X Tutup
Skip to content

Commit d1c2e04

Browse files
committed
Add deploy profiles for standalone wildfly using cargo plugin and for runtime installed instance
1 parent 2fd130e commit d1c2e04

File tree

4 files changed

+172
-109
lines changed

4 files changed

+172
-109
lines changed

ejb/ejb-client/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
<artifactId>ejb-client</artifactId>
1111
<name>EJB3 Client Maven</name>
1212
<description>EJB3 Client Maven</description>
13+
14+
<properties>
15+
<junit.version>4.12</junit.version>
16+
<maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>
17+
</properties>
18+
1319
<dependencies>
1420
<dependency>
1521
<groupId>org.wildfly</groupId>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
package com.baeldung.ejb.setup.test;
22

3-
import static org.junit.Assert.*;
4-
import org.junit.Test;
53
import com.baeldung.ejb.client.EJBClient;
64
import com.baeldung.ejb.tutorial.HelloWorldBean;
5+
import org.junit.Test;
6+
7+
import static org.junit.Assert.assertEquals;
78

89
public class EJBSetupTest {
910

1011
@Test
11-
public void testEJBClient() {
12+
public void EJBClientTest() {
1213
EJBClient ejbClient = new EJBClient();
1314
HelloWorldBean bean = new HelloWorldBean();
1415
assertEquals(bean.getHelloWorld(), ejbClient.getEJBRemoteMessage());
1516
}
17+
1618
}

ejb/ejb-remote/pom.xml

Lines changed: 93 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,95 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>com.baeldung.ejb</groupId>
7-
<artifactId>ejb</artifactId>
8-
<version>1.0-SNAPSHOT</version>
9-
</parent>
10-
<artifactId>ejb-remote</artifactId>
11-
<packaging>ejb</packaging>
12-
13-
<!-- <name>ejb-remote</name> -->
14-
<dependencies>
15-
<dependency>
16-
<groupId>javax</groupId>
17-
<artifactId>javaee-api</artifactId>
18-
<version>7.0</version>
19-
<scope>provided</scope>
20-
</dependency>
21-
</dependencies>
22-
23-
<build>
24-
<plugins>
25-
<plugin>
26-
<groupId>org.wildfly.plugins</groupId>
27-
<artifactId>wildfly-maven-plugin</artifactId>
28-
<version>1.1.0.Alpha5</version>
29-
<configuration>
30-
<hostname>127.0.0.1</hostname>
31-
<port>9990</port>
32-
<username>testUser</username>
33-
<password>admin1234!</password>
34-
<filename>${build.finalName}.jar</filename>
35-
</configuration>
36-
</plugin>
37-
</plugins>
38-
<!-- <finalName>ejb-remote</finalName> -->
39-
</build>
40-
</project>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>com.baeldung.ejb</groupId>
8+
<artifactId>ejb</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>ejb-remote</artifactId>
13+
<packaging>ejb</packaging>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>javax</groupId>
18+
<artifactId>javaee-api</artifactId>
19+
<version>${javaee-api.version}</version>
20+
<scope>provided</scope>
21+
</dependency>
22+
</dependencies>
23+
24+
25+
<profiles>
26+
<!-- mvn clean package cargo:run -->
27+
<profile>
28+
<id>wildfly-standalone</id>
29+
<activation>
30+
<activeByDefault>true</activeByDefault>
31+
</activation>
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<groupId>org.codehaus.cargo</groupId>
36+
<artifactId>cargo-maven2-plugin</artifactId>
37+
<version>${cargo-maven2-plugin.version}</version>
38+
39+
<configuration>
40+
41+
<container>
42+
<containerId>wildfly10x</containerId>
43+
<zipUrlInstaller>
44+
<url>http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip</url>
45+
</zipUrlInstaller>
46+
</container>
47+
48+
<configuration>
49+
<properties>
50+
<cargo.hostname>127.0.0.1</cargo.hostname>
51+
<cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
52+
<cargo.servlet.users>testUser:admin1234!</cargo.servlet.users>
53+
</properties>
54+
</configuration>
55+
56+
</configuration>
57+
</plugin>
58+
</plugins>
59+
</build>
60+
</profile>
61+
62+
<!--mvn clean install wildfly:deploy -Pwildfly-runtime-->
63+
<profile>
64+
<id>wildfly-runtime</id>
65+
<activation>
66+
<activeByDefault>false</activeByDefault>
67+
</activation>
68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>org.wildfly.plugins</groupId>
72+
<artifactId>wildfly-maven-plugin</artifactId>
73+
<version>1.1.0.Alpha5</version>
74+
<configuration>
75+
<hostname>127.0.0.1</hostname>
76+
<port>9990</port>
77+
<username>testUser</username>
78+
<password>admin1234!</password>
79+
<filename>${build.finalName}.jar</filename>
80+
</configuration>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
</profile>
85+
86+
</profiles>
87+
88+
<properties>
89+
<javaee-api.version>7.0</javaee-api.version>
90+
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
91+
</properties>
92+
93+
</project>
94+
95+

ejb/pom.xml

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<groupId>com.baeldung.ejb</groupId>
6-
<artifactId>ejb</artifactId>
7-
<version>1.0-SNAPSHOT</version>
8-
<packaging>pom</packaging>
9-
<name>ejb</name>
10-
<description>EJB Tutorial</description>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.baeldung.ejb</groupId>
6+
<artifactId>ejb</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
<packaging>pom</packaging>
9+
<name>ejb</name>
10+
<description>EJB Tutorial</description>
1111

12-
<repositories>
13-
<repository>
14-
<id>jboss-public-repository-group</id>
15-
<name>JBoss Public Maven Repository Group</name>
16-
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
17-
<layout>default</layout>
18-
<releases>
19-
<enabled>true</enabled>
20-
<updatePolicy>never</updatePolicy>
21-
</releases>
22-
<snapshots>
23-
<enabled>true</enabled>
24-
<updatePolicy>never</updatePolicy>
25-
</snapshots>
26-
</repository>
27-
</repositories>
12+
<repositories>
13+
<repository>
14+
<id>jboss-public-repository-group</id>
15+
<name>JBoss Public Maven Repository Group</name>
16+
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
17+
<layout>default</layout>
18+
<releases>
19+
<enabled>true</enabled>
20+
<updatePolicy>never</updatePolicy>
21+
</releases>
22+
<snapshots>
23+
<enabled>true</enabled>
24+
<updatePolicy>never</updatePolicy>
25+
</snapshots>
26+
</repository>
27+
</repositories>
2828

29-
<dependencyManagement>
30-
<dependencies>
31-
<dependency>
32-
<groupId>com.baeldung.ejb</groupId>
33-
<artifactId>ejb-remote</artifactId>
34-
<version>1.0-SNAPSHOT</version>
35-
<type>ejb</type>
36-
</dependency>
29+
<dependencyManagement>
30+
<dependencies>
31+
<dependency>
32+
<groupId>com.baeldung.ejb</groupId>
33+
<artifactId>ejb-remote</artifactId>
34+
<version>1.0-SNAPSHOT</version>
35+
<type>ejb</type>
36+
</dependency>
3737

38-
<dependency>
39-
<groupId>javax</groupId>
40-
<artifactId>javaee-api</artifactId>
41-
<version>7.0</version>
42-
<scope>provided</scope>
43-
</dependency>
38+
<dependency>
39+
<groupId>javax</groupId>
40+
<artifactId>javaee-api</artifactId>
41+
<version>7.0</version>
42+
<scope>provided</scope>
43+
</dependency>
4444

45-
<dependency>
46-
<groupId>org.wildfly</groupId>
47-
<artifactId>wildfly-ejb-client-bom</artifactId>
48-
<version>10.1.0.Final</version>
49-
<type>pom</type>
50-
<scope>import</scope>
51-
</dependency>
52-
</dependencies>
53-
</dependencyManagement>
45+
<dependency>
46+
<groupId>org.wildfly</groupId>
47+
<artifactId>wildfly-ejb-client-bom</artifactId>
48+
<version>10.1.0.Final</version>
49+
<type>pom</type>
50+
<scope>import</scope>
51+
</dependency>
52+
</dependencies>
53+
</dependencyManagement>
5454

55-
<build>
56-
<pluginManagement>
57-
<plugins>
58-
<plugin>
59-
<artifactId>maven-compiler-plugin</artifactId>
60-
<version>3.1</version>
61-
<configuration>
62-
<source>1.8</source>
63-
<target>1.8</target>
64-
</configuration>
65-
</plugin>
55+
<build>
56+
<pluginManagement>
57+
<plugins>
58+
<plugin>
59+
<artifactId>maven-compiler-plugin</artifactId>
60+
<version>3.1</version>
61+
<configuration>
62+
<source>1.8</source>
63+
<target>1.8</target>
64+
</configuration>
65+
</plugin>
6666

67-
<plugin>
68-
<artifactId>maven-ejb-plugin</artifactId>
69-
<version>2.4</version>
70-
<configuration>
71-
<ejbVersion>3.2</ejbVersion>
72-
</configuration>
73-
</plugin>
74-
</plugins>
75-
</pluginManagement>
76-
</build>
67+
<plugin>
68+
<artifactId>maven-ejb-plugin</artifactId>
69+
<version>2.4</version>
70+
<configuration>
71+
<ejbVersion>3.2</ejbVersion>
72+
</configuration>
73+
</plugin>
74+
</plugins>
75+
</pluginManagement>
76+
</build>
7777

7878
<modules>
7979
<module>ejb-remote</module>

0 commit comments

Comments
 (0)
X Tutup