Open glassfishrobot opened 10 years ago
Reported by t_heit
ahammar said: Dupe of #114
fschlier said: I created a patch with the migration to Eclipse Aether which resolves the issue. I used the most recent Aether version, but just version 3.1.1 of the Maven API's (3.2.2 is already available) to keep impact as small as possible.
Please review and push upstream if it's ok for you. Would be nice to see a promoted build in the repository soon.
**Aether migration patch**Index: pom.xml
===================================================================
--- pom.xml (revision 1185)
+++ pom.xml (working copy)
@@ -132,17 +132,17 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
-<version>3.0.5</version>
+<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
-<version>3.0.5</version>
+<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
-<version>3.0.10</version>
+<version>3.0.17</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
@@ -159,17 +159,17 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
-<version>3.0.5</version>
+<version>3.1.1</version>
</dependency>
<dependency>
-<groupId>org.sonatype.aether</groupId>
+<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
-<version>1.13.1</version>
+<version>1.0.0.v20140518</version>
</dependency>
<dependency>
-<groupId>org.sonatype.aether</groupId>
+<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
-<version>1.13.1</version>
+<version>1.0.0.v20140518</version>
</dependency>
</dependencies>
</dependencyManagement>
@@ -213,11 +213,11 @@
<artifactId>maven-settings</artifactId>
</dependency>
<dependency>
- <groupId>org.sonatype.aether</groupId>
+ <groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
</dependency>
<dependency>
- <groupId>org.sonatype.aether</groupId>
+ <groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
</dependency>
</dependencies>
Index: src/main/java/org/jvnet/jax_ws_commons/jaxws/AbstractJaxwsMojo.java
===================================================================
--- src/main/java/org/jvnet/jax_ws_commons/jaxws/AbstractJaxwsMojo.java (revision 1185)
+++ src/main/java/org/jvnet/jax_ws_commons/jaxws/AbstractJaxwsMojo.java (working copy)
@@ -50,6 +50,7 @@
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
@@ -67,16 +68,16 @@
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.DefaultConsumer;
import org.codehaus.plexus.util.cli.StreamConsumer;
-import org.sonatype.aether.RepositorySystem;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.graph.DependencyFilter;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.repository.RemoteRepository;
-import org.sonatype.aether.resolution.DependencyResolutionException;
-import org.sonatype.aether.resolution.DependencyResult;
-import org.sonatype.aether.util.filter.NotDependencyFilter;
-import org.sonatype.aether.util.graph.FilteringDependencyVisitor;
-import org.sonatype.aether.util.graph.PreorderNodeListGenerator;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.resolution.DependencyResult;
+import org.eclipse.aether.util.filter.NotDependencyFilter;
+import org.eclipse.aether.util.graph.visitor.FilteringDependencyVisitor;
+import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator;
/**
*
@@ -409,8 +410,8 @@
}
private String[] getCP() throws DependencyResolutionException {
- Set<org.sonatype.aether.artifact.Artifact> endorsedCp = new HashSet<org.sonatype.aether.artifact.Artifact>();
- Map<String, org.sonatype.aether.artifact.Artifact> cp = new HashMap<String, org.sonatype.aether.artifact.Artifact>();
+ Set<org.eclipse.aether.artifact.Artifact> endorsedCp = new HashSet<org.eclipse.aether.artifact.Artifact>();
+ Map<String, org.eclipse.aether.artifact.Artifact> cp = new HashMap<String, org.eclipse.aether.artifact.Artifact>();
Plugin p = pluginDescriptor.getPlugin();
boolean toolsFound = false;
for (Dependency d : p.getDependencies()) {
@@ -493,21 +494,21 @@
return Os.isFamily(Os.FAMILY_WINDOWS);
}
- private StringBuilder getCPasString(Collection<org.sonatype.aether.artifact.Artifact> artifacts) {
+ private StringBuilder getCPasString(Collection<org.eclipse.aether.artifact.Artifact> artifacts) {
StringBuilder sb = new StringBuilder();
- for (org.sonatype.aether.artifact.Artifact a : artifacts) {
+ for (org.eclipse.aether.artifact.Artifact a : artifacts) {
sb.append(a.getFile().getAbsolutePath());
sb.append(File.pathSeparator);
}
return sb;
}
- private void sortArtifacts(DependencyResult result, Map<String, org.sonatype.aether.artifact.Artifact> cp, Set<org.sonatype.aether.artifact.Artifact> endorsedCp) {
+ private void sortArtifacts(DependencyResult result, Map<String, org.eclipse.aether.artifact.Artifact> cp, Set<org.eclipse.aether.artifact.Artifact> endorsedCp) {
PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
FilteringDependencyVisitor visitor = new FilteringDependencyVisitor(
nlg, new NotDependencyFilter(new EndorsedFilter()));
result.getRoot().accept(visitor);
- for (org.sonatype.aether.artifact.Artifact a : nlg.getArtifacts(false)) {
+ for (org.eclipse.aether.artifact.Artifact a : nlg.getArtifacts(false)) {
cp.put(a.getGroupId() + ":" + a.getArtifactId(), a);
}
@@ -539,7 +540,7 @@
@Override
public boolean accept(DependencyNode node, List<DependencyNode> parents) {
- org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = node.getDependency().getArtifact();
return !toExclude.contains(new Dep(a.getGroupId(), a.getArtifactId()));
}
Index: src/main/java/org/jvnet/jax_ws_commons/jaxws/DependencyResolver.java
===================================================================
--- src/main/java/org/jvnet/jax_ws_commons/jaxws/DependencyResolver.java (revision 1185)
+++ src/main/java/org/jvnet/jax_ws_commons/jaxws/DependencyResolver.java (working copy)
@@ -20,18 +20,18 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.sonatype.aether.RepositorySystem;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.collection.CollectRequest;
-import org.sonatype.aether.graph.Dependency;
-import org.sonatype.aether.graph.DependencyFilter;
-import org.sonatype.aether.graph.Exclusion;
-import org.sonatype.aether.repository.RemoteRepository;
-import org.sonatype.aether.resolution.DependencyRequest;
-import org.sonatype.aether.resolution.DependencyResolutionException;
-import org.sonatype.aether.resolution.DependencyResult;
-import org.sonatype.aether.util.artifact.DefaultArtifact;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.graph.Exclusion;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.DependencyRequest;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.resolution.DependencyResult;
+import org.eclipse.aether.artifact.DefaultArtifact;
/**
*
Index: src/main/java/org/jvnet/jax_ws_commons/jaxws/EndorsedFilter.java
===================================================================
--- src/main/java/org/jvnet/jax_ws_commons/jaxws/EndorsedFilter.java (revision 1185)
+++ src/main/java/org/jvnet/jax_ws_commons/jaxws/EndorsedFilter.java (working copy)
@@ -18,9 +18,9 @@
package org.jvnet.jax_ws_commons.jaxws;
import java.util.List;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.graph.DependencyFilter;
-import org.sonatype.aether.graph.DependencyNode;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.graph.DependencyNode;
/**
*
Index: src/main/java/org/jvnet/jax_ws_commons/jaxws/ExclusionFilter.java
===================================================================
--- src/main/java/org/jvnet/jax_ws_commons/jaxws/ExclusionFilter.java (revision 1185)
+++ src/main/java/org/jvnet/jax_ws_commons/jaxws/ExclusionFilter.java (working copy)
@@ -19,9 +19,9 @@
import java.util.List;
import org.apache.maven.model.Exclusion;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.graph.DependencyFilter;
-import org.sonatype.aether.graph.DependencyNode;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.graph.DependencyNode;
/**
*
pic said: Hi, I got the problem during Eclipse Luna evaluation.
We are using Maven 3.0.5. Eclipse Luna use embedded Maven version for dependency resolution. (Maven 3.2.1)
During project import, the following error message appears in Eclipse :
Execution wsimport of goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3.1-b03:wsimport failed:
A required class was missing while executing org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3.1-b03:wsimport:
org/sonatype/aether/resolution/DependencyResolutionException
A promoted build in Maven repository would be very nice.
Thx and regards
lulseged said: Hi
When can a solution be available at least as a snapshot?
The latest in the snapshot under link below does not fix it.
BR Lulseged
hboutemy said: patch applied in revision 1186 you can build the plugin for yourself to test
the problem is that the plugin works now with Maven 3.1+ but not Maven 3.0.x
hboutemy said: IMHO, #108 should simply be reverted: using Aether just gives problems, when previous Maven code was working well AFAIK, and will continue in the future
was there a known problem related to #108? Or just the impression that Aether was the way to go (which is not always the case)?
Parent-Task: JAX_WS_COMMONS-108
This issue was imported from java.net JIRA JAX_WS_COMMONS-127
The modifications in #108 don't work anymore with Maven >= 3.1.x because Sonatype Aether was replaced with Eclipse aether. See also
The actual result is a NoClassDefFoundError when I use org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3.1-b03 (available at Maven Central repository) in combination with the recently released Maven 3.2.1:
However, plugin versions 2.3 or older work.
Environment
Maven 3.2.1 Java 7u51, Java 8 b132 Solaris 11.1 x86_64
Affected Versions
[2.3.1]