Skip to content

Commit 32d50be

Browse files
eelhazatipedja4
authored andcommitted
BAEL-1833 (eugenp#4530)
1 parent 1024102 commit 32d50be

7 files changed

Lines changed: 182 additions & 1 deletion

File tree

‎maven-archetype/pom.xml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.baeldung.archetypes</groupId>
8+
<artifactId>maven-archetype</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<packaging>maven-archetype</packaging>
11+
<description>Archetype used to generate rest application based on jaxrs 2.1</description>
12+
13+
<properties>
14+
<maven.compiler.source>1.8</maven.compiler.source>
15+
<maven.compiler.target>1.8</maven.compiler.target>
16+
</properties>
17+
18+
<build>
19+
<extensions>
20+
<extension>
21+
<groupId>org.apache.maven.archetype</groupId>
22+
<artifactId>archetype-packaging</artifactId>
23+
<version>3.0.1</version>
24+
</extension>
25+
</extensions>
26+
<!--....-->
27+
</build>
28+
29+
</project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<archetype-descriptor
2+
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
3+
http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
4+
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
name="microprofile12">
7+
8+
<requiredProperties>
9+
<requiredProperty key="app-path">
10+
<defaultValue>resources</defaultValue>
11+
</requiredProperty>
12+
<requiredProperty key="greeting-msg">
13+
<defaultValue>Hi, I was generated from an archetype!</defaultValue>
14+
</requiredProperty>
15+
<requiredProperty key="liberty-plugin-version">
16+
<defaultValue>2.4.2</defaultValue>
17+
</requiredProperty>
18+
</requiredProperties>
19+
20+
<fileSets>
21+
<fileSet filtered="true" packaged="true">
22+
<directory>src/main/java</directory>
23+
<includes>
24+
<include>**/*.java</include>
25+
</includes>
26+
</fileSet>
27+
<fileSet>
28+
<directory>src/main/liberty/config</directory>
29+
<includes>
30+
<include>server.xml</include>
31+
</includes>
32+
</fileSet>
33+
</fileSets>
34+
35+
</archetype-descriptor>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>${groupId}</groupId>
6+
<artifactId>${artifactId}</artifactId>
7+
<version>${version}</version>
8+
<packaging>war</packaging>
9+
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
<maven.compiler.source>1.8</maven.compiler.source>
13+
<maven.compiler.target>1.8</maven.compiler.target>
14+
<failOnMissingWebXml>false</failOnMissingWebXml>
15+
<liberty-maven-plugin.version>${liberty-plugin-version}</liberty-maven-plugin.version>
16+
<defaultHttpPort>9080</defaultHttpPort>
17+
<defaultHttpsPort>9443</defaultHttpsPort>
18+
</properties>
19+
20+
<build>
21+
<finalName>${artifactId}</finalName>
22+
<plugins>
23+
<plugin>
24+
<groupId>net.wasdev.wlp.maven.plugins</groupId>
25+
<artifactId>liberty-maven-plugin</artifactId>
26+
<version>${liberty-maven-plugin.version}</version>
27+
<configuration>
28+
<install>
29+
<runtimeUrl>
30+
https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/2018-06-18_1442/openliberty-all-20180618-1300.zip
31+
</runtimeUrl>
32+
</install>
33+
<looseApplication>true</looseApplication>
34+
<installAppPackages>project</installAppPackages>
35+
<configFile>src/main/liberty/config/server.xml</configFile>
36+
<stripVersion>true</stripVersion>
37+
<bootstrapProperties>
38+
<default.http.port>${defaultHttpPort}</default.http.port>
39+
<default.https.port>${defaultHttpsPort}</default.https.port>
40+
</bootstrapProperties>
41+
</configuration>
42+
<executions>
43+
<execution>
44+
<id>install-server</id>
45+
<phase>prepare-package</phase>
46+
<goals>
47+
<goal>install-server</goal>
48+
<goal>create-server</goal>
49+
<goal>install-feature</goal>
50+
</goals>
51+
</execution>
52+
<execution>
53+
<id>install-apps</id>
54+
<phase>package</phase>
55+
<goals>
56+
<goal>install-apps</goal>
57+
</goals>
58+
</execution>
59+
</executions>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
64+
<dependencies>
65+
66+
<dependency>
67+
<groupId>javax.enterprise</groupId>
68+
<artifactId>cdi-api</artifactId>
69+
<version>2.0</version>
70+
<scope>provided</scope>
71+
</dependency>
72+
73+
<dependency>
74+
<groupId>javax.ws.rs</groupId>
75+
<artifactId>javax.ws.rs-api</artifactId>
76+
<version>2.1</version>
77+
<scope>provided</scope>
78+
</dependency>
79+
80+
</dependencies>
81+
82+
</project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package ${package};
2+
3+
import javax.ws.rs.ApplicationPath;
4+
import javax.ws.rs.core.Application;
5+
6+
@ApplicationPath("${app-path}")
7+
public class AppConfig extends Application {
8+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package ${package};
2+
3+
import javax.enterprise.context.RequestScoped;
4+
import javax.inject.Inject;
5+
import javax.ws.rs.*;
6+
import javax.ws.rs.core.MediaType;
7+
import javax.ws.rs.core.Response;
8+
import javax.ws.rs.core.UriBuilder;
9+
10+
@Path("ping")
11+
public class PingResource {
12+
13+
@GET
14+
public Response get() {
15+
return Response.ok("${greeting-msg}").build();
16+
}
17+
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<server description="OpenLiberty MicroProfile server">
2+
<featureManager>
3+
<feature>cdi-2.0</feature>
4+
<feature>jaxrs-2.1</feature>
5+
</featureManager>
6+
<httpEndpoint httpPort="${default.http.port}" httpsPort="${default.https.port}"
7+
id="defaultHttpEndpoint" host="*"/>
8+
</server>

‎pom.xml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@
266266
<module>twilio</module>
267267
<module>spring-boot-ctx-fluent</module>
268268
<module>java-ee-8-security-api</module>
269-
<module>spring-webflux-amqp</module>
269+
<module>spring-webflux-amqp</module>
270+
<module>maven-archetype</module>
270271
</modules>
271272

272273
<dependencies>

0 commit comments

Comments
 (0)