Skip to content

Commit

Permalink
[CXF-9090]samples: use cargo-maven2-plugin instead of tomcat-maven-pl…
Browse files Browse the repository at this point in the history
…ugin to launch tomcat
  • Loading branch information
ffang committed Dec 12, 2024
1 parent 483fe3b commit f480881
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ Alternative: WAR deployment of service to Tomcat (either embedded or standalone)
value, for running this sample on your local machine most likely:
"http://localhost:8080/java_first_jaxws/services/hello_world".

2.) Standalone Tomcat: Manually copy the generated WAR file to the Tomcat webapps folder,
or, if you have Maven and Tomcat set up to use the Tomcat Maven Plugin
(http://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/index.html) you can
use the mvn tomcat7:redeploy command instead.
2.) Standalone Tomcat: Manually copy the generated WAR file to the Tomcat webapps folder

For embedded Tomcat 7: Just run mvn tomcat7:run-war from the project base folder.
For embedded Tomcat 8: Just run mvn cargo:run from the project base folder.
For embedded Tomcat: Just run mvn cargo:run from the project base folder.

Prior to running the client (mvn -Pclient) it would be good to confirm the
generated WSDL can be seen from a web browser at:
Expand Down
12 changes: 1 addition & 11 deletions distribution/src/main/release/samples/java_first_jaxws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,13 @@
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>myTomcat</server>
<url>http://localhost:8080/manager/text</url>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.8.5</version>
<configuration>
<container>
<containerId>tomcat8x</containerId>
<containerId>tomcat</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Using either UNIX or Windows:

This will produce a war file in the target folder.

To run the war file using jetty9
To run the war file using jetty

mvn jetty:run-war (from one command line window)

To run the war file using tomcat7
To run the war file using tomcat

mvn tomcat7:run-war (from one command line window)
mvn cargo:run (from one command line window)

To remove the target dir, run mvn clean".

Expand Down
85 changes: 31 additions & 54 deletions distribution/src/main/release/samples/jax_rs/websocket_web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,62 +50,39 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.8.5</version>
<configuration>
<warSourceDirectory>${project.build.directory}/${project.artifactId}</warSourceDirectory>
<port>9000</port>
<path>/</path>
<container>
<containerId>tomcat</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>${cxf.tomcat.version}</version>
</artifactInstaller>
</container>
<configuration>
<type>standalone</type>
<home>
${project.build.directory}/apache-tomcat-${cxf.tomcat.version}
</home>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.logging>high</cargo.logging>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<properties>
<context>/${project.build.finalName}</context>
</properties>
</deployable>
</deployables>
</configuration>
<executions>
<execution>
<id>run-tomcat</id>
<configuration>
<fork>true</fork>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${cxf.tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>${cxf.tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>${cxf.tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${cxf.tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper-el</artifactId>
<version>${cxf.tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>${cxf.tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>${cxf.tomcat.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
6 changes: 2 additions & 4 deletions distribution/src/main/release/samples/wsdl_first/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ switching the soap:address value to the servlet-specific one (presently
commented-out).

2.) For standalone Tomcat: You can manually copy the generated WAR file to the Tomcat
webapps folder, or, if you have Maven and Tomcat set up to use the Tomcat Maven Plugin
(http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/index.html)
you can use the mvn tomcat7:redeploy command instead.
webapps folder.

For embedded Tomcat: Just run mvn tomcat7:run-war from the project base folder.
For embedded Tomcat: Just run mvn cargo:run from the project base folder.

3.) Next activate the client via mvn -Pclient as explained in the previous section.

Expand Down
37 changes: 31 additions & 6 deletions distribution/src/main/release/samples/wsdl_first/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,38 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.8.5</version>
<configuration>
<server>myTomcat</server>
<url>http://localhost:8080/manager/text</url>
<path>/${project.build.finalName}</path>
<container>
<containerId>tomcat</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>${cxf.tomcat.version}</version>
</artifactInstaller>
</container>
<configuration>
<type>standalone</type>
<home>
${project.build.directory}/apache-tomcat-${cxf.tomcat.version}
</home>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.logging>high</cargo.logging>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<properties>
<context>/${project.build.finalName}</context>
</properties>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit f480881

Please sign in to comment.