fixed errors reported by Checkstyle

This commit is contained in:
Hervé Boutemy 2012-12-02 20:22:52 +01:00
parent 71a8427df6
commit 543870467f
22 changed files with 157 additions and 118 deletions

View File

@ -21,7 +21,6 @@
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.TimeZone;
/** /**
* Describes a set of policies for a repository to use under certain conditions. * Describes a set of policies for a repository to use under certain conditions.

View File

@ -69,9 +69,9 @@ public class ComparableVersion
private interface Item private interface Item
{ {
final int INTEGER_ITEM = 0; int INTEGER_ITEM = 0;
final int STRING_ITEM = 1; int STRING_ITEM = 1;
final int LIST_ITEM = 2; int LIST_ITEM = 2;
int compareTo( Item item ); int compareTo( Item item );
@ -86,7 +86,7 @@ private interface Item
private static class IntegerItem private static class IntegerItem
implements Item implements Item
{ {
private static final BigInteger BigInteger_ZERO = new BigInteger( "0" ); private static final BigInteger BIG_INTEGER_ZERO = new BigInteger( "0" );
private final BigInteger value; private final BigInteger value;
@ -94,7 +94,7 @@ private static class IntegerItem
private IntegerItem() private IntegerItem()
{ {
this.value = BigInteger_ZERO; this.value = BIG_INTEGER_ZERO;
} }
public IntegerItem( String str ) public IntegerItem( String str )
@ -109,14 +109,14 @@ public int getType()
public boolean isNull() public boolean isNull()
{ {
return BigInteger_ZERO.equals( value ); return BIG_INTEGER_ZERO.equals( value );
} }
public int compareTo( Item item ) public int compareTo( Item item )
{ {
if ( item == null ) if ( item == null )
{ {
return BigInteger_ZERO.equals( value ) ? 0 : 1; // 1.0 == 1, 1.1 > 1 return BIG_INTEGER_ZERO.equals( value ) ? 0 : 1; // 1.0 == 1, 1.1 > 1
} }
switch ( item.getType() ) switch ( item.getType() )
@ -266,7 +266,7 @@ public boolean isNull()
void normalize() void normalize()
{ {
for( ListIterator<Item> iterator = listIterator( size() ); iterator.hasPrevious(); ) for ( ListIterator<Item> iterator = listIterator( size() ); iterator.hasPrevious(); )
{ {
Item item = iterator.previous(); Item item = iterator.previous();
if ( item.isNull() ) if ( item.isNull() )
@ -327,7 +327,7 @@ public int compareTo( Item item )
public String toString() public String toString()
{ {
StringBuilder buffer = new StringBuilder( "(" ); StringBuilder buffer = new StringBuilder( "(" );
for( Iterator<Item> iter = iterator(); iter.hasNext(); ) for ( Iterator<Item> iter = iterator(); iter.hasNext(); )
{ {
buffer.append( iter.next() ); buffer.append( iter.next() );
if ( iter.hasNext() ) if ( iter.hasNext() )

View File

@ -72,7 +72,7 @@ public int compareTo( ArtifactVersion otherVersion )
{ {
if ( otherVersion instanceof DefaultArtifactVersion ) if ( otherVersion instanceof DefaultArtifactVersion )
{ {
return this.comparable.compareTo( ( (DefaultArtifactVersion) otherVersion).comparable ); return this.comparable.compareTo( ( (DefaultArtifactVersion) otherVersion ).comparable );
} }
else else
{ {

View File

@ -108,7 +108,7 @@ public boolean encloses( ArtifactScopeEnum scope )
{ {
final ArtifactScopeEnum s = checkScope( scope ); final ArtifactScopeEnum s = checkScope( scope );
// system scope is historic only - and simple // system scope is historic only - and simple
if ( id == system.id ) if ( id == system.id )
{ {
return scope.id == system.id; return scope.id == system.id;

View File

@ -1,18 +1,22 @@
package org.apache.maven.artifact.repository.metadata; package org.apache.maven.artifact.repository.metadata;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license * Licensed to the Apache Software Foundation (ASF) under one
* agreements. See the NOTICE file distributed with this work for additional information regarding * or more contributor license agreements. See the NOTICE file
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * distributed with this work for additional information
* "License"); you may not use this file except in compliance with the License. You may obtain a * regarding copyright ownership. The ASF licenses this file
* copy of the License at * to you under the Apache License, Version 2.0 (the
* * "License"); you may not use this file except in compliance
* http://www.apache.org/licenses/LICENSE-2.0 * with the License. You may obtain a copy of the License at
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License * http://www.apache.org/licenses/LICENSE-2.0
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express *
* or implied. See the License for the specific language governing permissions and limitations under * Unless required by applicable law or agreed to in writing,
* the License. * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/ */
import java.io.File; import java.io.File;
@ -47,7 +51,7 @@
/** /**
* @author Jason van Zyl * @author Jason van Zyl
*/ */
@Component(role=RepositoryMetadataManager.class) @Component( role = RepositoryMetadataManager.class )
public class DefaultRepositoryMetadataManager public class DefaultRepositoryMetadataManager
extends AbstractLogEnabled extends AbstractLogEnabled
implements RepositoryMetadataManager implements RepositoryMetadataManager

