Skip to content

Commit

Permalink
[MNG-6855] Remove redundant code
Browse files Browse the repository at this point in the history
Closes #280
  • Loading branch information
thelproad authored and slachiewicz committed Jan 26, 2020
1 parent e6c897e commit 96e11e1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ else if ( metadataFile.exists() )

// 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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,11 @@ public ClassRealm createExtensionRealm( Plugin plugin, List<Artifact> artifacts
{
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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ else if ( numTokens == 3 )
plugin.setArtifactId( tok.nextToken() );
goal = tok.nextToken();
}
else if ( numTokens <= 2 )
else
{
// We have a prefix and goal
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void initialize( CliRequest cliRequest )
"-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();
Expand Down Expand Up @@ -764,7 +764,7 @@ protected void configure()

MavenExecutionRequest request = DefaultMavenExecutionRequest.copy( cliRequest.request );

request = populateRequest( cliRequest, request );
populateRequest( cliRequest, request );

request = executionRequestPopulator.populateDefaults( request );

Expand Down

0 comments on commit 96e11e1

Please sign in to comment.