Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-3497

Wrong artifact type attached as a secondary artifact when project packaging is set to "pom"

    XMLWordPrintableJSON

    Details

      Description

      When trying to create a ${artifactid}-tests.jar in a maven project that does not produce a primary bundle the plugin attaches the ${artifactid}-tests.jar bundle as ${artifactid}-tests.pom. The plugin does not abide by the "<packaging>jar</packaging>" config.

      I have attached both an example POM and a simple fix in the form of a patch.

      Example POM:

      <project>
      	<groupId>foo</groupId>
      	<artifactId>bar</artifactId>
      	<version>1.5.1-SNAPSHOT</version>
      
      	<packaging>pom</packaging>
      
      	<build>
      		<plugins>
      			<!-- Create a Integration test bundle -->
      			<plugin>
      				<groupId>org.apache.felix</groupId>
      				<artifactId>maven-bundle-plugin</artifactId>
      				<executions>
      					<execution>
      						<id>bundle-tests</id>
      						<phase>package</phase>
      						<goals><goal>bundle</goal></goals>
      					</execution>
      				</executions>
      				<configuration>
      					<classifier>tests</classifier>
      					<packaging>jar</packaging>
      					<supportedProjectTypes><supportedProjectType>pom</supportedProjectType></supportedProjectTypes>
      					<outputDirectory>target/test-classes</outputDirectory>
      					<instructions>
      						<Export-Package>com.foo.*</Export-Package>
      						<Sling-Test-Regexp>.*Test</Sling-Test-Regexp>
      						<Bundle-Description>Integration Tests - ${project.description}</Bundle-Description>
      						<Bundle-Name>Integration Tests for ${project.name}</Bundle-Name>
      						<Bundle-SymbolicName>${groupId}.${artifactId}-tests</Bundle-SymbolicName>
      					</instructions>
      				</configuration>
      			</plugin>
      		</plugins>
      	</build>
      </project>
      

        Attachments

        1. example.pom
          1 kB
          Martin Petrovsky
        2. maven-bundle-fix.patch
          1 kB
          Martin Petrovsky

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mpetrovsky Martin Petrovsky
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: