Trimmed trailing whitespace

This commit is contained in:
Michael Osipov 2014-11-23 13:00:59 +01:00
parent 365066f46c
commit 0343c52601
641 changed files with 1844 additions and 1846 deletions

View File

@ -22,7 +22,7 @@ under the License.
<!--
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration for a single user,
| 1. User Level. This settings.xml file provides configuration for a single user,
| and is normally provided in ${user.home}/.m2/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
@ -31,7 +31,7 @@ under the License.
|
| 2. Global Level. This settings.xml file provides configuration for all Maven
| users on a machine (assuming they're all using the same Maven
| installation). It's normally provided in
| installation). It's normally provided in
| ${maven.home}/conf/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
@ -43,8 +43,8 @@ under the License.
| values (values used when the setting is not specified) are provided.
|
|-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
@ -112,8 +112,8 @@ under the License.
<!-- server
| Specifies the authentication information to use when connecting to a particular server, identified by
| a unique name within the system (referred to by the 'id' attribute below).
|
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
|
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
| used together.
|
<server>
@ -122,7 +122,7 @@ under the License.
<password>repopwd</password>
</server>
-->
<!-- Another sample, using keys to authenticate.
<server>
<id>siteServer</id>
@ -134,13 +134,13 @@ under the License.
<!-- mirrors
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
|
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
| However, this repository may have problems with heavy traffic at times, so people have mirrored
| it to several places.
|
| That repository definition will have a unique id, so we can create a mirror reference for that
| repository, to be used as an alternate download site. The mirror site will be the preferred
| repository, to be used as an alternate download site. The mirror site will be the preferred
| server for that repository.
|-->
<mirrors>
@ -157,20 +157,20 @@ under the License.
</mirror>
-->
</mirrors>
<!-- profiles
| This is a list of profiles which can be activated in a variety of ways, and which can modify
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
| specific paths and repository locations which allow the build to work in the local environment.
|
| For example, if you have an integration testing plugin - like cactus - that needs to know where
| your Tomcat instance is installed, you can provide a variable here such that the variable is
| your Tomcat instance is installed, you can provide a variable here such that the variable is
| dereferenced during the build process to configure the cactus plugin.
|
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
| section of this document (settings.xml) - will be discussed later. Another way essentially
| relies on the detection of a system property, either matching a particular value for the property,
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
| Finally, the list of active profiles can be specified directly from the command line.
|
@ -219,7 +219,7 @@ under the License.
| <plugin>
| <groupId>org.myco.myplugins</groupId>
| <artifactId>myplugin</artifactId>
|
|
| <configuration>
| <tomcatLocation>${tomcatPath}</tomcatLocation>
| </configuration>

View File

@ -30,7 +30,7 @@
/**
* Tests that the global settings.xml shipped with the distribution is in good state.
*
*
* @author Benjamin Bentmann
*/
public class GlobalSettingsTest

View File

@ -114,7 +114,7 @@ under the License.
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
</dependency>
</dependencies>
<build>

View File

@ -28,7 +28,7 @@
/**
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
* of the public API. In particular, this class can be changed or deleted without prior notice.
*
*
* @author Benjamin Bentmann
*/
public class ArtifactDescriptorUtils

View File

@ -25,7 +25,7 @@
/**
* A model builder cache backed by the repository system cache.
*
*
* @author Benjamin Bentmann
*/
class DefaultModelCache

View File

@ -52,7 +52,7 @@
/**
* A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have
* been initially specified and repositories discovered in dependency POMs are recessively merged into the search chain.
*
*
* @author Benjamin Bentmann
* @see DefaultArtifactDescriptorReader
*/

View File

