You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/03/19 23:56:50 UTC
svn commit: r1787676 - in /axis/axis2/java/core/trunk: ./
modules/tool/axis2-aar-maven-plugin/
modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/
modules/tool/axis2-idea-plugin/ modules/tool/axis2-java2wsdl-maven-plugin/
mod...
Author: veithen
Date: Sun Mar 19 23:56:49 2017
New Revision: 1787676
URL: http://svn.apache.org/viewvc?rev=1787676&view=rev
Log:
Upgrade Maven API to 3.x.
Modified:
axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/pom.xml
axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java
axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java
axis/axis2/java/core/trunk/modules/tool/axis2-idea-plugin/pom.xml
axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/pom.xml
axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/src/main/java/org/apache/axis2/maven2/java2wsdl/Java2WSDLMojo.java
axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/pom.xml
axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java
axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/MarMojo.java
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/pom.xml
axis/axis2/java/core/trunk/modules/tool/axis2-wsdl2code-maven-plugin/pom.xml
axis/axis2/java/core/trunk/pom.xml
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/pom.xml?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/pom.xml Sun Mar 19 23:56:49 2017
@@ -40,7 +40,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
+ <artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -56,11 +56,21 @@
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<exclusions>
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AarMojo.java Sun Mar 19 23:56:49 2017
@@ -23,6 +23,7 @@ import org.apache.maven.archiver.MavenAr
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.archiver.ArchiverException;
@@ -41,6 +42,15 @@ import java.io.IOException;
*/
public class AarMojo extends AbstractAarMojo {
/**
+ * The Maven Session
+ *
+ * @required
+ * @readonly
+ * @parameter expression="${session}"
+ */
+ private MavenSession session;
+
+ /**
* The directory for the generated aar.
*
* @parameter expression="${project.build.directory}"
@@ -132,7 +142,7 @@ public class AarMojo extends AbstractAar
jarArchiver.addDirectory(aarDirectory);
// create archive
- archiver.createArchive(project, archive);
+ archiver.createArchive(session, project, archive);
if (classifier != null) {
projectHelper.attachArtifact(project, "aar", classifier, aarFile);
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-aar-maven-plugin/src/main/java/org/apache/axis2/maven2/aar/AbstractAarMojo.java Sun Mar 19 23:56:49 2017
@@ -30,7 +30,6 @@ import org.codehaus.plexus.util.FileUtil
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -157,12 +156,11 @@ public abstract class AbstractAarMojo
copyMetaInfFile(wsdlFile, wsdlFileTarget, wsdlExistsBeforeCopyingClasses, "WSDL file");
if (includeDependencies) {
- Set artifacts = project.getArtifacts();
+ Set<Artifact> artifacts = project.getArtifacts();
- List duplicates = findDuplicates(artifacts);
+ List<String> duplicates = findDuplicates(artifacts);
- for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
- Artifact artifact = (Artifact)iter.next();
+ for (Artifact artifact : artifacts) {
String targetFileName = getDefaultFinalName(artifact);
getLog().debug("Processing: " + targetFileName);
@@ -198,11 +196,10 @@ public abstract class AbstractAarMojo
* @param artifacts set of artifacts
* @return List of duplicated artifacts
*/
- private List findDuplicates(Set artifacts) {
- List duplicates = new ArrayList();
- List identifiers = new ArrayList();
- for (Iterator iter = artifacts.iterator(); iter.hasNext();) {
- Artifact artifact = (Artifact)iter.next();
+ private List<String> findDuplicates(Set<Artifact> artifacts) {
+ List<String> duplicates = new ArrayList<String>();
+ List<String> identifiers = new ArrayList<String>();
+ for (Artifact artifact : artifacts) {
String candidate = getDefaultFinalName(artifact);
if (identifiers.contains(candidate)) {
duplicates.add(candidate);
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-idea-plugin/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-idea-plugin/pom.xml?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-idea-plugin/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-idea-plugin/pom.xml Sun Mar 19 23:56:49 2017
@@ -45,7 +45,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
+ <artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/pom.xml?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/pom.xml Sun Mar 19 23:56:49 2017
@@ -111,7 +111,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
+ <artifactId>maven-core</artifactId>
</dependency>
<dependency>
<!-- Maven supports SLF4J -->
@@ -120,8 +120,14 @@
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
+ <groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
<reporting>
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/src/main/java/org/apache/axis2/maven2/java2wsdl/Java2WSDLMojo.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/src/main/java/org/apache/axis2/maven2/java2wsdl/Java2WSDLMojo.java?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/src/main/java/org/apache/axis2/maven2/java2wsdl/Java2WSDLMojo.java (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-java2wsdl-maven-plugin/src/main/java/org/apache/axis2/maven2/java2wsdl/Java2WSDLMojo.java Sun Mar 19 23:56:49 2017
@@ -229,15 +229,15 @@ public class Java2WSDLMojo extends Abstr
Java2WSDLConstants.OUTPUT_FILENAME_OPTION,
outputFile.getName() );
- Artifact artifact = project.getArtifact();
- Set artifacts = project.getArtifacts();
- String[] artifactFileNames = new String[artifacts.size() + (artifact == null ? 0 : 1)];
+ Artifact projectArtifact = project.getArtifact();
+ Set<Artifact> artifacts = project.getArtifacts();
+ String[] artifactFileNames = new String[artifacts.size() + (projectArtifact == null ? 0 : 1)];
int j = 0;
- for(Iterator i = artifacts.iterator(); i.hasNext(); j++) {
- artifactFileNames[j] = ((Artifact) i.next()).getFile().getAbsolutePath();
+ for (Artifact artifact : artifacts) {
+ artifactFileNames[j++] = artifact.getFile().getAbsolutePath();
}
- if(artifact != null) {
- File file = artifact.getFile();
+ if(projectArtifact != null) {
+ File file = projectArtifact.getFile();
if(file != null){
artifactFileNames[j] = file.getAbsolutePath();
}
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/pom.xml?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/pom.xml Sun Mar 19 23:56:49 2017
@@ -37,31 +37,26 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
- <version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>${maven.version}</version>
+ <artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>${maven.artifact.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
- <version>${maven.archiver.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>${plexus.utils.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
+ <groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<scope>test</scope>
</dependency>
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/AbstractMarMojo.java Sun Mar 19 23:56:49 2017
@@ -30,7 +30,6 @@ import org.codehaus.plexus.util.FileUtil
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -136,13 +135,12 @@ public abstract class AbstractMarMojo
copyMetaInfFile( moduleXmlFile, moduleFileTarget, existsBeforeCopyingClasses, "module.xml file" );
if(includeDependencies){
- Set artifacts = project.getArtifacts();
+ Set<Artifact> artifacts = project.getArtifacts();
- List duplicates = findDuplicates( artifacts );
+ List<String> duplicates = findDuplicates( artifacts );
- for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
+ for (Artifact artifact : artifacts)
{
- Artifact artifact = (Artifact) iter.next();
String targetFileName = getDefaultFinalName( artifact );
getLog().debug( "Processing: " + targetFileName );
@@ -179,13 +177,12 @@ public abstract class AbstractMarMojo
* @param artifacts set of artifacts
* @return List of duplicated artifacts
*/
- private List findDuplicates( Set artifacts )
+ private List<String> findDuplicates( Set<Artifact> artifacts )
{
- List duplicates = new ArrayList();
- List identifiers = new ArrayList();
- for ( Iterator iter = artifacts.iterator(); iter.hasNext(); )
+ List<String> duplicates = new ArrayList<String>();
+ List<String> identifiers = new ArrayList<String>();
+ for (Artifact artifact : artifacts)
{
- Artifact artifact = (Artifact) iter.next();
String candidate = getDefaultFinalName( artifact );
if ( identifiers.contains( candidate ) )
{
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/MarMojo.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/MarMojo.java?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/MarMojo.java (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-mar-maven-plugin/src/main/java/org/apache/axis2/maven2/mar/MarMojo.java Sun Mar 19 23:56:49 2017
@@ -23,6 +23,7 @@ import org.apache.maven.archiver.MavenAr
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.archiver.ArchiverException;
@@ -42,6 +43,15 @@ import java.io.IOException;
public class MarMojo extends AbstractMarMojo
{
/**
+ * The Maven Session
+ *
+ * @required
+ * @readonly
+ * @parameter expression="${session}"
+ */
+ private MavenSession session;
+
+ /**
* The directory for the generated mar.
*
* @parameter expression="${project.build.directory}"
@@ -138,7 +148,7 @@ public class MarMojo extends AbstractMar
jarArchiver.addDirectory( marDirectory );
// create archive
- archiver.createArchive( project, archive );
+ archiver.createArchive(session, project, archive);
if ( classifier != null )
{
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/pom.xml?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/pom.xml Sun Mar 19 23:56:49 2017
@@ -39,7 +39,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
+ <artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Modified: axis/axis2/java/core/trunk/modules/tool/axis2-wsdl2code-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-wsdl2code-maven-plugin/pom.xml?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/axis2-wsdl2code-maven-plugin/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/tool/axis2-wsdl2code-maven-plugin/pom.xml Sun Mar 19 23:56:49 2017
@@ -54,7 +54,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
+ <artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
@@ -139,8 +139,14 @@
<artifactId>jalopy</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
+ <groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Modified: axis/axis2/java/core/trunk/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/pom.xml?rev=1787676&r1=1787675&r2=1787676&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/pom.xml (original)
+++ axis/axis2/java/core/trunk/pom.xml Sun Mar 19 23:56:49 2017
@@ -528,10 +528,8 @@
<jettison.version>1.3.8</jettison.version>
<jibx.version>1.2</jibx.version>
<log4j.version>1.2.15</log4j.version>
- <maven.archiver.version>2.2</maven.archiver.version>
- <maven.artifact.version>2.0.8</maven.artifact.version>
- <maven.plugin.testing.version>1.1</maven.plugin.testing.version>
- <maven.version>2.0.7</maven.version>
+ <maven.archiver.version>3.0.2</maven.archiver.version>
+ <maven.version>3.0.5</maven.version>
<maven.plugin.descriptor.version>2.0.7</maven.plugin.descriptor.version>
<maven.archetype.plugin.version>2.2</maven.archetype.plugin.version>
<plexus.classworlds.version>2.4</plexus.classworlds.version>
@@ -897,13 +895,18 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
+ <artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>${maven.artifact.version}</version>
+ <version>${maven.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -931,10 +934,10 @@
<version>${plexus.classworlds.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
+ <groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<scope>test</scope>
- <version>${maven.plugin.testing.version}</version>
+ <version>2.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>