Jetty.project: Jetty Maven Plugin should skip execution on projects it cannot support

Created on 2 May 2018  ·  13Comments  ·  Source: eclipse/jetty.project

This was added in 9.4.7 (#1623), works OK in 9.4.8, but no longer in 9.4.9, failing with

[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.4.9.v20180320:run (default-cli) on project xxx: Not war packaging -> [Help 1]

To reproduce, see https://github.com/tbroyer/gwt-maven-archetypes/
Version 2018.1.15 works as expected (uses jetty-maven-plugin 9.4.8), while 2018.4.29 fails with the above error (uses jetty-maven-plugin 9.4.9). Simply changing the version back to 9.4.8 in a project generated by the 2018.4.29 archetype fixes it.

/cc @olamy

All 13 comments

really weird as we have maven integration tests....
I will try your sample project

I think this is the culprit: https://github.com/eclipse/jetty.project/commit/85ed19ce3f21d1bfe7cdbd389f03032ee855a9ed#diff-234b7a9d2e6e45a43441b386190400be

@tbroyer yup please try 9.4.10.RC1 or 9.4.10.RC0 should be fixed with #2372

Those no longer error out, but now run Jetty on the root project rather than ignoring all but the war submodule; leading to an empty (and useless) webapp. It does print “Your project packaging is not supported by this plugin” to the console but then proceeds launching Jetty, apparently defeating the check.

"Your project packaging is not supported by this plugin" is an informational message, it doesn't stop any execution.

https://github.com/eclipse/jetty.project/blob/68215069853fb4c1d14f564cfdae6548b92ec468/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractJettyMojo.java#L312-L316

The package that you ran jetty:run within isn't a war packaging project, so it does not do anything.

Example:

Create Project from Archetype

C:\code\jetty\github\gwt-maven
>  mvn archetype:generate "-DarchetypeGroupId=net.ltgt.gwt.archetypes" "-DarchetypeArtifactId=modular-webapp" "-DarchetypeVersion=2018.4.29"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [net.ltgt.gwt.archetypes:modular-webapp:2018.1.15] found in catalog remote
Downloading: https://repo.maven.apache.org/maven2/net/ltgt/gwt/archetypes/modular-webapp/2018.4.29/modular-webapp-2018.4.29.pom
Downloaded: https://repo.maven.apache.org/maven2/net/ltgt/gwt/archetypes/modular-webapp/2018.4.29/modular-webapp-2018.4.29.pom (2.5 kB at 18 kB/s)
Downloading: https://repo.maven.apache.org/maven2/net/ltgt/gwt/archetypes/modular-webapp/2018.4.29/modular-webapp-2018.4.29.jar
Downloaded: https://repo.maven.apache.org/maven2/net/ltgt/gwt/archetypes/modular-webapp/2018.4.29/modular-webapp-2018.4.29.jar (27 kB at 105 kB/s)
Define value for property 'groupId': org.eclipse.jetty.test
Define value for property 'artifactId': test-a
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' org.eclipse.jetty.test: :
[INFO] Using property: module = App
Define value for property 'module-short-name' ${module.toLowerCase()}: :
Confirm properties configuration:
groupId: org.eclipse.jetty.test
artifactId: test-a
version: 1.0-SNAPSHOT
package: org.eclipse.jetty.test
module: App
module-short-name: ${module.toLowerCase()}
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: modular-webapp:2018.4.29
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.eclipse.jetty.test
[INFO] Parameter: artifactId, Value: test-a
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.eclipse.jetty.test
[INFO] Parameter: packageInPathFormat, Value: org/eclipse/jetty/test
[INFO] Parameter: package, Value: org.eclipse.jetty.test
[INFO] Parameter: module-short-name, Value: ${module.toLowerCase()}
[INFO] Parameter: module, Value: App
[INFO] Parameter: groupId, Value: org.eclipse.jetty.test
[INFO] Parameter: artifactId, Value: test-a
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.dom4j.io.SAXContentHandler (file:/C:/Users/joakim/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar) to method com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding()
WARNING: Please consider reporting this to the maintainers of org.dom4j.io.SAXContentHandler
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Parent element not overwritten in C:\code\jetty\github\gwt-maven\test-a\test-a-client\pom.xml
[INFO] Parent element not overwritten in C:\code\jetty\github\gwt-maven\test-a\test-a-shared\pom.xml
[INFO] Parent element not overwritten in C:\code\jetty\github\gwt-maven\test-a\test-a-server\pom.xml
[INFO] Project created from Archetype in dir: C:\code\jetty\github\gwt-maven\test-a
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 31.071 s
[INFO] Finished at: 2018-05-02T11:03:01-05:00
[INFO] Final Memory: 18M/62M
[INFO] ------------------------------------------------------------------------

C:\code\jetty\github\gwt-maven
>  dir

    Directory: C:\code\jetty\github\gwt-maven


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         5/2/2018  11:03 AM                test-a

Build Project

C:\code\jetty\github\gwt-maven
>  cd test-a
C:\code\jetty\github\gwt-maven\test-a
>  dir


    Directory: C:\code\jetty\github\gwt-maven\test-a


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         5/2/2018  11:03 AM                test-a-client
d-----         5/2/2018  11:03 AM                test-a-server
d-----         5/2/2018  11:03 AM                test-a-shared
-a----         5/2/2018  11:03 AM           3093 pom.xml


C:\code\jetty\github\gwt-maven\test-a
>  mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] test-a
[INFO] test-a-shared
[INFO] test-a-client
[INFO] test-a-server
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-a 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-a ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ test-a ---
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\pom.xml to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a\1.0-SNAPSHOT\test-a-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-a-shared 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/com/google/gwt/gwt-servlet/2.8.2/gwt-servlet-2.8.2.pom
Downloaded: https://repo.maven.apache.org/maven2/com/google/gwt/gwt-servlet/2.8.2/gwt-servlet-2.8.2.pom (1.1 kB at 17 kB/s)
Downloading: https://repo.maven.apache.org/maven2/com/google/gwt/gwt-servlet/2.8.2/gwt-servlet-2.8.2.jar
Downloaded: https://repo.maven.apache.org/maven2/com/google/gwt/gwt-servlet/2.8.2/gwt-servlet-2.8.2.jar (9.4 MB at 3.5 MB/s)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-a-shared ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test-a-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-shared\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test-a-shared ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\code\jetty\github\gwt-maven\test-a\test-a-shared\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test-a-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-shared\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test-a-shared ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ test-a-shared ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ test-a-shared ---
[INFO] Building jar: C:\code\jetty\github\gwt-maven\test-a\test-a-shared\target\test-a-shared-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar-no-fork (attach-sources) @ test-a-shared ---
[INFO] Building jar: C:\code\jetty\github\gwt-maven\test-a\test-a-shared\target\test-a-shared-1.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ test-a-shared ---
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\test-a-shared\target\test-a-shared-1.0-SNAPSHOT.jar to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a-shared\1.0-SNAPSHOT\test-a-shared-1.0-SNAPSHOT.jar
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\test-a-shared\pom.xml to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a-shared\1.0-SNAPSHOT\test-a-shared-1.0-SNAPSHOT.pom
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\test-a-shared\target\test-a-shared-1.0-SNAPSHOT-sources.jar to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a-shared\1.0-SNAPSHOT\test-a-shared-1.0-SNAPSHOT-sources.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-a-client 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-a-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-9:enforce-encoding (default-enforce-encoding) @ test-a-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-9:add-super-sources (default-add-super-sources) @ test-a-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-9:add-test-super-sources (default-add-test-super-sources) @ test-a-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-9:generate-module (default-generate-module) @ test-a-client ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ test-a-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-client\src\main\resources
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-client\src\main\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test-a-client ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\code\jetty\github\gwt-maven\test-a\test-a-client\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ test-a-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-client\src\test\resources
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-client\src\test\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test-a-client ---
[INFO] No sources to compile
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-9:test (default-test) @ test-a-client ---
[INFO] No tests to run.
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-9:compile (default-compile) @ test-a-client ---
[INFO] Compiling module org.eclipse.jetty.test.App
[INFO]    Compiling 3 permutations
[INFO]       Compiling permutation 0...
[INFO]       Compiling permutation 1...
[INFO]       Compiling permutation 2...
[INFO]    Compile of permutations succeeded
[INFO]    Compilation succeeded -- 18.812s
[INFO] Linking into C:\code\jetty\github\gwt-maven\test-a\test-a-client\target\test-a-client-1.0-SNAPSHOT\org.eclipse.jetty.test.App
[INFO]    Link succeeded
[INFO]    Linking succeeded -- 0.500s
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-9:package-app (default-package-app) @ test-a-client ---
[INFO] Building war: C:\code\jetty\github\gwt-maven\test-a\test-a-client\target\test-a-client-1.0-SNAPSHOT.war
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ test-a-client ---
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\test-a-client\target\test-a-client-1.0-SNAPSHOT.war to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a-client\1.0-SNAPSHOT\test-a-client-1.0-SNAPSHOT.war
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\test-a-client\pom.xml to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a-client\1.0-SNAPSHOT\test-a-client-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-a-server 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-a-server ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test-a-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-server\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test-a-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\code\jetty\github\gwt-maven\test-a\test-a-server\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test-a-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-server\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test-a-server ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ test-a-server ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ test-a-server ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/joakim/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Packaging webapp
[INFO] Assembling webapp [test-a-server] in [C:\code\jetty\github\gwt-maven\test-a\test-a-server\target\test-a-server-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\code\jetty\github\gwt-maven\test-a\test-a-server\src\main\webapp]
[INFO] Processing overlay [ id org.eclipse.jetty.test:test-a-client]
[INFO] Webapp assembled in [629 msecs]
[INFO] Building war: C:\code\jetty\github\gwt-maven\test-a\test-a-server\target\test-a-server-1.0-SNAPSHOT.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ test-a-server ---
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\test-a-server\target\test-a-server-1.0-SNAPSHOT.war to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a-server\1.0-SNAPSHOT\test-a-server-1.0-SNAPSHOT.war
[INFO] Installing C:\code\jetty\github\gwt-maven\test-a\test-a-server\pom.xml to C:\Users\joakim\.m2\repository\org\eclipse\jetty\test\test-a-server\1.0-SNAPSHOT\test-a-server-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] test-a ............................................. SUCCESS [  0.453 s]
[INFO] test-a-shared ...................................... SUCCESS [  6.560 s]
[INFO] test-a-client ...................................... SUCCESS [ 31.473 s]
[INFO] test-a-server ...................................... SUCCESS [  1.709 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.053 s
[INFO] Finished at: 2018-05-02T11:03:55-05:00
[INFO] Final Memory: 43M/144M
[INFO] ------------------------------------------------------------------------

Testing jetty:run with version 9.4.10.RC1

C:\code\jetty\github\gwt-maven\test-a
>  cd .\test-a-server\

C:\code\jetty\github\gwt-maven\test-a\test-a-server
>  mvn org.eclipse.jetty:jetty-maven-plugin:9.4.10.RC1:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-a-server 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.4.10.RC1:run (default-cli) > test-compile @ test-a-server >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test-a-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-server\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test-a-server ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test-a-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\code\jetty\github\gwt-maven\test-a\test-a-server\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test-a-server ---
[INFO] No sources to compile
[INFO]
[INFO] <<< jetty-maven-plugin:9.4.10.RC1:run (default-cli) < test-compile @ test-a-server <<<
[INFO]
[INFO]
[INFO] --- jetty-maven-plugin:9.4.10.RC1:run (default-cli) @ test-a-server ---
[INFO] Logging initialized @8759ms to org.eclipse.jetty.util.log.Slf4jLog
[INFO] Configuring Jetty for project: test-a-server
[INFO] webAppSourceDirectory not set. Trying src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] nonBlocking:false
[INFO] Classes = C:\code\jetty\github\gwt-maven\test-a\test-a-server\target\classes
[INFO] Applying context xml file C:\code\jetty\github\gwt-maven\test-a\test-a-server/src/main/jettyconf/context.xml
[INFO] Context path = /
[INFO] Tmp directory = C:\code\jetty\github\gwt-maven\test-a\test-a-server\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] Dependent war artifact org.eclipse.jetty.test:test-a-client:war:1.0-SNAPSHOT
[INFO] web.xml file = file:///C:/code/jetty/github/gwt-maven/test-a/test-a-server/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = C:\code\jetty\github\gwt-maven\test-a\test-a-server\src\main\webapp
[INFO] jetty-9.4.10.RC1; built: 2018-04-26T22:07:43.606Z; git: 19a3ca399d55cfbbdb3d8b5aad5aa164d6956c4f; jvm 9.0.4+11
[WARNING] THIS IS NOT A STABLE RELEASE! DO NOT USE IN PRODUCTION!
[WARNING] Download a stable release from http://download.eclipse.org/jetty/
[WARNING] Unknown asm implementation version, assuming version 393216
[WARNING] org.eclipse.jetty.test.FieldVerifier scanned from multiple locations: jar:file:///C:/Users/joakim/.m2/repository/org/eclipse/jetty/test/test-a-shared/1.0-SNAPSHOT/test-a-shared-1.0-SNAPSHOT.jar!/org/eclipse/jetty/test/FieldVerifier.class, file:///C:/code/jetty/github/gwt-maven/test-a/test-a-shared/target/classes/org/eclipse/jetty/test/FieldVerifier.class
[WARNING] org.eclipse.jetty.test.GreetingResponse scanned from multiple locations: file:///C:/code/jetty/github/gwt-maven/test-a/test-a-shared/target/classes/org/eclipse/jetty/test/GreetingResponse.class, jar:file:///C:/Users/joakim/.m2/repository/org/eclipse/jetty/test/test-a-shared/1.0-SNAPSHOT/test-a-shared-1.0-SNAPSHOT.jar!/org/eclipse/jetty/test/GreetingResponse.class
[WARNING] org.eclipse.jetty.test.GreetingService scanned from multiple locations: jar:file:///C:/Users/joakim/.m2/repository/org/eclipse/jetty/test/test-a-shared/1.0-SNAPSHOT/test-a-shared-1.0-SNAPSHOT.jar!/org/eclipse/jetty/test/GreetingService.class, file:///C:/code/jetty/github/gwt-maven/test-a/test-a-shared/target/classes/org/eclipse/jetty/test/GreetingService.class
[WARNING] org.eclipse.jetty.test.GreetingServiceAsync scanned from multiple locations: jar:file:///C:/Users/joakim/.m2/repository/org/eclipse/jetty/test/test-a-shared/1.0-SNAPSHOT/test-a-shared-1.0-SNAPSHOT.jar!/org/eclipse/jetty/test/GreetingServiceAsync.class, file:///C:/code/jetty/github/gwt-maven/test-a/test-a-shared/target/classes/org/eclipse/jetty/test/GreetingServiceAsync.class
[INFO] Scanning elapsed time=493ms
[INFO] DefaultSessionIdManager workerName=node0
[INFO] No SessionScavenger set, using defaults
[INFO] node0 Scavenging every 600000ms
[INFO] Started o.e.j.m.p.JettyWebAppContext@6ac45c0c{/,[file:///C:/code/jetty/github/gwt-maven/test-a/test-a-server/src/main/webapp/, file:///C:/code/jetty/github/gwt-maven/test-a/test-a-server/target/jetty_overlays/test-a-client-1_0-SNAPSHOT_war/],AVAILABLE}{file:///C:/code/jetty/github/gwt-maven/test-a/test-a-server/src/main/webapp/}
[INFO] Started ServerConnector@baa227e{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO] Started @10213ms
[INFO] Started Jetty Server

Seems to be working as advertised in Jetty 9.4.10.RC1 (at least)

Seems to be working as advertised in Jetty 9.4.10.RC1 (at least)

Absolutely not! We're back to the pre-9.4.7 stupid workflow relying on the mvn install anti-pattern. This does not use dependencies from the reactor, it uses those you just mvn install.

mvn install is not an anti-pattern, despite some people wanting it to be so.

First, all of the war based goals in jetty-maven-plugin uses the project's attached artifacts to know what the "webapp" is, not the reactor. The "webapp" itself could have dependencies on other projects in the reactor, and that is supported.

The requirements of mvn jetty:run are that webAppSourceDirectory is configured and exists, or that active project's src/main/webapp exists.

Using mvn jetty:run from the top level in your example deploys nothing, as the top level is a structural pom project with no attached artifacts, no webAppSourceDirectory configured, and no src/main/webapp directory in existence.

During a reactor build, the active project knows about its dependencies, either via the maven local repository system or the via reactor project references.
The active project in the top level of your archetype has no such dependencies.

The assertion that jetty-maven-plugin doesn't use the reactor is false. If you had a project that used jetty:run from within its own pom (for integration testing, for example), or a war project form a live reactor-server instance, or war project from a reactor used in an IDE, or a threaded build reactor, or a CI build reactor, then that war project and its use of jetty-maven-plugin will use the dependencies from the reactor.

It seems that you want any execution of jetty:run to check all reactor projects and deploy all wars found.
That's not supported, nor should it be.

Take this example (and very common) project structure:

/pom.xml  :: <packaging>pom</packaging>
/common-lib/  :: <packaging>jar</packaging> 
/public-webapp/  :: <packaging>war</packaging> <dependency>common-lib</dependency>
/admin-webapp/ :: <packaging>war</packaging>  <dependency>common-lib</dependency>
/corporate-webapp/ :: <packaging>war</packaging>  <dependency>common-lib</dependency>

In that scenario, if you ran jetty:run from the top level, with no configuration of jetty-maven-plugin, what should happen?

What I want is #1623 to work as advertised, like in the tomcat-maven-plugin too.

I want to be able to launch Jetty from the command line using the jetty-maven-plugin and have it use target/classes of the modules it depends on so that when my IDE recompiles a class in any module, Jetty detects it and reloads the webapp.

If there are several webapps in the same multimodule build, I expect users to use -am -pl public-webapp to run only one at a time. If that's not the case, I don't really care whether it's an error or the first (at Maven's discretion) is run, or whatever.

In previous versions of the plugin I had a hack where I skipped the goal everywhere but in my webapp module. If you're telling me that's the way to go, then I'll revert to that. But #1623 (and 9.4.7 and 9.4.8) worked like the tomcat-maven-plugin, much to my pleasure, and it's no longer the case in 9.4.9 and 9.4.10.RC1.

@tbroyer I believe this is a problem that has already been fixed, but I don't have the issue number to hand at the moment. We have released jetty-9.4.10.RC1, so please try that and confirm that it fixes your problem.

I have (see https://github.com/eclipse/jetty.project/issues/2496#issuecomment-386024686) and it's not fixed.

@tbroyer definitely fixed with #2497 Have a try with the branch jetty-9.4.x-issue-2496-skip-unsupported-packaging

Works like a charm, thanks a lot @joakime!

Just tested with the final 9.4.10.v20180503 and it works. Thanks again.

(great integration test btw :wink:)

Was this page helpful?
0 / 5 - 0 ratings