@ -52,7 +52,7 @@
* A utility class to assist in setting up a Maven-like repository system. <em>Note:</em> This component is meant to
* assist those clients that employ the repository system outside of an IoC container, Maven plugins should instead
* always use regular dependency injection to acquire the repository system.
*
*
* @author Benjamin Bentmann
*/
public final class MavenRepositorySystemUtils
@ -66,7 +66,7 @@ private MavenRepositorySystemUtils()
/**
* Creates a new service locator that already knows about all service implementations included in this library. To
* acquire a complete repository system, clients need to add some repository connectors for remote transfers.
*
*
* @return The new service locator, never {@code null}.
*/
public static DefaultServiceLocator newServiceLocator()
@ -85,7 +85,7 @@ public static DefaultServiceLocator newServiceLocator()
* Maven-based resolution. In more detail, this method configures settings relevant for the processing of dependency
* graphs, most other settings remain at their generic default value. Use the various setters to further configure
* the session with authentication, mirror, proxy and other information required for your environment.
*
*
* @return The new repository system session, never {@code null}.
*/
public static DefaultRepositorySystemSession newSession()
@ -126,7 +126,7 @@ public static DefaultRepositorySystemSession newSession()
session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) );
// MNG-5670 guard against ConcurrentModificationException
// MNG-5670 guard against ConcurrentModificationException
Properties sysProps = new Properties();
for ( String key : System.getProperties().stringPropertyNames() )
{

View File

@ -39,19 +39,19 @@ public void testMng5459()
{
// prepare
DefaultArtifactDescriptorReader reader = (DefaultArtifactDescriptorReader) lookup( ArtifactDescriptorReader.class );
RepositoryEventDispatcher eventDispatcher = mock( RepositoryEventDispatcher.class );
ArgumentCaptor<RepositoryEvent> event = ArgumentCaptor.forClass( RepositoryEvent.class );
reader.setRepositoryEventDispatcher( eventDispatcher );
ArtifactDescriptorRequest request = new ArtifactDescriptorRequest();
request.addRepository( newTestRepository() );
request.setArtifact( new DefaultArtifact( "org.apache.maven.its", "dep-mng5459", "jar", "0.4.0-SNAPSHOT" ) );
// execute
reader.readArtifactDescriptor( session, request );
@ -59,7 +59,7 @@ public void testMng5459()
verify( eventDispatcher ).dispatch( event.capture() );
boolean missingArtifactDescriptor = false;
for( RepositoryEvent evt : event.getAllValues() )
{
if ( EventType.ARTIFACT_DESCRIPTOR_MISSING.equals( evt.getType() ) )
@ -68,7 +68,7 @@ public void testMng5459()
missingArtifactDescriptor = true;
}
}
if( !missingArtifactDescriptor )
{
fail( "Expected missing artifact descriptor for org.apache.maven.its:dep-mng5459:pom:0.4.0-20130404.090532-2" );

View File

@ -59,7 +59,7 @@ public void testReadArtifactDescriptor()
ArtifactDescriptorRequest request = new ArtifactDescriptorRequest();
request.setArtifact( artifact );
request.addRepository( newTestRepository() );
ArtifactDescriptorResult result = system.readArtifactDescriptor( session, request );
List<Dependency> deps = result.getDependencies();

View File

@ -34,7 +34,7 @@
/**
* Maven Artifact interface. Notice that it mixes artifact definition concepts (groupId, artifactId, version)
* with dependency information (version range, scope).
* with dependency information (version range, scope).
*/
public interface Artifact
extends Comparable<Artifact>

View File

@ -23,5 +23,5 @@
public interface ArtifactMetadata
extends org.apache.maven.repository.legacy.metadata.ArtifactMetadata
{
void merge( ArtifactMetadata metadata );
void merge( ArtifactMetadata metadata );
}

View File

@ -44,7 +44,7 @@ public Authentication( String userName, String password )
/**
* Get the user's password which is used when connecting to the repository.
*
*
* @return password of user
*/
public String getPassword()
@ -54,7 +54,7 @@ public String getPassword()
/**
* Set the user's password which is used when connecting to the repository.
*
*
* @param password password of the user
*/
public void setPassword( String password )
@ -64,7 +64,7 @@ public void setPassword( String password )
/**
* Get the username used to access the repository.
*
*
* @return username at repository
*/
public String getUsername()
@ -74,7 +74,7 @@ public String getUsername()
/**
* Set username used to access the repository.
*
*
* @param userName the username used to access repository
*/
public void setUsername( final String userName )
@ -85,7 +85,7 @@ public void setUsername( final String userName )
/**
* Get the passphrase of the private key file. The passphrase is used only when host/protocol supports
* authentication via exchange of private/public keys and private key was used for authentication.
*
*
* @return passphrase of the private key file
*/
public String getPassphrase()
@ -95,7 +95,7 @@ public String getPassphrase()
/**
* Set the passphrase of the private key file.
*
*
* @param passphrase passphrase of the private key file
*/
public void setPassphrase( final String passphrase )
@ -105,7 +105,7 @@ public void setPassphrase( final String passphrase )
/**
* Get the absolute path to the private key file.
*
*
* @return absolute path to private key
*/
public String getPrivateKey()
@ -115,7 +115,7 @@ public String getPrivateKey()
/**
* Set the absolute path to private key file.
*
*
* @param privateKey path to private key in local file system
*/
public void setPrivateKey( final String privateKey )

View File

@ -44,7 +44,7 @@ public class AbstractArtifactResolutionException
private String classifier;
private Artifact artifact;
private Artifact artifact;
private List<ArtifactRepository> remoteRepositories;

View File

@ -31,7 +31,7 @@
/**
* Generic implementation of version comparison.
*
*
* <p>Features:
* <ul>
* <li>mixing of '<code>-</code>' (dash) and '<code>.</code>' (dot) separators,</li>

View File

@ -53,7 +53,7 @@ public void testRange()
throws InvalidVersionSpecificationException, OverConstrainedVersionException
{
Artifact artifact = null;
VersionRange range = VersionRange.createFromVersionSpec( "(,1.0]" );
List<Restriction> restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );

View File

@ -54,10 +54,10 @@ public class DefaultArtifactInstaller
@Requirement
private RepositorySystem repoSystem;
@Requirement
private LegacySupport legacySupport;
/** @deprecated we want to use the artifact method only, and ensure artifact.file is set correctly. */
@Deprecated
public void install( String basedir, String finalName, Artifact artifact, ArtifactRepository localRepository )

View File

@ -35,7 +35,7 @@
/**
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
* of the public API. In particular, this class can be changed or deleted without prior notice.
*
*
* @author Benjamin Bentmann
*/
public final class MetadataBridge

View File

@ -21,7 +21,7 @@
/**
* Assists in handling repository metadata.
*
*
* @author Benjamin Bentmann
*/
class MetadataUtils

View File

@ -74,7 +74,7 @@
public class DefaultArtifactResolver
implements ArtifactResolver, Disposable
{
@Requirement
@Requirement
private Logger logger;
@Requirement
@ -88,7 +88,7 @@ public class DefaultArtifactResolver
@Requirement
private ArtifactMetadataSource source;
@Requirement
private PlexusContainer container;
@ -169,7 +169,7 @@ private void resolve( Artifact artifact, List<ArtifactRepository> remoteReposito
{
return;
}
if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
{
File systemFile = artifact.getFile();
@ -190,7 +190,7 @@ private void resolve( Artifact artifact, List<ArtifactRepository> remoteReposito
}
artifact.setResolved( true );
return;
}
@ -322,7 +322,7 @@ public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Ar
.setArtifact( originatingArtifact )
.setResolveRoot( false )
// This is required by the surefire plugin
.setArtifactDependencies( artifacts )
.setArtifactDependencies( artifacts )
.setManagedVersionMap( managedVersions )
.setLocalRepository( localRepository )
.setRemoteRepositories( remoteRepositories )
@ -358,10 +358,10 @@ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
Set<Artifact> artifacts = request.getArtifactDependencies();
Map<String, Artifact> managedVersions = request.getManagedVersionMap();
List<ResolutionListener> listeners = request.getListeners();
ArtifactFilter collectionFilter = request.getCollectionFilter();
ArtifactFilter collectionFilter = request.getCollectionFilter();
ArtifactFilter resolutionFilter = request.getResolutionFilter();
RepositorySystemSession session = getSession( request.getLocalRepository() );
//TODO: hack because metadata isn't generated in m2e correctly and i want to run the maven i have in the workspace
if ( source == null )
{
@ -393,9 +393,9 @@ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
// This is often an artifact like a POM that is taken from disk and we already have hold of the
// file reference. But this may be a Maven Plugin that we need to resolve from a remote repository
// as well as its dependencies.
if ( request.isResolveRoot() /* && rootArtifact.getFile() == null */ )
{
{
try
{
resolve( rootArtifact, request.getRemoteRepositories(), session );
@ -470,7 +470,7 @@ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
return result;
}
}
if ( artifacts == null || artifacts.isEmpty() )
{
if ( request.isResolveRoot() )
@ -478,13 +478,13 @@ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
result.addArtifact( rootArtifact );
}
return result;
}
}
// After the collection we will have the artifact object in the result but they will not be resolved yet.
result =
artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source,
collectionFilter, listeners, null );
// We have metadata retrieval problems, or there are cycles that have been detected
// so we give this back to the calling code and let them deal with this information
// appropriately.
@ -528,14 +528,14 @@ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
// We want to send the root artifact back in the result but we need to do this after the other dependencies
// have been resolved.
if ( request.isResolveRoot() )
{
{
// Add the root artifact (as the first artifact to retain logical order of class path!)
Set<Artifact> allArtifacts = new LinkedHashSet<Artifact>();
allArtifacts.add( rootArtifact );
allArtifacts.addAll( result.getArtifacts() );
result.setArtifacts( allArtifacts );
}
}
return result;
}

View File

@ -51,14 +51,14 @@ public boolean equals( Object obj )
{
return true;
}
if ( !( obj instanceof InversionArtifactFilter ) )
{
return false;
}
InversionArtifactFilter other = (InversionArtifactFilter) obj;
return toInvert.equals( other.toInvert );
}

View File

@ -27,7 +27,7 @@
/**
* Apply multiple filters, accepting an artifact if at least one of the filters accepts it.
*
*
* @author Benjamin Bentmann
*/
public class OrArtifactFilter
@ -79,15 +79,15 @@ public boolean equals( Object obj )
{
return true;
}
if ( !( obj instanceof OrArtifactFilter ) )
{
return false;
}
OrArtifactFilter other = (OrArtifactFilter) obj;
return filters.equals( other.filters );
}
}

View File

@ -52,14 +52,14 @@ public boolean equals( Object obj )
{
return true;
}
if ( !( obj instanceof TypeArtifactFilter ) )
{
return false;
}
TypeArtifactFilter other = (TypeArtifactFilter) obj;
return type.equals( other.type );
}

View File

@ -29,7 +29,7 @@
/**
* Describes runtime information about the application.
*
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
@Deprecated

View File

@ -64,9 +64,9 @@ public static Profile convertFromProfileXmlProfile( org.apache.maven.profiles.Pr
activation.setProperty( prop );
}
ActivationOS profileOs = profileActivation.getOs();
if ( profileOs != null )
{
org.apache.maven.model.ActivationOS os = new org.apache.maven.model.ActivationOS();
@ -78,7 +78,7 @@ public static Profile convertFromProfileXmlProfile( org.apache.maven.profiles.Pr
activation.setOs( os );
}
org.apache.maven.profiles.ActivationFile profileFile = profileActivation.getFile();
if ( profileFile != null )

View File

@ -70,15 +70,15 @@ private boolean determineVersionMatch( String version )
{
String test = version;
boolean reverse = false;
if ( test.startsWith( "!" ) )
{
reverse = true;
test = test.substring( 1 );
}
boolean result = Os.isVersion( test );
if ( reverse )
{
return !result;
@ -93,15 +93,15 @@ private boolean determineArchMatch( String arch )
{
String test = arch;
boolean reverse = false;
if ( test.startsWith( "!" ) )
{
reverse = true;
test = test.substring( 1 );
}
boolean result = Os.isArch( test );
if ( reverse )
{
return !result;
@ -116,7 +116,7 @@ private boolean determineNameMatch( String name )
{
String test = name;
boolean reverse = false;
if ( test.startsWith( "!" ) )
{
reverse = true;
@ -139,15 +139,15 @@ private boolean determineFamilyMatch( String family )
{
String test = family;
boolean reverse = false;
if ( test.startsWith( "!" ) )
{
reverse = true;
test = test.substring( 1 );
}
boolean result = Os.isFamily( test );
if ( reverse )
{
return !result;

View File

@ -35,7 +35,7 @@ public class BuildTimestampValueSource
private final Date startTime;
private final String format;
private String formattedDate;
public BuildTimestampValueSource( Date startTime, String format )
@ -53,7 +53,7 @@ public Object getValue( String expression )
{
formattedDate = new SimpleDateFormat( format ).format( startTime );
}
return formattedDate;
}

View File

@ -41,7 +41,7 @@ public RegexBasedModelInterpolator()
throws IOException
{
}
public RegexBasedModelInterpolator( PathTranslator pathTranslator )
{
super( pathTranslator );

View File

@ -23,7 +23,7 @@
/**
* Checks the model for missing or invalid values.
*
*
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
*/
@Deprecated

View File

