Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.1
-
None
-
None
-
None
-
Windows XP
Description
I have a project that is similar to
+ - ProjectA
- pom.xml
+ ProjectB
- pom.xml
Within the pom.xml for ProjectB there is an entry describing additional resources to include in the war
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
...
When running 'mvn install' from the project A directory, I get the following error
...
[INFO] Copy webapp webResources to C:\thinktank\thinktank-d1.1.0\server\server-webapp\target\server-webapp-1.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] basedir src\main\resources does not exist
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
java.lang.IllegalStateException: basedir src\main\resources 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)
However, if I change the <directory> to
...
<directory>projectb/src/main/resources</directory>
...
The install goal works fine.
If I run 'mvn install' from projectb with the first configuration it does perform an install, ie, when the directory is configured as 'src/main/resources'. Seems like there is a problem in reading the base directory for hierarchical projects.
Thanks for taking a look at this.
Attachments
Issue Links
- is duplicated by
-
MWAR-79 <webResources> copy fails in a multi-project build
- Closed