dchaudhari7177 commented on PR #1013:
URL: https://github.com/apache/maven-archetype/pull/1013#issuecomment-5393033456
@slachiewicz good call — reworked along those lines. The samples all stay;
only the webapp sample's container profile changes.
`archetype-samples/webapp/pom.xml` now uses
`org.codehaus.cargo:cargo-maven3-plugin` 1.10.28 with an embedded container
instead of `org.mortbay.jetty:maven-jetty-plugin` 6.1.26, and the root pom's
matching `pluginManagement` entry goes away with it. Cargo keeps the "build the
war and serve it" affordance the sample was demonstrating while being
container-neutral — one `<containerId>` swap moves the same war to Jetty,
WildFly or Payara.
Tomcat 9 is the default rather than something newer on purpose: this
sample's `web.xml` declares servlet 2.5 in the `javax.servlet` namespace, and
Tomcat 10+/Jetty 11+ moved to `jakarta.servlet`, so they would not deploy it
unchanged.
One judgement call worth flagging — I folded the `tomcat` profile into the
same profile rather than leaving it beside the new one. It bound
`org.codehaus.mojo:tomcat-maven-plugin` (last release 2011), declared **no
version** in this pom or in `pluginManagement`, and used the Maven 2
`${pom.artifactId}` expression, so it could not have resolved either. Happy to
restore it as a separate `tomcat` profile if you would rather keep the two ids.
Verified rather than assumed: I copied the sample's `src/` and the new
profile into a standalone project and ran it.
```
[INFO] Tomcat 9.x Embedded starting...
INFO: Starting Servlet engine: [Apache Tomcat/9.0.120]
[INFO] Tomcat 9.x Embedded started on port [15000]
```
`curl http://localhost:15000/` returns 200 with the sample's `index.jsp`
body. The `<context>/</context>` deployable property is what puts it at the
root path — without it Cargo deploys to `/maven-webapp`, whereas `jetty:run`
served at `/`, so that keeps the documented URL unchanged.
`mvn -N validate` passes on the edited root pom. Note the samples tree is
still not in `<modules>` (and its own `<modules>` is commented out), so CI does
not build it — that standalone run is the only way to exercise it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]