
|
If you were logged in you would be able to see more operations.
|
|
|
AppFuse
Created: 20/Sep/07 02:18 PM
Updated: 20/Sep/07 06:57 PM
|
|
| Component/s: |
Tools - AMP
|
| Affects Version/s: |
2.0 Final
|
| Fix Version/s: |
None
|
|
|
Environment:
|
Mac OS X 10.4.10, JDK 1.5
|
|
|
I have created a multi-module project with two separate "web" applications - as the project requires two discreet web applications (one for admin and one that is public-facing).
The major change was to duplicate the contents of the web directory created from the archetype - and rename the two web directories as "admin-client" and "public-client". The following lines in the base pom.xml was changed
<modules>
<module>core</module>
<module>web</module>
</modules>
to:
<modules>
<module>core</module>
<module>admin-client</module>
<module>public-client</module>
</modules>
Each of the modular pom.xml were also updated to reflect the naming conventions.
When executing the mvn appfuse:full-source task, it successfully executes for the 'core' module.
However, it fails on the 'admin-client' module:
[INFO] ----------------------------------------------------------------------------
[INFO] Building Application - Admin Web Client (Spring MVC)
[INFO] task-segment: [appfuse:full-source]
[INFO] ----------------------------------------------------------------------------
[INFO] [appfuse:full-source]
[INFO] [AppFuse] Installing source from web-common module...
[INFO] [AppFuse] Installing source from spring module...
[ERROR] Failed to copy jdbc.properties to core module
[INFO] [AppFuse] Source successfully exported, modifying pom.xml...
[INFO] [AppFuse] Removing maven-warpath-plugin...
[INFO] [AppFuse] Adding dependencies from web-common module...
[INFO] [AppFuse] Adding dependencies from spring module...
[INFO] [AppFuse] Removing maven-warpath-plugin...
[INFO] [AppFuse] Updated dependencies in pom.xml...
[ERROR] Unable to write to pom.xml: File 'web/pom.xml' does not exist
java.io.FileNotFoundException: File 'web/pom.xml' does not exist
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:136)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:961)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:979)
at org.appfuse.mojo.installer.InstallSourceMojo.createFullSourcePom(InstallSourceMojo.java:428)
at org.appfuse.mojo.installer.InstallSourceMojo.execute(InstallSourceMojo.java:277)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
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)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] File 'web/pom.xml' does not exist
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 35 seconds
[INFO] Finished at: Thu Sep 20 20:22:49 CEST 2007
[INFO] Final Memory: 7M/22M
[INFO] ------------------------------------------------------------------------
It looks, therefore as though the AMP plugin hardcodes the 'web' module name - and expects only that module to exist, as opposed to allowing for the name to be picked up from the list of modules within the <module> tag in the base pom.xml.
|
|
Description
|
I have created a multi-module project with two separate "web" applications - as the project requires two discreet web applications (one for admin and one that is public-facing).
The major change was to duplicate the contents of the web directory created from the archetype - and rename the two web directories as "admin-client" and "public-client". The following lines in the base pom.xml was changed
<modules>
<module>core</module>
<module>web</module>
</modules>
to:
<modules>
<module>core</module>
<module>admin-client</module>
<module>public-client</module>
</modules>
Each of the modular pom.xml were also updated to reflect the naming conventions.
When executing the mvn appfuse:full-source task, it successfully executes for the 'core' module.
However, it fails on the 'admin-client' module:
[INFO] ----------------------------------------------------------------------------
[INFO] Building Application - Admin Web Client (Spring MVC)
[INFO] task-segment: [appfuse:full-source]
[INFO] ----------------------------------------------------------------------------
[INFO] [appfuse:full-source]
[INFO] [AppFuse] Installing source from web-common module...
[INFO] [AppFuse] Installing source from spring module...
[ERROR] Failed to copy jdbc.properties to core module
[INFO] [AppFuse] Source successfully exported, modifying pom.xml...
[INFO] [AppFuse] Removing maven-warpath-plugin...
[INFO] [AppFuse] Adding dependencies from web-common module...
[INFO] [AppFuse] Adding dependencies from spring module...
[INFO] [AppFuse] Removing maven-warpath-plugin...
[INFO] [AppFuse] Updated dependencies in pom.xml...
[ERROR] Unable to write to pom.xml: File 'web/pom.xml' does not exist
java.io.FileNotFoundException: File 'web/pom.xml' does not exist
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:136)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:961)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:979)
at org.appfuse.mojo.installer.InstallSourceMojo.createFullSourcePom(InstallSourceMojo.java:428)
at org.appfuse.mojo.installer.InstallSourceMojo.execute(InstallSourceMojo.java:277)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
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)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] File 'web/pom.xml' does not exist
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 35 seconds
[INFO] Finished at: Thu Sep 20 20:22:49 CEST 2007
[INFO] Final Memory: 7M/22M
[INFO] ------------------------------------------------------------------------
It looks, therefore as though the AMP plugin hardcodes the 'web' module name - and expects only that module to exist, as opposed to allowing for the name to be picked up from the list of modules within the <module> tag in the base pom.xml. |
Show » |
|
As a workaround, you could run full-source and then move/rename directories. I suppose it's possible to check the modules and see if they're JAR or WAR and then import accordingly. However, can't you do this by running full-source on a project and then copying directories?
I'll leave this bug open so we can provide a better error message, but I don't know if we'll enhance it to allow detection of modules and importing based on the type. It seems like a feature most folks won't need. Then again, I could be wrong.