This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new fbfb16b wsdl-validator-plugin: switch to java annotations
fbfb16b is described below
commit fbfb16b5344e415437ad73dc709c51c60755f430
Author: Alexey Markevich <[email protected]>
AuthorDate: Wed Mar 24 12:29:03 2021 +0300
wsdl-validator-plugin: switch to java annotations
---
maven-plugins/wsdl-validator-plugin/pom.xml | 9 +---
.../apache/cxf/maven_plugin/WSDLValidatorMojo.java | 62 ++++++++--------------
parent/pom.xml | 11 ----
testutils/pom.xml | 14 ++---
tools/common/pom.xml | 11 ----
5 files changed, 28 insertions(+), 79 deletions(-)
diff --git a/maven-plugins/wsdl-validator-plugin/pom.xml
b/maven-plugins/wsdl-validator-plugin/pom.xml
index 11d5271..68cc3af 100644
--- a/maven-plugins/wsdl-validator-plugin/pom.xml
+++ b/maven-plugins/wsdl-validator-plugin/pom.xml
@@ -34,18 +34,13 @@
</properties>
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
diff --git
a/maven-plugins/wsdl-validator-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDLValidatorMojo.java
b/maven-plugins/wsdl-validator-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDLValidatorMojo.java
index c66f22b..2880f55 100644
---
a/maven-plugins/wsdl-validator-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDLValidatorMojo.java
+++
b/maven-plugins/wsdl-validator-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDLValidatorMojo.java
@@ -26,68 +26,56 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.tools.common.toolspec.ToolSpec;
import org.apache.cxf.tools.validator.WSDLValidator;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
-/**
- * @goal wsdlvalidator
- * @description CXF WSDL Validation
- * @threadSafe
- */
+@Mojo(name = "wsdlvalidator", threadSafe = true)
public class WSDLValidatorMojo extends AbstractMojo {
- /**
- * @parameter
- */
+
+ @Parameter
private Boolean verbose;
- /**
- * @parameter
- */
+ @Parameter
private Boolean quiet;
-
- /**
- * @parameter expression="${cxf.wsdlRoot}"
default-value="${basedir}/src/main/resources/wsdl"
- */
+ @Parameter(property = "cxf.wsdlRoot", defaultValue =
"${basedir}/src/main/resources/wsdl")
private File wsdlRoot;
- /**
- * @parameter expression="${cxf.testWsdlRoot}"
default-value="${basedir}/src/test/resources/wsdl"
- */
+ @Parameter(property = "cxf.testWsdlRoot", defaultValue =
"${basedir}/src/test/resources/wsdl")
private File testWsdlRoot;
/**
* Directory in which the "DONE" markers are saved that
- * @parameter expression="${cxf.markerDirectory}"
- *
default-value="${project.build.directory}/cxf-wsdl-validator-markers"
*/
+ @Parameter(property = "cxf.markerDirectory", defaultValue =
"${project.build.directory}/cxf-wsdl-validator-markers")
private File markerDirectory;
+
/**
- * A list of wsdl files to include. Can contain ant-style wildcards and
double wildcards. Defaults to
- * *.wsdl
- *
- * @parameter
+ * A list of wsdl files to include. Can contain ant-style wildcards and
double wildcards. Defaults to *.wsdl
*/
- private String[] includes;
+ @Parameter
+ private String[] includes = {
+ "*.wsdl"
+ };
+
/**
* A list of wsdl files to exclude. Can contain ant-style wildcards and
double wildcards.
- *
- * @parameter
*/
+ @Parameter
private String[] excludes;
- private String getIncludeExcludeString(String[] arr) {
+ private static String getIncludeExcludeString(String[] arr) {
if (arr == null || arr.length == 0) {
return "";
}
return String.join(",", arr);
}
- private List<File> getWsdlFiles(File dir)
- throws MojoExecutionException {
+ private List<File> getWsdlFiles(File dir) throws MojoExecutionException {
List<String> exList = new ArrayList<>();
if (excludes != null) {
@@ -99,8 +87,7 @@ public class WSDLValidatorMojo extends AbstractMojo {
String ex = getIncludeExcludeString(exList.toArray(new String[0]));
try {
- List<?> newfiles =
org.codehaus.plexus.util.FileUtils.getFiles(dir, inc, ex);
- return CastUtils.cast(newfiles);
+ return org.codehaus.plexus.util.FileUtils.getFiles(dir, inc, ex);
} catch (IOException exc) {
throw new MojoExecutionException(exc.getMessage(), exc);
}
@@ -110,7 +97,7 @@ public class WSDLValidatorMojo extends AbstractMojo {
// If URL to WSDL, replace ? and & since they're invalid chars for
file names
File doneFile =
- new File(markerDirectory, "." + file.getName().replace('?',
'_').replace('&', '_') + ".DONE");
+ new File(markerDirectory, '.' + file.getName().replace('?',
'_').replace('&', '_') + ".DONE");
boolean doWork = false;
if (!doneFile.exists()) {
doWork = true;
@@ -155,11 +142,6 @@ public class WSDLValidatorMojo extends AbstractMojo {
public void execute() throws MojoExecutionException {
System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches",
"true");
- if (includes == null) {
- includes = new String[] {
- "*.wsdl"
- };
- }
markerDirectory.mkdirs();
@@ -174,7 +156,5 @@ public class WSDLValidatorMojo extends AbstractMojo {
for (File wsdl : wsdls) {
processWsdl(wsdl);
}
-
-
}
}
diff --git a/parent/pom.xml b/parent/pom.xml
index 7fd3bc2..51c70a2 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -94,7 +94,6 @@
<cxf.classgraph.version>4.8.25</cxf.classgraph.version>
<cxf.classmate.version>1.5.1</cxf.classmate.version>
<cxf.commons-codec.version>1.15</cxf.commons-codec.version>
-
<cxf.commons-collections.version>3.2.2</cxf.commons-collections.version>
<cxf.commons-io.version>2.8.0</cxf.commons-io.version>
<cxf.commons-jcs-jcache.version>2.1</cxf.commons-jcs-jcache.version>
<cxf.commons-lang3.version>3.11</cxf.commons-lang3.version>
@@ -842,10 +841,6 @@
<scope>provided</scope>
<exclusions>
<exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</exclusion>
@@ -856,12 +851,6 @@
<artifactId>maven-plugin-annotations</artifactId>
<version>3.6.0</version>
<scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
diff --git a/testutils/pom.xml b/testutils/pom.xml
index 2a88ed8..3479f46 100644
--- a/testutils/pom.xml
+++ b/testutils/pom.xml
@@ -152,23 +152,19 @@
</execution>
</executions>
</plugin>
- <plugin>
+ <!--plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-wsdl-validator-plugin</artifactId>
<version>${project.version}</version>
- <configuration>
- <wsdlRoot>${basedir}/src/main/resources/wsdl</wsdlRoot>
- </configuration>
<executions>
- <!-- execution>
- <id>validate</id>
+ <execution>
<phase>validate</phase>
<goals>
- <goal>wsdlvalidator</goal>
+ <goal>wsdlvalidator</goal>
</goals>
- </execution -->
+ </execution>
</executions>
- </plugin>
+ </plugin-->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
diff --git a/tools/common/pom.xml b/tools/common/pom.xml
index 90a9280..db5f485 100644
--- a/tools/common/pom.xml
+++ b/tools/common/pom.xml
@@ -41,17 +41,6 @@
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>${cxf.commons-collections.version}</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>