diff --git a/pom.xml b/pom.xml
index f236eac..713fa21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -144,20 +144,6 @@
provided
-
-
- org.apache.maven
- maven-compat
- ${maven.api.version}
- provided
-
-
- org.codehaus.plexus
- plexus-component-api
-
-
-
-
org.apache.maven
maven-repository-metadata
@@ -205,7 +191,7 @@
org.apache.maven.shared
file-management
- 3.0.0
+ 3.1.0
diff --git a/src/main/java/org/codehaus/mojo/wagon/UpdateMaven3Mojo.java b/src/main/java/org/codehaus/mojo/wagon/UpdateMaven3Mojo.java
index 5842bd1..4b0d9fc 100644
--- a/src/main/java/org/codehaus/mojo/wagon/UpdateMaven3Mojo.java
+++ b/src/main/java/org/codehaus/mojo/wagon/UpdateMaven3Mojo.java
@@ -25,13 +25,16 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.FileUtils;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.impl.ArtifactResolver;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResult;
/**
* Work around for WAGON-407 to copy commons-io, commons-lang, and jsoup to ${maven.home}/lib/ext directory.
@@ -87,9 +90,12 @@ private void updateMavenLib( Artifact artifact )
try
{
File mavenLibDir = new File( System.getProperty( "maven.home" ), "lib/ext" );
- artifactResolver.resolve( artifact, remoteRepositories, localRepository );
- this.getLog().info( "Copy " + artifact.getFile() + " to " + mavenLibDir );
- FileUtils.copyFileToDirectory( artifact.getFile(), mavenLibDir );
+ org.eclipse.aether.artifact.Artifact aetherArtifact = new DefaultArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(), artifact.getVersion(), artifact.getType());
+ ArtifactRequest request = new ArtifactRequest(aetherArtifact, null, null);
+ ArtifactResult artifactResult = artifactResolver.resolveArtifact(null, request);
+ File artifactFile = artifactResult.getArtifact().getFile();
+ this.getLog().info( "Copy " + artifactFile + " to " + mavenLibDir );
+ FileUtils.copyFileToDirectory( artifactFile, mavenLibDir );
}
catch ( Exception e )
{
diff --git a/src/main/java/org/codehaus/mojo/wagon/UploadMojo.java b/src/main/java/org/codehaus/mojo/wagon/UploadMojo.java
index c89771d..cff4fe0 100644
--- a/src/main/java/org/codehaus/mojo/wagon/UploadMojo.java
+++ b/src/main/java/org/codehaus/mojo/wagon/UploadMojo.java
@@ -109,7 +109,7 @@ protected void execute( Wagon wagon )
fileSet.setOutputDirectory( toDir );
- this.wagonUpload.upload( wagon, fileSet, optimize, this.getLog() );
+ this.wagonUpload.upload( wagon, fileSet, optimize );
}
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/codehaus/mojo/wagon/shared/DefaultMavenRepoMerger.java b/src/main/java/org/codehaus/mojo/wagon/shared/DefaultMavenRepoMerger.java
index eec2db7..b2d721a 100644
--- a/src/main/java/org/codehaus/mojo/wagon/shared/DefaultMavenRepoMerger.java
+++ b/src/main/java/org/codehaus/mojo/wagon/shared/DefaultMavenRepoMerger.java
@@ -112,7 +112,7 @@ public void merge( Wagon src, Wagon target, boolean optimize, Log logger )
FileSet tobeUploadedFileSet = new FileSet();
tobeUploadedFileSet.setDirectory( downloadSrcDir.getAbsolutePath() );
- this.uploader.upload( target, tobeUploadedFileSet, optimize, logger );
+ this.uploader.upload( target, tobeUploadedFileSet, optimize );
}
finally
diff --git a/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonCopy.java b/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonCopy.java
index e848878..5c0f2e3 100644
--- a/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonCopy.java
+++ b/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonCopy.java
@@ -70,7 +70,7 @@ public void copy( Wagon src, WagonFileSet wagonFileSet, Wagon target, boolean op
localFileSet.setDirectory( wagonFileSet.getDownloadDirectory().getAbsolutePath() );
localFileSet.setOutputDirectory( wagonFileSet.getOutputDirectory() );
- this.uploader.upload( target, localFileSet, optimize, logger );
+ this.uploader.upload( target, localFileSet, optimize );
}
finally
{
diff --git a/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonUpload.java b/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonUpload.java
index 242688f..8ff7234 100644
--- a/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonUpload.java
+++ b/src/main/java/org/codehaus/mojo/wagon/shared/DefaultWagonUpload.java
@@ -36,20 +36,24 @@
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@Component(role = WagonUpload.class, hint = "default")
public class DefaultWagonUpload
implements WagonUpload
{
+ private static final Logger LOG = LoggerFactory.getLogger(DefaultWagonUpload.class);
+
@Requirement
private ArchiverManager archiverManager;
- public void upload( Wagon wagon, FileSet fileset, Log logger )
+ public void upload( Wagon wagon, FileSet fileset )
throws WagonException
{
- FileSetManager fileSetManager = new FileSetManager( logger, logger.isDebugEnabled() );
+ FileSetManager fileSetManager = new FileSetManager( LOG, LOG.isDebugEnabled() );
String[] files = fileSetManager.getIncludedFiles( fileset );
Arrays.sort(files);
@@ -58,7 +62,7 @@ public void upload( Wagon wagon, FileSet fileset, Log logger )
if ( files.length == 0 )
{
- logger.info( "Nothing to upload." );
+ LOG.info( "Nothing to upload." );
return;
}
@@ -73,7 +77,7 @@ public void upload( Wagon wagon, FileSet fileset, Log logger )
File source = new File( fileset.getDirectory(), file );
- logger.info( "Uploading " + source + " to " + url + relativeDestPath + " ..." );
+ LOG.info( "Uploading " + source + " to " + url + relativeDestPath + " ..." );
wagon.put( source, relativeDestPath );
}
@@ -81,12 +85,12 @@ public void upload( Wagon wagon, FileSet fileset, Log logger )
}
@Override
- public void upload( Wagon wagon, FileSet fileset, boolean optimize, Log logger )
+ public void upload( Wagon wagon, FileSet fileset, boolean optimize )
throws WagonException, IOException
{
if ( !optimize )
{
- upload( wagon, fileset, logger );
+ upload( wagon, fileset );
return;
}
@@ -96,23 +100,23 @@ public void upload( Wagon wagon, FileSet fileset, boolean optimize, Log logger )
+ " does not support optimize upload" );
}
- logger.info( "Uploading " + fileset );
+ LOG.info( "Uploading " + fileset );
File zipFile;
zipFile = File.createTempFile( "wagon", ".zip" );
try
{
- FileSetManager fileSetManager = new FileSetManager( logger, logger.isDebugEnabled() );
+ FileSetManager fileSetManager = new FileSetManager( LOG, LOG.isDebugEnabled() );
String[] files = fileSetManager.getIncludedFiles( fileset );
if ( files.length == 0 )
{
- logger.info( "Nothing to upload." );
+ LOG.info( "Nothing to upload." );
return;
}
- logger.info( "Creating " + zipFile + " ..." );
+ LOG.info( "Creating " + zipFile + " ..." );
createZip( files, zipFile, fileset.getDirectory() );
String remoteFile = zipFile.getName();
@@ -122,7 +126,7 @@ public void upload( Wagon wagon, FileSet fileset, boolean optimize, Log logger )
remoteFile = remoteDir + "/" + remoteFile;
}
- logger.info( "Uploading " + zipFile + " to " + wagon.getRepository().getUrl() + "/" + remoteFile + " ..." );
+ LOG.info( "Uploading " + zipFile + " to " + wagon.getRepository().getUrl() + "/" + remoteFile + " ..." );
wagon.put( zipFile, remoteFile );
// We use the super quiet option here as all the noise seems to kill/stall the connection
@@ -134,13 +138,13 @@ public void upload( Wagon wagon, FileSet fileset, boolean optimize, Log logger )
try
{
- logger.info( "Remote: " + command );
+ LOG.info( "Remote: " + command );
( (CommandExecutor) wagon ).executeCommand( command );
}
finally
{
command = "rm -f " + remoteFile;
- logger.info( "Remote: " + command );
+ LOG.info( "Remote: " + command );
( (CommandExecutor) wagon ).executeCommand( command );
}
diff --git a/src/main/java/org/codehaus/mojo/wagon/shared/WagonUpload.java b/src/main/java/org/codehaus/mojo/wagon/shared/WagonUpload.java
index 6395706..7e2e38d 100644
--- a/src/main/java/org/codehaus/mojo/wagon/shared/WagonUpload.java
+++ b/src/main/java/org/codehaus/mojo/wagon/shared/WagonUpload.java
@@ -37,11 +37,10 @@ public interface WagonUpload
*
* @param wagon - a Wagon instance
* @param fileset file set to upload
- * @param logger logger used
* @param optimize locally compressed and uncompress at the remote site if scp is use
* @throws WagonException if nay wagon exception
* @throws IOException if any io exception
*/
- void upload( Wagon wagon, FileSet fileset, boolean optimize, Log logger )
+ void upload( Wagon wagon, FileSet fileset, boolean optimize )
throws WagonException, IOException;
}