Uploaded image for project: 'Maven JAR Plugin'
  1. Maven JAR Plugin
  2. MJAR-83

addClasspath is not respected for runtime dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1, 2.2
    • 2.2
    • None
    • None

    Description

      maven-jar-plugin does not resolve dependencies itself, so specifying

      	<configuration>
      		<archive>
      			<manifest>
      				<addClasspath>true</addClasspath>
      			</manifest>
      		</archive>
      	</configuration>
      

      will add no dependencies for

      	mvn jar:jar
      

      And even

      	mvn compiler:compile jar:jar
      

      will only add compile time dependencies, not runtime dependencies, presumably because the maven-compiler-plugin causes resolution of the compile time dependencies.

      See the attached POM.
      There is no manifest classpath generated by

      	mvn jar:jar
      

      The manifest classpath generated by

      	mvn compiler:compile jar:jar
      

      only contains commons-codec which is the compile time dependency.

      There needs to be a way to add runtime dependences to the manifest classpath of the jar.
      And preferably not requiring some other plugin to resolve the dependencies first.

      Attachments

        1. patch.txt
          2 kB
        2. pom.xml
          2 kB

        Activity

          People

            maurotalevi Mauro Talevi
            william_ferguson_au@yahoo.com William Ferguson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: