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

pom.xml information automatically included in META-INF during jar

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1
    • None
    • None

    Description

      The jar plugin automatically adds a pom.xml in META-INF, which makes sense. But this pom.xml also contains local paths ie

      <build>
      <sourceDirectory>d:\src\excalibur-trunk\framework\api\src\java</sourceDirectory>
      <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
      <testSourceDirectory>d:\src\excalibur-trunk\framework\api\src\test</testSourceDirectory>
      <outputDirectory>d:\src\excalibur-trunk\framework\api\target\classes</outputDirectory>
      <testOutputDirectory>d:\src\excalibur-trunk\framework\api\target\test-classes</testOutputDirectory>
      <resources>
      <resource>
      <targetPath>META-INF</targetPath>
      <directory>d:\src\excalibur-trunk\framework\api\..\..</directory>
      <includes>
      <include>LICENSE.txt</include>
      <include>NOTICE.txt</include>
      </includes>
      </resource>
      </resources>
      <testResources>
      <testResource>
      <directory>d:\src\excalibur-trunk\framework\api\src\test\resources</directory>

      I don't see how this information could be useful to anyone else, and i'ld rather not have my local paths in distribution jars - call me paranoid

      Conversation log from IRC :

      jorg is there a way to tell maven not to include the pom.xml in META-INF when creating jars ?
      jesse hm, not that I know of
      jesse might be a boolean to control it in there somewhere
      jorg i looked at the jar plugin config .. didn't seem like it
      jorg it's not a real problem, just funny that this is done by default
      jesse I don't know, it makes it easier down the road to have automated things interrogate the jar for dependencies of the things inside
      trygvis yeah, you're right there jesse
      jorg mmm well yes that makes sense ...
      jorg thanks !
      trygvis jorg: it's useful for the application itself
      trygvis like reading out the version number from pom.properties
      jorg trygvis: yes, but the pom also had my local paths in it for <sourceDirectory> and stuff, that's why i found it a bit strange
      trygvis makes it easier making versioning-aware application and gives a thigh integration with your project management tool (aka maven)
      trygvis hm
      trygvis that should possibly be changed indeed
      trygvis File properties should be made relative to ${basedir} again
      trygvis when writing out the pom that is
      jorg i can understand about the dependencies , but the build configuration probably shouldn't be in there
      jorg <directory>d:\src\excalibur-trunk\framework\api\..\..</directory>
      trygvis jorg: file an issue, it should be relative to ${basedir} if there at all
      trygvis IMO the <build> parts of a pom could be stripped from the repo

      Attachments

        1. MNG-1543-maven-archiver.patch
          1.0 kB
          Edwin Punzalan

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              heymjo Jorg Heymans
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: