You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2007/09/03 02:54:20 UTC
svn commit: r572207 -
/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Author: jvanzyl
Date: Sun Sep 2 17:54:19 2007
New Revision: 572207
URL: http://svn.apache.org/viewvc?rev=572207&view=rev
Log:
MNG-2871: improve handling for EJB artifacts so that the build will work correctly without having to install the attached client JAR. This should be handled generally but we have no way of know what plugins product attached artifacts that should be handled this way.
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=572207&r1=572206&r2=572207&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenProject.java Sun Sep 2 17:54:19 2007
@@ -1668,6 +1668,30 @@
return resultArtifact;
}
}
+
+ /**
+ * Patch/workaround for: MNG-2871
+ *
+ * We want to use orginal artifact (packaging:ejb) when we are
+ * resolving ejb-client package and we didn't manage to find
+ * attached to project one.
+ *
+ * The scenario is such that somebody run "mvn test" in composity project,
+ * and ejb-client.jar will not be attached to ejb.jar (because it is done in package phase)
+ *
+ * We prefer in such a case use orginal sources (of ejb.jar) instead of failure
+ */
+ if ( ( ref.getArtifactId().equals( pluginArtifact.getArtifactId() ) ) &&
+ ( ref.getGroupId().equals( pluginArtifact.getGroupId() ) ) &&
+ ( ref.getArtifact().getType().equals( "ejb" ) ) &&
+ ( pluginArtifact.getType().equals( "ejb-client" ) ) &&
+ ( ref.getArtifact().getFile() != null && ref.getArtifact().getFile().exists() ) )
+ {
+ pluginArtifact = new ActiveProjectArtifact(
+ ref,
+ pluginArtifact );
+ return pluginArtifact;
+ }
}
}
return pluginArtifact;