Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-2240

Handling of custom lifecycle artifacts is not working properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 2.0.4
    • None
    • None

    Description

      I am using a custom lifecycle, resource, as follows:

      <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>resource</role-hint>
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
      <configuration>
      <phases>
      <process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources>
      <package>org.apache.maven.plugins:maven-jar-plugin:jar</package>
      <install>org.apache.maven.plugins:maven-install-plugin:install,com.dcx.NGST:maven-bundle-plugin:install</install>
      <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
      </phases>
      </configuration>
      </component>

      <component>
      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
      <role-hint>resource</role-hint>
      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
      <configuration>
      <extension>jar</extension>
      <type>resource</type>
      <packaging>resource</packaging>
      <language>java</language>
      <addedToClasspath>true</addedToClasspath>
      </configuration>
      </component>

      I have a pom structure that looks like this:
      app\data\production\ecuDB\ABS\01\pom.xml
      app\data\production\ecuDB\ABS\02\pom.xml
      app\data\production\ecuDB\ABS\03\pom.xml
      app\data\production\ecuDB\ABS\04\pom.xml
      app\data\production\ecuDB\ABS\05\pom.xml
      app\data\production\ecuDB\ABS\06\pom.xml
      app\data\production\ecuDB\ABS\07\pom.xml

      Each folder in the structure contains a pom type, and references the child modules; 0X are resource type artifacts as defined above. I attached the text output of maven install on one of the resource projects, namely 01, followed by 'cd ..' and maven install on all ABS modules. Comparing the 2 runs, you will find that the 01 resource artifact has been installed with different extensions. It uses the correct .jar extension on the first run, but it defaults to .resource when build as a multiproject. It appears that the component definition isn't available, and it defaults the extension to the type value

      I am also going to attach the 01/pom.xml

      Attachments

        1. pom.xml
          0.9 kB
          Emanuel Bulic
        2. output1.txt
          3 kB
          Emanuel Bulic

        Issue Links

          Activity

            People

              carlos Carlos Sanchez Gonzalez
              emanuelbulic Emanuel Bulic
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: