maven 2 integration fails to execute goals that run fine using command line
I have a pom with packaging "war" that sets "Web Content" as the web resources source.
This works fine using mvn command line (mvn clean package works) but fails using the plugin
Following the output of the plugin
Scanning for projects...
-
Building HJE-MNS admin console
task-segment:
-
Using default encoding to copy filtered resources.
Artifact javax.servlet:servlet-api:jar:2.4:provided retains local scope 'provided' overriding broader scope 'compile'
given by a dependency. If this is not intended, modify or remove the local scope.
snapshot HJE-MNS:monitor:2.0-SNAPSHOT: checking for updates from local
Nothing to compile - all classes are up to date
Using default encoding to copy filtered resources.
No sources to compile
Setting reports dir: C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target/surefire-reports
-
T E S T S
-
Exploding webapp...
Copy webapp webResources to C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target\HJE-MNS-console-2.0-SNAPSHOT
-
basedir WebContent does not exist
-
Trace
java.lang.IllegalStateException: basedir WebContent does not exist
at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:542)
at org.apache.maven.plugin.war.AbstractWarMojo.getWarFiles(AbstractWarMojo.java:810)
at org.apache.maven.plugin.war.AbstractWarMojo.copyResources(AbstractWarMojo.java:437)
at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:355)
at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:161)
at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:127)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
-
Total time: 3 seconds
Finished at: Wed Dec 13 13:25:14 CET 2006
Final Memory: 4M/8M
-
and output of the command line
C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb>mvn clean package
Scanning for projects...
-
Building HJE-MNS admin console
task-segment:
-
Deleting directory C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target
Deleting directory C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\mavenClasses
Deleting directory C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\mavenUnitTestClasses
Using default encoding to copy filtered resources.
Artifact javax.servlet:servlet-api:jar:2.4:provided retains local scope 'provided' overriding broader scope 'compile'
given by a dependency. If this is not intended, modify or remove the local scope.
snapshot HJE-MNS:monitor:2.0-SNAPSHOT: checking for updates from local
Compiling 19 source files to C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\mavenClasses
Using default encoding to copy filtered resources.
No sources to compile
Setting reports dir: C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target/surefire-reports
-
T E S T S
-
Exploding webapp...
Copy webapp webResources to C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target\HJE-MNS-console-2.0-SNAPSHOT
Copy webapp webResources to C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target\HJE-MNS-console-2.0-SNAPSHOT
Assembling webapp HJE-MNS-console in C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target\HJE-MNS-console-2.0-SNAPSHOT
Generating war C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target\HJE-MNS-console-2.0-SNAPSHOT.war
Building war: C:\Documents and Settings\E9310750\sandboxes\WASSpecific\HJE-MNS-AdminWeb\target\HJE-MNS-console-2.0-SNAPSHOT.war
-
Total time: 5 seconds
Finished at: Wed Dec 13 13:28:05 CET 2006
Final Memory: 5M/10M
-
Please sign in to leave a comment.
it seems the problem is related to maven.
If i use this project in another (using a packaging=pom, and with this project as a module), it doesn't work using the command line either. Seems the web resources directory is resolved relative to the root pom location, not the current pom location.
I'm not maven 2 expert as you can see and if anyone has a clue i'm very much interested :)
Hi,
this may be a bug of the plugin that is fixed in the SNAPSHOT version of the upcoming release. The call to the maven script doesn't set the environment correctly under special circumstances.
If the bug doesn't occur on the command line this is a very good indicator of a bug in the plugin.
You might want to try out the SNAPSHOT version from
http://quebbemann.kicks-ass.net/development/software/idea-maven-plugin/idea-maven-plugin-1.2-SNAPSHOT.zip
But be careful, this is a nightly build and not production ready. I am currently in process of embedding the maven embedder into the plugin. You have to uncheck this in the project configuration dialog. The embedder is highly experimantel at this point of time and not usable!
If there is need I will release a bug fix release (Version 1.1.1) that fixes the problem.
Thanks for your patience!