You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2017/07/12 08:06:01 UTC

[1/2] ant-ivy git commit: FIX: Local conflict manager didn't handle deeper conflicts in transitive dependencies (IVY-1404)

Repository: ant-ivy
Updated Branches:
  refs/heads/master dcaacf4ca -> 1a36ae09d


FIX: Local conflict manager didn't handle deeper conflicts in transitive dependencies (IVY-1404)


Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/585a7021
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/585a7021
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/585a7021

Branch: refs/heads/master
Commit: 585a702138f1cc87df3b41509cc42ad34b6acd62
Parents: d0f7f36
Author: Maarten Coene <ma...@apache.org>
Authored: Wed Jul 12 10:05:15 2017 +0200
Committer: Maarten Coene <ma...@apache.org>
Committed: Wed Jul 12 10:05:15 2017 +0200

----------------------------------------------------------------------
 asciidoc/release-notes.adoc                     |  1 +
 .../apache/ivy/core/resolve/ResolveEngine.java  | 19 ++++++++++++-
 .../apache/ivy/core/resolve/ResolveTest.java    | 21 ++++++++++++++
 .../repositories/1/IVY-1404/M1/ivys/ivy-1.0.xml | 30 ++++++++++++++++++++
 .../repositories/1/IVY-1404/M2/ivys/ivy-1.0.xml | 30 ++++++++++++++++++++
 .../repositories/1/IVY-1404/M3/ivys/ivy-1.0.xml | 29 +++++++++++++++++++
 .../repositories/1/IVY-1404/M4/ivys/ivy-1.0.xml | 29 +++++++++++++++++++
 7 files changed, 158 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/585a7021/asciidoc/release-notes.adoc
----------------------------------------------------------------------
diff --git a/asciidoc/release-notes.adoc b/asciidoc/release-notes.adoc
index a3a52ab..c2b7962 100644
--- a/asciidoc/release-notes.adoc
+++ b/asciidoc/release-notes.adoc
@@ -50,6 +50,7 @@ http://issues.apache.org/jira/browse/ivy
 
 List of changes since Ivy 2.4.0:
 
