Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] problem with assembly on a multimodule project with interdependencies

No, not possible.

--
Regards,
Igor

On 2014-11-07, 14:46, Carlos Alegria Galicia wrote:
Hi Igor,
Thanks a lot for your answer.

I actually have these three symptoms you are mentioning. Curiously,
assembly works when I use the "jar-with-dependencies" descriptor ref. It
seems this is because it uses <unpack>true</unpack> which, according to
the debug info, allows m2e to resolve workspace dependencies with
target/classes directory.

In my project I have workspace project dependencies, so unchecking
"Resolve Workspace Artifacts" results in "The following artifacts could
not be resolved" issues while packaging. Is there a way to workaround
the need to install my workspace dependencies so they can be resolved by
m2e while unchecking "Resolve Workspace Artifacts"?

Best regards,
Carlos Alegria

On Fri, Nov 7, 2014 at 6:19 AM, Igor Fedorenko <igor@xxxxxxxxxxxxxx
<mailto:igor@xxxxxxxxxxxxxx>> wrote:

    Hard to tell for sure without looking at actual build, but this kind of
    exception is possible under the following conditions

    * Maven launch configuration has "Resolve Workspace artifacts" checked
    (it is unchecked by default)
    * Referenced dependency is not part of reactor build
    * Referenced dependency is part of m2e workspace

    Under these conditions referenced dependency will be resolved to m2e
    workspace project target/classes folder and assembly plugin will fail
    with the exception you observe.

    The solution is to disable "Resolve Workspace artifacts" in the launch
    configuration.

    If you believe these are not conditions that you have, please provide
    small standalone example project and exact steps to reproduce the
    problem using latest m2e 1.6 snapshot build and we'll have a look.

    --
    Regards,
    Igor


    On 2014-11-06, 23:14, Carlos Alegria Galicia wrote:

        Hi all,

        I have a project of type POM that I am using to concentrate several
        dependencies. From that project, I am inheriting a jar project
        that has
        an assembly descriptor attached to the package phase, via the
        assembly
        plugin. When I try to package this project, I am getting the
        following
        error:

        [ERROR] Failed to execute goal
        org.apache.maven.plugins:__maven-assembly-plugin:2.5:__single
        (make-assembly) on project child-a: Failed to create assembly: Error
        adding file 'a.group.id:dep-a:jar:0.0.1-__SNAPSHOT' to archive:
        C:\Users\alegriac\Documents\__Projects\Intueri\sub_projects\__clasp\workspace-test\dep-a\__target\classes
        isn't a file. -> [Help 1]
        org.apache.maven.lifecycle.__LifecycleExecutionException: Failed to
        execute goal
        org.apache.maven.plugins:__maven-assembly-plugin:2.5:__single
        (make-assembly) on project child-a: Failed to create assembly: Error
        adding file 'a.group.id:dep-a:jar:0.0.1-__SNAPSHOT' to archive:
        C:\Users\alegriac\Documents\__Projects\Intueri\sub_projects\__clasp\workspace-test\dep-a\__target\classes
        isn't a file.
        at
        org.apache.maven.lifecycle.__internal.MojoExecutor.execute(__MojoExecutor.java:216)
        at
        org.apache.maven.lifecycle.__internal.MojoExecutor.execute(__MojoExecutor.java:153)
        at
        org.apache.maven.lifecycle.__internal.MojoExecutor.execute(__MojoExecutor.java:145)
        at
        org.apache.maven.lifecycle.__internal.__LifecycleModuleBuilder.__buildProject(__LifecycleModuleBuilder.java:__108)
        at
        org.apache.maven.lifecycle.__internal.__LifecycleModuleBuilder.__buildProject(__LifecycleModuleBuilder.java:__76)
        at
        org.apache.maven.lifecycle.__internal.builder.__singlethreaded.__SingleThreadedBuilder.build(__SingleThreadedBuilder.java:51)
        at
        org.apache.maven.lifecycle.__internal.LifecycleStarter.__execute(LifecycleStarter.java:__116)
        at
        org.apache.maven.DefaultMaven.__doExecute(DefaultMaven.java:__361)
        at org.apache.maven.DefaultMaven.__execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.__execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.__doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.__main(MavenCli.java:157)
        at sun.reflect.__NativeMethodAccessorImpl.__invoke0(Native Method)
        at
        sun.reflect.__NativeMethodAccessorImpl.__invoke(__NativeMethodAccessorImpl.java:__57)
        at
        sun.reflect.__DelegatingMethodAccessorImpl.__invoke(__DelegatingMethodAccessorImpl.__java:43)
        at java.lang.reflect.Method.__invoke(Method.java:606)
        at
        org.codehaus.plexus.__classworlds.launcher.Launcher.__launchEnhanced(Launcher.java:__289)
        at
        org.codehaus.plexus.__classworlds.launcher.Launcher.__launch(Launcher.java:229)
        at
        org.codehaus.plexus.__classworlds.launcher.Launcher.__mainWithExitCode(Launcher.__java:415)
        at
        org.codehaus.plexus.__classworlds.launcher.Launcher.__main(Launcher.java:356)
        Caused by: org.apache.maven.plugin.__MojoExecutionException:
        Failed to
        create assembly: Error adding file
        'a.group.id:dep-a:jar:0.0.1-__SNAPSHOT'
        to archive:
        C:\Users\alegriac\Documents\__Projects\Intueri\sub_projects\__clasp\workspace-test\dep-a\__target\classes
        isn't a file.
        at
        org.apache.maven.plugin.__assembly.mojos.__AbstractAssemblyMojo.execute(__AbstractAssemblyMojo.java:530)
        at
        org.apache.maven.plugin.__DefaultBuildPluginManager.__executeMojo(__DefaultBuildPluginManager.__java:133)
        at
        org.apache.maven.lifecycle.__internal.MojoExecutor.execute(__MojoExecutor.java:208)
        ... 19 more
        Caused by:
        org.apache.maven.plugin.__assembly.archive.__ArchiveCreationException:
        Error
        adding file 'a.group.id:dep-a:jar:0.0.1-__SNAPSHOT' to archive:
        C:\Users\alegriac\Documents\__Projects\Intueri\sub_projects\__clasp\workspace-test\dep-a\__target\classes
        isn't a file.
        at
        org.apache.maven.plugin.__assembly.archive.task.__AddArtifactTask.execute(__AddArtifactTask.java:216)
        at
        org.apache.maven.plugin.__assembly.archive.task.__AddDependencySetsTask.__addNormalArtifact(__AddDependencySetsTask.java:__342)
        at
        org.apache.maven.plugin.__assembly.archive.task.__AddDependencySetsTask.__addDependencySet(__AddDependencySetsTask.java:__180)
        at
        org.apache.maven.plugin.__assembly.archive.task.__AddDependencySetsTask.execute(__AddDependencySetsTask.java:__120)
        at
        org.apache.maven.plugin.__assembly.archive.phase.__DependencySetAssemblyPhase.__execute(__DependencySetAssemblyPhase.__java:82)
        at
        org.apache.maven.plugin.__assembly.archive.__DefaultAssemblyArchiver.__createArchive(__DefaultAssemblyArchiver.java:__189)
        at
        org.apache.maven.plugin.__assembly.mojos.__AbstractAssemblyMojo.execute(__AbstractAssemblyMojo.java:475)
        ... 21 more
        Caused by: org.codehaus.plexus.archiver.__ArchiverException:
        C:\Users\alegriac\Documents\__Projects\Intueri\sub_projects\__clasp\workspace-test\dep-a\__target\classes
        isn't a file.
        at
        org.codehaus.plexus.archiver.__AbstractArchiver.addFile(__AbstractArchiver.java:414)
        at
        org.codehaus.plexus.archiver.__AbstractArchiver.addFile(__AbstractArchiver.java:340)
        at
        org.apache.maven.plugin.__assembly.archive.archiver.__AssemblyProxyArchiver.addFile(__AssemblyProxyArchiver.java:__563)
        at
        org.apache.maven.plugin.__assembly.archive.task.__AddArtifactTask.execute(__AddArtifactTask.java:211)
        ... 27 more
        [ERROR]
        [ERROR]
        [ERROR] For more information about the errors and possible
        solutions,
        please read the following articles:
        [ERROR] [Help 1]
        http://cwiki.apache.org/__confluence/display/MAVEN/__MojoExecutionException
        <http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException>

        This seems to be related to the issue described here
        https://mail-archives.apache.__org/mod_mbox/maven-issues/__201009.mbox/%3C14493974.64214.__1285253552573.JavaMail.haus-__jira@codehaus01.managed.__contegix.com%3E
        <https://mail-archives.apache.org/mod_mbox/maven-issues/201009.mbox/%3C14493974.64214.1285253552573.JavaMail.haus-jira@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%3E>.
        So if I understood correctly, there is a  problem while using a
        multimodule project with interdependencies in m2e. Does anyone have
        faced this issue?, is there a known workaround?

        Thanks a lot,
        Carlos Alegria



        _________________________________________________
        m2e-users mailing list
        m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
        To change your delivery options, retrieve your password, or
        unsubscribe from this list, visit
        https://dev.eclipse.org/__mailman/listinfo/m2e-users
        <https://dev.eclipse.org/mailman/listinfo/m2e-users>

    _________________________________________________
    m2e-users mailing list
    m2e-users@xxxxxxxxxxx <mailto:m2e-users@xxxxxxxxxxx>
    To change your delivery options, retrieve your password, or
    unsubscribe from this list, visit
    https://dev.eclipse.org/__mailman/listinfo/m2e-users
    <https://dev.eclipse.org/mailman/listinfo/m2e-users>




_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top