-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade project to Java EE 7 (+ TomEE 7 webprofile)
- upgrade to TomEE 7.0.2 webprofile - switch to the Java EE 7 API (TomEE provided) - add Arquillian BOM - upgrade to Arquillian 1.1.11.Final - set Java source/target compatibility to 1.8 - use JAX-RS 2 client API in tests - add JAX-RS 2 client API and providers to test runtime - annotate Arquillian test with @RunAsClient - add JAX-RS application initializer (required for portability) - upgrade Gradle wrapper to 3.2.1 - fix Gradle build, add Arquillian dependencies - rename ColorService to ColorResource - use consistent project name - exclude version from name of war file generated by Maven - update instructions in README - fix AsciiDoc syntax in README - stub in TomEE remote adapter and configuration for tests
- Loading branch information
1 parent
ed0e971
commit ef92fd2
Showing
11 changed files
with
229 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
# Apache TomEE JAX-RS Starter Project | ||
= Apache TomEE JAX-RS Starter Project | ||
:uri-companion-blog-post: http://www.tomitribe.com/blog/2014/06/apache-tomee-jax-rs-and-arquillian-starter-project/ | ||
|
||
Know JAX-RS, but haven't yet dug into Apache TomEE? Way too busy or impatient to read documentation? This repo is for you. | ||
Know JAX-RS, but haven't yet dug into Apache TomEE? | ||
Way too busy or impatient to read documentation? | ||
This repo is for you! | ||
|
||
The only thing better than a Maven archetype is a repo you can fork with everything already setup. Skip the documentation and just fork-and-code. This starter project contains: | ||
The only thing better than a Maven archetype is a repo you can fork with everything already setup. | ||
That's what you've got here. | ||
Skip the documentation and just fork-and-code. | ||
|
||
- 1 JAX-RS class, 1 JAXB class and 1 JUnit/Arquillian test | ||
- Maven pom for building a war file | ||
- Arquillian setup for testing against TomEE JAX-RS Embedded | ||
This starter project contains: | ||
|
||
- 1 JAX-RS initiator class, 1 JAX-RS resource class, 1 JAXB class, and 1 Arquillian (JUnit) test | ||
- Maven pom for running tests and building a war file | ||
- Gradle build for running tests and building a war file | ||
- Arquillian setup for testing against TomEE JAX-RS Embedded (or Remote) | ||
- TomEE Maven Plugin for deploying and running our war file | ||
|
||
Everything ready-to-run with a simple `maven clean install tomee:run` | ||
Everything ready-to-run with a simple `maven package tomee:run`. | ||
Then access the service at http://localhost:8080/tomee-jaxrs-starter-project/color (or any of the other JAX-RS resource paths). | ||
|
||
Delete the sample code, replace with your own and you're good to go. | ||
|
||
Have time for some reading and curious on how everything works? [Read here](http://www.tomitribe.com/blog/2014/06/apache-tomee-jax-rs-and-arquillian-starter-project/). | ||
Have time for some reading and curious on how everything works? Study {uri-companion-blog-post}[this blog post]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
apply plugin: 'war' | ||
|
||
group = 'org.superbiz' | ||
version = '1.0-SNAPSHOT' | ||
version = '1.0.0-SNAPSHOT' | ||
|
||
description = "TomEE JAXRS starter project" | ||
|
||
sourceCompatibility = 1.7 | ||
targetCompatibility = 1.7 | ||
description = "TomEE JAX-RS starter project" | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testCompile group: 'org.apache.openejb', name: 'arquillian-tomee-embedded', version:'1.7.2' | ||
testCompile group: 'org.apache.openejb', name: 'tomee-jaxrs', version:'1.7.2' | ||
testCompile group: 'junit', name: 'junit', version:'4.12' | ||
providedCompile group: 'org.apache.openejb', name: 'javaee-api', version:'6.0-6' | ||
providedCompile 'org.apache.tomee:javaee-api:7.0-1' | ||
testCompile 'junit:junit:4.12' | ||
testCompile 'org.jboss.arquillian.junit:arquillian-junit-container:1.1.11.Final' | ||
testRuntime 'org.apache.tomee:arquillian-tomee-embedded:7.0.2' | ||
// To use the TomEE remote adapter, enable all remaining dependencies in place of the previous one | ||
//testRuntime 'org.apache.tomee:arquillian-tomee-remote:7.0.2' | ||
//testRuntime 'org.apache.geronimo.specs:geronimo-osgi-locator:1.1' | ||
//testRuntime 'org.apache.cxf:cxf-rt-rs-client:3.1.8' | ||
//testRuntime 'org.apache.johnzon:johnzon-jaxrs:0.9.5' | ||
} | ||
|
||
test { | ||
systemProperties = [ | ||
'arquillian.launch': 'tomee.embedded' | ||
//'arquillian.launch': 'tomee.remote' | ||
] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Sep 29 17:40:36 CEST 2015 | ||
#Sun Dec 25 02:30:32 MST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rootProject.name = 'tomee-rest-arquillian' | ||
rootProject.name = 'tomee-jaxrs-starter-project' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.superbiz; | ||
|
||
import javax.ws.rs.ApplicationPath; | ||
import javax.ws.rs.core.Application; | ||
|
||
// NOTE The JAX-RS application component is optional in TomEE. | ||
@ApplicationPath("/") | ||
public class ColorApplication extends Application {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.