+- FIX: Local conflict manager didn't handle deeper conflicts in transitive dependencies (link:https://issues.apache.org/jira/browse/IVY-1404[IVY-1404])
 - FIX: Made the maven 'test' configuration public so we can use the test-jar as dependency (link:https://issues.apache.org/jira/browse/IVY-1444[IVY-1444])
 - FIX: NullPointerException in dependencytree with no dependencies (link:https://issues.apache.org/jira/browse/IVY-1539[IVY-1539])
 - FIX: checkIfChanged is not settable attribute for checkdepsupdate ant task (link:https://issues.apache.org/jira/browse/IVY-1549[IVY-1549])

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/585a7021/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/ivy/core/resolve/ResolveEngine.java b/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
index 8356f16..4258424 100644
--- a/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
+++ b/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
@@ -923,7 +923,24 @@ public class ResolveEngine {
         Collection<IvyNode> conflicts = computeConflicts(node, ancestor, conf, toevict,
             resolvedNodes);
 
-        ConflictManager conflictManager = ancestor.getNode().getConflictManager(node.getModuleId());
+        ConflictManager conflictManager = null;
+        for (VisitNode current : ancestor.getPath()) {
+            ModuleDescriptor descriptor = current.getNode().getDescriptor();
+            if (descriptor == null) {
+                throw new IllegalStateException(
+                        "impossible to get conflict manager when data has not been loaded. IvyNode = "
+                                + current.getNode());
+            }
+
+            conflictManager = descriptor.getConflictManager(node.getModuleId());
+            if (conflictManager != null) {
+                break;
+            }
+        }
+
+        if (conflictManager == null) {
+            conflictManager = settings.getConflictManager(node.getModuleId());
+        }
 
         Collection<IvyNode> resolved = resolveConflicts(node, ancestor, conflicts, conflictManager);
 

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/585a7021/test/java/org/apache/ivy/core/resolve/ResolveTest.java
----------------------------------------------------------------------
diff --git a/test/java/org/apache/ivy/core/resolve/ResolveTest.java b/test/java/org/apache/ivy/core/resolve/ResolveTest.java
index 1bddd54..43d3cf4 100644
--- a/test/java/org/apache/ivy/core/resolve/ResolveTest.java
+++ b/test/java/org/apache/ivy/core/resolve/ResolveTest.java
@@ -410,6 +410,27 @@ public class ResolveTest {
     }
 
     @Test
+    public void testResolveWithConflictManagerDefinedAtHigherLevel() throws Exception {
+        // test case for IVY-1404
+        // #M1;1.0 -> #M2;1.0
+        // #M1;2.0 -> {#M2;1.0 #M3;1.0}
+        // #M2;1.0 -> org1#mod1.2;1.1
+        // #M3;1.0 -> org1#mod1.2;2.0
+        // #M1;1.0 has conflict manager: <conflict org="org1" module="mod1.2" rev="1.1,2.0" />
+
+        ResolveReport report = ivy.resolve(new File(
+                        "test/repositories/1/IVY-1404/M1/ivys/ivy-1.0.xml"),
+                getResolveOptions(new String[] {"*"}));
+        assertFalse(report.hasError());
+
+        ArtifactDownloadReport[] adrs = report.getConfigurationReport("default")
+                .getDownloadedArtifactsReports();
+        assertEquals(2, adrs.length);
+        assertEquals("1.1", adrs[0].getArtifact().getId().getRevision());
+        assertEquals("2.0", adrs[1].getArtifact().getId().getRevision());
+    }
+
+    @Test
     public void testResolveRequiresDescriptor() throws Exception {
         // mod1.1 depends on mod1.2, mod1.2 has no ivy file
         Ivy ivy = new Ivy();

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/585a7021/test/repositories/1/IVY-1404/M1/ivys/ivy-1.0.xml
----------------------------------------------------------------------
diff --git a/test/repositories/1/IVY-1404/M1/ivys/ivy-1.0.xml b/test/repositories/1/IVY-1404/M1/ivys/ivy-1.0.xml
new file mode 100644
index 0000000..b4202c6
--- /dev/null
+++ b/test/repositories/1/IVY-1404/M1/ivys/ivy-1.0.xml
@@ -0,0 +1,30 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="2.0"> 
+	<info organisation="IVY-1404"
+	       module="M1"
+	       revision="1.0"
+	       status="release"
+	/>
+	<publications />
+	<dependencies>
+		<dependency name="M2" rev="1.0"/>
+		<conflict org="org1" module="mod1.2" rev="1.1,2.0" />
+	</dependencies>
+</ivy-module>

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/585a7021/test/repositories/1/IVY-1404/M2/ivys/ivy-1.0.xml
----------------------------------------------------------------------
diff --git a/test/repositories/1/IVY-1404/M2/ivys/ivy-1.0.xml b/test/repositories/1/IVY-1404/M2/ivys/ivy-1.0.xml
new file mode 100644
index 0000000..eae28e6
--- /dev/null
+++ b/test/repositories/1/IVY-1404/M2/ivys/ivy-1.0.xml
@@ -0,0 +1,30 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="2.0"> 
+	<info organisation="IVY-1404"
+	       module="M2"
+	       revision="1.0"
+	       status="release"
+	/>
+	<publications />
+	<dependencies>
+		<dependency name="M3" rev="1.0"/>
+		<dependency name="M4" rev="1.0"/>
+	</dependencies>
+</ivy-module>

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/585a7021/test/repositories/1/IVY-1404/M3/ivys/ivy-1.0.xml
----------------------------------------------------------------------
diff --git a/test/repositories/1/IVY-1404/M3/ivys/ivy-1.0.xml b/test/repositories/1/IVY-1404/M3/ivys/ivy-1.0.xml
new file mode 100644
index 0000000..5c20629
--- /dev/null
+++ b/test/repositories/1/IVY-1404/M3/ivys/ivy-1.0.xml
@@ -0,0 +1,29 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="2.0"> 
+	<info organisation="IVY-1404"
+	       module="M3"
+	       revision="1.0"
+	       status="release"
+	/>
+	<publications />
+	<dependencies>
+		<dependency org="org1" name="mod1.2" rev="1.1"/>
+	</dependencies>
+</ivy-module>

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/585a7021/test/repositories/1/IVY-1404/M4/ivys/ivy-1.0.xml
----------------------------------------------------------------------
diff --git a/test/repositories/1/IVY-1404/M4/ivys/ivy-1.0.xml b/test/repositories/1/IVY-1404/M4/ivys/ivy-1.0.xml
new file mode 100644
index 0000000..aa7d7b0
--- /dev/null
+++ b/test/repositories/1/IVY-1404/M4/ivys/ivy-1.0.xml
@@ -0,0 +1,29 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="2.0"> 
+	<info organisation="IVY-1404"
+	       module="M4"
+	       revision="1.0"
+	       status="release"
+	/>
+	<publications />
+	<dependencies>
+		<dependency org="org1" name="mod1.2" rev="2.0"/>
+	</dependencies>
+</ivy-module>


Re: Fw: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'

Posted by Jaikiran Pai <ja...@gmail.com>.
It's typically recommended not to include such merge commits (since they 
usually pollute the commit history) and instead use the "git rebase" 
approach. However, no harm is done with the merge commit. It essentially 
is one additional commit with "pointers" to other commits. In this 
specific case this merge commit just points to the previous commit that 
was already in the upstream repo. We won't have to revert anything.

-Jaikiran


On 13/07/17 5:47 AM, Maarten Coene wrote:
> I remember IntelliJ was saying something about a failed commit asking me to merge to the last revision.
> I still don't understand why this results in 2 commits. (my knowledge of git is very limited as you can see)
> But I guess this is ok? Or should it be reverted somehow?
>
> Maarten
>
>        Van: Jaikiran Pai <ja...@gmail.com>
>   Aan: dev@ant.apache.org
>   Verzonden: woensdag 12 juli 17:53 2017
>   Onderwerp: Re: Fw: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'
>     
> I'm guessing that while committing the fix for IVY-1404 you probably did
> a "git merge" against latest master of upstream, which created this
> merge commit.
>
>
> -Jaikiran
>
>
> On 12/07/17 1:45 PM, Maarten Coene wrote:
>> Any idea where this commit comes from?I didn't touch any of these files as far as I know...
>> Maarten
>>
>>        
>> ----- Doorgestuurd bericht -----
>>    Van: "maartenc@apache.org" <ma...@apache.org>
>>    Aan: notifications@ant.apache.org
>>    Verzonden: woensdag 12 juli 10:06 2017
>>    Onderwerp: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'
>>      
>> Merge remote-tracking branch 'origin/master'
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/1a36ae09
>> Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/1a36ae09
>> Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/1a36ae09
>>
>> Branch: refs/heads/master
>> Commit: 1a36ae09d2848d687895532acf46531437721692
>> Parents: 585a702 dcaacf4
>> Author: Maarten Coene <ma...@apache.org>
>> Authored: Wed Jul 12 10:05:54 2017 +0200
>> Committer: Maarten Coene <ma...@apache.org>
>> Committed: Wed Jul 12 10:05:54 2017 +0200
>>
>> ----------------------------------------------------------------------
>>    .../xml/XmlModuleDescriptorParserTest.java      | 56 ++++++++++++++++++++
>>    .../hello/test-ivy-extends-absolute.xml        | 25 +++++++++
>>    .../plugins/parser/xml/foo%2Fbar/parent-ivy.xml | 27 ++++++++++
>>    3 files changed, 108 insertions(+)
>> ----------------------------------------------------------------------
>>
>>
>>
>>
>>      
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>     


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Fw: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'

Posted by Maarten Coene <ma...@yahoo.com.INVALID>.
I remember IntelliJ was saying something about a failed commit asking me to merge to the last revision.
I still don't understand why this results in 2 commits. (my knowledge of git is very limited as you can see)
But I guess this is ok? Or should it be reverted somehow?

Maarten

      Van: Jaikiran Pai <ja...@gmail.com>
 Aan: dev@ant.apache.org 
 Verzonden: woensdag 12 juli 17:53 2017
 Onderwerp: Re: Fw: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'
   
I'm guessing that while committing the fix for IVY-1404 you probably did 
a "git merge" against latest master of upstream, which created this 
merge commit.


-Jaikiran


On 12/07/17 1:45 PM, Maarten Coene wrote:
>
> Any idea where this commit comes from?I didn't touch any of these files as far as I know...
> Maarten
>
>      
> ----- Doorgestuurd bericht -----
>  Van: "maartenc@apache.org" <ma...@apache.org>
>  Aan: notifications@ant.apache.org
>  Verzonden: woensdag 12 juli 10:06 2017
>  Onderwerp: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'
>    
> Merge remote-tracking branch 'origin/master'
>
>
> Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
> Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/1a36ae09
> Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/1a36ae09
> Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/1a36ae09
>
> Branch: refs/heads/master
> Commit: 1a36ae09d2848d687895532acf46531437721692
> Parents: 585a702 dcaacf4
> Author: Maarten Coene <ma...@apache.org>
> Authored: Wed Jul 12 10:05:54 2017 +0200
> Committer: Maarten Coene <ma...@apache.org>
> Committed: Wed Jul 12 10:05:54 2017 +0200
>
> ----------------------------------------------------------------------
>  .../xml/XmlModuleDescriptorParserTest.java      | 56 ++++++++++++++++++++
>  .../hello/test-ivy-extends-absolute.xml        | 25 +++++++++
>  .../plugins/parser/xml/foo%2Fbar/parent-ivy.xml | 27 ++++++++++
>  3 files changed, 108 insertions(+)
> ----------------------------------------------------------------------
>
>
>
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org



   

Re: Fw: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'

Posted by Jaikiran Pai <ja...@gmail.com>.
I'm guessing that while committing the fix for IVY-1404 you probably did 
a "git merge" against latest master of upstream, which created this 
merge commit.


-Jaikiran


On 12/07/17 1:45 PM, Maarten Coene wrote:
>
> Any idea where this commit comes from?I didn't touch any of these files as far as I know...
> Maarten
>
>      
> ----- Doorgestuurd bericht -----
>   Van: "maartenc@apache.org" <ma...@apache.org>
>   Aan: notifications@ant.apache.org
>   Verzonden: woensdag 12 juli 10:06 2017
>   Onderwerp: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'
>     
> Merge remote-tracking branch 'origin/master'
>
>
> Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
> Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/1a36ae09
> Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/1a36ae09
> Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/1a36ae09
>
> Branch: refs/heads/master
> Commit: 1a36ae09d2848d687895532acf46531437721692
> Parents: 585a702 dcaacf4
> Author: Maarten Coene <ma...@apache.org>
> Authored: Wed Jul 12 10:05:54 2017 +0200
> Committer: Maarten Coene <ma...@apache.org>
> Committed: Wed Jul 12 10:05:54 2017 +0200
>
> ----------------------------------------------------------------------
>   .../xml/XmlModuleDescriptorParserTest.java      | 56 ++++++++++++++++++++
>   .../hello/test-ivy-extends-absolute.xml        | 25 +++++++++
>   .../plugins/parser/xml/foo%2Fbar/parent-ivy.xml | 27 ++++++++++
>   3 files changed, 108 insertions(+)
> ----------------------------------------------------------------------
>
>
>
>
>     


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Fw: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'

Posted by Maarten Coene <ma...@yahoo.com.INVALID>.

Any idea where this commit comes from?I didn't touch any of these files as far as I know...
Maarten

    
----- Doorgestuurd bericht -----
 Van: "maartenc@apache.org" <ma...@apache.org>
 Aan: notifications@ant.apache.org 
 Verzonden: woensdag 12 juli 10:06 2017
 Onderwerp: [2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'
   
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/1a36ae09
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/1a36ae09
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/1a36ae09

Branch: refs/heads/master
Commit: 1a36ae09d2848d687895532acf46531437721692
Parents: 585a702 dcaacf4
Author: Maarten Coene <ma...@apache.org>
Authored: Wed Jul 12 10:05:54 2017 +0200
Committer: Maarten Coene <ma...@apache.org>
Committed: Wed Jul 12 10:05:54 2017 +0200

----------------------------------------------------------------------
 .../xml/XmlModuleDescriptorParserTest.java      | 56 ++++++++++++++++++++
 .../hello/test-ivy-extends-absolute.xml        | 25 +++++++++
 .../plugins/parser/xml/foo%2Fbar/parent-ivy.xml | 27 ++++++++++
 3 files changed, 108 insertions(+)
----------------------------------------------------------------------




   

[2/2] ant-ivy git commit: Merge remote-tracking branch 'origin/master'

Posted by ma...@apache.org.
Merge remote-tracking branch 'origin/master'


Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/1a36ae09
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/1a36ae09
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/1a36ae09

Branch: refs/heads/master
Commit: 1a36ae09d2848d687895532acf46531437721692
Parents: 585a702 dcaacf4
Author: Maarten Coene <ma...@apache.org>
Authored: Wed Jul 12 10:05:54 2017 +0200
Committer: Maarten Coene <ma...@apache.org>
Committed: Wed Jul 12 10:05:54 2017 +0200

----------------------------------------------------------------------
 .../xml/XmlModuleDescriptorParserTest.java      | 56 ++++++++++++++++++++
 .../hello/test-ivy-extends-absolute.xml         | 25 +++++++++
 .../plugins/parser/xml/foo%2Fbar/parent-ivy.xml | 27 ++++++++++
 3 files changed, 108 insertions(+)
----------------------------------------------------------------------