You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2018/04/10 12:38:31 UTC

[cxf] branch 3.1.x-fixes updated (b81f9c0 -> a07b573)

This is an automated email from the ASF dual-hosted git repository.

ffang pushed a change to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from b81f9c0  Recording .gitmergeinfo Changes
     new 0ff4063  Handle multiple classifiers for wsdlArtifact. (cherry picked from commit e2ca038b51f2d9b2bccbc69644e165f22c9cf859)
     new 2061c48  [CXF-6324]cxf-java2ws-plugin:ensure can attach multiple wsdl with different classifier
     new a07b573  make checkstyle happy

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cxf/maven_plugin/AbstractCodegenMoho.java      | 30 +++++++++++++++-------
 .../org/apache/cxf/maven_plugin/Java2WSMojo.java   |  8 ++----
 2 files changed, 23 insertions(+), 15 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
ffang@apache.org.

[cxf] 03/03: make checkstyle happy

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit a07b57324a504d496d650ef35b25fbe490e0e763
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Tue Apr 10 16:32:40 2018 +0800

    make checkstyle happy
    
    (cherry picked from commit 14d1f10a2e694ee9862053f4fa791f095767d8be)
---
 .../src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 4597f7e..9468310 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
@@ -884,7 +884,7 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
                 if (targetArtifact.getClassifier() != null && pArtifact.getClassifier() != null 
                         && targetArtifact.getClassifier().equals(pArtifact.getClassifier()) 
                         && artifactMatched) {
-                	//handle multile classifiers
+                    //handle multile classifiers
                     return pArtifact;
                 } else if (artifactMatched && targetArtifact.getClassifier() == null) {
                     return pArtifact;

-- 
To stop receiving notification emails like this one, please contact
ffang@apache.org.

[cxf] 01/03: Handle multiple classifiers for wsdlArtifact. (cherry picked from commit e2ca038b51f2d9b2bccbc69644e165f22c9cf859)

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 0ff40637dd61d08957ab874132cc10f65ae78e1d
Author: cpandey <ch...@hotmail.com>
AuthorDate: Mon Apr 9 21:21:45 2018 +0530

    Handle multiple classifiers for wsdlArtifact.
    (cherry picked from commit e2ca038b51f2d9b2bccbc69644e165f22c9cf859)
---
 .../cxf/maven_plugin/AbstractCodegenMoho.java      | 30 +++++++++++++++-------
 1 file changed, 21 insertions(+), 9 deletions(-)

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 ae27fc5..4597f7e 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
@@ -877,22 +877,34 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
     }
 
     private Artifact findWsdlArtifact(Artifact targetArtifact, Collection<Artifact> artifactSet) {
+        boolean artifactMatched = false;
         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()) 
-                        || (
-                                targetArtifact.getClassifier() != null
-                                        && pArtifact.getType() != null
-                                        && (targetArtifact.getClassifier() + ".wsdl").equals(pArtifact.getType())
-                        ))) {
+                artifactMatched = isArtifactMatched(targetArtifact, pArtifact);
+                if (targetArtifact.getClassifier() != null && pArtifact.getClassifier() != null 
+                        && targetArtifact.getClassifier().equals(pArtifact.getClassifier()) 
+                        && artifactMatched) {
+                	//handle multile classifiers
+                    return pArtifact;
+                } else if (artifactMatched && targetArtifact.getClassifier() == null) {
                     return pArtifact;
                 }
             }
         }
         return null;
     }
+    
+    private boolean isArtifactMatched(Artifact targetArtifact, Artifact pArtifact) {
+        return targetArtifact.getGroupId().equals(pArtifact.getGroupId())
+                && 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())
+                ));
+    }
 
 }
+

-- 
To stop receiving notification emails like this one, please contact
ffang@apache.org.

[cxf] 02/03: [CXF-6324]cxf-java2ws-plugin:ensure can attach multiple wsdl with different classifier

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 2061c48a3d95020c3ff08d35e7b9f2ada0720fdb
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Tue Apr 10 15:45:29 2018 +0800

    [CXF-6324]cxf-java2ws-plugin:ensure can attach multiple wsdl with different classifier
    
    (cherry picked from commit f30f3ce149fede81622fdb86fb4f5cee6a751230)
---
 .../src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java    | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java b/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
index 2df61da..c659b33 100644
--- a/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
+++ b/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
@@ -446,14 +446,10 @@ public class Java2WSMojo extends AbstractMojo {
         if (attachWsdl && outputFile != null) {
             File wsdlFile = new File(outputFile);
             if (wsdlFile.exists()) {
-                if (classifier != null) {
-                    projectHelper.attachArtifact(project, wsdlFile.getName(), classifier, wsdlFile);
-                } else {
-                    projectHelper.attachArtifact(project, wsdlFile.getName(), wsdlFile);
-                }
+                
                 boolean hasWsdlAttached = false;
                 for (Artifact a : project.getAttachedArtifacts()) {
-                    if ("wsdl".equals(a.getType())) {
+                    if ("wsdl".equals(a.getType()) && classifier.equals(a.getClassifier())) {
                         hasWsdlAttached = true;
                     }
                 }

-- 
To stop receiving notification emails like this one, please contact
ffang@apache.org.