jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Assembly Plugin
  • MASSEMBLY-467

Sharing assembly descriptor across sub modules does not work if invoked from parent project - bad resolve of the classpath

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 2.2-beta-5
  • Fix Version/s: None
  • Labels:
    None
  • Environment:
    Winfows7, Maven 2.2.1, Sun JDK1.6.0_u18

Description

My problem is similar to http://jira.codehaus.org/browse/MASSEMBLY-391, but in my opinion it is BUG, not request for new feature.

I have project structure like:

module
submodule-1
submodule-2
my-assembly-descriptor-submodule

The submodule-1 and submodule-2 use the shared my-assembly-descriptor-submodule to produce attached zip-artifact with configuration files.
The creation of the zip-artifact is defined on parent module by use of assembly plugin.

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<dependencies>
<dependency>
<groupId>org.mymodule</groupId>
<artifactId>my-assembly-descriptor-submodule</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>zip-config</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>config-assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>

Everything works fine, when I install the shared assembly-descriptor to local repository and run the "mvn clean package" separately in submodule-1 and submodule-2.

But when I try to run the same command in parent module, than the build fails - the config-assembly.xml is not found on classpath.

[INFO] Error reading assemblies: Error locating assembly descriptor: config-assembly.xml

[1] [INFO] Searching for file location: D:\mymodule\submodule-1\config-assembly.xml

[2] [INFO] File: D:\mymodule\submodule-1\config-assembly.xml does not exist.

[3] [INFO] Invalid artifact specification: 'config-assembly.xml'. Must contain at least three fields, separated by ':'.

[4] [INFO] Failed to resolve classpath resource: assemblies/config-assembly.xml from classloader: org.codehaus.classworlds.RealmClassLoader@11a75a2

[5] [INFO] Failed to resolve classpath resource: config-assembly.xml from classloader: org.codehaus.classworlds.RealmClassLoader@11a75a2

[6] [INFO] File: D:\mymodule\config-assembly.xml does not exist.

[7] [INFO] Building URL from location: config-assembly.xml
Error:
java.net.MalformedURLException: no protocol: config-assembly.xml
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.maven.shared.io.location.URLLocatorStrategy.resolve(URLLocatorStrategy.java:54)
at org.apache.maven.shared.io.location.Locator.resolve(Locator.java:81)
at org.apache.maven.plugin.assembly.io.DefaultAssemblyReader.addAssemblyFromDescriptor(DefaultAssemblyReader.java:309)
at org.apache.maven.plugin.assembly.io.DefaultAssemblyReader.readAssemblies(DefaultAssemblyReader.java:140)
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:352)
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)

The workaround exists:

1) install/deploy the shared descriptor in isolated build
2) remove <module>my-assembly-descriptor-submodule</module> from parent module to avoid build of this submodule in the same build-cycle as submodules that need it.
3) than the my-assembly-descriptor-submodule will be always resolved from repository and the problem doesn't occurre.

But you can not all-in-one build.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    build-log.txt
    31/Jan/10 12:07 PM
    15 kB
    Kek

Issue Links

is superceded by

Bug - A problem which impairs or prevents the functions of the product. MASSEMBLY-468 Sharing assembly descriptor across sub modules does not work if parent defines assembly and submodule want to add own assembly

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Kek added a comment - 01/Feb/10 3:51 AM

The problem is on other place, so I close this bug and create new one with right problem description and some project for simulation.

Show
Kek added a comment - 01/Feb/10 3:51 AM The problem is on other place, so I close this bug and create new one with right problem description and some project for simulation.
Hide
Permalink
Benjamin Bentmann added a comment - 01/Feb/10 4:55 AM

Could be another occurrence of MNG-1323.

Show
Benjamin Bentmann added a comment - 01/Feb/10 4:55 AM Could be another occurrence of MNG-1323.
Hide
Permalink
Kek added a comment - 01/Feb/10 6:03 AM

The root cause of the problem was different than described here.

Show
Kek added a comment - 01/Feb/10 6:03 AM The root cause of the problem was different than described here.

People

  • Assignee:
    Unassigned
    Reporter:
    Kek
Vote (0)
Watch (1)

Dates

  • Created:
    31/Jan/10 12:07 PM
    Updated:
    01/Feb/10 6:03 AM
    Resolved:
    01/Feb/10 3:51 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.