CXF-6942 - Fix to resolve problem finding wsdl with classifier
When using <attachWsdl>true<attachWsdl> when generating a wsdl
an ealier fix added the classifier to the artifact. This
classifier is not used correctly by cxf-codegen-plugin when
<wsdlArtifact> is used to locate the wsdl-file. This fix adds
an extra check to see if an artifact with exists with type
containing the classifier.
This closes #144
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9556cb06
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9556cb06
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9556cb06
Branch: refs/heads/3.0.x-fixes
Commit: 9556cb0654ee01f44900326f61b4c2c03e4ddbba
Parents: 0fad5ce
Author: Eivind Bergstøl <eivind@bergstol.no>
Authored: Tue Jun 28 10:55:51 2016 +0200
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Mar 23 13:13:57 2017 -0400
----------------------------------------------------------------------
.../apache/cxf/maven_plugin/AbstractCodegenMoho.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/9556cb06/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
index 68cc9d7..70fe528 100644
--- a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
+++ b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
@@ -929,11 +929,14 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
if (artifactSet != null && !artifactSet.isEmpty()) {
for (Artifact pArtifact : artifactSet) {
if (targetArtifact.getGroupId().equals(pArtifact.getGroupId())
- && targetArtifact.getArtifactId().equals(pArtifact.getArtifactId())
- && targetArtifact.getVersion().equals(pArtifact.getVersion())
- && "wsdl".equals(pArtifact.getType())) {
- getLog().info(String.format("%s resolved to %s", pArtifact.toString(),
pArtifact
- .getFile().getAbsolutePath()));
+ && targetArtifact.getArtifactId().equals(pArtifact.getArtifactId())
+ && targetArtifact.getVersion().equals(pArtifact.getVersion())
+ && ("wsdl".equals(pArtifact.getType())
+ || (
+ targetArtifact.getClassifier() != null
+ && pArtifact.getType() != null
+ && (targetArtifact.getClassifier() + ".wsdl").equals(pArtifact.getType())
+ ))) {
return pArtifact;
}
}
|