@ -26,7 +26,7 @@
/**
* Handles the selection of mirrors for repositories.
*
*
* @author Benjamin Bentmann
*/
public interface MirrorSelector
@ -34,7 +34,7 @@ public interface MirrorSelector
/**
* Determines the mirror for the specified repository.
*
*
* @param repository The repository to determine the mirror for, must not be {@code null}.
* @param mirrors The available mirrors, may be {@code null}.
* @return The mirror specification for the repository or {@code null} if no mirror matched.

View File

@ -29,18 +29,18 @@ public class UserLocalArtifactRepository
extends LocalArtifactRepository
{
private ArtifactRepository localRepository;
public UserLocalArtifactRepository( ArtifactRepository localRepository )
{
this.localRepository = localRepository;
setLayout( localRepository.getLayout() );
}
@Override
public Artifact find( Artifact artifact )
{
File artifactFile = new File( localRepository.getBasedir(), pathOf( artifact ) );
// We need to set the file here or the resolver will fail with an NPE, not fully equipped to deal
// with multiple local repository implementations yet.
artifact.setFile( artifactFile );
@ -53,13 +53,13 @@ public String getId()
{
return localRepository.getId();
}
@Override
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
{
return localRepository.pathOfLocalRepositoryMetadata( metadata, repository );
}
@Override
public String pathOf( Artifact artifact )
{

View File

@ -79,8 +79,8 @@ public class DefaultWagonManager
@Requirement
private LegacySupport legacySupport;
//
// Retriever
//
@ -235,12 +235,12 @@ public void getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metada
private void connectWagon( Wagon wagon, ArtifactRepository repository )
throws ConnectionException, AuthenticationException
{
// MNG-5509
// MNG-5509
// See org.eclipse.aether.connector.wagon.WagonRepositoryConnector.connectWagon(Wagon)
if( legacySupport.getRepositorySession() != null )
{
Properties headers = new Properties();
headers.put( "User-Agent", ConfigUtils.getString( legacySupport.getRepositorySession(), "Maven",
ConfigurationProperties.USER_AGENT ) );
try
@ -257,7 +257,7 @@ private void connectWagon( Wagon wagon, ArtifactRepository repository )
logger.debug( "Could not set user agent for wagon " + wagon.getClass().getName() + ": " + e );
}
}
if ( repository.getProxy() != null && logger.isDebugEnabled() )
{
logger.debug( "Using proxy " + repository.getProxy().getHost() + ":" + repository.getProxy().getPort()
@ -802,7 +802,7 @@ public Wagon getWagon( String protocol )
throw new UnsupportedProtocolException( "Cannot find wagon which supports the requested protocol: "
+ protocol, e );
}
return wagon;
}

View File

@ -88,8 +88,8 @@ under the License.
<![CDATA[
This is a set of Artifact instances resolved from the set of dependencies for
the current project.
NOTE: This will likely contain much more than the direct dependencies of the
NOTE: This will likely contain much more than the direct dependencies of the
current POM, since Maven uses transitive, or chained, dependency resolution.
]]></description>
</expression>
@ -120,7 +120,7 @@ under the License.
<![CDATA[
This is the list of Artifact instances for plugins used in the current build
for this project.
NOTE: This list may contain plugin Artifacts which are implied by the current POM's
packaging and the lifecycle phase being built.
]]></description>
@ -137,7 +137,7 @@ under the License.
<![CDATA[
This is a list of ArtifactRepository instances used to resolve the Artifacts associated
with the current POM.
NOTE: This list will contain entries for repositories specified by ancestor POMs, including
the default built-in super-POM, which is the parent of all POMs.
]]></description>
@ -154,7 +154,7 @@ under the License.
<![CDATA[
This is a list of ArtifactRepository instances used to resolve the Artifacts associated
with plugins used in building the current POM.
NOTE: This list will contain entries for repositories specified by ancestor POMs, including
the default built-in super-POM, which is the parent of all POMs.
]]></description>

View File

@ -27,8 +27,8 @@ under the License.
<configuration>
<![CDATA[
Inside ~/.m2/settings.xml:
<localRepository>/path/to/local/repository</localRepository>
<localRepository>/path/to/local/repository</localRepository>
]]></configuration>
<description>The ArtifactRepository instance referencing the local artifact
repository.</description>

View File

@ -85,7 +85,7 @@ protected void setUp()
throws Exception
{
super.setUp();
artifactFactory = lookup( ArtifactFactory.class);
artifactFactory = lookup( ArtifactFactory.class);
artifactRepositoryFactory = lookup( ArtifactRepositoryFactory.class );
RepositorySystemSession repoSession = initRepoSession();
@ -96,13 +96,13 @@ protected void setUp()
LegacySupport legacySupport = lookup(LegacySupport.class);
legacySupport.setSession( session );
}
@Override
protected void tearDown()
throws Exception
{
release( artifactFactory );
super.tearDown();
}
@ -110,7 +110,7 @@ protected void tearDown()
/**
* Return an existing file, not a directory - causes creation to fail.
*
*
* @throws Exception
*/
protected ArtifactRepository badLocalRepository()
@ -314,7 +314,7 @@ protected Artifact createArtifact( String groupId, String artifactId, String ver
throws Exception
{
Artifact a = artifactFactory.createBuildArtifact( groupId, artifactId, version, type );
return a;
}

View File

@ -29,7 +29,7 @@
/**
* Tests {@link ArtifactUtils}.
*
*
* @author Benjamin Bentmann
*/
public class ArtifactUtilsTest

View File

@ -26,19 +26,19 @@
public class DefaultArtifactFactoryTest
extends PlexusTestCase
{
public void testPropagationOfSystemScopeRegardlessOfInheritedScope() throws Exception
{
ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
Artifact artifact = factory.createDependencyArtifact( "test-grp", "test-artifact", VersionRange.createFromVersion("1.0"), "type", null, "system", "provided" );
Artifact artifact2 = factory.createDependencyArtifact( "test-grp", "test-artifact-2", VersionRange.createFromVersion("1.0"), "type", null, "system", "test" );
Artifact artifact3 = factory.createDependencyArtifact( "test-grp", "test-artifact-3", VersionRange.createFromVersion("1.0"), "type", null, "system", "runtime" );
Artifact artifact4 = factory.createDependencyArtifact( "test-grp", "test-artifact-4", VersionRange.createFromVersion("1.0"), "type", null, "system", "compile" );
// this one should never happen in practice...
Artifact artifact5 = factory.createDependencyArtifact( "test-grp", "test-artifact-5", VersionRange.createFromVersion("1.0"), "type", null, "system", "system" );
assertEquals( "system", artifact.getScope() );
assertEquals( "system", artifact2.getScope() );
assertEquals( "system", artifact3.getScope() );

View File

@ -37,7 +37,7 @@ public class TestMetadataSource
{
@Requirement
private ArtifactFactory factory;
public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
throws ArtifactMetadataRetrievalException
{
@ -56,7 +56,7 @@ public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepo
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
}
}
if ( "i".equals( artifact.getArtifactId() ) )
{
Artifact a = null;
@ -70,7 +70,7 @@ public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepo
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
}
}
return new ResolutionGroup( artifact, dependencies, remoteRepositories );
}

View File

@ -28,7 +28,7 @@ public class MavenArtifactRepositoryTest
private static class MavenArtifactRepositorySubclass extends MavenArtifactRepository
{
String id;
public MavenArtifactRepositorySubclass(String id)
{
this.id = id;

View File

@ -26,7 +26,7 @@
/**
* Test the artifact resolution exception message
*
*
* @author Mauro Talevi
*/
public class ArtifactResolutionExceptionTest

View File

@ -63,7 +63,7 @@ protected void setUp()
projectArtifact = createLocalArtifact( "project", "3.0" );
}
@Override
protected void tearDown()
throws Exception

View File

@ -30,7 +30,7 @@
import org.apache.maven.wagon.resource.Resource;
/**
* Wagon used for test cases that annotates some methods. Note that this is not a thread-safe implementation.
* Wagon used for test cases that annotates some methods. Note that this is not a thread-safe implementation.
*/
public class TestFileWagon
extends FileWagon
@ -38,10 +38,10 @@ public class TestFileWagon
private TestTransferListener testTransferListener;
private boolean insideGet;
protected void getTransfer( Resource resource,
File destination,
InputStream input,
boolean closeInput,
protected void getTransfer( Resource resource,
File destination,
InputStream input,
boolean closeInput,
int maxSize )
throws TransferFailedException
{
@ -50,16 +50,16 @@ protected void getTransfer( Resource resource,
}
public void get( String resourceName, File destination )
throws TransferFailedException,
ResourceDoesNotExistException,
throws TransferFailedException,
ResourceDoesNotExistException,
AuthorizationException
{
addTransfer( "get " + resourceName );
insideGet = true;
super.get( resourceName, destination );
insideGet = false;
}
@ -72,8 +72,8 @@ private void addTransfer( String resourceName )
}
public boolean getIfNewer( String resourceName, File destination, long timestamp )
throws TransferFailedException,
ResourceDoesNotExistException,
throws TransferFailedException,
ResourceDoesNotExistException,
AuthorizationException
{
if ( !insideGet )

View File

@ -27,7 +27,7 @@
/**
* Tests {@link AndArtifactFilter}.
*
*
* @author Benjamin Bentmann
*/
public class AndArtifactFilterTest

View File

@ -42,7 +42,7 @@ public void testIncludesExcludesArtifactFilter()
assertTrue( f1.equals(f2) );
assertTrue( f2.equals(f1) );
assertTrue( f1.hashCode() == f2.hashCode() );
IncludesArtifactFilter f3 = new IncludesArtifactFilter( Arrays.asList( "d", "c", "e" ) );
assertTrue( f1.equals( f3 ) );
assertTrue( f1.hashCode() == f3.hashCode() );

View File

@ -27,7 +27,7 @@
/**
* Tests {@link OrArtifactFilter}.
*
*
* @author Benjamin Bentmann
*/
public class OrArtifactFilterTest

View File

@ -26,7 +26,7 @@
/**
* Tests {@link ScopeArtifactFilter}.
*
*
* @author Benjamin Bentmann
*/
public class ScopeArtifactFilterTest

View File

@ -111,7 +111,7 @@ public void testShouldNotActivateDefaultProfile()
assertEquals( 1, active.size() );
assertEquals( "syspropActivated", ( (Profile) active.get( 0 ) ).getId() );
}
public void testShouldNotActivateReversalOfPresentSystemProperty()
throws Exception

View File

@ -6,9 +6,9 @@
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, 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
@ -55,7 +55,7 @@ protected void setUp()
throws Exception
{
super.setUp();
if ( getContainer().hasComponent( ProjectBuilder.class, "test" ) )
{
projectBuilder = lookup( ProjectBuilder.class, "test" );
@ -65,9 +65,9 @@ protected void setUp()
// default over to the main project builder...
projectBuilder = lookup( ProjectBuilder.class );
}
repositorySystem = lookup( RepositorySystem.class );
}
repositorySystem = lookup( RepositorySystem.class );
}
@Override
protected void tearDown()

View File

@ -35,7 +35,7 @@
/**
* A stub implementation that assumes an empty lifecycle to bypass interaction with the plugin manager and to avoid
* plugin artifact resolution from repositories.
*
*
* @author Benjamin Bentmann
*/
public class EmptyLifecycleExecutor

View File

@ -45,9 +45,9 @@ public void setUp()
// the metadata source looks up the default impl, so we have to trick it
getContainer().addComponent( projectBuilder, ProjectBuilder.class, "default" );
repositorySystem = lookup( RepositorySystem.class );
repositorySystem = lookup( RepositorySystem.class );
}
@Override
protected String getCustomConfigurationName()
{

View File

@ -26,16 +26,16 @@
@Component(role=ProjectBuilder.class,hint="classpath")
public class TestProjectBuilder
extends DefaultProjectBuilder
{
{
@Override
public ProjectBuildingResult build( Artifact artifact, ProjectBuildingRequest request )
throws ProjectBuildingException
{
{
if ( "maven-test".equals( artifact.getGroupId() ) )
{
String scope = artifact.getArtifactId().substring( "scope-".length() );
try
{
artifact.setFile( ProjectClasspathTest.getFileForClasspathResource( ProjectClasspathTest.dir + "transitive-" + scope + "-dep.xml" ) );

View File

@ -63,16 +63,16 @@ public void testProjectInheritance()
throws Exception
{
File localRepo = getLocalRepositoryPath();
System.out.println( "Local repository is at: " + localRepo.getAbsolutePath() );
File pom0 = new File( localRepo, "p0/pom.xml" );
File pom1 = new File( pom0.getParentFile(), "p1/pom.xml" );
File pom2 = new File( pom1.getParentFile(), "p2/pom.xml" );
File pom3 = new File( pom2.getParentFile(), "p3/pom.xml" );
File pom4 = new File( pom3.getParentFile(), "p4/pom.xml" );
File pom5 = new File( pom4.getParentFile(), "p5/pom.xml" );
System.out.println( "Location of project-4's POM: " + pom4.getPath() );
// load everything...
@ -114,22 +114,22 @@ public void testProjectInheritance()
// ----------------------------------------------------------------------
assertEquals( "4.0.0", project4.getModelVersion() );
Build build = project4.getBuild();
List<Plugin> plugins = build.getPlugins();
Map validPluginCounts = new HashMap();
String testPluginArtifactId = "maven-compiler-plugin";
// this is the plugin we're looking for.
validPluginCounts.put( testPluginArtifactId, 0 );
// these are injected if -DperformRelease=true
validPluginCounts.put( "maven-deploy-plugin", 0 );
validPluginCounts.put( "maven-javadoc-plugin", 0 );
validPluginCounts.put( "maven-source-plugin", 0 );
Plugin testPlugin = null;
for ( Plugin plugin : plugins )
@ -161,9 +161,9 @@ public void testProjectInheritance()
}
}
}
List executions = testPlugin.getExecutions();
assertEquals( 1, executions.size() );
}
}

View File

@ -1,24 +1,24 @@
package org.apache.maven.repository;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* 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.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* 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.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.codehaus.plexus.PlexusTestCase;

View File

@ -39,7 +39,7 @@ public String getId()
{
return "legacy";
}
public String pathOf( Artifact artifact )
{
ArtifactHandler artifactHandler = artifact.getArtifactHandler();

View File

@ -6,9 +6,9 @@
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, 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
@ -41,7 +41,7 @@
/**
* Tests {@link LegacyRepositorySystem}.
*
*
* @author Benjamin Bentmann
*/
public class LegacyRepositorySystemTest
@ -76,7 +76,7 @@ protected void tearDown()
resolutionErrorHandler = null;
super.tearDown();
}
protected List<ArtifactRepository> getRemoteRepositories()
throws Exception
{
@ -116,14 +116,14 @@ public void testThatASystemScopedDependencyIsNotResolvedFromRepositories()
d.setVersion( "0.1" );
d.setScope( Artifact.SCOPE_COMPILE );
Artifact artifact = repositorySystem.createDependencyArtifact( d );
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
.setArtifact( artifact )
.setResolveRoot( true )
.setResolveTransitively( true )
.setRemoteRepositories( getRemoteRepositories() )
.setLocalRepository( getLocalRepository() );
.setLocalRepository( getLocalRepository() );
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() );
session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( session, localRepo ) );
@ -132,19 +132,19 @@ public void testThatASystemScopedDependencyIsNotResolvedFromRepositories()
new DefaultMavenExecutionResult() ) );
ArtifactResolutionResult result = repositorySystem.resolve( request );
resolutionErrorHandler.throwErrors( request, result );
resolutionErrorHandler.throwErrors( request, result );
assertEquals( 2, result.getArtifacts().size() );
//
// System scoped version which should
//
// System scoped version which should
//
d.setScope( Artifact.SCOPE_SYSTEM );
File file = new File( getBasedir(), "src/test/repository-system/maven-core-2.1.0.jar" );
assertTrue( file.exists() );
d.setSystemPath( file.getCanonicalPath() );
artifact = repositorySystem.createDependencyArtifact( d );
//
// The request has not set any local or remote repositories as the system scoped dependency being resolved should only
// give us the dependency off the disk and nothing more.
@ -153,19 +153,19 @@ public void testThatASystemScopedDependencyIsNotResolvedFromRepositories()
.setArtifact( artifact )
.setResolveRoot( true )
.setResolveTransitively( true );
result = repositorySystem.resolve( request );
resolutionErrorHandler.throwErrors( request, result );
assertEquals( 1, result.getArtifacts().size() );
resolutionErrorHandler.throwErrors( request, result );
assertEquals( 1, result.getArtifacts().size() );
//
// Put in a bogus file to make sure missing files cause the resolution to fail.
//
//
file = new File( getBasedir(), "src/test/repository-system/maven-monkey-2.1.0.jar" );
assertFalse( file.exists() );
d.setSystemPath( file.getCanonicalPath() );
artifact = repositorySystem.createDependencyArtifact( d );
//
// The request has not set any local or remote repositories as the system scoped dependency being resolved should only
// give us the dependency off the disk and nothing more.
@ -174,7 +174,7 @@ public void testThatASystemScopedDependencyIsNotResolvedFromRepositories()
.setArtifact( artifact )
.setResolveRoot( true )
.setResolveTransitively( true );
try
{
result = repositorySystem.resolve( request );

View File

@ -59,7 +59,7 @@ public void testArtifact() throws Exception
ArtifactRepository localRepository = localRepository();
Artifact a = createArtifact( "a", "0.0.1-SNAPSHOT" );
File file = new File( localRepository.getBasedir(),
File file = new File( localRepository.getBasedir(),
localRepository.pathOf( a ) );
file.delete();
a.setFile( file );
@ -77,7 +77,7 @@ public void testArtifact() throws Exception
assertNull( updateCheckManager.readLastUpdated( touchFile,
updateCheckManager.getRepositoryKey( remoteRepository ) ) );
assertFalse( updateCheckManager.getTouchfile( a ).exists() );
}
@ -89,7 +89,7 @@ public void testMissingArtifact()
ArtifactRepository localRepository = localRepository();
Artifact a = createArtifact( "a", "0.0.1-SNAPSHOT" );
File file = new File( localRepository.getBasedir(),
File file = new File( localRepository.getBasedir(),
localRepository.pathOf( a ) );
file.delete();
a.setFile( file );
@ -115,7 +115,7 @@ public void testPom() throws Exception
ArtifactRepository localRepository = localRepository();
Artifact a = createArtifact( "a", "0.0.1", "pom" );
File file = new File( localRepository.getBasedir(),
File file = new File( localRepository.getBasedir(),
localRepository.pathOf( a ) );
file.delete();
a.setFile( file );
@ -133,7 +133,7 @@ public void testPom() throws Exception
assertNull( updateCheckManager.readLastUpdated( touchFile,
updateCheckManager.getRepositoryKey( remoteRepository ) ) );
assertFalse( updateCheckManager.getTouchfile( a ).exists() );
}
@ -145,7 +145,7 @@ public void testMissingPom()
ArtifactRepository localRepository = localRepository();
Artifact a = createArtifact( "a", "0.0.1", "pom" );
File file = new File( localRepository.getBasedir(),
File file = new File( localRepository.getBasedir(),
localRepository.pathOf( a ) );
file.delete();
a.setFile( file );
@ -223,14 +223,14 @@ public void testArtifactTouchFileName() throws Exception
ArtifactRepository localRepository = localRepository();
Artifact a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", null );
File file = new File( localRepository.getBasedir(),
File file = new File( localRepository.getBasedir(),
localRepository.pathOf( a ) );
a.setFile( file );
assertEquals( "a-0.0.1-SNAPSHOT.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );
a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" );
file = new File( localRepository.getBasedir(),
file = new File( localRepository.getBasedir(),
localRepository.pathOf( a ) );
a.setFile( file );

View File

@ -6,9 +6,9 @@
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, 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
@ -28,7 +28,7 @@
/**
* Tests {@link LegacyRepositorySystem}.
*
*
* @author Benjamin Bentmann
*/
public class LegacyRepositorySystemTest

View File

@ -42,7 +42,7 @@ public class StringWagon
extends StreamWagon
{
private Map<String, String> expectedContent = new HashMap<String, String>();
public void addExpectedContent( String resourceName, String expectedContent )
{
this.expectedContent.put( resourceName, expectedContent );
@ -66,7 +66,7 @@ public void fillInputData( InputData inputData )
Resource resource = inputData.getResource();
String content = expectedContent.get( resource.getName() );
if ( content != null )
{
resource.setContentLength( content.length() );
@ -102,6 +102,6 @@ protected void openConnectionInternal()
public void clearExpectedContent()
{
expectedContent.clear();
expectedContent.clear();
}
}

View File

@ -24,7 +24,7 @@
/**
* Wagon for testing, for protocol <code>a</code>
*
*
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
*/

View File

@ -24,7 +24,7 @@
/**
* Wagon for testing, for protocols <code>b1</code> and <code>b2</code>
*
*
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
*/

View File

@ -24,7 +24,7 @@
/**
* Wagon for testing, for protocol <code>c</code>
*
*
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
*/

View File

@ -23,7 +23,7 @@
/**
* Mock of a Wagon for testing
*
*
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
*/
public class WagonMock

View File

@ -36,11 +36,11 @@ public abstract class AbstractConflictResolverTest
extends PlexusTestCase
{
// constants --------------------------------------------------------------
private static final String GROUP_ID = "test";
// fields -----------------------------------------------------------------
protected Artifact a1;
protected Artifact a2;
@ -48,21 +48,21 @@ public abstract class AbstractConflictResolverTest
protected Artifact b1;
private final String roleHint;
private ArtifactFactory artifactFactory;
private ConflictResolver conflictResolver;
// constructors -----------------------------------------------------------
public AbstractConflictResolverTest( String roleHint )
throws Exception
{
this.roleHint = roleHint;
}
// TestCase methods -------------------------------------------------------
/*
* @see junit.framework.TestCase#setUp()
*/
@ -72,12 +72,12 @@ protected void setUp() throws Exception
artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
conflictResolver = (ConflictResolver) lookup( ConflictResolver.ROLE, roleHint );
a1 = createArtifact( "a", "1.0" );
a2 = createArtifact( "a", "2.0" );
b1 = createArtifact( "b", "1.0" );
}
/*
* @see org.codehaus.plexus.PlexusTestCase#tearDown()
*/
@ -86,24 +86,24 @@ protected void tearDown() throws Exception
a1 = null;
a2 = null;
b1 = null;
artifactFactory = null;
conflictResolver = null;
super.tearDown();
}
// protected methods ------------------------------------------------------
protected ConflictResolver getConflictResolver()
{
return conflictResolver;
}
protected void assertResolveConflict( ResolutionNode expectedNode, ResolutionNode actualNode1, ResolutionNode actualNode2 )
{
ResolutionNode resolvedNode = getConflictResolver().resolveConflict( actualNode1, actualNode2 );
assertNotNull( "Expected resolvable", resolvedNode );
assertEquals( "Resolution node", expectedNode, resolvedNode );
}
@ -111,7 +111,7 @@ protected void assertResolveConflict( ResolutionNode expectedNode, ResolutionNod
protected void assertUnresolvableConflict( ResolutionNode actualNode1, ResolutionNode actualNode2 )
{
ResolutionNode resolvedNode = getConflictResolver().resolveConflict( actualNode1, actualNode2 );
assertNull( "Expected unresolvable", resolvedNode );
}
@ -136,7 +136,7 @@ protected Artifact createArtifact( String id, String version, String scope, Stri
throws InvalidVersionSpecificationException
{
VersionRange versionRange = VersionRange.createFromVersionSpec( version );
return artifactFactory.createDependencyArtifact( GROUP_ID, id, versionRange, "jar", null, scope,
inheritedScope, optional );
}

View File

@ -34,13 +34,13 @@ public class FarthestConflictResolverTest
extends AbstractConflictResolverTest
{
// constructors -----------------------------------------------------------
public FarthestConflictResolverTest()
throws Exception
{
super("farthest");
}
// tests ------------------------------------------------------------------
/**
@ -55,7 +55,7 @@ public void testDepth()
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
assertResolveConflict( a2n, a1n, a2n );
}
@ -71,7 +71,7 @@ public void testDepthReversed()
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a2n, a2n, a1n );
}
@ -86,7 +86,7 @@ public void testEqual()
{
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
assertResolveConflict( a1n, a1n, a2n );
}
@ -101,7 +101,7 @@ public void testEqualReversed()
{
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a2n, a2n, a1n );
}
}

View File

@ -34,13 +34,13 @@ public class NearestConflictResolverTest
extends AbstractConflictResolverTest
{
// constructors -----------------------------------------------------------
public NearestConflictResolverTest()
throws Exception
{
super("nearest");
}
// tests ------------------------------------------------------------------
/**
@ -55,7 +55,7 @@ public void testDepth()
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
assertResolveConflict( a1n, a1n, a2n );
}
@ -71,7 +71,7 @@ public void testDepthReversed()
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a1n, a2n, a1n );
}
@ -86,7 +86,7 @@ public void testEqual()
{
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
assertResolveConflict( a1n, a1n, a2n );
}
@ -101,7 +101,7 @@ public void testEqualReversed()
{
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a2n, a2n, a1n );
}
}

View File

@ -34,13 +34,13 @@ public class NewestConflictResolverTest
extends AbstractConflictResolverTest
{
// constructors -----------------------------------------------------------
public NewestConflictResolverTest()
throws Exception
{
super("newest");
}
// tests ------------------------------------------------------------------
/**
@ -55,7 +55,7 @@ public void testDepth()
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
assertResolveConflict( a2n, a1n, a2n );
}
@ -71,7 +71,7 @@ public void testDepthReversed()
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a2n, a2n, a1n );
}
@ -86,7 +86,7 @@ public void testEqual()
{
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
assertResolveConflict( a2n, a1n, a2n );
}
@ -101,7 +101,7 @@ public void testEqualReversed()
{
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a2n, a2n, a1n );
}
}

View File

@ -34,13 +34,13 @@ public class OldestConflictResolverTest
extends AbstractConflictResolverTest
{
// constructors -----------------------------------------------------------
public OldestConflictResolverTest()
throws Exception
{
super("oldest");
}
// tests ------------------------------------------------------------------
/**
@ -55,7 +55,7 @@ public void testDepth()
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
assertResolveConflict( a1n, a1n, a2n );
}
@ -71,7 +71,7 @@ public void testDepthReversed()
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a1n, a2n, a1n );
}
@ -86,7 +86,7 @@ public void testEqual()
{
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
assertResolveConflict( a1n, a1n, a2n );
}
@ -101,7 +101,7 @@ public void testEqualReversed()
{
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
assertResolveConflict( a1n, a2n, a1n );
}
}

View File

@ -27,7 +27,7 @@
/**
*
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
*
*
*/
public class DefaultClasspathTransformationTest
@ -53,7 +53,7 @@ protected void setUp() throws Exception
* v2
* v1<
* v3-v4
*
*
*/
v1 = graph.addVertex(new ArtifactMetadata("g","a1","1.0"));
graph.setEntry(v1);

View File

@ -22,7 +22,7 @@
/**
*
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
*
*
*/
public class DefaultGraphConflictResolutionPolicyTest

View File

@ -27,7 +27,7 @@
/**
*
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
*
*
*/
public class DefaultGraphConflictResolverTest
@ -54,7 +54,7 @@ protected void setUp() throws Exception
* v2
* v1<
* v3-v4
*
*
*/
graph = new MetadataGraph( 4, 3 );
v1 = graph.addVertex(new ArtifactMetadata("g","a1","1.0"));

View File

@ -40,7 +40,7 @@ public class TestMetadataSource
{
@Requirement
private ArtifactFactory factory;
public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
throws ArtifactMetadataRetrievalException
{
@ -59,7 +59,7 @@ public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepo
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
}
}
if ( "i".equals( artifact.getArtifactId() ) )
{
Artifact a = null;
@ -73,7 +73,7 @@ public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepo
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
}
}
return new ResolutionGroup( artifact, dependencies, remoteRepositories );
}

View File

@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>p1</artifactId>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
@ -16,7 +16,7 @@
<executions>
<execution>
<id>normal</id>
<goals>
<goal>compile</goal>
</goals>

View File

@ -4,7 +4,7 @@
<artifactId>p0</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<build>
<plugins>
<plugin>
@ -13,10 +13,10 @@
<executions>
<execution>
<id>test</id>
<!-- The key to this test... -->
<inherited>false</inherited>
<goals>
<goal>compile</goal>
</goals>

View File

@ -7,5 +7,5 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>p1</artifactId>
</project>

View File

@ -4,13 +4,13 @@
<artifactId>p0</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<scm>
<connection>scm:svn:http://host/p0</connection>
<developerConnection>scm:svn:https://host/p0</developerConnection>
<url>http://host/viewer?path=/p0</url>
</scm>
<modules>
<module>modules/p1</module>
</modules>

View File

@ -36,7 +36,7 @@ We need to turn this list of phases into a set of plugin objects that have an xm
.
.
</plugins>
We need this form so that the model builder can make the first pass at merging. Full merging cannot be done because we don't know what the version of the plugin is yet that the user has requested. For plugins in the default lifecycle they are typically defined in the plugin management section of the parent POM. When the merging is complete we are going to have something that looks like the following:
<plugins>
@ -57,11 +57,11 @@ We need this form so that the model builder can make the first pass at merging.
.
</plugins>
Once we have the version of the plugins the appropriate call to the plugin manager can be made to get the MojoDescriptor for the goal that needs to be run. In the MojoDescriptor we are interested in the <configuration/> element and <parameters/> element. From these elements we need to make a component configuration for the MojoExecution. The actual DOM like structure we create is of type PlexusConfiguration and is the type we use with the ComponentConfigurator to initialize fields in a Plexus component. Typically this is done within Plexus with the configuration supplied with component configuration, but in Maven we take configuration values from the POM. So we have to use the ComponentConfigurator outside of Plexus in order to configurure the Maven Mojo which is just a Plexus component. We can use the information from the MojoDescriptor along with the merged configuration information that is now present in the POM to create the complete PlexusConfiguration used to populate values in the Maven Mojo.
Once we have the version of the plugins the appropriate call to the plugin manager can be made to get the MojoDescriptor for the goal that needs to be run. In the MojoDescriptor we are interested in the <configuration/> element and <parameters/> element. From these elements we need to make a component configuration for the MojoExecution. The actual DOM like structure we create is of type PlexusConfiguration and is the type we use with the ComponentConfigurator to initialize fields in a Plexus component. Typically this is done within Plexus with the configuration supplied with component configuration, but in Maven we take configuration values from the POM. So we have to use the ComponentConfigurator outside of Plexus in order to configurure the Maven Mojo which is just a Plexus component. We can use the information from the MojoDescriptor along with the merged configuration information that is now present in the POM to create the complete PlexusConfiguration used to populate values in the Maven Mojo.
foreach configuration element:
- if read only and being set squawk
- find the parameter
- get value from expression or default
- if required and null squawk

View File

@ -47,50 +47,50 @@ i'l
// - plugins with a dependency the same as the core but different versions, make it fail then fix it
/*
*
*
* h2. Concerns for the plugin manager
*
*
* h3. resolving the dependencies of a plugin - these could be resolved remotely at runtime or, -
* they could be resolved from a local repository - i think we need a simple dependency model here
* that is more mercury related and not Maven related i.e no POMs - workspace resolver - we need
* tools to pre-populate this repository
*
*
* h3. create an isolated classloader
*
*
* h3. lookup the plugin with a configuration
*
*
* h3. execute the plugin
*
*
* h3. plugins may have to deal with particular actions when a plugin is - installed - loaded -
* unloaded - update - uninstalled
*
*
* h3. plugins should be able to have specific metadata for a plugin model and that be translated -
* dependencies - resources - configuration - extension points of plugins
*
*
* For a particular application plugin there will be a declarative descriptor for that plugin type.
*
*
* - nexus - the plugin class - UI to contribute - what JS to hook into the UI - what resources to
* load into the UI - having packed or unpacked plugins, and positioning resources if necessary -
* maven can work out of the classloader, nexus plugins probably couldn't given the js and image
* resources
*
*
* We need to look at Maven, and Nexus as use cases and figure out what each of them needs to be
* able to do
*
*
* - now what is really the difference between this and loading a component in plexus - custom
* classloading capability - remote resolution of dependencies - do we want a model for sharing
* information among plugins, is this more like an extension point - do we need a sort of bus for
* application data - do we need a dictionary for our applications like Apple does. We could easily
* hook into this and this is the model we need to follow - how many of our REST services do not map
* directory to a method in the application interface?
*
*
* - research extension points versus plugins
*
*
* from igor: two plugins A and B, both depend on the same library but use different versions, say
* lib 1.0 and lib 2.0 when debugger hits a breakpoint inside a class from the library, IDE needs to
* know which version of library the class comes from
*/
This document outlines the concerns of a general plugin manager that would be used in conjunction with any Plexus-based application. The following outlined concerns are an attempt to describe what a plugin manager would need to do for Maven and for Nexus.
h2. Concerns for the plugin manager
@ -144,8 +144,8 @@ Each application will have its own model for plugins. Much of this model will be
* Configuration metadata and default configuration values
* Extension points that plugins might expose
h3. The plugin manager may have to deal with particular actions when a plugin is
h3. The plugin manager may have to deal with particular actions when a plugin is
* installation
* activation
* update
@ -158,7 +158,7 @@ We might want to separate between installation and activation, it might be nice
These particular phases in a plugins lifecycle can probably be generalized to all plugins so could be something implemented in all plugins. Here we could have the descriptor either point to methods for each of these phases to execute or we could create a lifecycle in Plexus for these phases.
For a particular application plugin there will be a declarative descriptor for that plugin type.
For a particular application plugin there will be a declarative descriptor for that plugin type.
h3. Some general notes on Nexus
@ -168,11 +168,11 @@ The plugin metadata:
* what JS to hook into the UI
* what resources to load into the UI
* having packed or unpacked plugins, and positioning resources if necessary
* maven can work out of the classloader, nexus plugins probably couldn't given the js and image resources
* maven can work out of the classloader, nexus plugins probably couldn't given the js and image resources
h3. Other issues
We need to look at Maven, and Nexus as use cases and figure out what each of them needs to be able to do
We need to look at Maven, and Nexus as use cases and figure out what each of them needs to be able to do
* now what is really the difference between this and loading a component in plexus
* do we want a model for sharing information among plugins, is this more like an extension point
@ -182,4 +182,3 @@ We need to look at Maven, and Nexus as use cases and figure out what each of the
- an example of adding js
- an example of adding a URI

View File

@ -69,7 +69,7 @@ public void afterSessionStart( MavenSession session )
* code.
*/
public void afterSessionEnd( MavenSession session )
throws MavenExecutionException
throws MavenExecutionException
{
// do nothing
}

View File

@ -38,7 +38,7 @@
* @todo this should probably be a component with some dynamic control of filtering
*/
@Component( role = ArtifactFilterManager.class )
public class DefaultArtifactFilterManager
public class DefaultArtifactFilterManager
implements ArtifactFilterManager
{

View File

@ -145,7 +145,7 @@ public class DefaultMaven
@Requirement
private SessionScope sessionScope;
public MavenExecutionResult execute( MavenExecutionRequest request )
{
MavenExecutionResult result;
@ -176,7 +176,7 @@ public MavenExecutionResult execute( MavenExecutionRequest request )
return result;
}
//
//
// 1) Setup initial properties.
//
// 2) Validate local repository directory is accessible.
@ -208,7 +208,7 @@ public MavenExecutionResult execute( MavenExecutionRequest request )
private MavenExecutionResult doExecute( MavenExecutionRequest request )
{
request.setStartTime( new Date() );
MavenExecutionResult result = new DefaultMavenExecutionResult();
try
@ -223,14 +223,14 @@ private MavenExecutionResult doExecute( MavenExecutionRequest request )
DefaultRepositorySystemSession repoSession = (DefaultRepositorySystemSession) newRepositorySession( request );
MavenSession session = new MavenSession( container, repoSession, request, result );
//
// We enter the session scope right after the MavenSession creation and before any of the AbstractLifecycleParticipant lookups
// so that @SessionScoped components can be @Injected into AbstractLifecycleParticipants.
//
//
sessionScope.enter();
sessionScope.seed( MavenSession.class, session );
legacySupport.setSession( session );
try
@ -285,7 +285,7 @@ private MavenExecutionResult doExecute( MavenExecutionRequest request )
{
return addExceptionToResult( result, e );
}
WorkspaceReader reactorWorkspace;
try
{
@ -295,14 +295,14 @@ private MavenExecutionResult doExecute( MavenExecutionRequest request )
{
return addExceptionToResult( result, e );
}
//
// Desired order of precedence for local artifact repositories
//
// Reactor
// Workspace
// User Local Repository
//
//
repoSession.setWorkspaceReader( ChainedWorkspaceReader.newInstance( reactorWorkspace,
repoSession.getWorkspaceReader() ) );
@ -380,7 +380,7 @@ private MavenExecutionResult doExecute( MavenExecutionRequest request )
return result;
}
private void afterSessionEnd( Collection<MavenProject> projects, MavenSession session )
private void afterSessionEnd( Collection<MavenProject> projects, MavenSession session )
throws MavenExecutionException
{
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
@ -641,7 +641,7 @@ private List<MavenProject> getProjectsForMavenReactor( MavenSession session )
throws ProjectBuildingException
{
MavenExecutionRequest request = session.getRequest();
request.getProjectBuildingRequest().setRepositorySession( session.getRepositorySession() );
List<MavenProject> projects = new ArrayList<MavenProject>();
@ -761,7 +761,7 @@ private void validateProjects( List<MavenProject> projects )
for ( MavenProject project : projects )
{
// MNG-1911 / MNG-5572: Building plugins with extensions cannot be part of reactor
// MNG-1911 / MNG-5572: Building plugins with extensions cannot be part of reactor
for ( Plugin plugin : project.getBuildPlugins() )
{
if ( plugin.isExtensions() )
@ -940,7 +940,7 @@ else if ( StringUtils.isNotEmpty( request.getMakeBehavior() ) )
return result;
}
private List<MavenProject> trimExcludedProjects( List<MavenProject> projects, MavenExecutionRequest request )
throws MavenExecutionException
{

View File

@ -26,7 +26,7 @@
/**
* Signals a collision of two or more projects with the same g:a:v during a reactor build.
*
*
* @author Benjamin Bentmann
*/
public class DuplicateProjectException
@ -37,7 +37,7 @@ public class DuplicateProjectException
/**
* Creates a new exception with specified details.
*
*
* @param message The message text, may be {@code null}.
* @param collisions The POM files of the projects that collided, indexed by their g:a:v, may be {@code null}.
*/
@ -50,7 +50,7 @@ public DuplicateProjectException( String message, Map<String, List<File>> collis
/**
* Gets the POM files of the projects that collided.
*
*
* @return The POM files of the projects that collided, indexed by their g:a:v, never {@code null}.
*/
public Map<String, List<File>> getCollisions()

View File

@ -30,7 +30,7 @@
/**
* Provides a sub view of another dependency graph.
*
*
* @author Benjamin Bentmann
*/
class FilteredProjectDependencyGraph
@ -45,7 +45,7 @@ class FilteredProjectDependencyGraph
/**
* Creates a new project dependency graph from the specified graph.
*
*
* @param projectDependencyGraph The project dependency graph to create a sub view from, must not be {@code null}.
* @param whiteList The projects on which the dependency view should focus, must not be {@code null}.
*/

View File

@ -21,7 +21,7 @@
/**
* Signals an internal error in Maven itself, e.g. a programming bug.
*
*
* @author Benjamin Bentmann
*/
public class InternalErrorException

View File

@ -30,5 +30,5 @@ public interface Maven
@Deprecated
String POMv4 = "pom.xml";
MavenExecutionResult execute( MavenExecutionRequest request );
MavenExecutionResult execute( MavenExecutionRequest request );
}

View File

@ -43,7 +43,7 @@
/**
* An implementation of a workspace reader that knows how to search the Maven reactor for artifacts, either
* as packaged jar if it has been built, or only compile output directory if packaging hasn't happened yet.
*
*
* @author Jason van Zyl
*/
@Named( ReactorReader.HINT )
@ -52,7 +52,7 @@ class ReactorReader
implements WorkspaceReader
{
public static final String HINT = "reactor";
private static final Collection<String> COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" );
private Map<String, MavenProject> projectsByGAV;
@ -193,7 +193,7 @@ private boolean hasBeenPackaged( MavenProject project )
/**
* Tries to resolve the specified artifact from the artifacts of the given project.
*
*
* @param project The project to try to resolve the artifact from, must not be <code>null</code>.
* @param requestedArtifact The artifact to resolve, must not be <code>null</code>.
* @return The matching artifact from the project or <code>null</code> if not found. Note that this
@ -234,7 +234,7 @@ private boolean attachedArtifactComparison( Artifact requested, Artifact attache
/**
* Determines whether the specified artifact refers to test classes.
*
*
* @param artifact The artifact to check, must not be {@code null}.
* @return {@code true} if the artifact refers to test classes, {@code false} otherwise.
*/

View File

@ -49,7 +49,7 @@
/**
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
* of the public API. In particular, this class can be changed or deleted without prior notice.
*
*
* @author Benjamin Bentmann
*/
public class RepositoryUtils

View File

@ -29,7 +29,7 @@
/**
* Indicates that annotated component should be instantiated before session starts and discarded after session execution completes.
*
*
* @author Jason van Zyl
* @since 3.2.0
*/

View File

@ -27,7 +27,7 @@
/**
* Collects basic settings to access the repository system.
*
*
* @author Benjamin Bentmann
*/
public class DefaultRepositoryRequest
@ -52,7 +52,7 @@ public DefaultRepositoryRequest()
/**
* Creates a shallow copy of the specified repository request.
*
*
* @param repositoryRequest The repository request to copy from, must not be {@code null}.
*/
public DefaultRepositoryRequest( RepositoryRequest repositoryRequest )

View File

@ -47,7 +47,7 @@
/**
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
* of the public API. In particular, this class can be changed or deleted without prior notice.
*
*
* @author Benjamin Bentmann
*/
public class LegacyLocalRepositoryManager

View File

@ -142,7 +142,7 @@ public String toString()
{
sb.append( " proxy: " ).append( proxy.getHost() ).append( ":" ).append( proxy.getPort() ).append( "\n" );
}
if ( snapshots != null )
{
sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() );

View File

@ -22,7 +22,7 @@
/**
* Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant
* for exclusive consumption by the repository system and is opaque to the cache implementation.
*
*
* @author Benjamin Bentmann
*/
@Deprecated
@ -37,7 +37,7 @@ public interface RepositoryCache
* Puts the specified data into the cache. <strong>Warning:</strong> The cache will directly save the provided
* reference. If the cached data is mutable, i.e. could be modified after being put into the cache, the caller is
* responsible for creating a copy of the original data and store the copy in the cache.
*
*
* @param request The repository request from which this cache was retrieved, must not be {@code null}.
* @param key The key to use associate the data with, must not be {@code null}.
* @param data The data to store in the cache, may be {@code null}.
@ -48,7 +48,7 @@ public interface RepositoryCache
* Gets the specified data from the cache. <strong>Warning:</strong> The cache will directly return the saved
* reference. If the cached data is to be modified after its retrieval, the caller is responsible to create a copy
* of the returned data and use this instead of the cache record.
*
*
* @param request The repository request from which this cache was retrieved, must not be {@code null}.
* @param key The key to use for lookup of the data, must not be {@code null}.
* @return The requested data or {@code null} if none was present in the cache.

View File

@ -23,7 +23,7 @@
/**
* Collects basic settings to access the repository system.
*
*
* @author Benjamin Bentmann
*/
public interface RepositoryRequest
@ -31,14 +31,14 @@ public interface RepositoryRequest
/**
* Indicates whether network access to remote repositories has been disabled.
*
*
* @return {@code true} if remote access has been disabled, {@code false} otherwise.
*/
boolean isOffline();
/**
* Enables/disables network access to remote repositories.
*
*
* @param offline {@code true} to disable remote access, {@code false} to allow network access.
* @return This request, never {@code null}.
*/
@ -47,7 +47,7 @@ public interface RepositoryRequest
/**
* Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their
* configured update policy.
*
*
* @return {@code true} if remote repositories should be re-checked for updated artifacts/metadata, {@code false}
* otherwise.
*/
@ -55,7 +55,7 @@ public interface RepositoryRequest
/**
* Enables/disabled forced checks for updated artifacts/metadata on remote repositories.
*
*
* @param forceUpdate {@code true} to forcibly check the remote repositories for updated artifacts/metadata, {@code
* false} to use the update policy configured on each repository.
* @return This request, never {@code null}.
@ -64,14 +64,14 @@ public interface RepositoryRequest
/**
* Gets the local repository to use.
*
*
* @return The local repository to use or {@code null} if not set.
*/
ArtifactRepository getLocalRepository();
/**
* Sets the local repository to use.
*
*
* @param localRepository The local repository to use.
* @return This request, never {@code null}.
*/
@ -79,14 +79,14 @@ public interface RepositoryRequest
/**
* Gets the remote repositories to use.
*
*
* @return The remote repositories to use, never {@code null}.
*/
List<ArtifactRepository> getRemoteRepositories();
/**
* Sets the remote repositories to use.
*
*
* @param remoteRepositories The remote repositories to use.
* @return This request, never {@code null}.
*/

View File

@ -56,7 +56,7 @@ public String getRemoteFilename()
}
public String getLocalFilename( ArtifactRepository repository )
{
{
return "maven-metadata-" + repository.getKey() + ".xml";
}
@ -208,7 +208,7 @@ public void merge( org.apache.maven.repository.legacy.metadata.ArtifactMetadata
AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata;
this.metadata.merge( repoMetadata.getMetadata() );
}
public void merge( ArtifactMetadata metadata )
{
// TODO: not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact replaces?

View File

@ -34,7 +34,7 @@
/**
* Handles deserialization of metadata from some kind of textual format like XML.
*
*
* @author Benjamin Bentmann
*/
@Component( role = MetadataReader.class )

View File

@ -23,7 +23,7 @@
/**
* Signals a failure to parse the metadata due to invalid syntax (e.g. non-wellformed XML or unknown elements).
*
*
* @author Benjamin Bentmann
*/
public class MetadataParseException
@ -42,7 +42,7 @@ public class MetadataParseException
/**
* Creates a new parser exception with the specified details.
*
*
* @param message The error message, may be {@code null}.
* @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown.
* @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown.
@ -56,7 +56,7 @@ public MetadataParseException( String message, int lineNumber, int columnNumber
/**
* Creates a new parser exception with the specified details.
*
*
* @param message The error message, may be {@code null}.
* @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown.
* @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown.
@ -72,7 +72,7 @@ public MetadataParseException( String message, int lineNumber, int columnNumber,
/**
* Gets the one-based index of the line containing the error.
*
*
* @return The one-based index of the line containing the error or a non-positive value if unknown.
*/
public int getLineNumber()
@ -82,7 +82,7 @@ public int getLineNumber()
/**
* Gets the one-based index of the column containing the error.
*
*
* @return The one-based index of the column containing the error or non-positive value if unknown.
*/
public int getColumnNumber()

View File

@ -61,9 +61,9 @@ public class ArtifactResolutionRequest
// Needs to go away
private List<ResolutionListener> listeners = new ArrayList<ResolutionListener>();
// This is like a filter but overrides all transitive versions
// This is like a filter but overrides all transitive versions
private Map<String, Artifact> managedVersionMap;
private boolean resolveRoot = true;
private boolean resolveTransitively = false;
@ -141,7 +141,7 @@ public ArtifactResolutionRequest setRemoteRepositories( List<ArtifactRepository>
/**
* Gets the artifact filter that controls traversal of the dependency graph.
*
*
* @return The filter used to determine which of the artifacts in the dependency graph should be traversed or
* {@code null} to collect all transitive dependencies.
*/
@ -160,7 +160,7 @@ public ArtifactResolutionRequest setCollectionFilter( ArtifactFilter filter )
/**
* Gets the artifact filter that controls downloading of artifact files. This filter operates on those artifacts
* that have been included by the {@link #getCollectionFilter()}.
*
*
* @return The filter used to determine which of the artifacts should have their files resolved or {@code null} to
* resolve the files for all collected artifacts.
*/
@ -182,12 +182,12 @@ public List<ResolutionListener> getListeners()
}
public ArtifactResolutionRequest setListeners( List<ResolutionListener> listeners )
{
{
this.listeners = listeners;
return this;
}
public ArtifactResolutionRequest addListener( ResolutionListener listener )
{
listeners.add( listener );
@ -210,26 +210,26 @@ public ArtifactResolutionRequest setManagedVersionMap( Map<String, Artifact> man
public ArtifactResolutionRequest setResolveRoot( boolean resolveRoot )
{
this.resolveRoot = resolveRoot;
return this;
}
public boolean isResolveRoot()
{
return resolveRoot;
}
}
public ArtifactResolutionRequest setResolveTransitively( boolean resolveDependencies )
{
this.resolveTransitively = resolveDependencies;
return this;
}
public boolean isResolveTransitively()
{
return resolveTransitively;
}
}
public String toString()
{
@ -239,7 +239,7 @@ public String toString()
.append( artifactDependencies ).append( "\n" )
.append( "localRepository: " ).append( localRepository ).append( "\n" )
.append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" );
return sb.toString();
}
@ -322,8 +322,8 @@ public List<Proxy> getProxies()
// Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave
// this here, possibly indefinitely.
//
public ArtifactResolutionRequest setCache( RepositoryCache cache )
{
return this;
}
public ArtifactResolutionRequest setCache( RepositoryCache cache )
{
return this;
}
}

View File

@ -35,7 +35,7 @@
public class AndArtifactFilter
implements ArtifactFilter
{
private Set<ArtifactFilter> filters;
private Set<ArtifactFilter> filters;
public AndArtifactFilter()
{
@ -46,7 +46,7 @@ public AndArtifactFilter( List<ArtifactFilter> filters )
{
this.filters = new LinkedHashSet<ArtifactFilter>( filters );
}
public boolean include( Artifact artifact )
{
boolean include = true;
@ -86,14 +86,14 @@ public boolean equals( Object obj )
{
return true;
}
if ( !( obj instanceof AndArtifactFilter ) )
{
return false;
}
AndArtifactFilter other = (AndArtifactFilter) obj;
return filters.equals( other.filters );
}
}

View File

@ -28,7 +28,7 @@
* scopes and their associated implied scopes, so that the user can filter apply a series of implication rules in a
* single step. This should be a more efficient implementation of multiple standard {@link ScopeArtifactFilter}
* instances ORed together.
*
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @author jdcasey
*/
@ -40,7 +40,7 @@ public class CumulativeScopeArtifactFilter
/**
* Create a new filter with the specified scopes and their implied scopes enabled.
*
*
* @param scopes The scopes to enable, along with all implied scopes, may be {@code null}.
*/
public CumulativeScopeArtifactFilter( Collection<String> scopes )
@ -52,7 +52,7 @@ public CumulativeScopeArtifactFilter( Collection<String> scopes )
/**
* Creates a new filter that combines the specified filters.
*
*
* @param filters The filters to combine, may be {@code null}.
*/
public CumulativeScopeArtifactFilter( CumulativeScopeArtifactFilter... filters )

View File

@ -73,14 +73,14 @@ public boolean equals( Object obj )
{
return true;
}
if ( !( obj instanceof ExclusionSetFilter ) )
{
return false;
}
ExclusionSetFilter other = (ExclusionSetFilter) obj;
return excludes.equals( other.excludes );
}
}

View File

@ -68,19 +68,19 @@ public int hashCode()
{
int hash = 17;
hash = hash * 31 + patterns.hashCode();
return hash;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
if ( this == obj )
{
return true;
}
// make sure IncludesArtifactFilter is not equal ExcludesArtifactFilter!
// make sure IncludesArtifactFilter is not equal ExcludesArtifactFilter!
if ( obj == null || getClass() != obj.getClass() )
{
return false;

View File

@ -79,7 +79,7 @@ public class MavenRepositorySystem
@Requirement
private ArtifactHandlerManager artifactHandlerManager;
@Requirement
private ArtifactResolver artifactResolver;
@ -91,7 +91,7 @@ public class MavenRepositorySystem
@Requirement
private SettingsDecrypter settingsDecrypter;
// DefaultProjectBuilder
public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
{
@ -600,7 +600,7 @@ public static ArtifactRepository createArtifactRepository( String id, String url
return repository;
}
// ArtifactFactory
private Artifact XcreateArtifact( String groupId, String artifactId, String version, String scope, String type )
{
@ -694,5 +694,5 @@ else if ( Artifact.SCOPE_COMPILE.equals( scope ) && Artifact.SCOPE_COMPILE.equal
return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler,
optional );
}
}
}

Some files were not shown because too many files have changed in this diff Show More