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 2011/01/27 08:04:43 UTC

[jira] Created: (SM-2045) jbi-maven-plugin should not filter out optional dependencies

jbi-maven-plugin should not filter out optional dependencies
------------------------------------------------------------

                 Key: SM-2045
                 URL: https://issues.apache.org/jira/browse/SM-2045
             Project: ServiceMix
          Issue Type: Bug
          Components: tooling
    Affects Versions: 4.0, jbi-maven-plugin-4.5
            Reporter: Kari J. Niemi


jbi-maven-plugin should not filter out optional dependencies of the project(pom.xml) that it's executed on. The optional element in maven denotes whether the dependency should be taken transitively for the _dependent_ projects -it is not supposed to have effect on project that defines the dependency as optional.

So I think "!artifact.isOptional()" should be removed from:
http://svn.apache.org/viewvc/servicemix/maven-plugins/jbi-maven-plugin/trunk/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyMojo.java?view=markup
--------
if (!artifact.isOptional() && filter.include(artifact) && (artifact.getDependencyTrail().size() == 2)) {
---------
Also, the same might concern the component/su generation mojos...

The use case and problem I ran into:
I'm supposed to package an SA to an rpm from a different maven project(via the basic maven way: a dependency). It's really not necessary for those SA dependencies to be propagated transitively to the rpm project. Of course I tried the basic maven way and added the optional flag to the dependencies in the SA project. To my surprise,  the SA was empty when I built it. Yes, there are workarounds, but still this a bug in jbi-maven-plugin.

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


[jira] Commented: (SM-2045) jbi-maven-plugin should not filter out optional dependencies

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

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

Hi,

-please refer the documentation maven optional dependencies: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
-I though/was supposed to link that info on my description but seems I forgot it.

After reading that -would you still think jbi-maven-plugin is doing it right? I still think it's using optional-flag wrongly -it's against the maven specs.


> jbi-maven-plugin should not filter out optional dependencies
> ------------------------------------------------------------
>
>                 Key: SM-2045
>                 URL: https://issues.apache.org/jira/browse/SM-2045
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: tooling
>    Affects Versions: 4.0, jbi-maven-plugin-4.5
>            Reporter: Kari J. Niemi
>
> jbi-maven-plugin should not filter out optional dependencies of the project(pom.xml) that it's executed on. The optional element in maven denotes whether the dependency should be taken transitively for the _dependent_ projects -it is not supposed to have effect on project that defines the dependency as optional.
> So I think "!artifact.isOptional()" should be removed from:
> http://svn.apache.org/viewvc/servicemix/maven-plugins/jbi-maven-plugin/trunk/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyMojo.java?view=markup
> --------
> if (!artifact.isOptional() && filter.include(artifact) && (artifact.getDependencyTrail().size() == 2)) {
> ---------
> Also, the same might concern the component/su generation mojos...
> The use case and problem I ran into:
> I'm supposed to package an SA to an rpm from a different maven project(via the basic maven way: a dependency). It's really not necessary for those SA dependencies to be propagated transitively to the rpm project. Of course I tried the basic maven way and added the optional flag to the dependencies in the SA project. To my surprise,  the SA was empty when I built it. Yes, there are workarounds, but still this a bug in jbi-maven-plugin.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SM-2045) jbi-maven-plugin should not filter out optional dependencies

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SM-2045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998721#comment-12998721 ] 

Guillaume Nodet commented on SM-2045:
-------------------------------------

I think you misuse the optional maven flag.  What you are looking for is more the provided flag which will remove it from the transitive dependency.  Imho, optional really means that the artifact can be used without the dependency, which is clearly not the case here.

> jbi-maven-plugin should not filter out optional dependencies
> ------------------------------------------------------------
>
>                 Key: SM-2045
>                 URL: https://issues.apache.org/jira/browse/SM-2045
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: tooling
>    Affects Versions: 4.0, jbi-maven-plugin-4.5
>            Reporter: Kari J. Niemi
>
> jbi-maven-plugin should not filter out optional dependencies of the project(pom.xml) that it's executed on. The optional element in maven denotes whether the dependency should be taken transitively for the _dependent_ projects -it is not supposed to have effect on project that defines the dependency as optional.
> So I think "!artifact.isOptional()" should be removed from:
> http://svn.apache.org/viewvc/servicemix/maven-plugins/jbi-maven-plugin/trunk/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyMojo.java?view=markup
> --------
> if (!artifact.isOptional() && filter.include(artifact) && (artifact.getDependencyTrail().size() == 2)) {
> ---------
> Also, the same might concern the component/su generation mojos...
> The use case and problem I ran into:
> I'm supposed to package an SA to an rpm from a different maven project(via the basic maven way: a dependency). It's really not necessary for those SA dependencies to be propagated transitively to the rpm project. Of course I tried the basic maven way and added the optional flag to the dependencies in the SA project. To my surprise,  the SA was empty when I built it. Yes, there are workarounds, but still this a bug in jbi-maven-plugin.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira