File: 01-maven-compatibility.patch

package info (click to toggle)
aether-ant-tasks 1.0.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 636 kB
  • sloc: java: 5,113; xml: 1,133; makefile: 2
file content (61 lines) | stat: -rw-r--r-- 2,110 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Description: Fixes the compatibility with the version of Maven in Debian
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/src/main/java/org/eclipse/aether/internal/ant/AntModelResolver.java
+++ b/src/main/java/org/eclipse/aether/internal/ant/AntModelResolver.java
@@ -16,6 +16,8 @@
 import java.util.List;
 import java.util.Set;
 
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Parent;
 import org.apache.maven.model.Repository;
 import org.apache.maven.model.building.FileModelSource;
 import org.apache.maven.model.building.ModelSource;
@@ -145,4 +147,24 @@
         return new FileModelSource( pomFile );
     }
 
+    @Override
+    public ModelSource resolveModel( Parent parent )
+        throws UnresolvableModelException
+    {
+        return resolveModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() );
+    }
+
+    @Override
+    public ModelSource resolveModel( Dependency dependency )
+        throws UnresolvableModelException
+    {
+        return resolveModel( dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion() );
+    }
+
+    @Override
+    public void addRepository( Repository repository, boolean replace )
+        throws InvalidRepositoryException
+    {
+        addRepository( repository );
+    }
 }
--- a/src/main/java/org/eclipse/aether/internal/ant/AntSettingsDecryptorFactory.java
+++ b/src/main/java/org/eclipse/aether/internal/ant/AntSettingsDecryptorFactory.java
@@ -23,18 +23,7 @@
     {
         AntSecDispatcher secDispatcher = new AntSecDispatcher();
 
-        DefaultSettingsDecrypter decrypter = new DefaultSettingsDecrypter();
-
-        try
-        {
-            Field field = decrypter.getClass().getDeclaredField( "securityDispatcher" );
-            field.setAccessible( true );
-            field.set( decrypter, secDispatcher );
-        }
-        catch ( Exception e )
-        {
-            throw new IllegalStateException( e );
-        }
+        DefaultSettingsDecrypter decrypter = new DefaultSettingsDecrypter(secDispatcher);
 
         return decrypter;
     }