[
https://issues.apache.org/jira/browse/IVY-1531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15729301#comment-15729301
]
ASF GitHub Bot commented on IVY-1531:
-------------------------------------
GitHub user jaikiran opened a pull request:
https://github.com/apache/ant-ivy/pull/10
Fix for IVY-1531
The commit here contains a potential fix for the issue reported in
https://issues.apache.org/jira/browse/IVY-1531.
Maven pom.xml allows dependency exclusion to include groupid=* and
artifactid=* in the exclusion, which technically translates to transitive =
false in Ivy world. The commit here handles that explicitly so that it doesn't
lead to a ivy.xml (generated off pom.xml) to have something like:
<exclude org="" module="" name="" type="" ext="*" conf=""
matcher="exact"/>
which effectively excludes the dependency which has this exclusion (as
noted in that JIRA).
The change in this commit now generates the ivy.xml as follows for such
exclusions in pom.xml:
<dependency org="org.owasp.esapi" name="esapi" rev="2.1.0"
force="true" transitive="false"
conf="compile->compile(*),master(*);runtime->runtime(*)"/>
(notice the transitive=false in there)
This commit also includes a test which verifies this change.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jaikiran/ant-ivy ivy-1531
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ant-ivy/pull/10.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #10
----
commit d3b8e1906c7f33b089824a4e6f71cc98d38dc369
Author: Jaikiran Pai <[email protected]>
Date: 2016-12-07T16:43:38Z
IVY-1531 Fix translation of * for groupid and artifactid, in pom.xml
exclusion, for implying transitive=false in ivy
modified:
src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
new file: test/java/org/apache/ivy/core/makepom/MakePomTest.java
modified:
test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
modified:
test/java/org/apache/ivy/plugins/parser/m2/test-exclusion.pom
----
> Translation of POM to Ivy XML with * exclusion is removing main artifact
> ------------------------------------------------------------------------
>
> Key: IVY-1531
> URL: https://issues.apache.org/jira/browse/IVY-1531
> Project: Ivy
> Issue Type: Bug
> Components: Maven Compatibility
> Affects Versions: 2.4.0
> Reporter: Eric Milles
> Labels: maven
>
> Using the change from issue 1470 (makepom with transitive=false dependency)
> we get a POM file with * for group and artifact exclusion. This may also
> occur naturally in POMs, but the main case for us is a library with
> transitive=false on a dependency.
> Ex:
> <dependency>
> <groupId>org.owasp.esapi</groupId>
> <artifactId>esapi</artifactId>
> <version>2.1.0</version>
> <exclusions>
> <exclusion>
> <groupId>*</groupId>
> <artifactId>*</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> When we are consuming this library as a dependency out of Nexus, Ivy
> translates the above into:
> <dependency org="org.owasp.esapi" name="esapi" rev="2.1.0" force="true"
> conf="compile->compile(*),master(*);runtime->runtime(*)">
> <exclude org="*" module="*" name="*" type="*" ext="*" conf=""
> matcher="exact"/>
> </dependency>
> This is having the effect of excluding all artifacts, including the master
> jar. We are expecting to get the master jar, its sources and javadocs if
> they exist but no transitive dependencies.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)