View File

@ -24,7 +24,6 @@
import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.FileUtils;
import org.sonatype.aether.RepositoryException; import org.sonatype.aether.RepositoryException;
import org.sonatype.aether.metadata.MergeableMetadata; import org.sonatype.aether.metadata.MergeableMetadata;

View File

@ -1,18 +1,22 @@
package org.apache.maven.artifact.resolver; package org.apache.maven.artifact.resolver;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license * Licensed to the Apache Software Foundation (ASF) under one
* agreements. See the NOTICE file distributed with this work for additional information regarding * or more contributor license agreements. See the NOTICE file
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * distributed with this work for additional information
* "License"); you may not use this file except in compliance with the License. You may obtain a * regarding copyright ownership. The ASF licenses this file
* copy of the License at * to you under the Apache License, Version 2.0 (the
* * "License"); you may not use this file except in compliance
* http://www.apache.org/licenses/LICENSE-2.0 * with the License. You may obtain a copy of the License at
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License * http://www.apache.org/licenses/LICENSE-2.0
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express *
* or implied. See the License for the specific language governing permissions and limitations under * Unless required by applicable law or agreed to in writing,
* the License. * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/ */
import java.io.File; import java.io.File;
@ -65,7 +69,7 @@
/** /**
* @author Jason van Zyl * @author Jason van Zyl
*/ */
@Component(role = ArtifactResolver.class) @Component( role = ArtifactResolver.class )
public class DefaultArtifactResolver public class DefaultArtifactResolver
implements ArtifactResolver implements ArtifactResolver
{ {
@ -111,7 +115,8 @@ public void execute( Runnable command )
else else
{ {
executor = executor =
new ThreadPoolExecutor( 0, threads, 3, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new DaemonThreadCreator()); new ThreadPoolExecutor( 0, threads, 3, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
new DaemonThreadCreator() );
} }
} }
@ -151,19 +156,22 @@ private void injectSession2( ArtifactResolutionRequest request, MavenSession ses
} }
} }
public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, TransferListener resolutionListener ) public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories,
ArtifactRepository localRepository, TransferListener resolutionListener )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
resolve( artifact, remoteRepositories, getSession( localRepository ) ); resolve( artifact, remoteRepositories, getSession( localRepository ) );
} }
public void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository ) public void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories,
ArtifactRepository localRepository )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
resolve( artifact, remoteRepositories, getSession( localRepository ) ); resolve( artifact, remoteRepositories, getSession( localRepository ) );
} }
private void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, RepositorySystemSession session ) private void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories,
RepositorySystemSession session )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
if ( artifact == null ) if ( artifact == null )
@ -249,52 +257,73 @@ private void resolve( Artifact artifact, List<ArtifactRepository> remoteReposito
} }
} }
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepositories,
ArtifactMetadataSource source, ArtifactFilter filter ) ArtifactMetadataSource source, ArtifactFilter filter )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, remoteRepositories, source, filter ); return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository,
remoteRepositories, source, filter );
} }
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository, public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source ) Map managedVersions, ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepositories,
ArtifactMetadataSource source )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, remoteRepositories, source, null ); return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository,
remoteRepositories, source, null );
} }
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository, public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter ) Map managedVersions, ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepositories,
ArtifactMetadataSource source, ArtifactFilter filter )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, remoteRepositories, source, filter, null ); return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository,
remoteRepositories, source, filter, null );
} }
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
List<ArtifactRepository> remoteRepositories,
ArtifactRepository localRepository,
ArtifactMetadataSource source ) ArtifactMetadataSource source )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
return resolveTransitively( artifacts, originatingArtifact, localRepository, remoteRepositories, source, null ); return resolveTransitively( artifacts, originatingArtifact, localRepository, remoteRepositories, source, null );
} }
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
ArtifactMetadataSource source, List<ResolutionListener> listeners ) List<ArtifactRepository> remoteRepositories,
ArtifactRepository localRepository,
ArtifactMetadataSource source,
List<ResolutionListener> listeners )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository,
remoteRepositories, source, null, listeners ); remoteRepositories, source, null, listeners );
} }
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository, public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter, List<ResolutionListener> listeners ) Map managedVersions, ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepositories,
ArtifactMetadataSource source, ArtifactFilter filter,
List<ResolutionListener> listeners )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, remoteRepositories, source, filter, listeners, null ); return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository,
remoteRepositories, source, filter, listeners, null );
} }
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository, public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter, List<ResolutionListener> listeners, Map managedVersions, ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepositories,
ArtifactMetadataSource source, ArtifactFilter filter,
List<ResolutionListener> listeners,
List<ConflictResolver> conflictResolvers ) List<ConflictResolver> conflictResolvers )
throws ArtifactResolutionException, ArtifactNotFoundException throws ArtifactResolutionException, ArtifactNotFoundException
{ {
@ -336,7 +365,7 @@ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
{ {
Artifact rootArtifact = request.getArtifact(); Artifact rootArtifact = request.getArtifact();
Set<Artifact> artifacts = request.getArtifactDependencies(); Set<Artifact> artifacts = request.getArtifactDependencies();
Map managedVersions = request.getManagedVersionMap(); Map<String, Artifact> managedVersions = request.getManagedVersionMap();
List<ResolutionListener> listeners = request.getListeners(); List<ResolutionListener> listeners = request.getListeners();
ArtifactFilter collectionFilter = request.getCollectionFilter(); ArtifactFilter collectionFilter = request.getCollectionFilter();
ArtifactFilter resolutionFilter = request.getResolutionFilter(); ArtifactFilter resolutionFilter = request.getResolutionFilter();

View File

@ -283,7 +283,7 @@ protected List<InterpolationPostProcessor> createPostProcessors( final Model mod
pathTranslator ) ); pathTranslator ) );
} }
@SuppressWarnings("unchecked") @SuppressWarnings( "unchecked" )
protected String interpolateInternal( String src, List<ValueSource> valueSources, protected String interpolateInternal( String src, List<ValueSource> valueSources,
List<InterpolationPostProcessor> postProcessors, boolean debug ) List<InterpolationPostProcessor> postProcessors, boolean debug )
throws ModelInterpolationException throws ModelInterpolationException
@ -296,7 +296,7 @@ protected String interpolateInternal( String src, List<ValueSource> valueSources
Logger logger = getLogger(); Logger logger = getLogger();
String result = src; String result = src;
synchronized( this ) synchronized ( this )
{ {
for ( ValueSource vs : valueSources ) for ( ValueSource vs : valueSources )
@ -315,7 +315,7 @@ protected String interpolateInternal( String src, List<ValueSource> valueSources
{ {
result = interpolator.interpolate( result, recursionInterceptor ); result = interpolator.interpolate( result, recursionInterceptor );
} }
catch( InterpolationException e ) catch ( InterpolationException e )
{ {
throw new ModelInterpolationException( e.getMessage(), e ); throw new ModelInterpolationException( e.getMessage(), e );
} }

View File

@ -19,15 +19,11 @@
* under the License. * under the License.
*/ */
import java.util.List;
import org.apache.maven.model.InputLocation;
import org.apache.maven.model.Model; import org.apache.maven.model.Model;
import org.apache.maven.model.building.DefaultModelBuildingRequest; import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblem; import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.model.building.ModelProblemCollector; import org.apache.maven.model.building.ModelProblemCollector;
import org.apache.maven.model.building.ModelProblem.Severity;
import org.apache.maven.model.building.ModelProblem.Version;
import org.apache.maven.model.building.ModelProblemCollectorRequest; import org.apache.maven.model.building.ModelProblemCollectorRequest;
import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.component.annotations.Requirement;

View File

@ -41,8 +41,8 @@ public class MetadataGraphNode
public MetadataGraphNode() public MetadataGraphNode()
{ {
inNodes = new ArrayList<MetadataGraphNode>(4); inNodes = new ArrayList<MetadataGraphNode>( 4 );
exNodes = new ArrayList<MetadataGraphNode>(8); exNodes = new ArrayList<MetadataGraphNode>( 8 );
} }
public MetadataGraphNode( MavenArtifactMetadata metadata ) public MetadataGraphNode( MavenArtifactMetadata metadata )

View File

@ -43,7 +43,7 @@ public class DefaultArtifactRepositoryFactory
private String globalChecksumPolicy; private String globalChecksumPolicy;
@Requirement( role = ArtifactRepositoryLayout.class ) @Requirement( role = ArtifactRepositoryLayout.class )
private Map<String,ArtifactRepositoryLayout> repositoryLayouts; private Map<String, ArtifactRepositoryLayout> repositoryLayouts;
public ArtifactRepositoryLayout getLayout( String layoutId ) public ArtifactRepositoryLayout getLayout( String layoutId )
throws UnknownRepositoryLayoutException throws UnknownRepositoryLayoutException

View File

@ -63,10 +63,10 @@
public class DefaultLegacyArtifactCollector public class DefaultLegacyArtifactCollector
implements LegacyArtifactCollector implements LegacyArtifactCollector
{ {
@Requirement(hint="nearest") @Requirement( hint = "nearest" )
private ConflictResolver defaultConflictResolver; private ConflictResolver defaultConflictResolver;
@Requirement @Requirement
private Logger logger; private Logger logger;
@Requirement @Requirement

View File

@ -28,7 +28,6 @@
* Artifact Metadata that is resolved independent of Artifact itself. * Artifact Metadata that is resolved independent of Artifact itself.
* *
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a> * @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
*
*/ */
public class ArtifactMetadata public class ArtifactMetadata
{ {
@ -291,7 +290,7 @@ public boolean isArtifactExists()
return artifactExists; return artifactExists;
} }
public void setArtifactExists(boolean artifactExists) public void setArtifactExists( boolean artifactExists )
{ {
this.artifactExists = artifactExists; this.artifactExists = artifactExists;
} }
@ -302,7 +301,7 @@ public Collection<ArtifactMetadata> getDependencies()
return dependencies; return dependencies;
} }
public void setDependencies(Collection<ArtifactMetadata> dependencies) public void setDependencies( Collection<ArtifactMetadata> dependencies )
{ {
this.dependencies = dependencies; this.dependencies = dependencies;
} }
@ -312,7 +311,7 @@ public String getArtifactUri()
return artifactUri; return artifactUri;
} }
public void setArtifactUri(String artifactUri) public void setArtifactUri( String artifactUri )
{ {
this.artifactUri = artifactUri; this.artifactUri = artifactUri;
} }
@ -322,23 +321,28 @@ public String getWhy()
{ {
return why; return why;
} }
public void setWhy(String why)
public void setWhy( String why )
{ {
this.why = why; this.why = why;
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------
public String getError() public String getError()
{ {
return error; return error;
} }
public void setError(String error)
public void setError( String error )
{ {
this.error = error; this.error = error;
} }
public boolean isError() public boolean isError()
{ {
return error == null; return error == null;
} }
//------------------------------------------------------------------ //------------------------------------------------------------------
public String getDependencyConflictId() public String getDependencyConflictId()
{ {

View File

@ -294,7 +294,7 @@ private static void checkEdge( MetadataGraphEdge e )
//------------------------------------------------------------------------ //------------------------------------------------------------------------
public List<MetadataGraphEdge> getEdgesBetween( MetadataGraphVertex vFrom, MetadataGraphVertex vTo ) public List<MetadataGraphEdge> getEdgesBetween( MetadataGraphVertex vFrom, MetadataGraphVertex vTo )
{ {
List<MetadataGraphEdge> edges = getIncidentEdges(vTo); List<MetadataGraphEdge> edges = getIncidentEdges( vTo );
if ( edges == null || edges.isEmpty() ) if ( edges == null || edges.isEmpty() )
{ {
return null; return null;

View File

@ -125,10 +125,10 @@ public void setDepth( int depth )
this.depth = depth; this.depth = depth;
} }
public boolean isResolved() public boolean isResolved()
{ {
return resolved; return resolved;
} }
public void setResolved( boolean resolved ) public void setResolved( boolean resolved )
{ {
@ -175,7 +175,7 @@ public void setTarget( MetadataGraphVertex target )
this.target = target; this.target = target;
} }
@Override @Override
public String toString() public String toString()
{ {
return "[ " + "FROM:(" return "[ " + "FROM:("

View File

@ -62,7 +62,7 @@ public ArtifactMetadata getArtifactMetadata()
return artifactMetadata; return artifactMetadata;
} }
public void setArtifactMetadata(ArtifactMetadata artifactMetadata) public void setArtifactMetadata( ArtifactMetadata artifactMetadata )
{ {
this.artifactMetadata = artifactMetadata; this.artifactMetadata = artifactMetadata;
} }

View File

@ -97,9 +97,9 @@ public void buildExtensionsAssembled( ModelBuildingEvent event )
} }
catch ( Exception e ) catch ( Exception e )
{ {
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Invalid plugin repository: " + e.getMessage() ) .setMessage( "Invalid plugin repository: " + e.getMessage() )
.setException( e )); .setException( e ) );
} }
project.setPluginArtifactRepositories( pluginRepositories ); project.setPluginArtifactRepositories( pluginRepositories );
@ -115,15 +115,15 @@ public void buildExtensionsAssembled( ModelBuildingEvent event )
} }
catch ( PluginResolutionException e ) catch ( PluginResolutionException e )
{ {
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Unresolveable build extension: " + e.getMessage()) .setMessage( "Unresolveable build extension: " + e.getMessage())
.setException( e )); .setException( e ) );
} }
catch ( PluginVersionResolutionException e ) catch ( PluginVersionResolutionException e )
{ {
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Unresolveable build extension: " + e.getMessage() ) .setMessage( "Unresolveable build extension: " + e.getMessage() )
.setException( e )); .setException( e ) );
} }
projectBuildingHelper.selectProjectRealm( project ); projectBuildingHelper.selectProjectRealm( project );
@ -138,9 +138,9 @@ public void buildExtensionsAssembled( ModelBuildingEvent event )
} }
catch ( Exception e ) catch ( Exception e )
{ {
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE) event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Invalid artifact repository: " + e.getMessage() ) .setMessage( "Invalid artifact repository: " + e.getMessage() )
.setException( e )); .setException( e ) );
} }
project.setRemoteArtifactRepositories( remoteRepositories ); project.setRemoteArtifactRepositories( remoteRepositories );
} }

