You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2012/11/05 17:34:16 UTC

[jira] (MASSEMBLY-565) jar-with-dependencies: class from the source in project does NOT override the class in jar dependency

     [ https://jira.codehaus.org/browse/MASSEMBLY-565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MASSEMBLY-565:
--------------------------------------

    Component/s: predefined descriptors
    
> jar-with-dependencies: class from the source in project does NOT override the class in jar dependency
> -----------------------------------------------------------------------------------------------------
>
>                 Key: MASSEMBLY-565
>                 URL: https://jira.codehaus.org/browse/MASSEMBLY-565
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>          Components: predefined descriptors
>    Affects Versions: 2.2.1
>         Environment: % mvn -version
> Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
> Maven home: /home/jmv/apps/apache-maven3
> Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
> Java home: /home/jmv/apps/jdk1.6.0_25/jre
> Default locale: fr_FR, platform encoding: UTF-8
> OS name: "linux", version: "2.6.38-10-generic", arch: "amd64", family: "unix"
>            Reporter: Jean-Marc Vanel
>         Attachments: maven_bug_build_override_class.zip
>
>
> When running plugin maven-assembly-plugin 2.2.1 with jar-with-dependencies, and there is a class C1 in src/main/java/ that overrides a class C1 in some dependency, in the resulting XXX-jar-with-dependencies.jar the C1.class comes from the dependency, not from the source in project.
> I would except the class from the source in project to override the corresponding class in jar dependency,
> So the executable jar is not built correctly. This is particularly annoying, because the tests pass, but the executable jar is not correct.
> You can see this in the test project attached, where I override class TestCase of JUnit , adding a main , and setting this overriden class as the main class:
> % java -jar target/maven_bug_build_override_class-1.0-SNAPSHOT-jar-with-dependencies.jar
> Exception in thread "main" java.lang.NoSuchMethodError: main
> ( the original class TestCase of JUnit has no main ).
> In the test project attached,I kept all the Maven plugins that are in my original project, because they might have a relation with the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira