[MNG-6855] Remove redundant code

Closes #280
This commit is contained in:
thelproad 2019-08-17 17:04:15 +08:00 committed by Sylwester Lachiewicz
parent e6c897efb6
commit 96e11e1c84
4 changed files with 6 additions and 8 deletions

View File

@ -123,8 +123,7 @@ public abstract class AbstractRepositoryMetadata
// beware meta-versions!
String version = metadata.getVersion();
if ( version != null && ( Artifact.LATEST_VERSION.equals( version ) || Artifact.RELEASE_VERSION.equals(
version ) ) )
if ( Artifact.LATEST_VERSION.equals( version ) || Artifact.RELEASE_VERSION.equals( version ) )
{
// meta-versions are not valid <version/> values...don't write them.
metadata.setVersion( null );

View File

@ -243,12 +243,11 @@ public class DefaultClassRealmManager
{
Objects.requireNonNull( plugin, "plugin cannot be null" );
ClassLoader parent = PARENT_CLASSLOADER;
Map<String, ClassLoader> foreignImports =
Collections.<String, ClassLoader>singletonMap( "", getMavenApiRealm() );
return createRealm( getKey( plugin, true ), RealmType.Extension, parent, null, foreignImports, artifacts );
return createRealm( getKey( plugin, true ), RealmType.Extension, PARENT_CLASSLOADER, null,
foreignImports, artifacts );
}
private boolean isProvidedArtifact( Artifact artifact )

View File

@ -190,7 +190,7 @@ public class MojoDescriptorCreator
plugin.setArtifactId( tok.nextToken() );
goal = tok.nextToken();
}
else if ( numTokens <= 2 )
else
{
// We have a prefix and goal
//

View File

@ -337,7 +337,7 @@ public class MavenCli
"-D%s system property is not set.", MULTIMODULE_PROJECT_DIRECTORY );
throw new ExitException( 1 );
}
File basedir = basedirProperty != null ? new File( basedirProperty ) : new File( "" );
File basedir = new File( basedirProperty );
try
{
cliRequest.multiModuleProjectDirectory = basedir.getCanonicalFile();
@ -764,7 +764,7 @@ public class MavenCli
MavenExecutionRequest request = DefaultMavenExecutionRequest.copy( cliRequest.request );
request = populateRequest( cliRequest, request );
populateRequest( cliRequest, request );
request = executionRequestPopulator.populateDefaults( request );