[ 
https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63310#action_63310
 ] 

Kari J. Niemi commented on SM-2008:
-----------------------------------

OK, I tried...it was somewhat difficult to get the snapshot version to my 
reactor...as I had no uptodate/snapshot maven&apache repositories available.

I studied the changes that you did. What I expected was that you would change:
------------------
            projectHelper.attachArtifact(project, "zip", null, new 
File(outputDirectory, finalName));
->
            projectHelper.attachArtifact(project, "zip", installer, new 
File(outputDirectory, finalName));

-------------------

Then I could reference the artifacts this way:

-------------------------
   </plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              
<outputDirectory>${project.build.directory}/tmp-hotdeploy</outputDirectory>
              <includeTypes>zip</includeTypes>
              <excludeTypes>jar</excludeTypes>
              <excludeTransitive>true</excludeTransitive>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  <dependencies>
    <dependency>
      <groupId>myGroupId</groupId>
      <artifactId>myServiceAssembly</artifactId>
      <version>DYNAMIC-SNAPSHOT</version>
      <scope>runtime</scope>
      <classifier>installer</classifier>
      <type>zip</type>
    </dependency>
  </dependencies>
-----------------------------------------------------

My project got packaged and the problem is still there. I had to remove the 
<classifier> from above example as the jbi-maven-plugin does not publish the 
service assembly artifact with such classifier. And when I removed the 
classifier, the copy-dependencies goal copies only the jar file to 
${project.build.directory}/tmp-hotdeploy. So after your change, the plugin is 
still publishing the artifacts with the same classifier -I  mean both are 
published without any classifier. And it's wrong according to the link I gave 
above:
http://maven.40175.n5.nabble.com/Missing-search-results-with-assembly-attached-artifacts-td131996.html

kari

> jbi maven plugin: service assembly & attached artifact
> ------------------------------------------------------
>
>                 Key: SM-2008
>                 URL: https://issues.apache.org/activemq/browse/SM-2008
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: tooling
>            Reporter: Kari J. Niemi
>            Assignee: Lars Heinemann
>
> jbi maven plugin would seem the behave badly when creating a service 
> assembly.  At least when the pom file with packaging jbi-service-assembly 
> contains only dependencies to jbi-service-units (and the project for that 
> pom.xml does not contain any java code in src/main/java), the plugin first 
> creates a jar, installs it as a _zip_, then creates the correct zip and 
> installs it as an attached artifact. 
> If I got it right from the plugins source code, it's contradicting the 
> "correct way" that's referred here:
> http://maven.40175.n5.nabble.com/Missing-search-results-with-assembly-attached-artifacts-td131996.html
> "What happens in those cases is that you end up with empty jar, and a zip 
> that has _same_ coordinates as main artifact, but only different extension. 
> Since Nexus reads POM to figure out the packaging, it will think in these two 
> cases it is "JAR"."
> I ran in to this problem when trying to package the service assebly using the 
> maven-rpm-plugin. When using dependencies to package the rpm, it just keeps 
> packing the jar whiles of the service assembly -not the zip file at all. I 
> suppose it's because the jar & zip files have the same maven coordinates. 
> With the BCs/SEs the zip file gets the classifier "installer", and with that 
> I can get the BC/SE zip file to the rpm(but I'm also getting the jar there 
> even if I'm setting the dependency type to zip...)
> maven 2.09,2.2.1,3 tried. latest beta of maven-rpm-plugin, 
> jbi-maven-plugin:4.0,4.3...errrr....at least some combinations of these...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to