File tree Expand file tree Collapse file tree 17 files changed +264
-16
lines changed
redhat/roles/configure/tasks
jmx-tomcat/install/rhel/roles/configure
tomcat/systemd/shScript/catalina/install/linux/roles/configure/tasks
manual/definitions/apm/java/linux Expand file tree Collapse file tree 17 files changed +264
-16
lines changed Original file line number Diff line number Diff line change
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/maven-v4_0_0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+ <groupId >com.newrelic</groupId >
5
+ <artifactId >javaApp</artifactId >
6
+ <packaging >war</packaging >
7
+ <version >1.0-SNAPSHOT</version >
8
+ <name >javaApp Maven Webapp</name >
9
+ <url >http://maven.apache.org</url >
10
+ <dependencies >
11
+ <dependency >
12
+ <groupId >junit</groupId >
13
+ <artifactId >junit</artifactId >
14
+ <version >3.8.1</version >
15
+ <scope >test</scope >
16
+ </dependency >
17
+ </dependencies >
18
+ <build >
19
+ <finalName >javaApp</finalName >
20
+ <plugins >
21
+ <!-- Add the exec-maven-plugin below -->
22
+ <plugin >
23
+ <groupId >org.codehaus.mojo</groupId >
24
+ <artifactId >exec-maven-plugin</artifactId >
25
+ <version >3.0.0</version >
26
+ <executions >
27
+ <execution >
28
+ <id >curl-self</id >
29
+ <phase >install</phase >
30
+ <goals >
31
+ <goal >exec</goal >
32
+ </goals >
33
+ <configuration >
34
+ <executable >bash</executable >
35
+ <arguments >
36
+ <argument >-c</argument >
37
+ <argument >
38
+ while true; do
39
+ curl http://localhost:8080/javaApp/dummy.jsp;
40
+ sleep 5;
41
+ done;
42
+ </argument >
43
+ </arguments >
44
+ </configuration >
45
+ </execution >
46
+ </executions >
47
+ </plugin >
48
+ <!-- Add other plugins if necessary -->
49
+ </plugins >
50
+ </build >
51
+ </project >
Original file line number Diff line number Diff line change
1
+ <html >
2
+ <head >
3
+ <title >Dummy Page</title >
4
+ </head >
5
+ <body >
6
+ <h1 >List of Harry Potter Subjects</h1 >
7
+ <ul >
8
+ <li >Alchemy</li >
9
+ <li >Astronomy</li >
10
+ <li >Charms</li >
11
+ <!-- Add other subjects here -->
12
+ </ul >
13
+ </body >
14
+ </html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE web-app PUBLIC
2
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
3
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
4
+
5
+ <web-app >
6
+ <display-name >Archetype Created Web Application</display-name >
7
+ </web-app >
Original file line number Diff line number Diff line change
1
+ <html >
2
+ <body >
3
+ <h2 >Hello World!</h2 >
4
+ </body >
5
+ </html >
Original file line number Diff line number Diff line change
1
+ <html >
2
+ <head >
3
+ <title >Dummy Page</title >
4
+ </head >
5
+ <body >
6
+ <h1 >List of Harry Potter Subjects</h1 >
7
+ <ul >
8
+ <li >Alchemy</li >
9
+ <li >Astronomy</li >
10
+ <li >Charms</li >
11
+ <!-- Add other subjects here -->
12
+ </ul >
13
+ </body >
14
+ </html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE web-app PUBLIC
2
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
3
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
4
+
5
+ <web-app >
6
+ <display-name >Archetype Created Web Application</display-name >
7
+ </web-app >
Original file line number Diff line number Diff line change
1
+ <html >
2
+ <body >
3
+ <h2 >Hello World!</h2 >
4
+ </body >
5
+ </html >
Original file line number Diff line number Diff line change
1
+ artifactId =javaApp
2
+ groupId =com.newrelic
3
+ version =1.0-SNAPSHOT
Original file line number Diff line number Diff line change
1
+ ---
2
+ - debug :
3
+ msg : Set up sample tomcat-java app on the host
4
+
5
+ - name : Copy file to remote
6
+ ansible.builtin.copy :
7
+ src : ../../../../javaApp
8
+ dest : /home/ec2-user
9
+ mode : ' 0777'
10
+ become : true
11
+
12
+ - name : Change the permissions of the tomcat directory
13
+ shell : chmod 755 /opt/tomcat/latest/webapps
14
+ become : true
15
+
16
+ - name : Change the permissions of the tomcat bin
17
+ shell : chmod -R 777 /opt/tomcat/latest/bin
18
+ become : true
19
+
20
+ - name : Build Java App with Maven
21
+ ansible.builtin.command :
22
+ cmd : mvn clean package -f /home/ec2-user/javaApp/pom.xml
23
+ environment :
24
+ JAVA_HOME : " /opt/jdk-14.0.1"
25
+ PATH : " {{ ansible_env.PATH }}:/opt/jdk-14.0.1/bin:/opt/apache-maven/bin"
26
+ JRE_HOME : " /opt/jdk-14.0.1"
27
+ become : true
28
+
29
+ - name : Move the package
30
+ shell : mv /home/ec2-user/javaApp/target/javaApp.war /opt/tomcat/latest/webapps
31
+ become : true
32
+
Original file line number Diff line number Diff line change
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/maven-v4_0_0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+ <groupId >com.newrelic</groupId >
5
+ <artifactId >javaApp</artifactId >
6
+ <packaging >war</packaging >
7
+ <version >1.0-SNAPSHOT</version >
8
+ <name >javaApp Maven Webapp</name >
9
+ <url >http://maven.apache.org</url >
10
+ <dependencies >
11
+ <dependency >
12
+ <groupId >junit</groupId >
13
+ <artifactId >junit</artifactId >
14
+ <version >3.8.1</version >
15
+ <scope >test</scope >
16
+ </dependency >
17
+ </dependencies >
18
+ <build >
19
+ <finalName >javaApp</finalName >
20
+ <plugins >
21
+ <!-- Add the exec-maven-plugin below -->
22
+ <plugin >
23
+ <groupId >org.codehaus.mojo</groupId >
24
+ <artifactId >exec-maven-plugin</artifactId >
25
+ <version >3.0.0</version >
26
+ <executions >
27
+ <execution >
28
+ <id >curl-self</id >
29
+ <phase >install</phase >
30
+ <goals >
31
+ <goal >exec</goal >
32
+ </goals >
33
+ <configuration >
34
+ <executable >bash</executable >
35
+ <arguments >
36
+ <argument >-c</argument >
37
+ <argument >
38
+ while true; do
39
+ curl http://localhost:8080/javaApp/dummy.jsp;
40
+ sleep 5;
41
+ done;
42
+ </argument >
43
+ </arguments >
44
+ </configuration >
45
+ </execution >
46
+ </executions >
47
+ </plugin >
48
+ <!-- Add other plugins if necessary -->
49
+ </plugins >
50
+ </build >
51
+ </project >
You can’t perform that action at this time.
0 commit comments