mirror of https://github.com/apache/maven.git
Trimmed trailing whitespace
This commit is contained in:
parent
365066f46c
commit
0343c52601
|
@ -22,7 +22,7 @@ under the License.
|
||||||
<!--
|
<!--
|
||||||
| This is the configuration file for Maven. It can be specified at two levels:
|
| 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.
|
| and is normally provided in ${user.home}/.m2/settings.xml.
|
||||||
|
|
|
|
||||||
| NOTE: This location can be overridden with the CLI option:
|
| 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
|
| 2. Global Level. This settings.xml file provides configuration for all Maven
|
||||||
| users on a machine (assuming they're all using the same 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.
|
| ${maven.home}/conf/settings.xml.
|
||||||
|
|
|
|
||||||
| NOTE: This location can be overridden with the CLI option:
|
| 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.
|
| values (values used when the setting is not specified) are provided.
|
||||||
|
|
|
|
||||||
|-->
|
|-->
|
||||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
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">
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||||
<!-- localRepository
|
<!-- localRepository
|
||||||
| The path to the local repository maven will use to store artifacts.
|
| The path to the local repository maven will use to store artifacts.
|
||||||
|
@ -112,8 +112,8 @@ under the License.
|
||||||
<!-- server
|
<!-- server
|
||||||
| Specifies the authentication information to use when connecting to a particular server, identified by
|
| 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).
|
| 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.
|
| used together.
|
||||||
|
|
|
|
||||||
<server>
|
<server>
|
||||||
|
@ -122,7 +122,7 @@ under the License.
|
||||||
<password>repopwd</password>
|
<password>repopwd</password>
|
||||||
</server>
|
</server>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Another sample, using keys to authenticate.
|
<!-- Another sample, using keys to authenticate.
|
||||||
<server>
|
<server>
|
||||||
<id>siteServer</id>
|
<id>siteServer</id>
|
||||||
|
@ -134,13 +134,13 @@ under the License.
|
||||||
|
|
||||||
<!-- mirrors
|
<!-- mirrors
|
||||||
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
| 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.
|
| 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
|
| However, this repository may have problems with heavy traffic at times, so people have mirrored
|
||||||
| it to several places.
|
| it to several places.
|
||||||
|
|
|
|
||||||
| That repository definition will have a unique id, so we can create a mirror reference for that
|
| 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.
|
| server for that repository.
|
||||||
|-->
|
|-->
|
||||||
<mirrors>
|
<mirrors>
|
||||||
|
@ -157,20 +157,20 @@ under the License.
|
||||||
</mirror>
|
</mirror>
|
||||||
-->
|
-->
|
||||||
</mirrors>
|
</mirrors>
|
||||||
|
|
||||||
<!-- profiles
|
<!-- profiles
|
||||||
| This is a list of profiles which can be activated in a variety of ways, and which can modify
|
| 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-
|
| 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.
|
| 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
|
| 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.
|
| 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
|
| 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
|
| 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,
|
| 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'.
|
| 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.
|
| Finally, the list of active profiles can be specified directly from the command line.
|
||||||
|
|
|
|
||||||
|
@ -219,7 +219,7 @@ under the License.
|
||||||
| <plugin>
|
| <plugin>
|
||||||
| <groupId>org.myco.myplugins</groupId>
|
| <groupId>org.myco.myplugins</groupId>
|
||||||
| <artifactId>myplugin</artifactId>
|
| <artifactId>myplugin</artifactId>
|
||||||
|
|
|
|
||||||
| <configuration>
|
| <configuration>
|
||||||
| <tomcatLocation>${tomcatPath}</tomcatLocation>
|
| <tomcatLocation>${tomcatPath}</tomcatLocation>
|
||||||
| </configuration>
|
| </configuration>
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that the global settings.xml shipped with the distribution is in good state.
|
* Tests that the global settings.xml shipped with the distribution is in good state.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class GlobalSettingsTest
|
public class GlobalSettingsTest
|
||||||
|
|
|
@ -114,7 +114,7 @@ under the License.
|
||||||
<artifactId>mockito-core</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
<version>1.9.5</version>
|
<version>1.9.5</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.aether.repository.RepositoryPolicy;
|
||||||
/**
|
/**
|
||||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
* <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.
|
* of the public API. In particular, this class can be changed or deleted without prior notice.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class ArtifactDescriptorUtils
|
public class ArtifactDescriptorUtils
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.eclipse.aether.RepositorySystemSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A model builder cache backed by the repository system cache.
|
* A model builder cache backed by the repository system cache.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
class DefaultModelCache
|
class DefaultModelCache
|
||||||
|
|
|
@ -52,7 +52,7 @@ import org.eclipse.aether.resolution.VersionRangeResult;
|
||||||
/**
|
/**
|
||||||
* A model resolver to assist building of dependency POMs. This resolver gives priority to those repositories that have
|
* 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.
|
* been initially specified and repositories discovered in dependency POMs are recessively merged into the search chain.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
* @see DefaultArtifactDescriptorReader
|
* @see DefaultArtifactDescriptorReader
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -52,7 +52,7 @@ import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy;
|
||||||
* A utility class to assist in setting up a Maven-like repository system. <em>Note:</em> This component is meant to
|
* 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
|
* 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.
|
* always use regular dependency injection to acquire the repository system.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public final class MavenRepositorySystemUtils
|
public final class MavenRepositorySystemUtils
|
||||||
|
@ -66,7 +66,7 @@ public final class MavenRepositorySystemUtils
|
||||||
/**
|
/**
|
||||||
* Creates a new service locator that already knows about all service implementations included in this library. To
|
* 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.
|
* acquire a complete repository system, clients need to add some repository connectors for remote transfers.
|
||||||
*
|
*
|
||||||
* @return The new service locator, never {@code null}.
|
* @return The new service locator, never {@code null}.
|
||||||
*/
|
*/
|
||||||
public static DefaultServiceLocator newServiceLocator()
|
public static DefaultServiceLocator newServiceLocator()
|
||||||
|
@ -85,7 +85,7 @@ public final class MavenRepositorySystemUtils
|
||||||
* Maven-based resolution. In more detail, this method configures settings relevant for the processing of dependency
|
* 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
|
* 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.
|
* the session with authentication, mirror, proxy and other information required for your environment.
|
||||||
*
|
*
|
||||||
* @return The new repository system session, never {@code null}.
|
* @return The new repository system session, never {@code null}.
|
||||||
*/
|
*/
|
||||||
public static DefaultRepositorySystemSession newSession()
|
public static DefaultRepositorySystemSession newSession()
|
||||||
|
@ -126,7 +126,7 @@ public final class MavenRepositorySystemUtils
|
||||||
|
|
||||||
session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) );
|
session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) );
|
||||||
|
|
||||||
// MNG-5670 guard against ConcurrentModificationException
|
// MNG-5670 guard against ConcurrentModificationException
|
||||||
Properties sysProps = new Properties();
|
Properties sysProps = new Properties();
|
||||||
for ( String key : System.getProperties().stringPropertyNames() )
|
for ( String key : System.getProperties().stringPropertyNames() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,19 +39,19 @@ public class DefaultArtifactDescriptorReaderTest
|
||||||
{
|
{
|
||||||
// prepare
|
// prepare
|
||||||
DefaultArtifactDescriptorReader reader = (DefaultArtifactDescriptorReader) lookup( ArtifactDescriptorReader.class );
|
DefaultArtifactDescriptorReader reader = (DefaultArtifactDescriptorReader) lookup( ArtifactDescriptorReader.class );
|
||||||
|
|
||||||
RepositoryEventDispatcher eventDispatcher = mock( RepositoryEventDispatcher.class );
|
RepositoryEventDispatcher eventDispatcher = mock( RepositoryEventDispatcher.class );
|
||||||
|
|
||||||
ArgumentCaptor<RepositoryEvent> event = ArgumentCaptor.forClass( RepositoryEvent.class );
|
ArgumentCaptor<RepositoryEvent> event = ArgumentCaptor.forClass( RepositoryEvent.class );
|
||||||
|
|
||||||
reader.setRepositoryEventDispatcher( eventDispatcher );
|
reader.setRepositoryEventDispatcher( eventDispatcher );
|
||||||
|
|
||||||
ArtifactDescriptorRequest request = new ArtifactDescriptorRequest();
|
ArtifactDescriptorRequest request = new ArtifactDescriptorRequest();
|
||||||
|
|
||||||
request.addRepository( newTestRepository() );
|
request.addRepository( newTestRepository() );
|
||||||
|
|
||||||
request.setArtifact( new DefaultArtifact( "org.apache.maven.its", "dep-mng5459", "jar", "0.4.0-SNAPSHOT" ) );
|
request.setArtifact( new DefaultArtifact( "org.apache.maven.its", "dep-mng5459", "jar", "0.4.0-SNAPSHOT" ) );
|
||||||
|
|
||||||
// execute
|
// execute
|
||||||
reader.readArtifactDescriptor( session, request );
|
reader.readArtifactDescriptor( session, request );
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class DefaultArtifactDescriptorReaderTest
|
||||||
verify( eventDispatcher ).dispatch( event.capture() );
|
verify( eventDispatcher ).dispatch( event.capture() );
|
||||||
|
|
||||||
boolean missingArtifactDescriptor = false;
|
boolean missingArtifactDescriptor = false;
|
||||||
|
|
||||||
for( RepositoryEvent evt : event.getAllValues() )
|
for( RepositoryEvent evt : event.getAllValues() )
|
||||||
{
|
{
|
||||||
if ( EventType.ARTIFACT_DESCRIPTOR_MISSING.equals( evt.getType() ) )
|
if ( EventType.ARTIFACT_DESCRIPTOR_MISSING.equals( evt.getType() ) )
|
||||||
|
@ -68,7 +68,7 @@ public class DefaultArtifactDescriptorReaderTest
|
||||||
missingArtifactDescriptor = true;
|
missingArtifactDescriptor = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !missingArtifactDescriptor )
|
if( !missingArtifactDescriptor )
|
||||||
{
|
{
|
||||||
fail( "Expected missing artifact descriptor for org.apache.maven.its:dep-mng5459:pom:0.4.0-20130404.090532-2" );
|
fail( "Expected missing artifact descriptor for org.apache.maven.its:dep-mng5459:pom:0.4.0-20130404.090532-2" );
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class RepositorySystemTest
|
||||||
ArtifactDescriptorRequest request = new ArtifactDescriptorRequest();
|
ArtifactDescriptorRequest request = new ArtifactDescriptorRequest();
|
||||||
request.setArtifact( artifact );
|
request.setArtifact( artifact );
|
||||||
request.addRepository( newTestRepository() );
|
request.addRepository( newTestRepository() );
|
||||||
|
|
||||||
ArtifactDescriptorResult result = system.readArtifactDescriptor( session, request );
|
ArtifactDescriptorResult result = system.readArtifactDescriptor( session, request );
|
||||||
|
|
||||||
List<Dependency> deps = result.getDependencies();
|
List<Dependency> deps = result.getDependencies();
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.maven.artifact.versioning.VersionRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maven Artifact interface. Notice that it mixes artifact definition concepts (groupId, artifactId, version)
|
* 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
|
public interface Artifact
|
||||||
extends Comparable<Artifact>
|
extends Comparable<Artifact>
|
||||||
|
|
|
@ -23,5 +23,5 @@ package org.apache.maven.artifact.metadata;
|
||||||
public interface ArtifactMetadata
|
public interface ArtifactMetadata
|
||||||
extends org.apache.maven.repository.legacy.metadata.ArtifactMetadata
|
extends org.apache.maven.repository.legacy.metadata.ArtifactMetadata
|
||||||
{
|
{
|
||||||
void merge( ArtifactMetadata metadata );
|
void merge( ArtifactMetadata metadata );
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class Authentication
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the user's password which is used when connecting to the repository.
|
* Get the user's password which is used when connecting to the repository.
|
||||||
*
|
*
|
||||||
* @return password of user
|
* @return password of user
|
||||||
*/
|
*/
|
||||||
public String getPassword()
|
public String getPassword()
|
||||||
|
@ -54,7 +54,7 @@ public class Authentication
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the user's password which is used when connecting to the repository.
|
* Set the user's password which is used when connecting to the repository.
|
||||||
*
|
*
|
||||||
* @param password password of the user
|
* @param password password of the user
|
||||||
*/
|
*/
|
||||||
public void setPassword( String password )
|
public void setPassword( String password )
|
||||||
|
@ -64,7 +64,7 @@ public class Authentication
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the username used to access the repository.
|
* Get the username used to access the repository.
|
||||||
*
|
*
|
||||||
* @return username at repository
|
* @return username at repository
|
||||||
*/
|
*/
|
||||||
public String getUsername()
|
public String getUsername()
|
||||||
|
@ -74,7 +74,7 @@ public class Authentication
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set username used to access the repository.
|
* Set username used to access the repository.
|
||||||
*
|
*
|
||||||
* @param userName the username used to access repository
|
* @param userName the username used to access repository
|
||||||
*/
|
*/
|
||||||
public void setUsername( final String userName )
|
public void setUsername( final String userName )
|
||||||
|
@ -85,7 +85,7 @@ public class Authentication
|
||||||
/**
|
/**
|
||||||
* Get the passphrase of the private key file. The passphrase is used only when host/protocol supports
|
* 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.
|
* authentication via exchange of private/public keys and private key was used for authentication.
|
||||||
*
|
*
|
||||||
* @return passphrase of the private key file
|
* @return passphrase of the private key file
|
||||||
*/
|
*/
|
||||||
public String getPassphrase()
|
public String getPassphrase()
|
||||||
|
@ -95,7 +95,7 @@ public class Authentication
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the passphrase of the private key file.
|
* Set the passphrase of the private key file.
|
||||||
*
|
*
|
||||||
* @param passphrase passphrase of the private key file
|
* @param passphrase passphrase of the private key file
|
||||||
*/
|
*/
|
||||||
public void setPassphrase( final String passphrase )
|
public void setPassphrase( final String passphrase )
|
||||||
|
@ -105,7 +105,7 @@ public class Authentication
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the absolute path to the private key file.
|
* Get the absolute path to the private key file.
|
||||||
*
|
*
|
||||||
* @return absolute path to private key
|
* @return absolute path to private key
|
||||||
*/
|
*/
|
||||||
public String getPrivateKey()
|
public String getPrivateKey()
|
||||||
|
@ -115,7 +115,7 @@ public class Authentication
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the absolute path to private key file.
|
* Set the absolute path to private key file.
|
||||||
*
|
*
|
||||||
* @param privateKey path to private key in local file system
|
* @param privateKey path to private key in local file system
|
||||||
*/
|
*/
|
||||||
public void setPrivateKey( final String privateKey )
|
public void setPrivateKey( final String privateKey )
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class AbstractArtifactResolutionException
|
||||||
|
|
||||||
private String classifier;
|
private String classifier;
|
||||||
|
|
||||||
private Artifact artifact;
|
private Artifact artifact;
|
||||||
|
|
||||||
private List<ArtifactRepository> remoteRepositories;
|
private List<ArtifactRepository> remoteRepositories;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Stack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic implementation of version comparison.
|
* Generic implementation of version comparison.
|
||||||
*
|
*
|
||||||
* <p>Features:
|
* <p>Features:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>mixing of '<code>-</code>' (dash) and '<code>.</code>' (dot) separators,</li>
|
* <li>mixing of '<code>-</code>' (dash) and '<code>.</code>' (dot) separators,</li>
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class VersionRangeTest
|
||||||
throws InvalidVersionSpecificationException, OverConstrainedVersionException
|
throws InvalidVersionSpecificationException, OverConstrainedVersionException
|
||||||
{
|
{
|
||||||
Artifact artifact = null;
|
Artifact artifact = null;
|
||||||
|
|
||||||
VersionRange range = VersionRange.createFromVersionSpec( "(,1.0]" );
|
VersionRange range = VersionRange.createFromVersionSpec( "(,1.0]" );
|
||||||
List<Restriction> restrictions = range.getRestrictions();
|
List<Restriction> restrictions = range.getRestrictions();
|
||||||
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
|
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
|
||||||
|
|
|
@ -54,10 +54,10 @@ public class DefaultArtifactInstaller
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private RepositorySystem repoSystem;
|
private RepositorySystem repoSystem;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private LegacySupport legacySupport;
|
private LegacySupport legacySupport;
|
||||||
|
|
||||||
/** @deprecated we want to use the artifact method only, and ensure artifact.file is set correctly. */
|
/** @deprecated we want to use the artifact method only, and ensure artifact.file is set correctly. */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void install( String basedir, String finalName, Artifact artifact, ArtifactRepository localRepository )
|
public void install( String basedir, String finalName, Artifact artifact, ArtifactRepository localRepository )
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.eclipse.aether.metadata.Metadata;
|
||||||
/**
|
/**
|
||||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
* <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.
|
* of the public API. In particular, this class can be changed or deleted without prior notice.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public final class MetadataBridge
|
public final class MetadataBridge
|
||||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.maven.artifact.repository.metadata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assists in handling repository metadata.
|
* Assists in handling repository metadata.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
class MetadataUtils
|
class MetadataUtils
|
||||||
|
|
|
@ -74,7 +74,7 @@ import org.eclipse.aether.resolution.ArtifactResult;
|
||||||
public class DefaultArtifactResolver
|
public class DefaultArtifactResolver
|
||||||
implements ArtifactResolver, Disposable
|
implements ArtifactResolver, Disposable
|
||||||
{
|
{
|
||||||
@Requirement
|
@Requirement
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
|
@ -88,7 +88,7 @@ public class DefaultArtifactResolver
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private ArtifactMetadataSource source;
|
private ArtifactMetadataSource source;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private PlexusContainer container;
|
private PlexusContainer container;
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ public class DefaultArtifactResolver
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
|
if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
|
||||||
{
|
{
|
||||||
File systemFile = artifact.getFile();
|
File systemFile = artifact.getFile();
|
||||||
|
@ -190,7 +190,7 @@ public class DefaultArtifactResolver
|
||||||
}
|
}
|
||||||
|
|
||||||
artifact.setResolved( true );
|
artifact.setResolved( true );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ public class DefaultArtifactResolver
|
||||||
.setArtifact( originatingArtifact )
|
.setArtifact( originatingArtifact )
|
||||||
.setResolveRoot( false )
|
.setResolveRoot( false )
|
||||||
// This is required by the surefire plugin
|
// This is required by the surefire plugin
|
||||||
.setArtifactDependencies( artifacts )
|
.setArtifactDependencies( artifacts )
|
||||||
.setManagedVersionMap( managedVersions )
|
.setManagedVersionMap( managedVersions )
|
||||||
.setLocalRepository( localRepository )
|
.setLocalRepository( localRepository )
|
||||||
.setRemoteRepositories( remoteRepositories )
|
.setRemoteRepositories( remoteRepositories )
|
||||||
|
@ -358,10 +358,10 @@ public class DefaultArtifactResolver
|
||||||
Set<Artifact> artifacts = request.getArtifactDependencies();
|
Set<Artifact> artifacts = request.getArtifactDependencies();
|
||||||
Map<String, Artifact> 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();
|
||||||
RepositorySystemSession session = getSession( request.getLocalRepository() );
|
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
|
//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 )
|
if ( source == null )
|
||||||
{
|
{
|
||||||
|
@ -393,9 +393,9 @@ public class DefaultArtifactResolver
|
||||||
// This is often an artifact like a POM that is taken from disk and we already have hold of the
|
// 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
|
// file reference. But this may be a Maven Plugin that we need to resolve from a remote repository
|
||||||
// as well as its dependencies.
|
// as well as its dependencies.
|
||||||
|
|
||||||
if ( request.isResolveRoot() /* && rootArtifact.getFile() == null */ )
|
if ( request.isResolveRoot() /* && rootArtifact.getFile() == null */ )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
resolve( rootArtifact, request.getRemoteRepositories(), session );
|
resolve( rootArtifact, request.getRemoteRepositories(), session );
|
||||||
|
@ -470,7 +470,7 @@ public class DefaultArtifactResolver
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( artifacts == null || artifacts.isEmpty() )
|
if ( artifacts == null || artifacts.isEmpty() )
|
||||||
{
|
{
|
||||||
if ( request.isResolveRoot() )
|
if ( request.isResolveRoot() )
|
||||||
|
@ -478,13 +478,13 @@ public class DefaultArtifactResolver
|
||||||
result.addArtifact( rootArtifact );
|
result.addArtifact( rootArtifact );
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// After the collection we will have the artifact object in the result but they will not be resolved yet.
|
// After the collection we will have the artifact object in the result but they will not be resolved yet.
|
||||||
result =
|
result =
|
||||||
artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source,
|
artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source,
|
||||||
collectionFilter, listeners, null );
|
collectionFilter, listeners, null );
|
||||||
|
|
||||||
// We have metadata retrieval problems, or there are cycles that have been detected
|
// 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
|
// so we give this back to the calling code and let them deal with this information
|
||||||
// appropriately.
|
// appropriately.
|
||||||
|
@ -528,14 +528,14 @@ public class DefaultArtifactResolver
|
||||||
// We want to send the root artifact back in the result but we need to do this after the other dependencies
|
// We want to send the root artifact back in the result but we need to do this after the other dependencies
|
||||||
// have been resolved.
|
// have been resolved.
|
||||||
if ( request.isResolveRoot() )
|
if ( request.isResolveRoot() )
|
||||||
{
|
{
|
||||||
// Add the root artifact (as the first artifact to retain logical order of class path!)
|
// Add the root artifact (as the first artifact to retain logical order of class path!)
|
||||||
Set<Artifact> allArtifacts = new LinkedHashSet<Artifact>();
|
Set<Artifact> allArtifacts = new LinkedHashSet<Artifact>();
|
||||||
allArtifacts.add( rootArtifact );
|
allArtifacts.add( rootArtifact );
|
||||||
allArtifacts.addAll( result.getArtifacts() );
|
allArtifacts.addAll( result.getArtifacts() );
|
||||||
result.setArtifacts( allArtifacts );
|
result.setArtifacts( allArtifacts );
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,14 +51,14 @@ public class InversionArtifactFilter
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !( obj instanceof InversionArtifactFilter ) )
|
if ( !( obj instanceof InversionArtifactFilter ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
InversionArtifactFilter other = (InversionArtifactFilter) obj;
|
InversionArtifactFilter other = (InversionArtifactFilter) obj;
|
||||||
|
|
||||||
return toInvert.equals( other.toInvert );
|
return toInvert.equals( other.toInvert );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.maven.artifact.Artifact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply multiple filters, accepting an artifact if at least one of the filters accepts it.
|
* Apply multiple filters, accepting an artifact if at least one of the filters accepts it.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class OrArtifactFilter
|
public class OrArtifactFilter
|
||||||
|
@ -79,15 +79,15 @@ public class OrArtifactFilter
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !( obj instanceof OrArtifactFilter ) )
|
if ( !( obj instanceof OrArtifactFilter ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OrArtifactFilter other = (OrArtifactFilter) obj;
|
OrArtifactFilter other = (OrArtifactFilter) obj;
|
||||||
|
|
||||||
return filters.equals( other.filters );
|
return filters.equals( other.filters );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,14 +52,14 @@ public class TypeArtifactFilter
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !( obj instanceof TypeArtifactFilter ) )
|
if ( !( obj instanceof TypeArtifactFilter ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeArtifactFilter other = (TypeArtifactFilter) obj;
|
TypeArtifactFilter other = (TypeArtifactFilter) obj;
|
||||||
|
|
||||||
return type.equals( other.type );
|
return type.equals( other.type );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.codehaus.plexus.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes runtime information about the application.
|
* Describes runtime information about the application.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
|
@ -64,9 +64,9 @@ public class ProfilesConversionUtils
|
||||||
activation.setProperty( prop );
|
activation.setProperty( prop );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ActivationOS profileOs = profileActivation.getOs();
|
ActivationOS profileOs = profileActivation.getOs();
|
||||||
|
|
||||||
if ( profileOs != null )
|
if ( profileOs != null )
|
||||||
{
|
{
|
||||||
org.apache.maven.model.ActivationOS os = new org.apache.maven.model.ActivationOS();
|
org.apache.maven.model.ActivationOS os = new org.apache.maven.model.ActivationOS();
|
||||||
|
@ -78,7 +78,7 @@ public class ProfilesConversionUtils
|
||||||
|
|
||||||
activation.setOs( os );
|
activation.setOs( os );
|
||||||
}
|
}
|
||||||
|
|
||||||
org.apache.maven.profiles.ActivationFile profileFile = profileActivation.getFile();
|
org.apache.maven.profiles.ActivationFile profileFile = profileActivation.getFile();
|
||||||
|
|
||||||
if ( profileFile != null )
|
if ( profileFile != null )
|
||||||
|
|
|
@ -70,15 +70,15 @@ public class OperatingSystemProfileActivator
|
||||||
{
|
{
|
||||||
String test = version;
|
String test = version;
|
||||||
boolean reverse = false;
|
boolean reverse = false;
|
||||||
|
|
||||||
if ( test.startsWith( "!" ) )
|
if ( test.startsWith( "!" ) )
|
||||||
{
|
{
|
||||||
reverse = true;
|
reverse = true;
|
||||||
test = test.substring( 1 );
|
test = test.substring( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean result = Os.isVersion( test );
|
boolean result = Os.isVersion( test );
|
||||||
|
|
||||||
if ( reverse )
|
if ( reverse )
|
||||||
{
|
{
|
||||||
return !result;
|
return !result;
|
||||||
|
@ -93,15 +93,15 @@ public class OperatingSystemProfileActivator
|
||||||
{
|
{
|
||||||
String test = arch;
|
String test = arch;
|
||||||
boolean reverse = false;
|
boolean reverse = false;
|
||||||
|
|
||||||
if ( test.startsWith( "!" ) )
|
if ( test.startsWith( "!" ) )
|
||||||
{
|
{
|
||||||
reverse = true;
|
reverse = true;
|
||||||
test = test.substring( 1 );
|
test = test.substring( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean result = Os.isArch( test );
|
boolean result = Os.isArch( test );
|
||||||
|
|
||||||
if ( reverse )
|
if ( reverse )
|
||||||
{
|
{
|
||||||
return !result;
|
return !result;
|
||||||
|
@ -116,7 +116,7 @@ public class OperatingSystemProfileActivator
|
||||||
{
|
{
|
||||||
String test = name;
|
String test = name;
|
||||||
boolean reverse = false;
|
boolean reverse = false;
|
||||||
|
|
||||||
if ( test.startsWith( "!" ) )
|
if ( test.startsWith( "!" ) )
|
||||||
{
|
{
|
||||||
reverse = true;
|
reverse = true;
|
||||||
|
@ -139,15 +139,15 @@ public class OperatingSystemProfileActivator
|
||||||
{
|
{
|
||||||
String test = family;
|
String test = family;
|
||||||
boolean reverse = false;
|
boolean reverse = false;
|
||||||
|
|
||||||
if ( test.startsWith( "!" ) )
|
if ( test.startsWith( "!" ) )
|
||||||
{
|
{
|
||||||
reverse = true;
|
reverse = true;
|
||||||
test = test.substring( 1 );
|
test = test.substring( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean result = Os.isFamily( test );
|
boolean result = Os.isFamily( test );
|
||||||
|
|
||||||
if ( reverse )
|
if ( reverse )
|
||||||
{
|
{
|
||||||
return !result;
|
return !result;
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class BuildTimestampValueSource
|
||||||
private final Date startTime;
|
private final Date startTime;
|
||||||
|
|
||||||
private final String format;
|
private final String format;
|
||||||
|
|
||||||
private String formattedDate;
|
private String formattedDate;
|
||||||
|
|
||||||
public BuildTimestampValueSource( Date startTime, String format )
|
public BuildTimestampValueSource( Date startTime, String format )
|
||||||
|
@ -53,7 +53,7 @@ public class BuildTimestampValueSource
|
||||||
{
|
{
|
||||||
formattedDate = new SimpleDateFormat( format ).format( startTime );
|
formattedDate = new SimpleDateFormat( format ).format( startTime );
|
||||||
}
|
}
|
||||||
|
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class RegexBasedModelInterpolator
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public RegexBasedModelInterpolator( PathTranslator pathTranslator )
|
public RegexBasedModelInterpolator( PathTranslator pathTranslator )
|
||||||
{
|
{
|
||||||
super( pathTranslator );
|
super( pathTranslator );
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.maven.model.Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks the model for missing or invalid values.
|
* Checks the model for missing or invalid values.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
|
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.apache.maven.settings.Mirror;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the selection of mirrors for repositories.
|
* Handles the selection of mirrors for repositories.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public interface MirrorSelector
|
public interface MirrorSelector
|
||||||
|
@ -34,7 +34,7 @@ public interface MirrorSelector
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines the mirror for the specified repository.
|
* Determines the mirror for the specified repository.
|
||||||
*
|
*
|
||||||
* @param repository The repository to determine the mirror for, must not be {@code null}.
|
* @param repository The repository to determine the mirror for, must not be {@code null}.
|
||||||
* @param mirrors The available mirrors, may 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.
|
* @return The mirror specification for the repository or {@code null} if no mirror matched.
|
||||||
|
|
|
@ -29,18 +29,18 @@ public class UserLocalArtifactRepository
|
||||||
extends LocalArtifactRepository
|
extends LocalArtifactRepository
|
||||||
{
|
{
|
||||||
private ArtifactRepository localRepository;
|
private ArtifactRepository localRepository;
|
||||||
|
|
||||||
public UserLocalArtifactRepository( ArtifactRepository localRepository )
|
public UserLocalArtifactRepository( ArtifactRepository localRepository )
|
||||||
{
|
{
|
||||||
this.localRepository = localRepository;
|
this.localRepository = localRepository;
|
||||||
setLayout( localRepository.getLayout() );
|
setLayout( localRepository.getLayout() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Artifact find( Artifact artifact )
|
public Artifact find( Artifact artifact )
|
||||||
{
|
{
|
||||||
File artifactFile = new File( localRepository.getBasedir(), pathOf( 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
|
// 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.
|
// with multiple local repository implementations yet.
|
||||||
artifact.setFile( artifactFile );
|
artifact.setFile( artifactFile );
|
||||||
|
@ -53,13 +53,13 @@ public class UserLocalArtifactRepository
|
||||||
{
|
{
|
||||||
return localRepository.getId();
|
return localRepository.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
|
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
|
||||||
{
|
{
|
||||||
return localRepository.pathOfLocalRepositoryMetadata( metadata, repository );
|
return localRepository.pathOfLocalRepositoryMetadata( metadata, repository );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String pathOf( Artifact artifact )
|
public String pathOf( Artifact artifact )
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,8 +79,8 @@ public class DefaultWagonManager
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private LegacySupport legacySupport;
|
private LegacySupport legacySupport;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Retriever
|
// Retriever
|
||||||
//
|
//
|
||||||
|
@ -235,12 +235,12 @@ public class DefaultWagonManager
|
||||||
private void connectWagon( Wagon wagon, ArtifactRepository repository )
|
private void connectWagon( Wagon wagon, ArtifactRepository repository )
|
||||||
throws ConnectionException, AuthenticationException
|
throws ConnectionException, AuthenticationException
|
||||||
{
|
{
|
||||||
// MNG-5509
|
// MNG-5509
|
||||||
// See org.eclipse.aether.connector.wagon.WagonRepositoryConnector.connectWagon(Wagon)
|
// See org.eclipse.aether.connector.wagon.WagonRepositoryConnector.connectWagon(Wagon)
|
||||||
if( legacySupport.getRepositorySession() != null )
|
if( legacySupport.getRepositorySession() != null )
|
||||||
{
|
{
|
||||||
Properties headers = new Properties();
|
Properties headers = new Properties();
|
||||||
|
|
||||||
headers.put( "User-Agent", ConfigUtils.getString( legacySupport.getRepositorySession(), "Maven",
|
headers.put( "User-Agent", ConfigUtils.getString( legacySupport.getRepositorySession(), "Maven",
|
||||||
ConfigurationProperties.USER_AGENT ) );
|
ConfigurationProperties.USER_AGENT ) );
|
||||||
try
|
try
|
||||||
|
@ -257,7 +257,7 @@ public class DefaultWagonManager
|
||||||
logger.debug( "Could not set user agent for wagon " + wagon.getClass().getName() + ": " + e );
|
logger.debug( "Could not set user agent for wagon " + wagon.getClass().getName() + ": " + e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( repository.getProxy() != null && logger.isDebugEnabled() )
|
if ( repository.getProxy() != null && logger.isDebugEnabled() )
|
||||||
{
|
{
|
||||||
logger.debug( "Using proxy " + repository.getProxy().getHost() + ":" + repository.getProxy().getPort()
|
logger.debug( "Using proxy " + repository.getProxy().getHost() + ":" + repository.getProxy().getPort()
|
||||||
|
@ -802,7 +802,7 @@ public class DefaultWagonManager
|
||||||
throw new UnsupportedProtocolException( "Cannot find wagon which supports the requested protocol: "
|
throw new UnsupportedProtocolException( "Cannot find wagon which supports the requested protocol: "
|
||||||
+ protocol, e );
|
+ protocol, e );
|
||||||
}
|
}
|
||||||
|
|
||||||
return wagon;
|
return wagon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,8 +88,8 @@ under the License.
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
This is a set of Artifact instances resolved from the set of dependencies for
|
This is a set of Artifact instances resolved from the set of dependencies for
|
||||||
the current project.
|
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.
|
current POM, since Maven uses transitive, or chained, dependency resolution.
|
||||||
]]></description>
|
]]></description>
|
||||||
</expression>
|
</expression>
|
||||||
|
@ -120,7 +120,7 @@ under the License.
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
This is the list of Artifact instances for plugins used in the current build
|
This is the list of Artifact instances for plugins used in the current build
|
||||||
for this project.
|
for this project.
|
||||||
|
|
||||||
NOTE: This list may contain plugin Artifacts which are implied by the current POM's
|
NOTE: This list may contain plugin Artifacts which are implied by the current POM's
|
||||||
packaging and the lifecycle phase being built.
|
packaging and the lifecycle phase being built.
|
||||||
]]></description>
|
]]></description>
|
||||||
|
@ -137,7 +137,7 @@ under the License.
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
This is a list of ArtifactRepository instances used to resolve the Artifacts associated
|
This is a list of ArtifactRepository instances used to resolve the Artifacts associated
|
||||||
with the current POM.
|
with the current POM.
|
||||||
|
|
||||||
NOTE: This list will contain entries for repositories specified by ancestor POMs, including
|
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.
|
the default built-in super-POM, which is the parent of all POMs.
|
||||||
]]></description>
|
]]></description>
|
||||||
|
@ -154,7 +154,7 @@ under the License.
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
This is a list of ArtifactRepository instances used to resolve the Artifacts associated
|
This is a list of ArtifactRepository instances used to resolve the Artifacts associated
|
||||||
with plugins used in building the current POM.
|
with plugins used in building the current POM.
|
||||||
|
|
||||||
NOTE: This list will contain entries for repositories specified by ancestor POMs, including
|
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.
|
the default built-in super-POM, which is the parent of all POMs.
|
||||||
]]></description>
|
]]></description>
|
||||||
|
|
|
@ -27,8 +27,8 @@ under the License.
|
||||||
<configuration>
|
<configuration>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Inside ~/.m2/settings.xml:
|
Inside ~/.m2/settings.xml:
|
||||||
|
|
||||||
<localRepository>/path/to/local/repository</localRepository>
|
<localRepository>/path/to/local/repository</localRepository>
|
||||||
]]></configuration>
|
]]></configuration>
|
||||||
<description>The ArtifactRepository instance referencing the local artifact
|
<description>The ArtifactRepository instance referencing the local artifact
|
||||||
repository.</description>
|
repository.</description>
|
||||||
|
|
|
@ -85,7 +85,7 @@ public abstract class AbstractArtifactComponentTestCase
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
artifactFactory = lookup( ArtifactFactory.class);
|
artifactFactory = lookup( ArtifactFactory.class);
|
||||||
artifactRepositoryFactory = lookup( ArtifactRepositoryFactory.class );
|
artifactRepositoryFactory = lookup( ArtifactRepositoryFactory.class );
|
||||||
|
|
||||||
RepositorySystemSession repoSession = initRepoSession();
|
RepositorySystemSession repoSession = initRepoSession();
|
||||||
|
@ -96,13 +96,13 @@ public abstract class AbstractArtifactComponentTestCase
|
||||||
LegacySupport legacySupport = lookup(LegacySupport.class);
|
LegacySupport legacySupport = lookup(LegacySupport.class);
|
||||||
legacySupport.setSession( session );
|
legacySupport.setSession( session );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown()
|
protected void tearDown()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
release( artifactFactory );
|
release( artifactFactory );
|
||||||
|
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ public abstract class AbstractArtifactComponentTestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an existing file, not a directory - causes creation to fail.
|
* Return an existing file, not a directory - causes creation to fail.
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected ArtifactRepository badLocalRepository()
|
protected ArtifactRepository badLocalRepository()
|
||||||
|
@ -314,7 +314,7 @@ public abstract class AbstractArtifactComponentTestCase
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
Artifact a = artifactFactory.createBuildArtifact( groupId, artifactId, version, type );
|
Artifact a = artifactFactory.createBuildArtifact( groupId, artifactId, version, type );
|
||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import junit.framework.TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link ArtifactUtils}.
|
* Tests {@link ArtifactUtils}.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class ArtifactUtilsTest
|
public class ArtifactUtilsTest
|
||||||
|
|
|
@ -26,19 +26,19 @@ import org.codehaus.plexus.PlexusTestCase;
|
||||||
public class DefaultArtifactFactoryTest
|
public class DefaultArtifactFactoryTest
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public void testPropagationOfSystemScopeRegardlessOfInheritedScope() throws Exception
|
public void testPropagationOfSystemScopeRegardlessOfInheritedScope() throws Exception
|
||||||
{
|
{
|
||||||
ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
|
ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
|
||||||
|
|
||||||
Artifact artifact = factory.createDependencyArtifact( "test-grp", "test-artifact", VersionRange.createFromVersion("1.0"), "type", null, "system", "provided" );
|
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 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 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" );
|
Artifact artifact4 = factory.createDependencyArtifact( "test-grp", "test-artifact-4", VersionRange.createFromVersion("1.0"), "type", null, "system", "compile" );
|
||||||
|
|
||||||
// this one should never happen in practice...
|
// this one should never happen in practice...
|
||||||
Artifact artifact5 = factory.createDependencyArtifact( "test-grp", "test-artifact-5", VersionRange.createFromVersion("1.0"), "type", null, "system", "system" );
|
Artifact artifact5 = factory.createDependencyArtifact( "test-grp", "test-artifact-5", VersionRange.createFromVersion("1.0"), "type", null, "system", "system" );
|
||||||
|
|
||||||
assertEquals( "system", artifact.getScope() );
|
assertEquals( "system", artifact.getScope() );
|
||||||
assertEquals( "system", artifact2.getScope() );
|
assertEquals( "system", artifact2.getScope() );
|
||||||
assertEquals( "system", artifact3.getScope() );
|
assertEquals( "system", artifact3.getScope() );
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class TestMetadataSource
|
||||||
{
|
{
|
||||||
@Requirement
|
@Requirement
|
||||||
private ArtifactFactory factory;
|
private ArtifactFactory factory;
|
||||||
|
|
||||||
public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
|
public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
|
||||||
throws ArtifactMetadataRetrievalException
|
throws ArtifactMetadataRetrievalException
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@ public class TestMetadataSource
|
||||||
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( "i".equals( artifact.getArtifactId() ) )
|
if ( "i".equals( artifact.getArtifactId() ) )
|
||||||
{
|
{
|
||||||
Artifact a = null;
|
Artifact a = null;
|
||||||
|
@ -70,7 +70,7 @@ public class TestMetadataSource
|
||||||
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ResolutionGroup( artifact, dependencies, remoteRepositories );
|
return new ResolutionGroup( artifact, dependencies, remoteRepositories );
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class MavenArtifactRepositoryTest
|
||||||
private static class MavenArtifactRepositorySubclass extends MavenArtifactRepository
|
private static class MavenArtifactRepositorySubclass extends MavenArtifactRepository
|
||||||
{
|
{
|
||||||
String id;
|
String id;
|
||||||
|
|
||||||
public MavenArtifactRepositorySubclass(String id)
|
public MavenArtifactRepositorySubclass(String id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import junit.framework.TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the artifact resolution exception message
|
* Test the artifact resolution exception message
|
||||||
*
|
*
|
||||||
* @author Mauro Talevi
|
* @author Mauro Talevi
|
||||||
*/
|
*/
|
||||||
public class ArtifactResolutionExceptionTest
|
public class ArtifactResolutionExceptionTest
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class ArtifactResolverTest
|
||||||
|
|
||||||
projectArtifact = createLocalArtifact( "project", "3.0" );
|
projectArtifact = createLocalArtifact( "project", "3.0" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown()
|
protected void tearDown()
|
||||||
throws Exception
|
throws Exception
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.maven.wagon.providers.file.FileWagon;
|
||||||
import org.apache.maven.wagon.resource.Resource;
|
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
|
public class TestFileWagon
|
||||||
extends FileWagon
|
extends FileWagon
|
||||||
|
@ -38,10 +38,10 @@ public class TestFileWagon
|
||||||
private TestTransferListener testTransferListener;
|
private TestTransferListener testTransferListener;
|
||||||
private boolean insideGet;
|
private boolean insideGet;
|
||||||
|
|
||||||
protected void getTransfer( Resource resource,
|
protected void getTransfer( Resource resource,
|
||||||
File destination,
|
File destination,
|
||||||
InputStream input,
|
InputStream input,
|
||||||
boolean closeInput,
|
boolean closeInput,
|
||||||
int maxSize )
|
int maxSize )
|
||||||
throws TransferFailedException
|
throws TransferFailedException
|
||||||
{
|
{
|
||||||
|
@ -50,16 +50,16 @@ public class TestFileWagon
|
||||||
}
|
}
|
||||||
|
|
||||||
public void get( String resourceName, File destination )
|
public void get( String resourceName, File destination )
|
||||||
throws TransferFailedException,
|
throws TransferFailedException,
|
||||||
ResourceDoesNotExistException,
|
ResourceDoesNotExistException,
|
||||||
AuthorizationException
|
AuthorizationException
|
||||||
{
|
{
|
||||||
addTransfer( "get " + resourceName );
|
addTransfer( "get " + resourceName );
|
||||||
|
|
||||||
insideGet = true;
|
insideGet = true;
|
||||||
|
|
||||||
super.get( resourceName, destination );
|
super.get( resourceName, destination );
|
||||||
|
|
||||||
insideGet = false;
|
insideGet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ public class TestFileWagon
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getIfNewer( String resourceName, File destination, long timestamp )
|
public boolean getIfNewer( String resourceName, File destination, long timestamp )
|
||||||
throws TransferFailedException,
|
throws TransferFailedException,
|
||||||
ResourceDoesNotExistException,
|
ResourceDoesNotExistException,
|
||||||
AuthorizationException
|
AuthorizationException
|
||||||
{
|
{
|
||||||
if ( !insideGet )
|
if ( !insideGet )
|
||||||
|
|
|
@ -27,7 +27,7 @@ import junit.framework.TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link AndArtifactFilter}.
|
* Tests {@link AndArtifactFilter}.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class AndArtifactFilterTest
|
public class AndArtifactFilterTest
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class FilterHashEqualsTest
|
||||||
assertTrue( f1.equals(f2) );
|
assertTrue( f1.equals(f2) );
|
||||||
assertTrue( f2.equals(f1) );
|
assertTrue( f2.equals(f1) );
|
||||||
assertTrue( f1.hashCode() == f2.hashCode() );
|
assertTrue( f1.hashCode() == f2.hashCode() );
|
||||||
|
|
||||||
IncludesArtifactFilter f3 = new IncludesArtifactFilter( Arrays.asList( "d", "c", "e" ) );
|
IncludesArtifactFilter f3 = new IncludesArtifactFilter( Arrays.asList( "d", "c", "e" ) );
|
||||||
assertTrue( f1.equals( f3 ) );
|
assertTrue( f1.equals( f3 ) );
|
||||||
assertTrue( f1.hashCode() == f3.hashCode() );
|
assertTrue( f1.hashCode() == f3.hashCode() );
|
||||||
|
|
|
@ -27,7 +27,7 @@ import junit.framework.TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link OrArtifactFilter}.
|
* Tests {@link OrArtifactFilter}.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class OrArtifactFilterTest
|
public class OrArtifactFilterTest
|
||||||
|
|
|
@ -26,7 +26,7 @@ import junit.framework.TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link ScopeArtifactFilter}.
|
* Tests {@link ScopeArtifactFilter}.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class ScopeArtifactFilterTest
|
public class ScopeArtifactFilterTest
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class DefaultProfileManagerTest
|
||||||
assertEquals( 1, active.size() );
|
assertEquals( 1, active.size() );
|
||||||
assertEquals( "syspropActivated", ( (Profile) active.get( 0 ) ).getId() );
|
assertEquals( "syspropActivated", ( (Profile) active.get( 0 ) ).getId() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testShouldNotActivateReversalOfPresentSystemProperty()
|
public void testShouldNotActivateReversalOfPresentSystemProperty()
|
||||||
throws Exception
|
throws Exception
|
||||||
|
|
|
@ -6,9 +6,9 @@ package org.apache.maven.project;
|
||||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
* 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
|
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||||
* copy of the License at
|
* copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
* 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
|
* 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
|
* or implied. See the License for the specific language governing permissions and limitations under
|
||||||
|
@ -55,7 +55,7 @@ public abstract class AbstractMavenProjectTestCase
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
if ( getContainer().hasComponent( ProjectBuilder.class, "test" ) )
|
if ( getContainer().hasComponent( ProjectBuilder.class, "test" ) )
|
||||||
{
|
{
|
||||||
projectBuilder = lookup( ProjectBuilder.class, "test" );
|
projectBuilder = lookup( ProjectBuilder.class, "test" );
|
||||||
|
@ -65,9 +65,9 @@ public abstract class AbstractMavenProjectTestCase
|
||||||
// default over to the main project builder...
|
// default over to the main project builder...
|
||||||
projectBuilder = lookup( ProjectBuilder.class );
|
projectBuilder = lookup( ProjectBuilder.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
repositorySystem = lookup( RepositorySystem.class );
|
repositorySystem = lookup( RepositorySystem.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown()
|
protected void tearDown()
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.maven.plugin.MojoExecution;
|
||||||
/**
|
/**
|
||||||
* A stub implementation that assumes an empty lifecycle to bypass interaction with the plugin manager and to avoid
|
* A stub implementation that assumes an empty lifecycle to bypass interaction with the plugin manager and to avoid
|
||||||
* plugin artifact resolution from repositories.
|
* plugin artifact resolution from repositories.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class EmptyLifecycleExecutor
|
public class EmptyLifecycleExecutor
|
||||||
|
|
|
@ -45,9 +45,9 @@ public class ProjectClasspathTest
|
||||||
// the metadata source looks up the default impl, so we have to trick it
|
// the metadata source looks up the default impl, so we have to trick it
|
||||||
getContainer().addComponent( projectBuilder, ProjectBuilder.class, "default" );
|
getContainer().addComponent( projectBuilder, ProjectBuilder.class, "default" );
|
||||||
|
|
||||||
repositorySystem = lookup( RepositorySystem.class );
|
repositorySystem = lookup( RepositorySystem.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getCustomConfigurationName()
|
protected String getCustomConfigurationName()
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,16 +26,16 @@ import org.codehaus.plexus.component.annotations.Component;
|
||||||
@Component(role=ProjectBuilder.class,hint="classpath")
|
@Component(role=ProjectBuilder.class,hint="classpath")
|
||||||
public class TestProjectBuilder
|
public class TestProjectBuilder
|
||||||
extends DefaultProjectBuilder
|
extends DefaultProjectBuilder
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectBuildingResult build( Artifact artifact, ProjectBuildingRequest request )
|
public ProjectBuildingResult build( Artifact artifact, ProjectBuildingRequest request )
|
||||||
throws ProjectBuildingException
|
throws ProjectBuildingException
|
||||||
{
|
{
|
||||||
if ( "maven-test".equals( artifact.getGroupId() ) )
|
if ( "maven-test".equals( artifact.getGroupId() ) )
|
||||||
{
|
{
|
||||||
String scope = artifact.getArtifactId().substring( "scope-".length() );
|
String scope = artifact.getArtifactId().substring( "scope-".length() );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
artifact.setFile( ProjectClasspathTest.getFileForClasspathResource( ProjectClasspathTest.dir + "transitive-" + scope + "-dep.xml" ) );
|
artifact.setFile( ProjectClasspathTest.getFileForClasspathResource( ProjectClasspathTest.dir + "transitive-" + scope + "-dep.xml" ) );
|
||||||
|
|
|
@ -63,16 +63,16 @@ public class ProjectInheritanceTest
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
System.out.println( "Local repository is at: " + localRepo.getAbsolutePath() );
|
System.out.println( "Local repository is at: " + localRepo.getAbsolutePath() );
|
||||||
|
|
||||||
File pom0 = new File( localRepo, "p0/pom.xml" );
|
File pom0 = new File( localRepo, "p0/pom.xml" );
|
||||||
File pom1 = new File( pom0.getParentFile(), "p1/pom.xml" );
|
File pom1 = new File( pom0.getParentFile(), "p1/pom.xml" );
|
||||||
File pom2 = new File( pom1.getParentFile(), "p2/pom.xml" );
|
File pom2 = new File( pom1.getParentFile(), "p2/pom.xml" );
|
||||||
File pom3 = new File( pom2.getParentFile(), "p3/pom.xml" );
|
File pom3 = new File( pom2.getParentFile(), "p3/pom.xml" );
|
||||||
File pom4 = new File( pom3.getParentFile(), "p4/pom.xml" );
|
File pom4 = new File( pom3.getParentFile(), "p4/pom.xml" );
|
||||||
File pom5 = new File( pom4.getParentFile(), "p5/pom.xml" );
|
File pom5 = new File( pom4.getParentFile(), "p5/pom.xml" );
|
||||||
|
|
||||||
System.out.println( "Location of project-4's POM: " + pom4.getPath() );
|
System.out.println( "Location of project-4's POM: " + pom4.getPath() );
|
||||||
|
|
||||||
// load everything...
|
// load everything...
|
||||||
|
@ -114,22 +114,22 @@ public class ProjectInheritanceTest
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
assertEquals( "4.0.0", project4.getModelVersion() );
|
assertEquals( "4.0.0", project4.getModelVersion() );
|
||||||
|
|
||||||
Build build = project4.getBuild();
|
Build build = project4.getBuild();
|
||||||
List<Plugin> plugins = build.getPlugins();
|
List<Plugin> plugins = build.getPlugins();
|
||||||
|
|
||||||
Map validPluginCounts = new HashMap();
|
Map validPluginCounts = new HashMap();
|
||||||
|
|
||||||
String testPluginArtifactId = "maven-compiler-plugin";
|
String testPluginArtifactId = "maven-compiler-plugin";
|
||||||
|
|
||||||
// this is the plugin we're looking for.
|
// this is the plugin we're looking for.
|
||||||
validPluginCounts.put( testPluginArtifactId, 0 );
|
validPluginCounts.put( testPluginArtifactId, 0 );
|
||||||
|
|
||||||
// these are injected if -DperformRelease=true
|
// these are injected if -DperformRelease=true
|
||||||
validPluginCounts.put( "maven-deploy-plugin", 0 );
|
validPluginCounts.put( "maven-deploy-plugin", 0 );
|
||||||
validPluginCounts.put( "maven-javadoc-plugin", 0 );
|
validPluginCounts.put( "maven-javadoc-plugin", 0 );
|
||||||
validPluginCounts.put( "maven-source-plugin", 0 );
|
validPluginCounts.put( "maven-source-plugin", 0 );
|
||||||
|
|
||||||
Plugin testPlugin = null;
|
Plugin testPlugin = null;
|
||||||
|
|
||||||
for ( Plugin plugin : plugins )
|
for ( Plugin plugin : plugins )
|
||||||
|
@ -161,9 +161,9 @@ public class ProjectInheritanceTest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List executions = testPlugin.getExecutions();
|
List executions = testPlugin.getExecutions();
|
||||||
|
|
||||||
assertEquals( 1, executions.size() );
|
assertEquals( 1, executions.size() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
package org.apache.maven.repository;
|
package org.apache.maven.repository;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
* distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
* to you under the Apache License, Version 2.0 (the
|
* to you under the Apache License, Version 2.0 (the
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class LegacyRepositoryLayout
|
||||||
{
|
{
|
||||||
return "legacy";
|
return "legacy";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String pathOf( Artifact artifact )
|
public String pathOf( Artifact artifact )
|
||||||
{
|
{
|
||||||
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
|
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
|
||||||
|
|
|
@ -6,9 +6,9 @@ package org.apache.maven.repository;
|
||||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
* 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
|
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||||
* copy of the License at
|
* copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
* 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
|
* 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
|
* or implied. See the License for the specific language governing permissions and limitations under
|
||||||
|
@ -41,7 +41,7 @@ import org.eclipse.aether.repository.LocalRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link LegacyRepositorySystem}.
|
* Tests {@link LegacyRepositorySystem}.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class LegacyRepositorySystemTest
|
public class LegacyRepositorySystemTest
|
||||||
|
@ -76,7 +76,7 @@ public class LegacyRepositorySystemTest
|
||||||
resolutionErrorHandler = null;
|
resolutionErrorHandler = null;
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<ArtifactRepository> getRemoteRepositories()
|
protected List<ArtifactRepository> getRemoteRepositories()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
|
@ -116,14 +116,14 @@ public class LegacyRepositorySystemTest
|
||||||
d.setVersion( "0.1" );
|
d.setVersion( "0.1" );
|
||||||
d.setScope( Artifact.SCOPE_COMPILE );
|
d.setScope( Artifact.SCOPE_COMPILE );
|
||||||
Artifact artifact = repositorySystem.createDependencyArtifact( d );
|
Artifact artifact = repositorySystem.createDependencyArtifact( d );
|
||||||
|
|
||||||
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
|
ArtifactResolutionRequest request = new ArtifactResolutionRequest()
|
||||||
.setArtifact( artifact )
|
.setArtifact( artifact )
|
||||||
.setResolveRoot( true )
|
.setResolveRoot( true )
|
||||||
.setResolveTransitively( true )
|
.setResolveTransitively( true )
|
||||||
.setRemoteRepositories( getRemoteRepositories() )
|
.setRemoteRepositories( getRemoteRepositories() )
|
||||||
.setLocalRepository( getLocalRepository() );
|
.setLocalRepository( getLocalRepository() );
|
||||||
|
|
||||||
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
|
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
|
||||||
LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() );
|
LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() );
|
||||||
session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( session, localRepo ) );
|
session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( session, localRepo ) );
|
||||||
|
@ -132,19 +132,19 @@ public class LegacyRepositorySystemTest
|
||||||
new DefaultMavenExecutionResult() ) );
|
new DefaultMavenExecutionResult() ) );
|
||||||
|
|
||||||
ArtifactResolutionResult result = repositorySystem.resolve( request );
|
ArtifactResolutionResult result = repositorySystem.resolve( request );
|
||||||
resolutionErrorHandler.throwErrors( request, result );
|
resolutionErrorHandler.throwErrors( request, result );
|
||||||
assertEquals( 2, result.getArtifacts().size() );
|
assertEquals( 2, result.getArtifacts().size() );
|
||||||
|
|
||||||
|
//
|
||||||
|
// System scoped version which should
|
||||||
//
|
//
|
||||||
// System scoped version which should
|
|
||||||
//
|
|
||||||
d.setScope( Artifact.SCOPE_SYSTEM );
|
d.setScope( Artifact.SCOPE_SYSTEM );
|
||||||
File file = new File( getBasedir(), "src/test/repository-system/maven-core-2.1.0.jar" );
|
File file = new File( getBasedir(), "src/test/repository-system/maven-core-2.1.0.jar" );
|
||||||
assertTrue( file.exists() );
|
assertTrue( file.exists() );
|
||||||
d.setSystemPath( file.getCanonicalPath() );
|
d.setSystemPath( file.getCanonicalPath() );
|
||||||
|
|
||||||
artifact = repositorySystem.createDependencyArtifact( d );
|
artifact = repositorySystem.createDependencyArtifact( d );
|
||||||
|
|
||||||
//
|
//
|
||||||
// The request has not set any local or remote repositories as the system scoped dependency being resolved should only
|
// 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.
|
// give us the dependency off the disk and nothing more.
|
||||||
|
@ -153,19 +153,19 @@ public class LegacyRepositorySystemTest
|
||||||
.setArtifact( artifact )
|
.setArtifact( artifact )
|
||||||
.setResolveRoot( true )
|
.setResolveRoot( true )
|
||||||
.setResolveTransitively( true );
|
.setResolveTransitively( true );
|
||||||
|
|
||||||
result = repositorySystem.resolve( request );
|
result = repositorySystem.resolve( request );
|
||||||
resolutionErrorHandler.throwErrors( request, result );
|
resolutionErrorHandler.throwErrors( request, result );
|
||||||
assertEquals( 1, result.getArtifacts().size() );
|
assertEquals( 1, result.getArtifacts().size() );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Put in a bogus file to make sure missing files cause the resolution to fail.
|
// 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" );
|
file = new File( getBasedir(), "src/test/repository-system/maven-monkey-2.1.0.jar" );
|
||||||
assertFalse( file.exists() );
|
assertFalse( file.exists() );
|
||||||
d.setSystemPath( file.getCanonicalPath() );
|
d.setSystemPath( file.getCanonicalPath() );
|
||||||
artifact = repositorySystem.createDependencyArtifact( d );
|
artifact = repositorySystem.createDependencyArtifact( d );
|
||||||
|
|
||||||
//
|
//
|
||||||
// The request has not set any local or remote repositories as the system scoped dependency being resolved should only
|
// 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.
|
// give us the dependency off the disk and nothing more.
|
||||||
|
@ -174,7 +174,7 @@ public class LegacyRepositorySystemTest
|
||||||
.setArtifact( artifact )
|
.setArtifact( artifact )
|
||||||
.setResolveRoot( true )
|
.setResolveRoot( true )
|
||||||
.setResolveTransitively( true );
|
.setResolveTransitively( true );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = repositorySystem.resolve( request );
|
result = repositorySystem.resolve( request );
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class DefaultUpdateCheckManagerTest
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
|
||||||
Artifact a = createArtifact( "a", "0.0.1-SNAPSHOT" );
|
Artifact a = createArtifact( "a", "0.0.1-SNAPSHOT" );
|
||||||
File file = new File( localRepository.getBasedir(),
|
File file = new File( localRepository.getBasedir(),
|
||||||
localRepository.pathOf( a ) );
|
localRepository.pathOf( a ) );
|
||||||
file.delete();
|
file.delete();
|
||||||
a.setFile( file );
|
a.setFile( file );
|
||||||
|
@ -77,7 +77,7 @@ public class DefaultUpdateCheckManagerTest
|
||||||
|
|
||||||
assertNull( updateCheckManager.readLastUpdated( touchFile,
|
assertNull( updateCheckManager.readLastUpdated( touchFile,
|
||||||
updateCheckManager.getRepositoryKey( remoteRepository ) ) );
|
updateCheckManager.getRepositoryKey( remoteRepository ) ) );
|
||||||
|
|
||||||
assertFalse( updateCheckManager.getTouchfile( a ).exists() );
|
assertFalse( updateCheckManager.getTouchfile( a ).exists() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class DefaultUpdateCheckManagerTest
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
|
||||||
Artifact a = createArtifact( "a", "0.0.1-SNAPSHOT" );
|
Artifact a = createArtifact( "a", "0.0.1-SNAPSHOT" );
|
||||||
File file = new File( localRepository.getBasedir(),
|
File file = new File( localRepository.getBasedir(),
|
||||||
localRepository.pathOf( a ) );
|
localRepository.pathOf( a ) );
|
||||||
file.delete();
|
file.delete();
|
||||||
a.setFile( file );
|
a.setFile( file );
|
||||||
|
@ -115,7 +115,7 @@ public class DefaultUpdateCheckManagerTest
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
|
||||||
Artifact a = createArtifact( "a", "0.0.1", "pom" );
|
Artifact a = createArtifact( "a", "0.0.1", "pom" );
|
||||||
File file = new File( localRepository.getBasedir(),
|
File file = new File( localRepository.getBasedir(),
|
||||||
localRepository.pathOf( a ) );
|
localRepository.pathOf( a ) );
|
||||||
file.delete();
|
file.delete();
|
||||||
a.setFile( file );
|
a.setFile( file );
|
||||||
|
@ -133,7 +133,7 @@ public class DefaultUpdateCheckManagerTest
|
||||||
|
|
||||||
assertNull( updateCheckManager.readLastUpdated( touchFile,
|
assertNull( updateCheckManager.readLastUpdated( touchFile,
|
||||||
updateCheckManager.getRepositoryKey( remoteRepository ) ) );
|
updateCheckManager.getRepositoryKey( remoteRepository ) ) );
|
||||||
|
|
||||||
assertFalse( updateCheckManager.getTouchfile( a ).exists() );
|
assertFalse( updateCheckManager.getTouchfile( a ).exists() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ public class DefaultUpdateCheckManagerTest
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
|
||||||
Artifact a = createArtifact( "a", "0.0.1", "pom" );
|
Artifact a = createArtifact( "a", "0.0.1", "pom" );
|
||||||
File file = new File( localRepository.getBasedir(),
|
File file = new File( localRepository.getBasedir(),
|
||||||
localRepository.pathOf( a ) );
|
localRepository.pathOf( a ) );
|
||||||
file.delete();
|
file.delete();
|
||||||
a.setFile( file );
|
a.setFile( file );
|
||||||
|
@ -223,14 +223,14 @@ public class DefaultUpdateCheckManagerTest
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
|
||||||
Artifact a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", null );
|
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 ) );
|
localRepository.pathOf( a ) );
|
||||||
a.setFile( file );
|
a.setFile( file );
|
||||||
|
|
||||||
assertEquals( "a-0.0.1-SNAPSHOT.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );
|
assertEquals( "a-0.0.1-SNAPSHOT.jar.lastUpdated", updateCheckManager.getTouchfile( a ).getName() );
|
||||||
|
|
||||||
a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" );
|
a = artifactFactory.createArtifactWithClassifier( "groupdId", "a", "0.0.1-SNAPSHOT", "jar", "classifier" );
|
||||||
file = new File( localRepository.getBasedir(),
|
file = new File( localRepository.getBasedir(),
|
||||||
localRepository.pathOf( a ) );
|
localRepository.pathOf( a ) );
|
||||||
a.setFile( file );
|
a.setFile( file );
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ package org.apache.maven.repository.legacy;
|
||||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
* 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
|
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||||
* copy of the License at
|
* copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
* 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
|
* 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
|
* or implied. See the License for the specific language governing permissions and limitations under
|
||||||
|
@ -28,7 +28,7 @@ import org.codehaus.plexus.PlexusTestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link LegacyRepositorySystem}.
|
* Tests {@link LegacyRepositorySystem}.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class LegacyRepositorySystemTest
|
public class LegacyRepositorySystemTest
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class StringWagon
|
||||||
extends StreamWagon
|
extends StreamWagon
|
||||||
{
|
{
|
||||||
private Map<String, String> expectedContent = new HashMap<String, String>();
|
private Map<String, String> expectedContent = new HashMap<String, String>();
|
||||||
|
|
||||||
public void addExpectedContent( String resourceName, String expectedContent )
|
public void addExpectedContent( String resourceName, String expectedContent )
|
||||||
{
|
{
|
||||||
this.expectedContent.put( resourceName, expectedContent );
|
this.expectedContent.put( resourceName, expectedContent );
|
||||||
|
@ -66,7 +66,7 @@ public class StringWagon
|
||||||
Resource resource = inputData.getResource();
|
Resource resource = inputData.getResource();
|
||||||
|
|
||||||
String content = expectedContent.get( resource.getName() );
|
String content = expectedContent.get( resource.getName() );
|
||||||
|
|
||||||
if ( content != null )
|
if ( content != null )
|
||||||
{
|
{
|
||||||
resource.setContentLength( content.length() );
|
resource.setContentLength( content.length() );
|
||||||
|
@ -102,6 +102,6 @@ public class StringWagon
|
||||||
|
|
||||||
public void clearExpectedContent()
|
public void clearExpectedContent()
|
||||||
{
|
{
|
||||||
expectedContent.clear();
|
expectedContent.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wagon for testing, for protocol <code>a</code>
|
* Wagon for testing, for protocol <code>a</code>
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wagon for testing, for protocols <code>b1</code> and <code>b2</code>
|
* 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:carlos@apache.org">Carlos Sanchez</a>
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wagon for testing, for protocol <code>c</code>
|
* Wagon for testing, for protocol <code>c</code>
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.apache.maven.wagon.providers.file.FileWagon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mock of a Wagon for testing
|
* Mock of a Wagon for testing
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
||||||
*/
|
*/
|
||||||
public class WagonMock
|
public class WagonMock
|
||||||
|
|
|
@ -36,11 +36,11 @@ public abstract class AbstractConflictResolverTest
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
// constants --------------------------------------------------------------
|
// constants --------------------------------------------------------------
|
||||||
|
|
||||||
private static final String GROUP_ID = "test";
|
private static final String GROUP_ID = "test";
|
||||||
|
|
||||||
// fields -----------------------------------------------------------------
|
// fields -----------------------------------------------------------------
|
||||||
|
|
||||||
protected Artifact a1;
|
protected Artifact a1;
|
||||||
|
|
||||||
protected Artifact a2;
|
protected Artifact a2;
|
||||||
|
@ -48,21 +48,21 @@ public abstract class AbstractConflictResolverTest
|
||||||
protected Artifact b1;
|
protected Artifact b1;
|
||||||
|
|
||||||
private final String roleHint;
|
private final String roleHint;
|
||||||
|
|
||||||
private ArtifactFactory artifactFactory;
|
private ArtifactFactory artifactFactory;
|
||||||
|
|
||||||
private ConflictResolver conflictResolver;
|
private ConflictResolver conflictResolver;
|
||||||
|
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public AbstractConflictResolverTest( String roleHint )
|
public AbstractConflictResolverTest( String roleHint )
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
this.roleHint = roleHint;
|
this.roleHint = roleHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestCase methods -------------------------------------------------------
|
// TestCase methods -------------------------------------------------------
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see junit.framework.TestCase#setUp()
|
* @see junit.framework.TestCase#setUp()
|
||||||
*/
|
*/
|
||||||
|
@ -72,12 +72,12 @@ public abstract class AbstractConflictResolverTest
|
||||||
|
|
||||||
artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
|
artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
|
||||||
conflictResolver = (ConflictResolver) lookup( ConflictResolver.ROLE, roleHint );
|
conflictResolver = (ConflictResolver) lookup( ConflictResolver.ROLE, roleHint );
|
||||||
|
|
||||||
a1 = createArtifact( "a", "1.0" );
|
a1 = createArtifact( "a", "1.0" );
|
||||||
a2 = createArtifact( "a", "2.0" );
|
a2 = createArtifact( "a", "2.0" );
|
||||||
b1 = createArtifact( "b", "1.0" );
|
b1 = createArtifact( "b", "1.0" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see org.codehaus.plexus.PlexusTestCase#tearDown()
|
* @see org.codehaus.plexus.PlexusTestCase#tearDown()
|
||||||
*/
|
*/
|
||||||
|
@ -86,24 +86,24 @@ public abstract class AbstractConflictResolverTest
|
||||||
a1 = null;
|
a1 = null;
|
||||||
a2 = null;
|
a2 = null;
|
||||||
b1 = null;
|
b1 = null;
|
||||||
|
|
||||||
artifactFactory = null;
|
artifactFactory = null;
|
||||||
conflictResolver = null;
|
conflictResolver = null;
|
||||||
|
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected methods ------------------------------------------------------
|
// protected methods ------------------------------------------------------
|
||||||
|
|
||||||
protected ConflictResolver getConflictResolver()
|
protected ConflictResolver getConflictResolver()
|
||||||
{
|
{
|
||||||
return conflictResolver;
|
return conflictResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void assertResolveConflict( ResolutionNode expectedNode, ResolutionNode actualNode1, ResolutionNode actualNode2 )
|
protected void assertResolveConflict( ResolutionNode expectedNode, ResolutionNode actualNode1, ResolutionNode actualNode2 )
|
||||||
{
|
{
|
||||||
ResolutionNode resolvedNode = getConflictResolver().resolveConflict( actualNode1, actualNode2 );
|
ResolutionNode resolvedNode = getConflictResolver().resolveConflict( actualNode1, actualNode2 );
|
||||||
|
|
||||||
assertNotNull( "Expected resolvable", resolvedNode );
|
assertNotNull( "Expected resolvable", resolvedNode );
|
||||||
assertEquals( "Resolution node", expectedNode, resolvedNode );
|
assertEquals( "Resolution node", expectedNode, resolvedNode );
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public abstract class AbstractConflictResolverTest
|
||||||
protected void assertUnresolvableConflict( ResolutionNode actualNode1, ResolutionNode actualNode2 )
|
protected void assertUnresolvableConflict( ResolutionNode actualNode1, ResolutionNode actualNode2 )
|
||||||
{
|
{
|
||||||
ResolutionNode resolvedNode = getConflictResolver().resolveConflict( actualNode1, actualNode2 );
|
ResolutionNode resolvedNode = getConflictResolver().resolveConflict( actualNode1, actualNode2 );
|
||||||
|
|
||||||
assertNull( "Expected unresolvable", resolvedNode );
|
assertNull( "Expected unresolvable", resolvedNode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ public abstract class AbstractConflictResolverTest
|
||||||
throws InvalidVersionSpecificationException
|
throws InvalidVersionSpecificationException
|
||||||
{
|
{
|
||||||
VersionRange versionRange = VersionRange.createFromVersionSpec( version );
|
VersionRange versionRange = VersionRange.createFromVersionSpec( version );
|
||||||
|
|
||||||
return artifactFactory.createDependencyArtifact( GROUP_ID, id, versionRange, "jar", null, scope,
|
return artifactFactory.createDependencyArtifact( GROUP_ID, id, versionRange, "jar", null, scope,
|
||||||
inheritedScope, optional );
|
inheritedScope, optional );
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,13 @@ public class FarthestConflictResolverTest
|
||||||
extends AbstractConflictResolverTest
|
extends AbstractConflictResolverTest
|
||||||
{
|
{
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public FarthestConflictResolverTest()
|
public FarthestConflictResolverTest()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super("farthest");
|
super("farthest");
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests ------------------------------------------------------------------
|
// tests ------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public class FarthestConflictResolverTest
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a1n, a2n );
|
assertResolveConflict( a2n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class FarthestConflictResolverTest
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a2n, a1n );
|
assertResolveConflict( a2n, a2n, a1n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public class FarthestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a1n, a2n );
|
assertResolveConflict( a1n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class FarthestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a2n, a1n );
|
assertResolveConflict( a2n, a2n, a1n );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,13 @@ public class NearestConflictResolverTest
|
||||||
extends AbstractConflictResolverTest
|
extends AbstractConflictResolverTest
|
||||||
{
|
{
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public NearestConflictResolverTest()
|
public NearestConflictResolverTest()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super("nearest");
|
super("nearest");
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests ------------------------------------------------------------------
|
// tests ------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public class NearestConflictResolverTest
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a1n, a2n );
|
assertResolveConflict( a1n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class NearestConflictResolverTest
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a2n, a1n );
|
assertResolveConflict( a1n, a2n, a1n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public class NearestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a1n, a2n );
|
assertResolveConflict( a1n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class NearestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a2n, a1n );
|
assertResolveConflict( a2n, a2n, a1n );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,13 @@ public class NewestConflictResolverTest
|
||||||
extends AbstractConflictResolverTest
|
extends AbstractConflictResolverTest
|
||||||
{
|
{
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public NewestConflictResolverTest()
|
public NewestConflictResolverTest()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super("newest");
|
super("newest");
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests ------------------------------------------------------------------
|
// tests ------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public class NewestConflictResolverTest
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a1n, a2n );
|
assertResolveConflict( a2n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class NewestConflictResolverTest
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a2n, a1n );
|
assertResolveConflict( a2n, a2n, a1n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public class NewestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a1n, a2n );
|
assertResolveConflict( a2n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class NewestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a2n, a2n, a1n );
|
assertResolveConflict( a2n, a2n, a1n );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,13 +34,13 @@ public class OldestConflictResolverTest
|
||||||
extends AbstractConflictResolverTest
|
extends AbstractConflictResolverTest
|
||||||
{
|
{
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public OldestConflictResolverTest()
|
public OldestConflictResolverTest()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
super("oldest");
|
super("oldest");
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests ------------------------------------------------------------------
|
// tests ------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public class OldestConflictResolverTest
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a1n, a2n );
|
assertResolveConflict( a1n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class OldestConflictResolverTest
|
||||||
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
ResolutionNode b1n = new ResolutionNode( b1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST, b1n );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a2n, a1n );
|
assertResolveConflict( a1n, a2n, a1n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public class OldestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a1n, a2n );
|
assertResolveConflict( a1n, a1n, a2n );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class OldestConflictResolverTest
|
||||||
{
|
{
|
||||||
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
ResolutionNode a2n = new ResolutionNode( a2, Collections.EMPTY_LIST );
|
||||||
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
ResolutionNode a1n = new ResolutionNode( a1, Collections.EMPTY_LIST );
|
||||||
|
|
||||||
assertResolveConflict( a1n, a2n, a1n );
|
assertResolveConflict( a1n, a2n, a1n );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.codehaus.plexus.PlexusTestCase;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class DefaultClasspathTransformationTest
|
public class DefaultClasspathTransformationTest
|
||||||
|
@ -53,7 +53,7 @@ extends PlexusTestCase
|
||||||
* v2
|
* v2
|
||||||
* v1<
|
* v1<
|
||||||
* v3-v4
|
* v3-v4
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
v1 = graph.addVertex(new ArtifactMetadata("g","a1","1.0"));
|
v1 = graph.addVertex(new ArtifactMetadata("g","a1","1.0"));
|
||||||
graph.setEntry(v1);
|
graph.setEntry(v1);
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.codehaus.plexus.PlexusTestCase;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class DefaultGraphConflictResolutionPolicyTest
|
public class DefaultGraphConflictResolutionPolicyTest
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.codehaus.plexus.logging.Logger;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class DefaultGraphConflictResolverTest
|
public class DefaultGraphConflictResolverTest
|
||||||
|
@ -54,7 +54,7 @@ extends PlexusTestCase
|
||||||
* v2
|
* v2
|
||||||
* v1<
|
* v1<
|
||||||
* v3-v4
|
* v3-v4
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
graph = new MetadataGraph( 4, 3 );
|
graph = new MetadataGraph( 4, 3 );
|
||||||
v1 = graph.addVertex(new ArtifactMetadata("g","a1","1.0"));
|
v1 = graph.addVertex(new ArtifactMetadata("g","a1","1.0"));
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class TestMetadataSource
|
||||||
{
|
{
|
||||||
@Requirement
|
@Requirement
|
||||||
private ArtifactFactory factory;
|
private ArtifactFactory factory;
|
||||||
|
|
||||||
public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
|
public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
|
||||||
throws ArtifactMetadataRetrievalException
|
throws ArtifactMetadataRetrievalException
|
||||||
{
|
{
|
||||||
|
@ -59,7 +59,7 @@ public class TestMetadataSource
|
||||||
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( "i".equals( artifact.getArtifactId() ) )
|
if ( "i".equals( artifact.getArtifactId() ) )
|
||||||
{
|
{
|
||||||
Artifact a = null;
|
Artifact a = null;
|
||||||
|
@ -73,7 +73,7 @@ public class TestMetadataSource
|
||||||
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
throw new ArtifactMetadataRetrievalException( "Error retrieving metadata", e, a );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ResolutionGroup( artifact, dependencies, remoteRepositories );
|
return new ResolutionGroup( artifact, dependencies, remoteRepositories );
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>p1</artifactId>
|
<artifactId>p1</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>normal</id>
|
<id>normal</id>
|
||||||
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>compile</goal>
|
<goal>compile</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<artifactId>p0</artifactId>
|
<artifactId>p0</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -13,10 +13,10 @@
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>test</id>
|
<id>test</id>
|
||||||
|
|
||||||
<!-- The key to this test... -->
|
<!-- The key to this test... -->
|
||||||
<inherited>false</inherited>
|
<inherited>false</inherited>
|
||||||
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>compile</goal>
|
<goal>compile</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>p1</artifactId>
|
<artifactId>p1</artifactId>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
<artifactId>p0</artifactId>
|
<artifactId>p0</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:svn:http://host/p0</connection>
|
<connection>scm:svn:http://host/p0</connection>
|
||||||
<developerConnection>scm:svn:https://host/p0</developerConnection>
|
<developerConnection>scm:svn:https://host/p0</developerConnection>
|
||||||
<url>http://host/viewer?path=/p0</url>
|
<url>http://host/viewer?path=/p0</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>modules/p1</module>
|
<module>modules/p1</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
|
@ -36,7 +36,7 @@ We need to turn this list of phases into a set of plugin objects that have an xm
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
</plugins>
|
</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:
|
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>
|
<plugins>
|
||||||
|
@ -57,11 +57,11 @@ We need this form so that the model builder can make the first pass at merging.
|
||||||
.
|
.
|
||||||
</plugins>
|
</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:
|
foreach configuration element:
|
||||||
- if read only and being set squawk
|
- if read only and being set squawk
|
||||||
|
|
||||||
- find the parameter
|
- find the parameter
|
||||||
- get value from expression or default
|
- get value from expression or default
|
||||||
- if required and null squawk
|
- if required and null squawk
|
||||||
|
|
|
@ -47,50 +47,50 @@ i'l
|
||||||
// - plugins with a dependency the same as the core but different versions, make it fail then fix it
|
// - plugins with a dependency the same as the core but different versions, make it fail then fix it
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* h2. Concerns for the plugin manager
|
* h2. Concerns for the plugin manager
|
||||||
*
|
*
|
||||||
* h3. resolving the dependencies of a plugin - these could be resolved remotely at runtime or, -
|
* 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
|
* 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
|
* that is more mercury related and not Maven related i.e no POMs - workspace resolver - we need
|
||||||
* tools to pre-populate this repository
|
* tools to pre-populate this repository
|
||||||
*
|
*
|
||||||
* h3. create an isolated classloader
|
* h3. create an isolated classloader
|
||||||
*
|
*
|
||||||
* h3. lookup the plugin with a configuration
|
* h3. lookup the plugin with a configuration
|
||||||
*
|
*
|
||||||
* h3. execute the plugin
|
* h3. execute the plugin
|
||||||
*
|
*
|
||||||
* h3. plugins may have to deal with particular actions when a plugin is - installed - loaded -
|
* h3. plugins may have to deal with particular actions when a plugin is - installed - loaded -
|
||||||
* unloaded - update - uninstalled
|
* unloaded - update - uninstalled
|
||||||
*
|
*
|
||||||
* h3. plugins should be able to have specific metadata for a plugin model and that be translated -
|
* h3. plugins should be able to have specific metadata for a plugin model and that be translated -
|
||||||
* dependencies - resources - configuration - extension points of plugins
|
* dependencies - resources - configuration - extension points of plugins
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
*
|
*
|
||||||
* - nexus - the plugin class - UI to contribute - what JS to hook into the UI - what resources to
|
* - 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 -
|
* 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
|
* maven can work out of the classloader, nexus plugins probably couldn't given the js and image
|
||||||
* resources
|
* resources
|
||||||
*
|
*
|
||||||
* We need to look at Maven, and Nexus as use cases and figure out what each of them needs to be
|
* We need to look at Maven, and Nexus as use cases and figure out what each of them needs to be
|
||||||
* able to do
|
* able to do
|
||||||
*
|
*
|
||||||
* - now what is really the difference between this and loading a component in plexus - custom
|
* - 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
|
* 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
|
* 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
|
* 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
|
* 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?
|
* directory to a method in the application interface?
|
||||||
*
|
*
|
||||||
* - research extension points versus plugins
|
* - research extension points versus plugins
|
||||||
*
|
*
|
||||||
* from igor: two plugins A and B, both depend on the same library but use different versions, say
|
* 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
|
* 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
|
* 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.
|
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
|
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
|
* Configuration metadata and default configuration values
|
||||||
* Extension points that plugins might expose
|
* 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
|
* installation
|
||||||
* activation
|
* activation
|
||||||
* update
|
* update
|
||||||
|
@ -158,7 +158,7 @@ We might want to separate between installation and activation, it might be nice
|
||||||
|
|
||||||
These particular phases in a plugin’s 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.
|
These particular phases in a plugin’s 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
|
h3. Some general notes on Nexus
|
||||||
|
|
||||||
|
@ -168,11 +168,11 @@ The plugin metadata:
|
||||||
* what JS to hook into the UI
|
* what JS to hook into the UI
|
||||||
* what resources to load into the UI
|
* what resources to load into the UI
|
||||||
* having packed or unpacked plugins, and positioning resources if necessary
|
* 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
|
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
|
* 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
|
* 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 js
|
||||||
- an example of adding a URI
|
- an example of adding a URI
|
||||||
|
|
|
@ -69,7 +69,7 @@ public abstract class AbstractMavenLifecycleParticipant
|
||||||
* code.
|
* code.
|
||||||
*/
|
*/
|
||||||
public void afterSessionEnd( MavenSession session )
|
public void afterSessionEnd( MavenSession session )
|
||||||
throws MavenExecutionException
|
throws MavenExecutionException
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
|
||||||
* @todo this should probably be a component with some dynamic control of filtering
|
* @todo this should probably be a component with some dynamic control of filtering
|
||||||
*/
|
*/
|
||||||
@Component( role = ArtifactFilterManager.class )
|
@Component( role = ArtifactFilterManager.class )
|
||||||
public class DefaultArtifactFilterManager
|
public class DefaultArtifactFilterManager
|
||||||
implements ArtifactFilterManager
|
implements ArtifactFilterManager
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ public class DefaultMaven
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private SessionScope sessionScope;
|
private SessionScope sessionScope;
|
||||||
|
|
||||||
public MavenExecutionResult execute( MavenExecutionRequest request )
|
public MavenExecutionResult execute( MavenExecutionRequest request )
|
||||||
{
|
{
|
||||||
MavenExecutionResult result;
|
MavenExecutionResult result;
|
||||||
|
@ -176,7 +176,7 @@ public class DefaultMaven
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// 1) Setup initial properties.
|
// 1) Setup initial properties.
|
||||||
//
|
//
|
||||||
// 2) Validate local repository directory is accessible.
|
// 2) Validate local repository directory is accessible.
|
||||||
|
@ -208,7 +208,7 @@ public class DefaultMaven
|
||||||
private MavenExecutionResult doExecute( MavenExecutionRequest request )
|
private MavenExecutionResult doExecute( MavenExecutionRequest request )
|
||||||
{
|
{
|
||||||
request.setStartTime( new Date() );
|
request.setStartTime( new Date() );
|
||||||
|
|
||||||
MavenExecutionResult result = new DefaultMavenExecutionResult();
|
MavenExecutionResult result = new DefaultMavenExecutionResult();
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -223,14 +223,14 @@ public class DefaultMaven
|
||||||
DefaultRepositorySystemSession repoSession = (DefaultRepositorySystemSession) newRepositorySession( request );
|
DefaultRepositorySystemSession repoSession = (DefaultRepositorySystemSession) newRepositorySession( request );
|
||||||
|
|
||||||
MavenSession session = new MavenSession( container, repoSession, request, result );
|
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
|
// 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.
|
// so that @SessionScoped components can be @Injected into AbstractLifecycleParticipants.
|
||||||
//
|
//
|
||||||
sessionScope.enter();
|
sessionScope.enter();
|
||||||
sessionScope.seed( MavenSession.class, session );
|
sessionScope.seed( MavenSession.class, session );
|
||||||
|
|
||||||
legacySupport.setSession( session );
|
legacySupport.setSession( session );
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -285,7 +285,7 @@ public class DefaultMaven
|
||||||
{
|
{
|
||||||
return addExceptionToResult( result, e );
|
return addExceptionToResult( result, e );
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspaceReader reactorWorkspace;
|
WorkspaceReader reactorWorkspace;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -295,14 +295,14 @@ public class DefaultMaven
|
||||||
{
|
{
|
||||||
return addExceptionToResult( result, e );
|
return addExceptionToResult( result, e );
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Desired order of precedence for local artifact repositories
|
// Desired order of precedence for local artifact repositories
|
||||||
//
|
//
|
||||||
// Reactor
|
// Reactor
|
||||||
// Workspace
|
// Workspace
|
||||||
// User Local Repository
|
// User Local Repository
|
||||||
//
|
//
|
||||||
repoSession.setWorkspaceReader( ChainedWorkspaceReader.newInstance( reactorWorkspace,
|
repoSession.setWorkspaceReader( ChainedWorkspaceReader.newInstance( reactorWorkspace,
|
||||||
repoSession.getWorkspaceReader() ) );
|
repoSession.getWorkspaceReader() ) );
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ public class DefaultMaven
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void afterSessionEnd( Collection<MavenProject> projects, MavenSession session )
|
private void afterSessionEnd( Collection<MavenProject> projects, MavenSession session )
|
||||||
throws MavenExecutionException
|
throws MavenExecutionException
|
||||||
{
|
{
|
||||||
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
|
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
|
||||||
|
@ -641,7 +641,7 @@ public class DefaultMaven
|
||||||
throws ProjectBuildingException
|
throws ProjectBuildingException
|
||||||
{
|
{
|
||||||
MavenExecutionRequest request = session.getRequest();
|
MavenExecutionRequest request = session.getRequest();
|
||||||
|
|
||||||
request.getProjectBuildingRequest().setRepositorySession( session.getRepositorySession() );
|
request.getProjectBuildingRequest().setRepositorySession( session.getRepositorySession() );
|
||||||
|
|
||||||
List<MavenProject> projects = new ArrayList<MavenProject>();
|
List<MavenProject> projects = new ArrayList<MavenProject>();
|
||||||
|
@ -761,7 +761,7 @@ public class DefaultMaven
|
||||||
|
|
||||||
for ( MavenProject project : 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() )
|
for ( Plugin plugin : project.getBuildPlugins() )
|
||||||
{
|
{
|
||||||
if ( plugin.isExtensions() )
|
if ( plugin.isExtensions() )
|
||||||
|
@ -940,7 +940,7 @@ public class DefaultMaven
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<MavenProject> trimExcludedProjects( List<MavenProject> projects, MavenExecutionRequest request )
|
private List<MavenProject> trimExcludedProjects( List<MavenProject> projects, MavenExecutionRequest request )
|
||||||
throws MavenExecutionException
|
throws MavenExecutionException
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signals a collision of two or more projects with the same g:a:v during a reactor build.
|
* Signals a collision of two or more projects with the same g:a:v during a reactor build.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class DuplicateProjectException
|
public class DuplicateProjectException
|
||||||
|
@ -37,7 +37,7 @@ public class DuplicateProjectException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new exception with specified details.
|
* Creates a new exception with specified details.
|
||||||
*
|
*
|
||||||
* @param message The message text, may be {@code null}.
|
* @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}.
|
* @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 class DuplicateProjectException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the POM files of the projects that collided.
|
* 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}.
|
* @return The POM files of the projects that collided, indexed by their g:a:v, never {@code null}.
|
||||||
*/
|
*/
|
||||||
public Map<String, List<File>> getCollisions()
|
public Map<String, List<File>> getCollisions()
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.maven.project.MavenProject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a sub view of another dependency graph.
|
* Provides a sub view of another dependency graph.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
class FilteredProjectDependencyGraph
|
class FilteredProjectDependencyGraph
|
||||||
|
@ -45,7 +45,7 @@ class FilteredProjectDependencyGraph
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new project dependency graph from the specified graph.
|
* 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 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}.
|
* @param whiteList The projects on which the dependency view should focus, must not be {@code null}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -21,7 +21,7 @@ package org.apache.maven;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signals an internal error in Maven itself, e.g. a programming bug.
|
* Signals an internal error in Maven itself, e.g. a programming bug.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class InternalErrorException
|
public class InternalErrorException
|
||||||
|
|
|
@ -30,5 +30,5 @@ public interface Maven
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String POMv4 = "pom.xml";
|
String POMv4 = "pom.xml";
|
||||||
|
|
||||||
MavenExecutionResult execute( MavenExecutionRequest request );
|
MavenExecutionResult execute( MavenExecutionRequest request );
|
||||||
}
|
}
|
|
@ -43,7 +43,7 @@ import org.eclipse.aether.util.artifact.ArtifactIdUtils;
|
||||||
/**
|
/**
|
||||||
* An implementation of a workspace reader that knows how to search the Maven reactor for artifacts, either
|
* 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.
|
* as packaged jar if it has been built, or only compile output directory if packaging hasn't happened yet.
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
@Named( ReactorReader.HINT )
|
@Named( ReactorReader.HINT )
|
||||||
|
@ -52,7 +52,7 @@ class ReactorReader
|
||||||
implements WorkspaceReader
|
implements WorkspaceReader
|
||||||
{
|
{
|
||||||
public static final String HINT = "reactor";
|
public static final String HINT = "reactor";
|
||||||
|
|
||||||
private static final Collection<String> COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" );
|
private static final Collection<String> COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" );
|
||||||
|
|
||||||
private Map<String, MavenProject> projectsByGAV;
|
private Map<String, MavenProject> projectsByGAV;
|
||||||
|
@ -193,7 +193,7 @@ class ReactorReader
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to resolve the specified artifact from the artifacts of the given 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 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>.
|
* @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
|
* @return The matching artifact from the project or <code>null</code> if not found. Note that this
|
||||||
|
@ -234,7 +234,7 @@ class ReactorReader
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether the specified artifact refers to test classes.
|
* Determines whether the specified artifact refers to test classes.
|
||||||
*
|
*
|
||||||
* @param artifact The artifact to check, must not be {@code null}.
|
* @param artifact The artifact to check, must not be {@code null}.
|
||||||
* @return {@code true} if the artifact refers to test classes, {@code false} otherwise.
|
* @return {@code true} if the artifact refers to test classes, {@code false} otherwise.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,7 +49,7 @@ import org.eclipse.aether.util.repository.AuthenticationBuilder;
|
||||||
/**
|
/**
|
||||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
* <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.
|
* of the public API. In particular, this class can be changed or deleted without prior notice.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class RepositoryUtils
|
public class RepositoryUtils
|
||||||
|
|
|
@ -29,7 +29,7 @@ import com.google.inject.ScopeAnnotation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that annotated component should be instantiated before session starts and discarded after session execution completes.
|
* Indicates that annotated component should be instantiated before session starts and discarded after session execution completes.
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.maven.project.MavenProject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects basic settings to access the repository system.
|
* Collects basic settings to access the repository system.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class DefaultRepositoryRequest
|
public class DefaultRepositoryRequest
|
||||||
|
@ -52,7 +52,7 @@ public class DefaultRepositoryRequest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a shallow copy of the specified repository request.
|
* Creates a shallow copy of the specified repository request.
|
||||||
*
|
*
|
||||||
* @param repositoryRequest The repository request to copy from, must not be {@code null}.
|
* @param repositoryRequest The repository request to copy from, must not be {@code null}.
|
||||||
*/
|
*/
|
||||||
public DefaultRepositoryRequest( RepositoryRequest repositoryRequest )
|
public DefaultRepositoryRequest( RepositoryRequest repositoryRequest )
|
||||||
|
|
|
@ -47,7 +47,7 @@ import org.eclipse.aether.repository.RemoteRepository;
|
||||||
/**
|
/**
|
||||||
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
|
* <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.
|
* of the public API. In particular, this class can be changed or deleted without prior notice.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class LegacyLocalRepositoryManager
|
public class LegacyLocalRepositoryManager
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class MavenArtifactRepository
|
||||||
{
|
{
|
||||||
sb.append( " proxy: " ).append( proxy.getHost() ).append( ":" ).append( proxy.getPort() ).append( "\n" );
|
sb.append( " proxy: " ).append( proxy.getHost() ).append( ":" ).append( proxy.getPort() ).append( "\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( snapshots != null )
|
if ( snapshots != null )
|
||||||
{
|
{
|
||||||
sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() );
|
sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() );
|
||||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.artifact.repository;
|
||||||
/**
|
/**
|
||||||
* Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant
|
* 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.
|
* for exclusive consumption by the repository system and is opaque to the cache implementation.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@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
|
* 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
|
* 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.
|
* 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 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 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}.
|
* @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
|
* 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
|
* 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.
|
* 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 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}.
|
* @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.
|
* @return The requested data or {@code null} if none was present in the cache.
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects basic settings to access the repository system.
|
* Collects basic settings to access the repository system.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public interface RepositoryRequest
|
public interface RepositoryRequest
|
||||||
|
@ -31,14 +31,14 @@ public interface RepositoryRequest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether network access to remote repositories has been disabled.
|
* Indicates whether network access to remote repositories has been disabled.
|
||||||
*
|
*
|
||||||
* @return {@code true} if remote access has been disabled, {@code false} otherwise.
|
* @return {@code true} if remote access has been disabled, {@code false} otherwise.
|
||||||
*/
|
*/
|
||||||
boolean isOffline();
|
boolean isOffline();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables/disables network access to remote repositories.
|
* Enables/disables network access to remote repositories.
|
||||||
*
|
*
|
||||||
* @param offline {@code true} to disable remote access, {@code false} to allow network access.
|
* @param offline {@code true} to disable remote access, {@code false} to allow network access.
|
||||||
* @return This request, never {@code null}.
|
* @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
|
* Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their
|
||||||
* configured update policy.
|
* configured update policy.
|
||||||
*
|
*
|
||||||
* @return {@code true} if remote repositories should be re-checked for updated artifacts/metadata, {@code false}
|
* @return {@code true} if remote repositories should be re-checked for updated artifacts/metadata, {@code false}
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
|
@ -55,7 +55,7 @@ public interface RepositoryRequest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables/disabled forced checks for updated artifacts/metadata on remote repositories.
|
* 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
|
* @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.
|
* false} to use the update policy configured on each repository.
|
||||||
* @return This request, never {@code null}.
|
* @return This request, never {@code null}.
|
||||||
|
@ -64,14 +64,14 @@ public interface RepositoryRequest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the local repository to use.
|
* Gets the local repository to use.
|
||||||
*
|
*
|
||||||
* @return The local repository to use or {@code null} if not set.
|
* @return The local repository to use or {@code null} if not set.
|
||||||
*/
|
*/
|
||||||
ArtifactRepository getLocalRepository();
|
ArtifactRepository getLocalRepository();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the local repository to use.
|
* Sets the local repository to use.
|
||||||
*
|
*
|
||||||
* @param localRepository The local repository to use.
|
* @param localRepository The local repository to use.
|
||||||
* @return This request, never {@code null}.
|
* @return This request, never {@code null}.
|
||||||
*/
|
*/
|
||||||
|
@ -79,14 +79,14 @@ public interface RepositoryRequest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the remote repositories to use.
|
* Gets the remote repositories to use.
|
||||||
*
|
*
|
||||||
* @return The remote repositories to use, never {@code null}.
|
* @return The remote repositories to use, never {@code null}.
|
||||||
*/
|
*/
|
||||||
List<ArtifactRepository> getRemoteRepositories();
|
List<ArtifactRepository> getRemoteRepositories();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the remote repositories to use.
|
* Sets the remote repositories to use.
|
||||||
*
|
*
|
||||||
* @param remoteRepositories The remote repositories to use.
|
* @param remoteRepositories The remote repositories to use.
|
||||||
* @return This request, never {@code null}.
|
* @return This request, never {@code null}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -56,7 +56,7 @@ public abstract class AbstractRepositoryMetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocalFilename( ArtifactRepository repository )
|
public String getLocalFilename( ArtifactRepository repository )
|
||||||
{
|
{
|
||||||
return "maven-metadata-" + repository.getKey() + ".xml";
|
return "maven-metadata-" + repository.getKey() + ".xml";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ public abstract class AbstractRepositoryMetadata
|
||||||
AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata;
|
AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata;
|
||||||
this.metadata.merge( repoMetadata.getMetadata() );
|
this.metadata.merge( repoMetadata.getMetadata() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void merge( ArtifactMetadata metadata )
|
public void merge( ArtifactMetadata metadata )
|
||||||
{
|
{
|
||||||
// TODO: not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact replaces?
|
// TODO: not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact replaces?
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles deserialization of metadata from some kind of textual format like XML.
|
* Handles deserialization of metadata from some kind of textual format like XML.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
@Component( role = MetadataReader.class )
|
@Component( role = MetadataReader.class )
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signals a failure to parse the metadata due to invalid syntax (e.g. non-wellformed XML or unknown elements).
|
* Signals a failure to parse the metadata due to invalid syntax (e.g. non-wellformed XML or unknown elements).
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class MetadataParseException
|
public class MetadataParseException
|
||||||
|
@ -42,7 +42,7 @@ public class MetadataParseException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new parser exception with the specified details.
|
* Creates a new parser exception with the specified details.
|
||||||
*
|
*
|
||||||
* @param message The error message, may be {@code null}.
|
* @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 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.
|
* @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown.
|
||||||
|
@ -56,7 +56,7 @@ public class MetadataParseException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new parser exception with the specified details.
|
* Creates a new parser exception with the specified details.
|
||||||
*
|
*
|
||||||
* @param message The error message, may be {@code null}.
|
* @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 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.
|
* @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown.
|
||||||
|
@ -72,7 +72,7 @@ public class MetadataParseException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the one-based index of the line containing the error.
|
* 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.
|
* @return The one-based index of the line containing the error or a non-positive value if unknown.
|
||||||
*/
|
*/
|
||||||
public int getLineNumber()
|
public int getLineNumber()
|
||||||
|
@ -82,7 +82,7 @@ public class MetadataParseException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the one-based index of the column containing the error.
|
* 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.
|
* @return The one-based index of the column containing the error or non-positive value if unknown.
|
||||||
*/
|
*/
|
||||||
public int getColumnNumber()
|
public int getColumnNumber()
|
||||||
|
|
|
@ -61,9 +61,9 @@ public class ArtifactResolutionRequest
|
||||||
// Needs to go away
|
// Needs to go away
|
||||||
private List<ResolutionListener> listeners = new ArrayList<ResolutionListener>();
|
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 Map<String, Artifact> managedVersionMap;
|
||||||
|
|
||||||
private boolean resolveRoot = true;
|
private boolean resolveRoot = true;
|
||||||
|
|
||||||
private boolean resolveTransitively = false;
|
private boolean resolveTransitively = false;
|
||||||
|
@ -141,7 +141,7 @@ public class ArtifactResolutionRequest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the artifact filter that controls traversal of the dependency graph.
|
* 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
|
* @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.
|
* {@code null} to collect all transitive dependencies.
|
||||||
*/
|
*/
|
||||||
|
@ -160,7 +160,7 @@ public class ArtifactResolutionRequest
|
||||||
/**
|
/**
|
||||||
* Gets the artifact filter that controls downloading of artifact files. This filter operates on those artifacts
|
* Gets the artifact filter that controls downloading of artifact files. This filter operates on those artifacts
|
||||||
* that have been included by the {@link #getCollectionFilter()}.
|
* 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
|
* @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.
|
* resolve the files for all collected artifacts.
|
||||||
*/
|
*/
|
||||||
|
@ -182,12 +182,12 @@ public class ArtifactResolutionRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactResolutionRequest setListeners( List<ResolutionListener> listeners )
|
public ArtifactResolutionRequest setListeners( List<ResolutionListener> listeners )
|
||||||
{
|
{
|
||||||
this.listeners = listeners;
|
this.listeners = listeners;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactResolutionRequest addListener( ResolutionListener listener )
|
public ArtifactResolutionRequest addListener( ResolutionListener listener )
|
||||||
{
|
{
|
||||||
listeners.add( listener );
|
listeners.add( listener );
|
||||||
|
@ -210,26 +210,26 @@ public class ArtifactResolutionRequest
|
||||||
public ArtifactResolutionRequest setResolveRoot( boolean resolveRoot )
|
public ArtifactResolutionRequest setResolveRoot( boolean resolveRoot )
|
||||||
{
|
{
|
||||||
this.resolveRoot = resolveRoot;
|
this.resolveRoot = resolveRoot;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isResolveRoot()
|
public boolean isResolveRoot()
|
||||||
{
|
{
|
||||||
return resolveRoot;
|
return resolveRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactResolutionRequest setResolveTransitively( boolean resolveDependencies )
|
public ArtifactResolutionRequest setResolveTransitively( boolean resolveDependencies )
|
||||||
{
|
{
|
||||||
this.resolveTransitively = resolveDependencies;
|
this.resolveTransitively = resolveDependencies;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isResolveTransitively()
|
public boolean isResolveTransitively()
|
||||||
{
|
{
|
||||||
return resolveTransitively;
|
return resolveTransitively;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -239,7 +239,7 @@ public class ArtifactResolutionRequest
|
||||||
.append( artifactDependencies ).append( "\n" )
|
.append( artifactDependencies ).append( "\n" )
|
||||||
.append( "localRepository: " ).append( localRepository ).append( "\n" )
|
.append( "localRepository: " ).append( localRepository ).append( "\n" )
|
||||||
.append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" );
|
.append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" );
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,8 +322,8 @@ public class ArtifactResolutionRequest
|
||||||
// Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave
|
// 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.
|
// this here, possibly indefinitely.
|
||||||
//
|
//
|
||||||
public ArtifactResolutionRequest setCache( RepositoryCache cache )
|
public ArtifactResolutionRequest setCache( RepositoryCache cache )
|
||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.maven.artifact.Artifact;
|
||||||
public class AndArtifactFilter
|
public class AndArtifactFilter
|
||||||
implements ArtifactFilter
|
implements ArtifactFilter
|
||||||
{
|
{
|
||||||
private Set<ArtifactFilter> filters;
|
private Set<ArtifactFilter> filters;
|
||||||
|
|
||||||
public AndArtifactFilter()
|
public AndArtifactFilter()
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ public class AndArtifactFilter
|
||||||
{
|
{
|
||||||
this.filters = new LinkedHashSet<ArtifactFilter>( filters );
|
this.filters = new LinkedHashSet<ArtifactFilter>( filters );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean include( Artifact artifact )
|
public boolean include( Artifact artifact )
|
||||||
{
|
{
|
||||||
boolean include = true;
|
boolean include = true;
|
||||||
|
@ -86,14 +86,14 @@ public class AndArtifactFilter
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !( obj instanceof AndArtifactFilter ) )
|
if ( !( obj instanceof AndArtifactFilter ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AndArtifactFilter other = (AndArtifactFilter) obj;
|
AndArtifactFilter other = (AndArtifactFilter) obj;
|
||||||
|
|
||||||
return filters.equals( other.filters );
|
return filters.equals( other.filters );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Set;
|
||||||
* scopes and their associated implied scopes, so that the user can filter apply a series of implication rules in a
|
* 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}
|
* single step. This should be a more efficient implementation of multiple standard {@link ScopeArtifactFilter}
|
||||||
* instances ORed together.
|
* instances ORed together.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||||
* @author jdcasey
|
* @author jdcasey
|
||||||
*/
|
*/
|
||||||
|
@ -40,7 +40,7 @@ public class CumulativeScopeArtifactFilter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new filter with the specified scopes and their implied scopes enabled.
|
* 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}.
|
* @param scopes The scopes to enable, along with all implied scopes, may be {@code null}.
|
||||||
*/
|
*/
|
||||||
public CumulativeScopeArtifactFilter( Collection<String> scopes )
|
public CumulativeScopeArtifactFilter( Collection<String> scopes )
|
||||||
|
@ -52,7 +52,7 @@ public class CumulativeScopeArtifactFilter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new filter that combines the specified filters.
|
* Creates a new filter that combines the specified filters.
|
||||||
*
|
*
|
||||||
* @param filters The filters to combine, may be {@code null}.
|
* @param filters The filters to combine, may be {@code null}.
|
||||||
*/
|
*/
|
||||||
public CumulativeScopeArtifactFilter( CumulativeScopeArtifactFilter... filters )
|
public CumulativeScopeArtifactFilter( CumulativeScopeArtifactFilter... filters )
|
||||||
|
|
|
@ -73,14 +73,14 @@ public class ExclusionSetFilter
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !( obj instanceof ExclusionSetFilter ) )
|
if ( !( obj instanceof ExclusionSetFilter ) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExclusionSetFilter other = (ExclusionSetFilter) obj;
|
ExclusionSetFilter other = (ExclusionSetFilter) obj;
|
||||||
|
|
||||||
return excludes.equals( other.excludes );
|
return excludes.equals( other.excludes );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,19 +68,19 @@ public class IncludesArtifactFilter
|
||||||
{
|
{
|
||||||
int hash = 17;
|
int hash = 17;
|
||||||
hash = hash * 31 + patterns.hashCode();
|
hash = hash * 31 + patterns.hashCode();
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals( Object obj )
|
public boolean equals( Object obj )
|
||||||
{
|
{
|
||||||
if ( this == obj )
|
if ( this == obj )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure IncludesArtifactFilter is not equal ExcludesArtifactFilter!
|
// make sure IncludesArtifactFilter is not equal ExcludesArtifactFilter!
|
||||||
if ( obj == null || getClass() != obj.getClass() )
|
if ( obj == null || getClass() != obj.getClass() )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class MavenRepositorySystem
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private ArtifactHandlerManager artifactHandlerManager;
|
private ArtifactHandlerManager artifactHandlerManager;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private ArtifactResolver artifactResolver;
|
private ArtifactResolver artifactResolver;
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class MavenRepositorySystem
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
private SettingsDecrypter settingsDecrypter;
|
private SettingsDecrypter settingsDecrypter;
|
||||||
|
|
||||||
// DefaultProjectBuilder
|
// DefaultProjectBuilder
|
||||||
public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
|
public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
|
||||||
{
|
{
|
||||||
|
@ -600,7 +600,7 @@ public class MavenRepositorySystem
|
||||||
|
|
||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ArtifactFactory
|
// ArtifactFactory
|
||||||
private Artifact XcreateArtifact( String groupId, String artifactId, String version, String scope, String type )
|
private Artifact XcreateArtifact( String groupId, String artifactId, String version, String scope, String type )
|
||||||
{
|
{
|
||||||
|
@ -694,5 +694,5 @@ public class MavenRepositorySystem
|
||||||
|
|
||||||
return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler,
|
return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler,
|
||||||
optional );
|
optional );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue