You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ma...@fiducia.de on 2011/09/13 11:27:04 UTC

Question about assambling a multi module project [*]


Hello,

we are developing a multi module project at the moment. Unfortunately we
cannot structure our modules the maven standard way.
We have following structure:

wsp
|
|-wsp-maven (aggregator: pom)
|           |-pom.xml  (this has ws-sn as module)
|
|-wsp-build (aggregator: pom)
|           |- pom.xml
|           |-src
|               |-main
|                     |-assembly
|                               |-wsp-build.xml (this is the assembly
config)
|
|
|-wsp-sn (aggregator: pom)
|          |-pom.xml (with the modules pom-api.xml and pom-iml.xml)
|          |-pom-api.xml (aggregator: jar)
|          |-pom-imp.xml (aggregator: jar)
|          |-api
|          |    |-src.... (here are the java-sources of the api submodule)
|          |-impl
|          |    |-src.... (here are the java-sources of the impl submodule)
|          |-assembly
|               |-api
|                   |-assembly.xml
|               |-impl
|                   |-assembly.xml

We don't use the api-assembly at the moment.
Well, if we build and assembly form the ws-sn-project then all works fine.
ws-sn-api and ws-sn-impl are build, and the dependencies are all copied to
the desired folder.
But - if we call maven from the wsp-maven-project, then we see an
IllegalStateException. The same happens if we call maven from ws-build...

Until last week we had a different structure - the modules ws-sn, ws-sn-api
and ws-sn-impl were oganized in the maven way - they were real submodules
with pom.xml-files. In this case the assambly was working fine, from
ws-maven too...

What are we doing wrong? Or is there a Bug in the assambly-plugin?
We are using maven 2.2.1 in the command line, and the maven 3.0.1 in an
eclipse plug-in (both wre throwing the same exception...)

Here is the output from the maven install command:
---
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   WSP Maven
[INFO]   WSP Servicenehmer
[INFO]   WSP Servicenehmer API
[INFO]   WSP Servicenehmer IMPL
[INFO]
------------------------------------------------------------------------
[INFO] Building WSP Maven
[INFO]    task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\Z_M\ws\wsp\wsp\wsp-maven\pom.xml to c:\maven
\repository\de\jbfagree\wsp-maven\1.00-00-SNAPSHOT
\wsp-maven-1.00-00-SNAPSHOT.pom
[INFO]
------------------------------------------------------------------------
[INFO] Building WSP Servicenehmer
[INFO]    task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [site:attach-descriptor {execution: default-attach-descriptor}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\Z_M\ws\wsp\wsp\wsp-servicenehmer\pom.xml to c:\maven
\repository\de\jbfagree\wsp-servicenehmer\1.00-00-SNAPSHOT
\wsp-servicenehmer-1.00-00-SNAPSHOT.pom
[INFO]
------------------------------------------------------------------------
[INFO] Building WSP Servicenehmer API
[INFO]    task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'Cp1252' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'Cp1252' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: C:\Z_M\ws\wsp\wsp\wsp-servicenehmer
\target\api\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running de.jbfagree.wsp.dummy.DummyTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.114 sec

Results :

Tests run: 10, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar {execution: default-jar}]
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\Z_M\ws\wsp\wsp\wsp-servicenehmer\target\api
\wsp-servicenehmer-api-1.00-00-SNAPSHOT.jar to c:\maven\repository\de
\jbfagree\wsp-servicenehmer-api\1.00-00-SNAPSHOT
\wsp-servicenehmer-api-1.00-00-SNAPSHOT.jar
[INFO]
------------------------------------------------------------------------
[INFO] Building WSP Servicenehmer IMPL
[INFO]    task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'Cp1252' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'Cp1252' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: C:\Z_M\ws\wsp\wsp\wsp-servicenehmer
\target\impl\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running de.jbfagree.wsp.impl.dummy.DummyTest
SLF4J: The requested version 1.5.6 by your slf4j binding is not compatible
with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further
details.
Tests run: 35, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.295 sec

Results :

Tests run: 35, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar {execution: default-jar}]
[INFO] [assembly:single {execution: bin}]
[INFO] Reading assembly descriptor: assembly/impl/assembly.xml
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] null
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException
	at java.util.LinkedHashMap$LinkedHashIterator.remove
(LinkedHashMap.java:362)
	at
org.apache.maven.plugin.assembly.utils.ProjectUtils.getProjectModules
(ProjectUtils.java:114)
	at
org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPhase.getModuleProjects
(ModuleSetAssemblyPhase.java:556)
	at
org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolver.getModuleSetResolutionRequirements
(DefaultDependencyResolver.java:260)
	at
org.apache.maven.plugin.assembly.artifact.DefaultDependencyResolver.resolve
(DefaultDependencyResolver.java:113)
	at
org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive
(DefaultAssemblyArchiver.java:183)
	at
org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute
(AbstractAssemblyMojo.java:413)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:490)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:694)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:556)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:535)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:387)
	at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
(DefaultLifecycleExecutor.java:348)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at org.apache.maven.cli.compat.CompatibleMain.main
(CompatibleMain.java:60)
	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:597)
	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]
------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Sep 13 11:11:43 CEST 2011
[INFO] Final Memory: 32M/78M
[INFO]
------------------------------------------------------------------------
---

and here is our project (well, it is quite simple now. But it will
grow. :-) )
The test will fail now, but you can disable them anyway...

(See attached file: wsp.zip)

Greetings,
Marcin Markiewicz



----------------------------------------------------------------------------------------------------------------------------------------------


Fiducia IT AG
Fiduciastra�e 20
76227 Karlsruhe

Sitz der Gesellschaft: Karlsruhe
AG Mannheim HRB 100059

Vorsitzender des Aufsichtsrats: Gregor Scheller
Vorsitzender des Vorstands: Michael Krings
Stellv. Vorsitzender des Vorstands: Klaus-Peter Bruns
Vorstand: Jens-Olaf Bartels, Carsten Pfl�ging, Hans-Peter Straberger

Umsatzsteuer-ID.Nr. DE143582320, http://www.fiducia.de
----------------------------------------------------------------------------------------------------------------------------------------------