mirror of https://github.com/apache/maven.git
PR: MNG-829
Submitted by: Johnny R. Ruiz III Reviewed by: Brett Porter use File for basedir aligned parameters in various plugins git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@312877 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
55bbfd0fd6
commit
9ad08679f8
|
@ -93,10 +93,6 @@ public class DefaultRepositoryMetadataManager
|
|||
{
|
||||
file.setLastModified( System.currentTimeMillis() );
|
||||
}
|
||||
else
|
||||
{
|
||||
metadata.storeInLocalRepository( localRepository, repository );
|
||||
}
|
||||
}
|
||||
}
|
||||
cachedMetadata.add( metadata.getKey() );
|
||||
|
|
|
@ -30,7 +30,7 @@ public class AntlrPlugin
|
|||
* @parameter expression="${basedir}/src/main/antlr"
|
||||
* @required
|
||||
*/
|
||||
private String sourceDirectory;
|
||||
private File sourceDirectory;
|
||||
|
||||
/**
|
||||
* @parameter expression="${project.build.directory}/generated-sources/antlr"
|
||||
|
|
|
@ -45,21 +45,21 @@ public class EarMojo
|
|||
* @parameter expression="${basedir}/src/main/application"
|
||||
* @required
|
||||
*/
|
||||
private String earSourceDirectory;
|
||||
private File earSourceDirectory;
|
||||
|
||||
/**
|
||||
* The location of the manifest file to be used within the ear file.
|
||||
*
|
||||
* @parameter expression="${basedir}/src/main/application/META-INF/MANIFEST.MF"
|
||||
*/
|
||||
private String manifestFile;
|
||||
private File manifestFile;
|
||||
|
||||
/**
|
||||
* The location of the application.xml file to be used within the ear file.
|
||||
*
|
||||
* @parameter expression="${basedir}/src/main/application/META-INF/application.xml"
|
||||
*/
|
||||
private String applicationXmlFile;
|
||||
private File applicationXmlFile;
|
||||
|
||||
/**
|
||||
* The directory for the generated EAR.
|
||||
|
@ -144,7 +144,7 @@ public class EarMojo
|
|||
// Copy source files
|
||||
try
|
||||
{
|
||||
File earSourceDir = new File( earSourceDirectory );
|
||||
File earSourceDir = earSourceDirectory;
|
||||
if ( earSourceDir.exists() )
|
||||
{
|
||||
getLog().info( "Copy ear sources to " + getWorkDirectory().getAbsolutePath() );
|
||||
|
@ -206,7 +206,8 @@ public class EarMojo
|
|||
|
||||
private void includeCustomManifestFile()
|
||||
{
|
||||
File customManifestFile = new File( manifestFile );
|
||||
File customManifestFile = manifestFile;
|
||||
|
||||
if ( !customManifestFile.exists() )
|
||||
{
|
||||
getLog().info( "Could not find manifest file: " + manifestFile + " - Generating one" );
|
||||
|
|
|
@ -52,14 +52,14 @@ public class RarMojo
|
|||
* @parameter expression="${basedir}/src/main/rar"
|
||||
* @required
|
||||
*/
|
||||
private String rarSourceDirectory;
|
||||
private File rarSourceDirectory;
|
||||
|
||||
/**
|
||||
* The location of the ra.xml file to be used within the rar file.
|
||||
*
|
||||
* @parameter expression="${basedir}/src/main/rar/META-INF/ra.xml"
|
||||
*/
|
||||
private String raXmlFile;
|
||||
private File raXmlFile;
|
||||
|
||||
/**
|
||||
* Specify if the generated jar file of this project should be
|
||||
|
@ -74,7 +74,7 @@ public class RarMojo
|
|||
*
|
||||
* @parameter expression="${basedir}/src/main/rar/META-INF/MANIFEST.MF"
|
||||
*/
|
||||
private String manifestFile;
|
||||
private File manifestFile;
|
||||
|
||||
/**
|
||||
* Directory that resources are copied to during the build.
|
||||
|
@ -181,7 +181,7 @@ public class RarMojo
|
|||
// Copy source files
|
||||
try
|
||||
{
|
||||
File rarSourceDir = new File( rarSourceDirectory );
|
||||
File rarSourceDir = rarSourceDirectory;
|
||||
if ( rarSourceDir.exists() )
|
||||
{
|
||||
getLog().info( "Copy rar resources to " + getBuildDir().getAbsolutePath() );
|
||||
|
@ -241,7 +241,7 @@ public class RarMojo
|
|||
|
||||
private void includeCustomManifestFile()
|
||||
{
|
||||
File customManifestFile = new File( manifestFile );
|
||||
File customManifestFile = manifestFile;
|
||||
if ( !customManifestFile.exists() )
|
||||
{
|
||||
getLog().info( "Could not find manifest file: " + manifestFile +" - Generating one");
|
||||
|
@ -256,10 +256,10 @@ public class RarMojo
|
|||
private void includeCustomRaXmlFile()
|
||||
throws IOException
|
||||
{
|
||||
if (raXmlFile == null || raXmlFile.trim().length() == 0) {
|
||||
if (raXmlFile == null) {
|
||||
|
||||
}
|
||||
File raXml = new File(raXmlFile );
|
||||
File raXml = raXmlFile;
|
||||
if (raXml.exists()) {
|
||||
getLog().info( "Using ra.xml "+ raXmlFile);
|
||||
File metaInfDir = new File(getBuildDir(), "META-INF");
|
||||
|
|
|
@ -16,6 +16,11 @@ package org.apache.maven.plugins.release;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.release.helpers.ReleaseProgressTracker;
|
||||
|
@ -27,10 +32,6 @@ import org.codehaus.plexus.util.cli.Commandline;
|
|||
import org.codehaus.plexus.util.cli.DefaultConsumer;
|
||||
import org.codehaus.plexus.util.cli.StreamConsumer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Perform a release from SCM
|
||||
*
|
||||
|
@ -47,7 +48,7 @@ public class PerformReleaseMojo
|
|||
* @required
|
||||
* @readonly
|
||||
*/
|
||||
private String basedir;
|
||||
private File basedir;
|
||||
|
||||
/**
|
||||
* @parameter expression="${goals}"
|
||||
|
@ -159,7 +160,7 @@ public class PerformReleaseMojo
|
|||
{
|
||||
try
|
||||
{
|
||||
releaseProgress = ReleaseProgressTracker.load( basedir );
|
||||
releaseProgress = ReleaseProgressTracker.load( basedir.getAbsolutePath() );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
|
|
@ -16,6 +16,19 @@ package org.apache.maven.plugins.release;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.ArtifactUtils;
|
||||
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
|
||||
|
@ -49,19 +62,6 @@ import org.codehaus.plexus.components.interactivity.InputHandler;
|
|||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Prepare for a release in SCM
|
||||
*
|
||||
|
@ -86,7 +86,7 @@ public class PrepareReleaseMojo
|
|||
* @required
|
||||
* @readonly
|
||||
*/
|
||||
private String basedir;
|
||||
private File basedir;
|
||||
|
||||
/**
|
||||
* @parameter expression="${settings.interactiveMode}"
|
||||
|
@ -183,7 +183,7 @@ public class PrepareReleaseMojo
|
|||
{
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_INITIALIZED );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_INITIALIZED );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -220,7 +220,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_POM_TRANSFORMED_FOR_RELEASE );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_POM_TRANSFORMED_FOR_RELEASE );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir,
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(),
|
||||
ReleaseProgressTracker.CP_POM_TRANSORMED_FOR_DEVELOPMENT );
|
||||
}
|
||||
catch ( IOException e )
|
||||
|
@ -268,7 +268,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_PREPARED_RELEASE );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_PREPARED_RELEASE );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -405,11 +405,11 @@ public class PrepareReleaseMojo
|
|||
{
|
||||
try
|
||||
{
|
||||
releaseProgress = ReleaseProgressTracker.loadOrCreate( basedir );
|
||||
releaseProgress = ReleaseProgressTracker.loadOrCreate( basedir.getAbsolutePath() );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
getLog().warn( "Cannot read existing release progress file from directory: " + basedir + "." );
|
||||
getLog().warn( "Cannot read existing release progress file from directory: " + basedir.getAbsolutePath() + "." );
|
||||
getLog().debug( "Cause", e );
|
||||
|
||||
releaseProgress = ReleaseProgressTracker.create();
|
||||
|
@ -490,7 +490,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
ScmHelper scm = getScm( basedir );
|
||||
ScmHelper scm = getScm( basedir.getAbsolutePath() );
|
||||
|
||||
changedFiles = scm.getStatus();
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_LOCAL_MODIFICATIONS_CHECKED );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_LOCAL_MODIFICATIONS_CHECKED );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -824,11 +824,11 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
canonicalBasedir = trimPathForScmCalculation( new File( basedir ) );
|
||||
canonicalBasedir = trimPathForScmCalculation( basedir );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new MojoExecutionException( "Cannot canonicalize basedir: " + basedir, e );
|
||||
throw new MojoExecutionException( "Cannot canonicalize basedir: " + basedir.getAbsolutePath(), e );
|
||||
}
|
||||
|
||||
for ( Iterator it = reactorProjects.iterator(); it.hasNext(); )
|
||||
|
@ -1037,7 +1037,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
releasePomPath = releasePomPath.substring( canonicalBasedir.length() + 1 );
|
||||
|
||||
ScmHelper scm = getScm( basedir );
|
||||
ScmHelper scm = getScm( basedir.getAbsolutePath() );
|
||||
|
||||
scm.add( releasePomPath );
|
||||
}
|
||||
|
@ -1052,7 +1052,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_GENERATED_RELEASE_POM );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_GENERATED_RELEASE_POM );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -1182,7 +1182,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_CHECKED_IN_RELEASE_VERSION );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_CHECKED_IN_RELEASE_VERSION );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -1202,7 +1202,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
String canonicalBasedir = trimPathForScmCalculation( new File( basedir ) );
|
||||
String canonicalBasedir = trimPathForScmCalculation( basedir );
|
||||
|
||||
for ( Iterator it = reactorProjects.iterator(); it.hasNext(); )
|
||||
{
|
||||
|
@ -1214,7 +1214,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
releasePomPath = releasePomPath.substring( canonicalBasedir.length() + 1 );
|
||||
|
||||
ScmHelper scm = getScm( basedir );
|
||||
ScmHelper scm = getScm( basedir.getAbsolutePath() );
|
||||
|
||||
scm.remove( "Removing for next development iteration.", releasePomPath );
|
||||
|
||||
|
@ -1234,7 +1234,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_REMOVED_RELEASE_POM );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_REMOVED_RELEASE_POM );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -1269,7 +1269,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_CHECKED_IN_DEVELOPMENT_VERSION );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_CHECKED_IN_DEVELOPMENT_VERSION );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
@ -1281,7 +1281,7 @@ public class PrepareReleaseMojo
|
|||
private void checkIn( String message )
|
||||
throws MojoExecutionException
|
||||
{
|
||||
ScmHelper scm = getScm( basedir );
|
||||
ScmHelper scm = getScm( basedir.getAbsolutePath() );
|
||||
|
||||
String tag = scm.getTag();
|
||||
|
||||
|
@ -1362,7 +1362,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
ScmHelper scm = getScm( basedir );
|
||||
ScmHelper scm = getScm( basedir.getAbsolutePath() );
|
||||
|
||||
scm.setTag( tag );
|
||||
|
||||
|
@ -1377,7 +1377,7 @@ public class PrepareReleaseMojo
|
|||
|
||||
try
|
||||
{
|
||||
getReleaseProgress().checkpoint( basedir, ReleaseProgressTracker.CP_TAGGED_RELEASE );
|
||||
getReleaseProgress().checkpoint( basedir.getAbsolutePath(), ReleaseProgressTracker.CP_TAGGED_RELEASE );
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ public class SurefirePlugin
|
|||
* @parameter expression="${basedir}"
|
||||
* @required
|
||||
*/
|
||||
private String basedir;
|
||||
private File basedir;
|
||||
|
||||
/**
|
||||
* The directory containing generated classes of the project being tested.
|
||||
|
@ -230,7 +230,7 @@ public class SurefirePlugin
|
|||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
System.setProperty( "basedir", basedir );
|
||||
System.setProperty( "basedir", basedir.getAbsolutePath() );
|
||||
|
||||
System.setProperty( "localRepository", localRepository.getBasedir() );
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class VerifierMojo
|
|||
* @parameter expression="${basedir}"
|
||||
* @required
|
||||
*/
|
||||
private String basedir;
|
||||
private File basedir;
|
||||
|
||||
/**
|
||||
* @parameter expression="${basedir}/src/test/verifier/verifications.xml"
|
||||
|
@ -85,7 +85,7 @@ public class VerifierMojo
|
|||
File result = file;
|
||||
if ( !file.isAbsolute() )
|
||||
{
|
||||
result = new File( new File( this.basedir ), file.getPath() );
|
||||
result = new File( basedir , file.getPath() );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ public class VerifierMojo
|
|||
return result;
|
||||
}
|
||||
|
||||
public void setBaseDir( String basedir )
|
||||
public void setBaseDir( File basedir )
|
||||
{
|
||||
this.basedir = basedir;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue