You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Kari J. Niemi (JIRA)" <ji...@apache.org> on 2010/11/05 22:04:01 UTC

[jira] Created: (SM-2008) jbi maven plugin: service assembly & attached artifact

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


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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63316#action_63316 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

That would be awesome. 


> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63216#action_63216 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

Kari,

would you mind attaching some simple test project to reproduce this easily? 

Regards
Lars


> 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.


[jira] Assigned: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Heinemann reassigned SM-2008:
----------------------------------

    Assignee: Lars Heinemann

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63255#action_63255 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

It's quite easy to test this. Just checkout the source code of the Maven JBI Plugin from the trunk and build it locally using mvn clean install.
Afterwards switch all pom files in your project to use the maven-jbi-plugin in version 4.4-SNAPSHOT (thats the trunk)

Yes, please create an issue for the m3 incompatibility.

Regards
Lars


> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Kari J. Niemi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63230#action_63230 ] 

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

Hi, thanks for taking the issue.

As far as I can see the problem is caused by these lines in GenerateServiceAssemblyMojo.java
---------------
* @parameter expression="${project.build.finalName}.zip"
private String finalName;
...
createArchive(new File(outputDirectory, finalName));
...
archiver.setOutputFile(installerFile);
...
projectHelper.attachArtifact(project, "zip", null, new File(outputDirectory, finalName));
---------------
So the jar and zip files get created with the same maven coordinates.

In GenerateComponentMojo.java the attached zip Artifact is given the "installer"-classifier:
projectHelper.attachArtifact(project, "zip", "installer", new File(outputDirectory, installerName)); 

And because of that the zip artifact can referenced using the <classifier>installer</classifier> in the maven dependency.

I'm feeling lazy about creating a simple test project, but if you would really need it, I could try of course...

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63234#action_63234 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

I committed some changes to the trunk version of the plugin. Could you please check if it fixes the problem for you?
Anyway it seems there are incompatibilities with Maven 3. They should be addressed in another issue then.

Waiting for your feedback before closing the issue.

Regards
Lars


> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Kari J. Niemi (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Kari J. Niemi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63103#action_63103 ] 

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

Actually, with maven 2.2.1 I was getting both jar&zip of a service assembly to the rpm -with maven3 I was only able to get the jar file. I had to start picking the SA to rpm using a relative path (../.../../xxx/yyy/) instead of a maven dependency... which really is not the maven way to do it....

> 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
>
> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63312#action_63312 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

The following is working fine here:

{code}
    <dependencies>
        <dependency>
            <groupId>testapp</groupId>
            <artifactId>copyapp</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>install</defaultGoal>
        <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,jar</includeTypes>
            <excludeTransitive>true</excludeTransitive>
         </configuration>
      </execution>
   </executions>
</plugin>
        </plugins>
    </build>
{code}

After execution I've got a folder target/tmp-hotdeploy containing the demanded jar file of my SA.


> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Kari J. Niemi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63314#action_63314 ] 

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

Well that won't work: <type> defaults to jar and the <packaging> for a service assembly is jbi-service-assembly, not jar. Even though a jar is produced by the jbi-maven-plugin, it cannot be referenced as maven dependency. I even tried it and maven tells me that "Could not find artifact my-sa:jar:DYNAMIC-SNAPSHOT. Don't ask me why having .zip there as <type> is accepted.

Further, when I have <type>zip</type> in place only the jar gets copied.

There's something very wrong here. I have to set up a small example project. Otherwise, we are not "arguing" the same issue here :-). 

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Kari J. Niemi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63315#action_63315 ] 

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

sorry, my last reply  was for the post  at - 12/Nov/10 08:12 AM

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63311#action_63311 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

The classifier "installer" is only used for JBI Components (ServiceEngines and BindingComponents). All others do not use that kind of classifier and I did not intend to change the logic.
My change fixes the problem that you first create a zip which is deployed to the repo and then overwrite this zip with the jar built afterwards which does not even contain possible SU/SL etc.
The SA artifact is now deployed to the maven repo as ZIP and JAR both containing the full SA with all SU/SL/etc. So referencing any of both in your dependency plugin should result in the wanted behaviour but of course you should not specify a classifier and you can even skip away the type.

Something like this....

{code}
<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>
   </dependency>
</dependencies>
{code}

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63317#action_63317 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

btw. the latest snapshot version of the plugin is now available from the asf nexus. So you don't need to build it locally.

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63313#action_63313 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

And if you specifically want to have the deployed ZIP file you can always do this:

{code}
<dependencies>
        <dependency>
            <groupId>testapp</groupId>
            <artifactId>copyapp</artifactId>
            <version>1.0</version>
            <type>zip</type>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>install</defaultGoal>
        <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,jar</includeTypes>
            <excludeTransitive>true</excludeTransitive>
         </configuration>
      </execution>
   </executions>
</plugin>
        </plugins>
    </build>

{code}

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63275#action_63275 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

Kari,

have you tested the changes? 

Regards
Lars


> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Lars Heinemann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63545#action_63545 ] 

Lars Heinemann commented on SM-2008:
------------------------------------

Any news on that issue? 

> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Kari J. Niemi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63104#action_63104 ] 

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

And what's more to it =), with maven 3 I was experiencing the same kind of behaviour as here: http://jira.codehaus.org/browse/MNG-2877. If I built the whole reactor, I was only getting the jar in my rpm, but if I built the SA separately, and then the rpm separately ->the zip was included in the rpm...

> 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
>
> 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.


[jira] Commented: (SM-2008) jbi maven plugin: service assembly & attached artifact

Posted by "Kari J. Niemi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63254#action_63254 ] 

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

Wow, thanks...

-I've never taken new stuff from the trunk, I've just been using stuff from maven repositories. But I'll try to test this... any hints are welcome of course. I am able to do it on my own, but I'll have to bang my head for a while to get through and it's always a nice learning process/experience...=)
-And yes, there might be some incompatibilities with Maven 3, should I create an issue for that -or did you already do it =)?

Br,
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.