View File

@ -1,18 +1,22 @@
package org.apache.maven.project; package org.apache.maven.project;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license * Licensed to the Apache Software Foundation (ASF) under one
* agreements. See the NOTICE file distributed with this work for additional information regarding * or more contributor license agreements. See the NOTICE file
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the * distributed with this work for additional information
* "License"); you may not use this file except in compliance with the License. You may obtain a * regarding copyright ownership. The ASF licenses this file
* copy of the License at * to you under the Apache License, Version 2.0 (the
* * "License"); you may not use this file except in compliance
* http://www.apache.org/licenses/LICENSE-2.0 * with the License. You may obtain a copy of the License at
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License * http://www.apache.org/licenses/LICENSE-2.0
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express *
* or implied. See the License for the specific language governing permissions and limitations under * Unless required by applicable law or agreed to in writing,
* the License. * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/ */
import org.apache.maven.RepositoryUtils; import org.apache.maven.RepositoryUtils;
@ -1477,7 +1481,7 @@ public void addAttachedArtifact( Artifact artifact )
for ( int ax = 0; ax < attachedArtifacts.size(); ax++ ) for ( int ax = 0; ax < attachedArtifacts.size(); ax++ )
{ {
Artifact a = attachedArtifacts.get( ax ); Artifact a = attachedArtifacts.get( ax );
if ( a.equals( artifact )) if ( a.equals( artifact ) )
{ {
if ( logger != null ) if ( logger != null )
{ {

View File

@ -79,7 +79,7 @@ public interface ProjectBuildingRequest
*/ */
Properties getUserProperties(); Properties getUserProperties();
void setProject(MavenProject mavenProject); void setProject( MavenProject mavenProject );
MavenProject getProject(); MavenProject getProject();

View File

@ -42,17 +42,17 @@
*/ */
public interface RepositorySystem public interface RepositorySystem
{ {
final String DEFAULT_LOCAL_REPO_ID = "local"; String DEFAULT_LOCAL_REPO_ID = "local";
final String userHome = System.getProperty( "user.home" ); String userHome = System.getProperty( "user.home" );
final File userMavenConfigurationHome = new File( userHome, ".m2" ); File userMavenConfigurationHome = new File( userHome, ".m2" );
final File defaultUserLocalRepository = new File( userMavenConfigurationHome, "repository" ); File defaultUserLocalRepository = new File( userMavenConfigurationHome, "repository" );
final String DEFAULT_REMOTE_REPO_ID = "central"; String DEFAULT_REMOTE_REPO_ID = "central";
final String DEFAULT_REMOTE_REPO_URL = "http://repo.maven.apache.org/maven2"; String DEFAULT_REMOTE_REPO_URL = "http://repo.maven.apache.org/maven2";
Artifact createArtifact( String groupId, String artifactId, String version, String packaging ); Artifact createArtifact( String groupId, String artifactId, String version, String packaging );

View File

@ -53,11 +53,15 @@ public static String showVersion()
Properties properties = getBuildProperties(); Properties properties = getBuildProperties();
StringBuffer version = new StringBuffer(); StringBuffer version = new StringBuffer();
version.append( createMavenVersionString( properties ) ).append( LS ); version.append( createMavenVersionString( properties ) ).append( LS );
version.append( reduce( properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home", "<unknown maven home>" ) ) ).append( LS ); version.append( reduce( properties.getProperty( "distributionShortName" ) + " home: "
version.append( "Java version: " + System.getProperty( "java.version", "<unknown java version>" ) + ", vendor: " + System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( LS ); + System.getProperty( "maven.home", "<unknown maven home>" ) ) ).append( LS );
version.append( "Java version: " + System.getProperty( "java.version", "<unknown java version>" )
+ ", vendor: " + System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( LS );
version.append( "Java home: " + System.getProperty( "java.home", "<unknown java home>" ) ).append( LS ); version.append( "Java home: " + System.getProperty( "java.home", "<unknown java home>" ) ).append( LS );
version.append( "Default locale: " + Locale.getDefault() + ", platform encoding: " + System.getProperty( "file.encoding", "<unknown encoding>" ) ).append( LS ); version.append( "Default locale: " + Locale.getDefault() + ", platform encoding: "
version.append( "OS name: \"" + Os.OS_NAME + "\", version: \"" + Os.OS_VERSION + "\", arch: \"" + Os.OS_ARCH + "\", family: \"" + Os.OS_FAMILY + "\"" ); + System.getProperty( "file.encoding", "<unknown encoding>" ) ).append( LS );
version.append( "OS name: \"" + Os.OS_NAME + "\", version: \"" + Os.OS_VERSION + "\", arch: \"" + Os.OS_ARCH
+ "\", family: \"" + Os.OS_FAMILY + "\"" );
return version.toString(); return version.toString();
} }

View File

@ -233,7 +233,7 @@ public int doMain( CliRequest cliRequest )
} }
finally finally
{ {
if (localContainer != null) if ( localContainer != null )
{ {
localContainer.dispose(); localContainer.dispose();
} }