-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hantsy Bai <[email protected]>
- Loading branch information
Showing
13 changed files
with
498 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.eclipse.ee4j</groupId> | ||
<artifactId>maven-archetype-jakartaee9</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>maven-archetype</packaging> | ||
|
||
<name>Archetype - Maven archetype for Jakarta EE 9</name> | ||
|
||
<url>https://www.jakarta.ee</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<archetype-packaging.version>3.2.0</archetype-packaging.version> | ||
</properties> | ||
|
||
<build> | ||
<extensions> | ||
<extension> | ||
<groupId>org.apache.maven.archetype</groupId> | ||
<artifactId>archetype-packaging</artifactId> | ||
<version>${archetype-packaging.version}</version> | ||
</extension> | ||
</extensions> | ||
</build> | ||
<issueManagement> | ||
<system>Github Issues</system> | ||
<url>https://github.com/eclipse-ee4j/starter/issues</url> | ||
</issueManagement> | ||
<ciManagement> | ||
<system>Github Actions</system> | ||
<url>https://github.com/eclipse-ee4j/starter/actions</url> | ||
</ciManagement> | ||
<scm> | ||
<url>https://github.com/eclipse-ee4j/starter/</url> | ||
<connection>scm:git:https://github.com/eclipse-ee4j/starter/</connection> | ||
<developerConnection>scm:git:https://github.com/eclipse-ee4j/starter/</developerConnection> | ||
</scm> | ||
</project> |
42 changes: 42 additions & 0 deletions
42
maven-archetype-jakartaee9/src/main/resources/META-INF/maven/archetype-metadata.xml
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,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
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. | ||
--> | ||
|
||
<archetype-descriptor | ||
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" | ||
name="${artifactId}"> | ||
|
||
<fileSets> | ||
<fileSet filtered="true" packaged="true"> | ||
<directory>src/main/java</directory> | ||
</fileSet> | ||
<fileSet> | ||
<directory>src/main/resources</directory> | ||
</fileSet> | ||
<fileSet filtered="true" packaged="true"> | ||
<directory>src/test/java</directory> | ||
</fileSet> | ||
<fileSet> | ||
<directory>src/test/resources</directory> | ||
</fileSet> | ||
</fileSets> | ||
</archetype-descriptor> |
188 changes: 188 additions & 0 deletions
188
maven-archetype-jakartaee9/src/main/resources/archetype-resources/pom.xml
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,188 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>${groupId}</groupId> | ||
<artifactId>${artifactId}</artifactId> | ||
<version>${version}</version> | ||
<packaging>war</packaging> | ||
|
||
<name>${groupId}</name> | ||
<description>A Jakarta EE starter boilerplate for Jakarta EE 9</description> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
|
||
<!-- Official Maven Plugins --> | ||
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> | ||
<maven-war-plugin.version>3.3.1</maven-war-plugin.version> | ||
<maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version> | ||
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version> | ||
<maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version> | ||
<maven-surefire-report-plugin.version>3.0.0-M5</maven-surefire-report-plugin.version> | ||
|
||
<!-- Cargo maven plugin --> | ||
<!-- Since 1.9.0, cargo-maven3-plugin is the default for cargo prefix. --> | ||
<cargo-maven3-plugin.version>1.9.0</cargo-maven3-plugin.version> | ||
|
||
<!-- Jakarta EE API --> | ||
<jakartaee-api.version>9.0.0</jakartaee-api.version> | ||
|
||
<!-- Arquillian BOM --> | ||
<arquillian-bom.version>1.7.0.Alpha9</arquillian-bom.version> | ||
<junit-jupiter.version>5.7.1</junit-jupiter.version> | ||
|
||
<!-- Glassfish server --> | ||
<glassfish.version>6.0.0</glassfish.version> | ||
<arquillian-glassfish6.version>1.0.0.Alpha1</arquillian-glassfish6.version> | ||
<jersey.version>3.0.1</jersey.version> | ||
|
||
<!-- by default skip tests --> | ||
<skipTests>true</skipTests> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>jakarta.platform</groupId> | ||
<artifactId>jakarta.jakartaee-api</artifactId> | ||
<version>${jakartaee-api.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.arquillian</groupId> | ||
<artifactId>arquillian-bom</artifactId> | ||
<version>${arquillian-bom.version}</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit</groupId> | ||
<artifactId>junit-bom</artifactId> | ||
<version>${junit-jupiter.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>jakarta.platform</groupId> | ||
<artifactId>jakarta.jakartaee-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.arquillian.junit5</groupId> | ||
<artifactId>arquillian-junit5-container</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- see: https://github.com/arquillian/arquillian-core/issues/248 --> | ||
<!-- and https://github.com/arquillian/arquillian-core/pull/246/files --> | ||
<dependency> | ||
<groupId>org.jboss.arquillian.protocol</groupId> | ||
<artifactId>arquillian-protocol-servlet-jakarta</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.cargo</groupId> | ||
<artifactId>cargo-maven3-plugin</artifactId> | ||
<version>${cargo-maven3-plugin.version}</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${maven-compiler-plugin.version}</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>${maven-war-plugin.version}</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>glassfish</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.cargo</groupId> | ||
<artifactId>cargo-maven3-plugin</artifactId> | ||
<configuration> | ||
<container> | ||
<containerId>glassfish6x</containerId> | ||
<artifactInstaller> | ||
<groupId>org.glassfish.main.distributions</groupId> | ||
<artifactId>glassfish</artifactId> | ||
<version>${glassfish.version}</version> | ||
</artifactInstaller> | ||
</container> | ||
<configuration> | ||
<!-- the configuration used to deploy --> | ||
<home>${project.build.directory}/glassfish6x-home</home> | ||
<properties> | ||
<cargo.remote.password></cargo.remote.password> | ||
</properties> | ||
</configuration> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<!-- Jersey --> | ||
<dependency> | ||
<groupId>org.glassfish.jersey.media</groupId> | ||
<artifactId>jersey-media-sse</artifactId> | ||
<version>${jersey.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish.jersey.media</groupId> | ||
<artifactId>jersey-media-json-binding</artifactId> | ||
<version>${jersey.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish.jersey.inject</groupId> | ||
<artifactId>jersey-hk2</artifactId> | ||
<version>${jersey.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish.jersey.core</groupId> | ||
<artifactId>jersey-client</artifactId> | ||
<version>${jersey.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.arquillian.container</groupId> | ||
<artifactId>arquillian-glassfish-remote-6</artifactId> | ||
<version>${arquillian-glassfish6.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</profile> | ||
</profiles> | ||
</project> |
23 changes: 23 additions & 0 deletions
23
...type-jakartaee9/src/main/resources/archetype-resources/src/main/java/GreetingMessage.java
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,23 @@ | ||
package $package; | ||
|
||
import java.io.Serializable; | ||
|
||
@SuppressWarnings("serial") | ||
public class GreetingMessage implements Serializable { | ||
|
||
private String message; | ||
|
||
public static GreetingMessage of(String s) { | ||
final GreetingMessage message = new GreetingMessage(); | ||
message.setMessage(s); | ||
return message; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...ype-jakartaee9/src/main/resources/archetype-resources/src/main/java/GreetingResource.java
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,27 @@ | ||
package $package; | ||
|
||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.inject.Inject; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import static jakarta.ws.rs.core.Response.ok; | ||
|
||
@Path("greeting") | ||
@RequestScoped | ||
public class GreetingResource { | ||
|
||
@Inject | ||
private GreetingService greetingService; | ||
|
||
@GET | ||
@Path("{name}") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public Response greeting(@PathParam("name") String name) { | ||
return ok(this.greetingService.buildGreetingMessage(name)).build(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...type-jakartaee9/src/main/resources/archetype-resources/src/main/java/GreetingService.java
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,12 @@ | ||
package $package; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import java.time.LocalDateTime; | ||
|
||
@ApplicationScoped | ||
public class GreetingService { | ||
|
||
public GreetingMessage buildGreetingMessage(String name) { | ||
return GreetingMessage.of("Say Hello to " + name + " at " + LocalDateTime.now()); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...etype-jakartaee9/src/main/resources/archetype-resources/src/main/java/JaxrsActivator.java
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,9 @@ | ||
package $package; | ||
|
||
import jakarta.ws.rs.ApplicationPath; | ||
import jakarta.ws.rs.core.Application; | ||
|
||
@ApplicationPath("/api") | ||
public class JaxrsActivator extends Application { | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
...e-jakartaee9/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd" | ||
version="3.0"> | ||
</beans> |
Oops, something went wrong.