You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2022/03/10 07:13:01 UTC
[maven] branch mvn4 updated (9c362c9 -> 406dbed)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a change to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git.
discard 9c362c9 Fix m-deploy-p ITs
discard 4b04bf1 runtime support
discard 9343d03 Add runtime support
discard 485fcd9 Remove wrong test
discard e13ad87 Switch a few core plugins to the new api
discard 68c65e3 Add the mojo plugin api
discard e3144f3 Add Listener / Event, JavaToolchain, ArtifactManager.isSnapshot(String) ...
discard d446d13 Make all exceptions RuntimeException and introduce a common MavenException base type
discard 25dd5d9 Add some missing bits
discard 5eea23c Maven API (draft)
discard 44b8c18 [MNG-7391] add execution strategy+runner required by Maven Build Cache
discard cc589d6 mvn4 aggregator
add 1d47323 [MNG-6727] Using version range in parent and CI Friendly Version fails
add 6ca13af [MNG-7408] explain Maven 3 reporting plugin version selection
add a472975 [MNG-7400] Allow more WorkspaceReaders to participate
add cc51006 [MNG-6776] Inconsistent list of parameters for MojoDescriptor (#584)
add 0be5e40 [MNG-7406] Do not include formatted details in Exception message
add 62cf29b [MNG-7407] Introduce a ModelVersionProcessor component to make CI Friendly Versions pluggable
add 2798ee9 [MNG-7395] Support interpolation in extensions.xml
add b2a21f1 [MNG-7244] Remove deprecated WARNING for usage of pom.X placeholders
add 03df5f7 [MNG-7390] Allow selecting modules outside the cwd into the reactor using --projects
add 69d6c6d [MNG-7417] Several classes do not set properties properly for building requests
add e327be3 [MNG-7402] BuildListCalculator never detaches the classloader
add 1e33a57 [MNG-5180] Versioning's snapshot version list is not included in metadata merge
add 5394e75 (refactoring) Resolve usage of deprecated method
add 83bbbb3 [MNG-6960] Use RuntimeInformation instead of reading properties
add 09e5154 Remove unused import
add 48be53a [MNG-7428] Upgrade Maven Parent to 35
add e1d359a [MNG-7330] Revert MNG-7329
add 1fff173 [MNG-7428] Upgrade Maven Parent to 35
add 20b6cec [MNG-7304] Use try-with-resources statement
add 48fc4c9 [MNG-7299] Simplify conditional expressions
add e8c35ae [MNG-7206] Properly prioritize JVM options from MAVEN_OPTS and jvm.config
add 8e5676c [MNG-7391] add execution strategy+runner required by Maven Build Cache (#661)
add b3d5c12 [master][MNG-7350] Introduce a factory for ModelCache (#629)
add 97c1e4b Remove unused test which should have been removed with MNG-7047 (#686)
new cf56704 mvn4 aggregator
new 0db4597 Maven API (draft)
new e7bab86 Add some missing bits
new 5d4688f Make all exceptions RuntimeException and introduce a common MavenException base type
new 92ab732 Add Listener / Event, JavaToolchain, ArtifactManager.isSnapshot(String) ...
new 36efde0 Add the mojo plugin api
new 6179bc1 Switch a few core plugins to the new api
new 3f9c736 Add runtime support
new dea91e2 runtime support
new bacfa84 Fix m-deploy-p ITs
new bb68564 Fix m-install-p ITs
new 406dbed Upgrade latest resolver
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (9c362c9)
\
N -- N -- N refs/heads/mvn4 (406dbed)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
apache-maven/src/assembly/shared/init | 2 +-
apache-maven/src/assembly/shared/init.cmd | 7 +-
apache-maven/src/assembly/shared/run.cmd | 1 -
maven-bom/pom.xml | 12 -
.../legacy/DefaultUpdateCheckManager.java | 54 +---
.../apache/maven/project/TestProjectBuilder.java | 5 +-
.../main/java/org/apache/maven/api/Session.java | 9 +-
.../apache/maven/api/services/ArtifactFactory.java | 11 +-
.../maven/api/services/ArtifactFactoryRequest.java | 49 ++--
.../apache/maven/api/services/ProjectManager.java | 13 +-
.../main/java/org/apache/maven/DefaultMaven.java | 107 +++++---
.../apache/maven/graph/DefaultGraphBuilder.java | 14 +-
.../DefaultRepositorySystemSessionFactory.java | 32 +--
.../maven/internal/impl/DefaultArtifact.java | 8 +-
.../internal/impl/DefaultArtifactFactory.java | 10 +-
.../internal/impl/DefaultArtifactInstaller.java | 4 -
.../internal/impl/DefaultArtifactManager.java | 4 -
.../apache/maven/internal/impl/DefaultProject.java | 2 +-
.../internal/impl/DefaultRepositoryFactory.java | 2 +-
.../apache/maven/internal/impl/DefaultSession.java | 7 +
.../apache/maven/lifecycle/DefaultLifecycles.java | 2 +-
.../lifecycle/internal/BuildListCalculator.java | 16 +-
.../internal/DefaultLifecyclePluginAnalyzer.java | 13 -
.../apache/maven/plugin/MojoExecutionRunner.java | 2 +-
.../plugin/PluginParameterExpressionEvaluator.java | 18 +-
.../maven/project/DefaultProjectBuilder.java | 9 +-
.../maven/project/ProjectBuildingException.java | 39 +--
.../project/artifact/MavenMetadataSource.java | 1 +
.../maven/AbstractCoreMavenComponentTestCase.java | 3 +-
.../DefaultBuildResumptionDataRepositoryTest.java | 10 +-
.../maven/lifecycle/DefaultLifecyclesTest.java | 4 +-
.../project/DefaultMavenProjectBuilderTest.java | 146 ++++++++++-
.../apache/maven/project/PomConstructionTest.java | 22 +-
.../apache/maven/project/ProjectBuilderTest.java | 11 +-
.../ProjectBuildingResultWithLocationMatcher.java | 91 +++++++
...ectBuildingResultWithProblemMessageMatcher.java | 84 ++++++
.../pom.xml | 4 +-
.../pom.xml | 4 +-
.../pom.xml | 4 +-
.../pom.xml | 3 +-
.../pom.xml | 5 +-
.../child/pom.xml | 4 +-
.../pom.xml | 0
.../child/pom.xml | 4 +-
.../pom.xml | 0
.../child/pom.xml | 5 +-
.../pom.xml | 0
.../internal/BootstrapCoreExtensionManager.java | 41 ++-
.../maven/model/building/DefaultModelBuilder.java | 20 +-
.../model/building/DefaultModelBuilderFactory.java | 13 +-
.../AbstractStringBasedModelInterpolator.java | 45 +---
.../DefaultModelVersionProcessor.java | 69 +++++
.../ModelVersionProcessor.java} | 27 +-
.../StringSearchModelInterpolator.java | 10 +-
.../StringVisitorModelInterpolator.java | 5 +-
.../profile/activation/FileProfileActivator.java | 2 +-
.../OperatingSystemProfileActivator.java | 8 +-
.../activation/PropertyProfileActivator.java | 8 +-
.../model/validation/DefaultModelValidator.java | 30 +--
.../AbstractModelInterpolatorTest.java | 37 ++-
.../StringSearchModelInterpolatorTest.java | 8 +-
.../StringVisitorModelInterpolatorTest.java | 2 +-
.../validation/DefaultModelValidatorTest.java | 7 +-
maven-model/src/main/mdo/maven.mdo | 7 +-
.../maven/plugin/descriptor/MojoDescriptor.java | 83 ++----
.../plugin/descriptor/MojoDescriptorTest.java | 53 ++++
maven-repository-metadata/pom.xml | 5 +
.../src/main/mdo/metadata.mdo | 50 +++-
.../artifact/repository/metadata/MetadataTest.java | 289 +++++++++++++++++++++
.../internal/DefaultArtifactDescriptorReader.java | 23 +-
.../internal/DefaultModelCacheFactory.java | 21 +-
.../repository/internal/MavenResolverModule.java | 3 +-
.../{package-info.java => ModelCacheFactory.java} | 18 +-
.../repository/internal/RelocatedArtifact.java | 5 -
pom.xml | 19 --
75 files changed, 1243 insertions(+), 522 deletions(-)
create mode 100644 maven-core/src/test/java/org/apache/maven/project/ProjectBuildingResultWithLocationMatcher.java
create mode 100644 maven-core/src/test/java/org/apache/maven/project/ProjectBuildingResultWithProblemMessageMatcher.java
copy maven-core/src/test/resources/projects/{parent-version-range-external-child-version-expression => parent-version-range-external-child-pom-parent-version-expression}/pom.xml (67%)
copy maven-core/src/test/resources/projects/{parent-version-range-external-child-version-expression => parent-version-range-external-child-pom-version-expression}/pom.xml (69%)
rename maven-core/src/test/resources/projects/{parent-version-range-external-child-version-expression => parent-version-range-external-child-project-parent-version-expression}/pom.xml (67%)
copy maven-core/src/test/resources/projects/{parent-version-range-external-child-without-version => parent-version-range-external-child-project-version-expression}/pom.xml (69%)
copy maven-core/src/test/resources/projects/{parent-version-range-external-child-without-version => parent-version-range-external-child-revision-expression}/pom.xml (70%)
copy maven-core/src/test/resources/projects/{parent-version-range-local-child-version-expression => parent-version-range-local-child-project-parent-version-expression}/child/pom.xml (68%)
rename maven-core/src/test/resources/projects/{parent-version-range-local-child-version-expression => parent-version-range-local-child-project-parent-version-expression}/pom.xml (100%)
rename maven-core/src/test/resources/projects/{parent-version-range-local-child-version-expression => parent-version-range-local-child-project-version-expression}/child/pom.xml (70%)
copy maven-core/src/test/resources/projects/{parent-version-range-local-valid => parent-version-range-local-child-project-version-expression}/pom.xml (100%)
copy maven-core/src/test/resources/projects/{parent-version-range-local-child-without-version => parent-version-range-local-child-revision-expression}/child/pom.xml (71%)
copy maven-core/src/test/resources/projects/{parent-version-range-local-valid => parent-version-range-local-child-revision-expression}/pom.xml (100%)
create mode 100644 maven-model-builder/src/main/java/org/apache/maven/model/interpolation/DefaultModelVersionProcessor.java
copy maven-model-builder/src/main/java/org/apache/maven/model/{path/ModelUrlNormalizer.java => interpolation/ModelVersionProcessor.java} (56%)
create mode 100644 maven-plugin-api/src/test/java/org/apache/maven/plugin/descriptor/MojoDescriptorTest.java
create mode 100644 maven-repository-metadata/src/test/java/org/apache/maven/artifact/repository/metadata/MetadataTest.java
copy maven-model-builder/src/main/java/org/apache/maven/model/locator/DefaultModelLocator.java => maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelCacheFactory.java (70%)
copy maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/{package-info.java => ModelCacheFactory.java} (77%)
[maven] 12/12: Upgrade latest resolver
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 406dbed9cceddccee18099e597c4b3b5a9636257
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Mar 10 08:12:48 2022 +0100
Upgrade latest resolver
---
.../java/org/apache/maven/repository/internal/RelocatedArtifact.java | 5 -----
1 file changed, 5 deletions(-)
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
index 6dd05d6..d12454f 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
@@ -153,9 +153,4 @@ public final class RelocatedArtifact
return message;
}
- @Override
- protected Artifact newInstance( String version, Map<String, String> properties, File file )
- {
- throw new IllegalStateException();
- }
}
[maven] 11/12: Fix m-install-p ITs
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit bb68564a7e4217c9096dc3077d153f2f4f25392c
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Mar 10 07:46:09 2022 +0100
Fix m-install-p ITs
---
.../main/java/org/apache/maven/api/Session.java | 9 ++--
.../apache/maven/api/services/ArtifactFactory.java | 11 ++---
.../maven/api/services/ArtifactFactoryRequest.java | 49 +++++++++++-----------
.../apache/maven/api/services/ProjectManager.java | 13 ++++--
.../maven/internal/impl/DefaultArtifact.java | 8 +++-
.../internal/impl/DefaultArtifactFactory.java | 10 ++++-
.../internal/impl/DefaultArtifactInstaller.java | 4 --
.../internal/impl/DefaultArtifactManager.java | 4 --
.../apache/maven/internal/impl/DefaultProject.java | 2 +-
.../internal/impl/DefaultRepositoryFactory.java | 2 +-
.../apache/maven/internal/impl/DefaultSession.java | 7 ++++
.../plugin/PluginParameterExpressionEvaluator.java | 18 +++++++-
12 files changed, 84 insertions(+), 53 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Session.java b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
index 4e50ec1..d568b47 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Session.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
@@ -135,21 +135,22 @@ public interface Session
/**
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
*/
- default Artifact createArtifact( String groupId, String artifactId, String version, String type )
+ default Artifact createArtifact( String groupId, String artifactId, String version, String extension )
throws ArtifactFactoryException, IllegalArgumentException
{
return getService( ArtifactFactory.class )
- .create( this, groupId, artifactId, version, type );
+ .create( this, groupId, artifactId, version, extension );
}
/**
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
*/
- default Artifact createArtifact( String groupId, String artifactId, String classifier, String version, String type )
+ default Artifact createArtifact( String groupId, String artifactId, String version, String classifier,
+ String extension, String type )
throws ArtifactFactoryException, IllegalArgumentException
{
return getService( ArtifactFactory.class )
- .create( this, groupId, artifactId, classifier, version, type );
+ .create( this, groupId, artifactId, version, classifier, extension, type );
}
/**
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
index c1ab305..c581a97 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
@@ -28,16 +28,17 @@ public interface ArtifactFactory extends Service
Artifact create( ArtifactFactoryRequest request )
throws ArtifactFactoryException, IllegalArgumentException;
- default Artifact create( Session session, String groupId, String artifactId, String version, String type )
+ default Artifact create( Session session, String groupId, String artifactId, String version, String extension )
throws ArtifactFactoryException, IllegalArgumentException
{
- return create( ArtifactFactoryRequest.build( session, groupId, artifactId, version, type ) );
+ return create( ArtifactFactoryRequest.build( session, groupId, artifactId, version, extension ) );
}
- default Artifact create( Session session, String groupId, String artifactId,
- String classifier, String version, String type )
+ default Artifact create( Session session, String groupId, String artifactId, String version,
+ String classifier, String extension, String type )
throws ArtifactFactoryException, IllegalArgumentException
{
- return create( ArtifactFactoryRequest.build( session, groupId, artifactId, classifier, version, type ) );
+ return create( ArtifactFactoryRequest.build( session, groupId, artifactId,
+ version, classifier, extension, type ) );
}
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
index 4032330..2a0c0c6 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
@@ -35,33 +35,34 @@ public interface ArtifactFactoryRequest
String getVersion();
- String getType();
+ String getClassifier();
String getExtension();
- String getClassifier();
+ String getType();
static ArtifactFactoryRequest build( Session session, String groupId, String artifactId,
- String version, String type )
+ String version, String extension )
{
return ArtifactFactoryRequest.builder()
.session( session )
.groupId( groupId )
.artifactId( artifactId )
.version( version )
- .type( type )
+ .extension( extension )
.build();
}
static ArtifactFactoryRequest build( Session session, String groupId, String artifactId,
- String classifier, String version, String type )
+ String version, String classifier, String extension, String type )
{
return ArtifactFactoryRequest.builder()
.session( session )
.groupId( groupId )
.artifactId( artifactId )
- .classifier( classifier )
.version( version )
+ .classifier( classifier )
+ .extension( extension )
.type( type )
.build();
}
@@ -77,9 +78,9 @@ public interface ArtifactFactoryRequest
private String groupId;
private String artifactId;
private String version;
- private String type;
- private String extension;
private String classifier;
+ private String extension;
+ private String type;
public ArtifactFactoryRequestBuilder session( Session session )
{
@@ -105,9 +106,9 @@ public interface ArtifactFactoryRequest
return this;
}
- public ArtifactFactoryRequestBuilder type( String type )
+ public ArtifactFactoryRequestBuilder classifier( String classifier )
{
- this.type = type;
+ this.classifier = classifier;
return this;
}
@@ -117,16 +118,16 @@ public interface ArtifactFactoryRequest
return this;
}
- public ArtifactFactoryRequestBuilder classifier( String classifier )
+ public ArtifactFactoryRequestBuilder type( String type )
{
- this.classifier = classifier;
+ this.type = type;
return this;
}
public ArtifactFactoryRequest build()
{
- return new DefaultArtifactFactoryRequest( session, groupId, artifactId,
- version, type, extension, classifier );
+ return new DefaultArtifactFactoryRequest( session, groupId, artifactId, version,
+ classifier, extension, type );
}
private static class DefaultArtifactFactoryRequest extends BaseRequest implements ArtifactFactoryRequest
@@ -134,25 +135,25 @@ public interface ArtifactFactoryRequest
private final String groupId;
private final String artifactId;
private final String version;
- private final String type;
- private final String extension;
private final String classifier;
+ private final String extension;
+ private final String type;
DefaultArtifactFactoryRequest( @Nonnull Session session,
String groupId,
String artifactId,
String version,
- String type,
+ String classifier,
String extension,
- String classifier )
+ String type )
{
super( session );
this.groupId = groupId;
this.artifactId = artifactId;
this.version = version;
- this.type = type;
- this.extension = extension;
this.classifier = classifier;
+ this.extension = extension;
+ this.type = type;
}
@Override
@@ -174,9 +175,9 @@ public interface ArtifactFactoryRequest
}
@Override
- public String getType()
+ public String getClassifier()
{
- return type;
+ return classifier;
}
@Override
@@ -186,9 +187,9 @@ public interface ArtifactFactoryRequest
}
@Override
- public String getClassifier()
+ public String getType()
{
- return classifier;
+ return type;
}
}
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
index ccc58c2..3904281 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
@@ -49,15 +49,20 @@ public interface ProjectManager extends Service
@Nonnull
Collection<Artifact> getAttachedArtifacts( Project project );
- default void attachArtifact( Session session, Project project, String type, Path path )
+ default void attachArtifact( Session session, Project project, Path path )
{
- attachArtifact( session, project, type, "", path );
+ String name = path.getFileName().toString();
+ int dot = name.lastIndexOf( '.' );
+ String ext = dot >= 1 ? name.substring( dot + 1 ) : "";
+ Artifact artifact = session.createArtifact( project.getGroupId(), project.getArtifactId(),
+ project.getVersion(), ext );
+ attachArtifact( project, artifact, path );
}
- default void attachArtifact( Session session, Project project, String type, String classifier, Path path )
+ default void attachArtifact( Session session, Project project, String type, Path path )
{
Artifact artifact = session.createArtifact( project.getGroupId(), project.getArtifactId(),
- classifier, project.getVersion(), type );
+ project.getVersion(), null, null, type );
attachArtifact( project, artifact, path );
}
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
index 37b669a..f2532f9 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
@@ -111,13 +111,17 @@ public class DefaultArtifact implements Artifact
return false;
}
DefaultArtifact that = (DefaultArtifact) o;
- return artifact.equals( that.artifact );
+ return Objects.equals( this.getGroupId(), that.getGroupId() )
+ && Objects.equals( this.getArtifactId(), that.getArtifactId() )
+ && Objects.equals( this.getVersion(), that.getVersion() )
+ && Objects.equals( this.getClassifier(), that.getClassifier() )
+ && Objects.equals( this.getExtension(), that.getExtension() );
}
@Override
public int hashCode()
{
- return Objects.hash( artifact );
+ return Objects.hash( getGroupId(), getArtifactId(), getVersion(), getClassifier(), getExtension() );
}
@Override
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactFactory.java
index c0a6f6c..e4f9b94 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactFactory.java
@@ -27,6 +27,7 @@ import org.apache.maven.api.Artifact;
import org.apache.maven.api.services.ArtifactFactory;
import org.apache.maven.api.services.ArtifactFactoryException;
import org.apache.maven.api.services.ArtifactFactoryRequest;
+import org.apache.maven.shared.utils.StringUtils;
import org.eclipse.aether.artifact.ArtifactType;
@Named
@@ -41,13 +42,18 @@ public class DefaultArtifactFactory implements ArtifactFactory
{
type = session.getSession().getArtifactTypeRegistry().get( request.getType() );
}
+ String classifier = StringUtils.isNotEmpty( request.getClassifier() )
+ ? request.getClassifier()
+ : type != null ? type.getClassifier() : null;
+ String extension = StringUtils.isNotEmpty( request.getExtension() )
+ ? request.getExtension() : type != null ? type.getExtension() : null;
return new DefaultArtifact(
session,
new org.eclipse.aether.artifact.DefaultArtifact(
request.getGroupId(),
request.getArtifactId(),
- request.getClassifier(),
- request.getExtension(),
+ classifier,
+ extension,
request.getVersion(),
type ) );
}
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java
index f9df047..592e495 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java
@@ -20,8 +20,6 @@ package org.apache.maven.internal.impl;
*/
import javax.annotation.Nonnull;
-import javax.inject.Inject;
-import javax.inject.Named;
import java.util.Collection;
import java.util.List;
@@ -38,13 +36,11 @@ import org.eclipse.aether.installation.InstallResult;
import org.eclipse.aether.installation.InstallationException;
import org.eclipse.aether.metadata.Metadata;
-@Named
public class DefaultArtifactInstaller implements ArtifactInstaller
{
private final RepositorySystem repositorySystem;
- @Inject
DefaultArtifactInstaller( @Nonnull RepositorySystem repositorySystem )
{
this.repositorySystem = Objects.requireNonNull( repositorySystem );
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
index 60b338b..d007f93 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
@@ -20,7 +20,6 @@ package org.apache.maven.internal.impl;
*/
import javax.annotation.Nonnull;
-import javax.inject.Named;
import java.nio.file.Path;
import java.util.Collection;
@@ -31,13 +30,10 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Pattern;
-import org.apache.maven.SessionScoped;
import org.apache.maven.api.Artifact;
import org.apache.maven.api.Metadata;
import org.apache.maven.api.services.ArtifactManager;
-@Named
-@SessionScoped
public class DefaultArtifactManager implements ArtifactManager
{
private static final String SNAPSHOT = "SNAPSHOT";
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
index 5677cf9..8aaf7a1 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
@@ -143,7 +143,7 @@ public class DefaultProject implements Project
public Artifact getArtifact()
{
return session.createArtifact( dependency.getGroupId(), dependency.getArtifactId(),
- dependency.getVersion(), dependency.getType() );
+ dependency.getVersion(), null, null, dependency.getType() );
}
@Nonnull
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
index c7430b7..793b1d8 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
@@ -41,7 +41,7 @@ public class DefaultRepositoryFactory implements RepositoryFactory
@Override
public LocalRepository createLocal( Path path )
{
- return new DefaultLocalRepository( new org.eclipse.aether.repository.LocalRepository( "target/repo" ) );
+ return new DefaultLocalRepository( new org.eclipse.aether.repository.LocalRepository( path.toFile() ) );
}
@Override
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
index 39a181a..08c296d 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
@@ -308,6 +308,13 @@ public class DefaultSession implements Session
return allDependencies.computeIfAbsent( dependency, d -> new DefaultDependency( this, d ) );
}
+ public List<Project> getProjects( List<MavenProject> projects )
+ {
+ return projects == null ? null : projects.stream()
+ .map( this::getProject )
+ .collect( Collectors.toList() );
+ }
+
public Project getProject( MavenProject project )
{
return allProjects.computeIfAbsent( project.getId(), id -> new DefaultProject( this, project ) );
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
index 6ae8d7d..656b0a3 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
@@ -236,7 +236,14 @@ public class PluginParameterExpressionEvaluator
}
else if ( "reactorProjects".equals( expression ) )
{
- value = session.getProjects();
+ if ( mojoDescriptor.isV4Api() )
+ {
+ value = ( ( DefaultSession ) session.getSession() ).getProjects( session.getProjects() );
+ }
+ else
+ {
+ value = session.getProjects();
+ }
}
else if ( "mojoExecution".equals( expression ) )
{
@@ -255,7 +262,14 @@ public class PluginParameterExpressionEvaluator
}
else if ( "executedProject".equals( expression ) )
{
- value = project.getExecutionProject();
+ if ( mojoDescriptor.isV4Api() )
+ {
+ value = ( (DefaultSession) session.getSession() ).getProject( project.getExecutionProject() );
+ }
+ else
+ {
+ value = project.getExecutionProject();
+ }
}
else if ( expression.startsWith( "project" ) || expression.startsWith( "pom" ) )
{
[maven] 09/12: runtime support
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit dea91e2d7fb5bd7b41ac94f074e6bf5348bded98
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Mar 8 11:48:02 2022 +0100
runtime support
---
.../main/java/org/apache/maven/api/Metadata.java | 3 +
.../apache/maven/api/services/ArtifactManager.java | 6 ++
maven-core-impl/pom.xml | 71 ----------------------
.../internal/impl/DefaultArtifactManager.java | 3 +-
.../impl/DefaultLocalRepositoryManager.java | 8 ++-
.../maven/internal/impl/DefaultProjectManager.java | 37 ++++++++---
.../internal/impl/DefaultRepositoryFactory.java | 10 +--
.../apache/maven/internal/impl/DefaultSession.java | 31 +++++-----
.../plugin/PluginParameterExpressionEvaluator.java | 10 ++-
9 files changed, 79 insertions(+), 100 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Metadata.java b/maven-core-api/src/main/java/org/apache/maven/api/Metadata.java
index b3575d2..d0b83ef 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Metadata.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Metadata.java
@@ -19,6 +19,9 @@ package org.apache.maven.api;
* under the License.
*/
+/**
+ * TODO: investigate removing the Metadata api completely
+ */
public interface Metadata
{
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
index 949a50e..48488a5 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
@@ -43,9 +43,15 @@ public interface ArtifactManager extends Service
*/
void setPath( @Nonnull Artifact artifact, Path path );
+ /**
+ * TODO: investigate removing the Metadata api completely
+ */
@Nonnull
Collection<Metadata> getAttachedMetadatas( @Nonnull Artifact artifact );
+ /**
+ * TODO: investigate removing the Metadata api completely
+ */
void attachMetadata( @Nonnull Artifact artifact, @Nonnull Metadata metadata );
/**
diff --git a/maven-core-impl/pom.xml b/maven-core-impl/pom.xml
deleted file mode 100644
index 65551b4..0000000
--- a/maven-core-impl/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven</artifactId>
- <version>4.0.0-alpha-1-SNAPSHOT</version>
- </parent>
-
- <artifactId>maven-core-impl</artifactId>
- <name>Apache Maven Core API Implementation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-impl</artifactId>
- </dependency>
-
- <!-- Testing -->
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-testing</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-connector-basic</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-transport-http</artifactId>
- <version>${resolverVersion}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-transport-file</artifactId>
- <version>${resolverVersion}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
index 6d7706f..60b338b 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
@@ -51,7 +51,8 @@ public class DefaultArtifactManager implements ArtifactManager
@Override
public Optional<Path> getPath( @Nonnull Artifact artifact )
{
- return Optional.ofNullable( paths.get( artifact ) );
+ Path path = paths.get( artifact );
+ return path != null ? Optional.of( path ) : artifact.getPath();
}
@Override
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepositoryManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepositoryManager.java
index 54d6c06..450791d 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepositoryManager.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepositoryManager.java
@@ -70,8 +70,12 @@ public class DefaultLocalRepositoryManager implements LocalRepositoryManager
private org.eclipse.aether.repository.LocalRepositoryManager getManager(
DefaultSession session, LocalRepository local )
{
- return session.getRepositorySystem()
- .newLocalRepositoryManager( session.getSession(), session.toRepository( local ) );
+ org.eclipse.aether.repository.LocalRepository repository = session.toRepository( local );
+ if ( "enhanced".equals( repository.getContentType() ) )
+ {
+ repository = new org.eclipse.aether.repository.LocalRepository( repository.getBasedir(), "" );
+ }
+ return session.getRepositorySystem().newLocalRepositoryManager( session.getSession(), repository );
}
}
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
index aeb0c9e..ba27d0b 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
@@ -23,60 +23,83 @@ import javax.annotation.Nonnull;
import java.nio.file.Path;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.maven.api.Artifact;
import org.apache.maven.api.Node;
import org.apache.maven.api.Project;
import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.api.services.ArtifactManager;
import org.apache.maven.api.services.ProjectManager;
public class DefaultProjectManager implements ProjectManager
{
+ private final Map<Project, Path> paths = new ConcurrentHashMap<>();
+ private final Map<Project, Collection<Artifact>> attachedArtifacts = new ConcurrentHashMap<>();
+ private final Map<Project, List<String>> compileSourceRoots = new ConcurrentHashMap<>();
+ private final Map<Project, List<String>> testCompileSourceRoots = new ConcurrentHashMap<>();
+ private final ArtifactManager artifactManager;
+
+ public DefaultProjectManager( ArtifactManager artifactManager )
+ {
+ this.artifactManager = artifactManager;
+ }
+
@Nonnull
@Override
public Optional<Path> getPath( Project project )
{
- return Optional.empty();
+ return Optional.ofNullable( paths.get( project ) );
}
@Nonnull
@Override
public Collection<Artifact> getAttachedArtifacts( Project project )
{
- return null;
+ Collection<Artifact> attached = attachedArtifacts.get( project );
+ return attached != null ? Collections.unmodifiableCollection( attached ) : Collections.emptyList();
}
@Override
public void attachArtifact( Project project, Artifact artifact, Path path )
{
-
+ attachedArtifacts.computeIfAbsent( project, p -> new CopyOnWriteArrayList<>() )
+ .add( artifact );
+ artifactManager.setPath( artifact, path );
}
@Override
public List<String> getCompileSourceRoots( Project project )
{
- return null;
+ List<String> roots = compileSourceRoots.get( project );
+ return roots != null ? Collections.unmodifiableList( roots ) : Collections.emptyList();
}
@Override
public void addCompileSourceRoot( Project project, String sourceRoot )
{
-
+ compileSourceRoots.computeIfAbsent( project, p -> new CopyOnWriteArrayList<>() )
+ .add( sourceRoot );
}
@Override
public List<String> getTestCompileSourceRoots( Project project )
{
- return null;
+ List<String> roots = testCompileSourceRoots.get( project );
+ return roots != null ? Collections.unmodifiableList( roots ) : Collections.emptyList();
}
@Override
public void addTestCompileSourceRoot( Project project, String sourceRoot )
{
-
+ testCompileSourceRoots.computeIfAbsent( project, p -> new CopyOnWriteArrayList<>() )
+ .add( sourceRoot );
}
@Override
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
index e6595f7..c7430b7 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
@@ -26,6 +26,7 @@ import org.apache.maven.api.RemoteRepository;
import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.model.Repository;
import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.repository.RepositoryPolicy;
public class DefaultRepositoryFactory implements RepositoryFactory
{
@@ -47,7 +48,7 @@ public class DefaultRepositoryFactory implements RepositoryFactory
public RemoteRepository createRemote( String id, String url )
{
return new DefaultRemoteRepository(
- new org.eclipse.aether.repository.RemoteRepository.Builder( id, "", url )
+ new org.eclipse.aether.repository.RemoteRepository.Builder( id, "default", url )
.build() );
}
@@ -67,8 +68,8 @@ public class DefaultRepositoryFactory implements RepositoryFactory
org.apache.maven.model.RepositoryPolicy policy )
{
boolean enabled = true;
- String updatePolicy = null;
- String checksumPolicy = null;
+ String updatePolicy = RepositoryPolicy.UPDATE_POLICY_DAILY;
+ String checksumPolicy = RepositoryPolicy.CHECKSUM_POLICY_FAIL;
if ( policy != null )
{
enabled = policy.isEnabled();
@@ -81,6 +82,7 @@ public class DefaultRepositoryFactory implements RepositoryFactory
checksumPolicy = policy.getChecksumPolicy();
}
}
- return new org.eclipse.aether.repository.RepositoryPolicy( enabled, updatePolicy, checksumPolicy );
+ return new org.eclipse.aether.repository.RepositoryPolicy(
+ enabled, updatePolicy, checksumPolicy );
}
}
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
index 72c6dba..2671c3c 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
@@ -22,6 +22,7 @@ package org.apache.maven.internal.impl;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import java.io.File;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
@@ -82,7 +83,7 @@ public class DefaultSession implements Session
private final DefaultToolchainManagerPrivate toolchainManagerPrivate;
private final List<Listener> listeners = new CopyOnWriteArrayList<>();
private final ArtifactManager artifactManager = new DefaultArtifactManager();
- private final ProjectManager projectManager = new DefaultProjectManager();
+ private final ProjectManager projectManager = new DefaultProjectManager( artifactManager );
private final Map<org.eclipse.aether.graph.DependencyNode, Node> allNodes
= Collections.synchronizedMap( new WeakHashMap<>() );
@@ -424,22 +425,24 @@ public class DefaultSession implements Session
public org.eclipse.aether.artifact.Artifact toArtifact( Artifact artifact )
{
+ File file = getService( ArtifactManager.class ).getPath( artifact ).map( Path::toFile ).orElse( null );
if ( artifact instanceof DefaultArtifact )
{
- return ( ( DefaultArtifact ) artifact ).getArtifact();
- }
- else
- {
- return new org.eclipse.aether.artifact.DefaultArtifact(
- artifact.getGroupId(),
- artifact.getArtifactId(),
- artifact.getClassifier(),
- artifact.getExtension(),
- artifact.getVersion(),
- null,
- getService( ArtifactManager.class ).getPath( artifact ).map( Path::toFile ).orElse( null )
- );
+ org.eclipse.aether.artifact.Artifact a = ( (DefaultArtifact) artifact ).getArtifact();
+ if ( Objects.equals( file, a.getFile() ) )
+ {
+ return a;
+ }
}
+ return new org.eclipse.aether.artifact.DefaultArtifact(
+ artifact.getGroupId(),
+ artifact.getArtifactId(),
+ artifact.getClassifier(),
+ artifact.getExtension(),
+ artifact.getVersion(),
+ null,
+ file
+ );
}
public org.eclipse.aether.metadata.Metadata toMetadata( Metadata metadata )
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
index 6f00873..6ae8d7d 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
@@ -23,6 +23,7 @@ import java.io.File;
import java.util.Properties;
import org.apache.maven.execution.MavenSession;
+import org.apache.maven.internal.impl.DefaultSession;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject;
@@ -243,7 +244,14 @@ public class PluginParameterExpressionEvaluator
}
else if ( "project".equals( expression ) )
{
- value = project;
+ if ( mojoDescriptor.isV4Api() )
+ {
+ value = ( (DefaultSession) session.getSession() ).getProject( project );
+ }
+ else
+ {
+ value = project;
+ }
}
else if ( "executedProject".equals( expression ) )
{
[maven] 05/12: Add Listener / Event, JavaToolchain, ArtifactManager.isSnapshot(String) ...
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 92ab732173917c4d64e6602ab9897be22df88892
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Feb 15 13:23:10 2022 +0100
Add Listener / Event, JavaToolchain, ArtifactManager.isSnapshot(String) ...
---
.../main/java/org/apache/maven/api/Dependency.java | 1 +
.../src/main/java/org/apache/maven/api/Event.java | 88 ++++++++++++++++++++++
.../{RemoteRepository.java => JavaToolchain.java} | 6 +-
.../api/{RemoteRepository.java => Listener.java} | 12 ++-
.../org/apache/maven/api/RemoteRepository.java | 8 ++
.../main/java/org/apache/maven/api/Session.java | 48 ++++++++++++
.../apache/maven/api/services/ArtifactManager.java | 8 +-
.../apache/maven/api/services/ProjectManager.java | 25 ++++++
.../maven/api/services/RepositoryFactory.java | 3 +
.../apache/maven/impl/DefaultRemoteRepository.java | 14 ++++
.../maven/impl/DefaultRepositoryFactory.java | 42 +++++++++++
.../java/org/apache/maven/impl/DefaultSession.java | 23 +++++-
.../maven/plugin/descriptor/PluginDescriptor.java | 19 ++---
13 files changed, 281 insertions(+), 16 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java b/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
index b0e0fe3..0e672f6 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
@@ -31,6 +31,7 @@ public interface Dependency
@Nonnull
Artifact getArtifact();
+ // TODO: make that en enum ?
String getScope();
@Nullable
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Event.java b/maven-core-api/src/main/java/org/apache/maven/api/Event.java
new file mode 100644
index 0000000..9e2c1f6
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Event.java
@@ -0,0 +1,88 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Event
+ */
+public interface Event
+{
+
+ /**
+ * The possible types of execution events.
+ */
+ enum Type
+ {
+ ProjectDiscoveryStarted,
+ SessionStarted,
+ SessionEnded,
+ ProjectSkipped,
+ ProjectStarted,
+ ProjectSucceeded,
+ ProjectFailed,
+ MojoSkipped,
+ MojoStarted,
+ MojoSucceeded,
+ MojoFailed,
+ ForkStarted,
+ ForkSucceeded,
+ ForkFailed,
+ ForkedProjectStarted,
+ ForkedProjectSucceeded,
+ ForkedProjectFailed,
+ }
+
+ /**
+ * Gets the type of the event.
+ *
+ * @return The type of the event, never {@code null}.
+ */
+ Type getType();
+
+ /**
+ * Gets the session from which this event originates.
+ *
+ * @return The current session, never {@code null}.
+ */
+ Session getSession();
+
+ /**
+ * Gets the current project (if any).
+ *
+ * @return The current project or {@code null} if not applicable.
+ */
+ Project getProject();
+
+ /**
+ * Gets the current mojo execution (if any).
+ *
+ * @return The current mojo execution or {@code null} if not applicable.
+ * TODO: return MojoExecution
+ */
+ Object getMojoExecution();
+
+ /**
+ * Gets the exception that caused the event (if any).
+ *
+ * @return The exception or {@code null} if none.
+ */
+ Exception getException();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java b/maven-core-api/src/main/java/org/apache/maven/api/JavaToolchain.java
similarity index 86%
copy from maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
copy to maven-core-api/src/main/java/org/apache/maven/api/JavaToolchain.java
index 6b8c3ea..d863e6f 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/JavaToolchain.java
@@ -9,7 +9,7 @@ package org.apache.maven.api;
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -19,7 +19,9 @@ package org.apache.maven.api;
* under the License.
*/
-public interface RemoteRepository extends Repository
+public interface JavaToolchain extends Toolchain
{
+ String getJavaHome();
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java b/maven-core-api/src/main/java/org/apache/maven/api/Listener.java
similarity index 79%
copy from maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
copy to maven-core-api/src/main/java/org/apache/maven/api/Listener.java
index 6b8c3ea..3d83a88 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Listener.java
@@ -9,7 +9,7 @@ package org.apache.maven.api;
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -19,7 +19,13 @@ package org.apache.maven.api;
* under the License.
*/
-public interface RemoteRepository extends Repository
-{
+import javax.annotation.Nonnull;
+/**
+ * A listener for session events.
+ */
+@FunctionalInterface
+public interface Listener
+{
+ void onEvent( @Nonnull Event event );
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java b/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
index 6b8c3ea..1790b98 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
@@ -19,7 +19,15 @@ package org.apache.maven.api;
* under the License.
*/
+import javax.annotation.Nonnull;
+
public interface RemoteRepository extends Repository
{
+ @Nonnull
+ String getUrl();
+
+ @Nonnull
+ String getProtocol();
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Session.java b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
index b4f9dc0..4e50ec1 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Session.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
@@ -24,6 +24,7 @@ import javax.annotation.concurrent.ThreadSafe;
import java.nio.file.Path;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Properties;
@@ -44,6 +45,7 @@ import org.apache.maven.api.services.DependencyFactory;
import org.apache.maven.api.services.DependencyResolver;
import org.apache.maven.api.services.DependencyResolverException;
import org.apache.maven.api.services.DependencyResolverResult;
+import org.apache.maven.api.services.LocalRepositoryManager;
import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.api.services.Service;
import org.apache.maven.settings.Settings;
@@ -100,6 +102,28 @@ public interface Session
Session withRemoteRepositories( @Nonnull List<RemoteRepository> repositories );
/**
+ * Register the given listener which will receive all events.
+ *
+ * @param listener the listener to register
+ */
+ void registerListener( @Nonnull Listener listener );
+
+ /**
+ * Unregisters a previously registered listener.
+ *
+ * @param listener the listener to unregister
+ */
+ void unregisterListener( @Nonnull Listener listener );
+
+ /**
+ * Returns the list of registered listeners.
+ *
+ * @return an immutable collection of listeners
+ */
+ @Nonnull
+ Collection<Listener> getListeners();
+
+ /**
* Shortcut for <code>getService(RepositoryFactory.class).createLocal(...)</code>
*/
default LocalRepository createLocalRepository( Path path )
@@ -207,4 +231,28 @@ public interface Session
.resolve( this, dependency, null );
}
+ default Path getPathForLocalArtifact( Artifact artifact )
+ {
+ return getService( LocalRepositoryManager.class )
+ .getPathForLocalArtifact( this, getLocalRepository(), artifact );
+ }
+
+ default Path getPathForLocalMetadata( Metadata metadata )
+ {
+ return getService( LocalRepositoryManager.class )
+ .getPathForLocalMetadata( this, getLocalRepository(), metadata );
+ }
+
+ default Path getPathForRemoteArtifact( RemoteRepository remote, Artifact artifact )
+ {
+ return getService( LocalRepositoryManager.class )
+ .getPathForRemoteArtifact( this, getLocalRepository(), remote, artifact );
+ }
+
+ default Path getPathForRemoteMetadata( RemoteRepository remote, Metadata metadata )
+ {
+ return getService( LocalRepositoryManager.class )
+ .getPathForRemoteMetadata( this, getLocalRepository(), remote, metadata );
+ }
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
index 609a9ac..a354458 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
@@ -40,10 +40,16 @@ public interface ArtifactManager extends Service
@Nonnull
Optional<Path> getPath( Artifact artifact );
+ void setPath( Artifact artifact, Path path );
+
@Nonnull
Collection<Metadata> getAttachedMetadatas( Artifact artifact );
void attachMetadata( @Nonnull Artifact artifact, @Nonnull Metadata metadata );
- void setPath( Artifact artifact, Path path );
+ /**
+ * Checks whether a given artifact version is considered a <code>SNAPSHOT</code> or not.
+ */
+ boolean isSnapshot( String version );
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
index 0651a26..a8456c6 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
@@ -23,10 +23,13 @@ import javax.annotation.Nonnull;
import java.nio.file.Path;
import java.util.Collection;
+import java.util.List;
import java.util.Optional;
import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Node;
import org.apache.maven.api.Project;
+import org.apache.maven.api.RemoteRepository;
/**
* Interface to manage the project during its lifecycle
@@ -49,4 +52,26 @@ public interface ProjectManager extends Service
void attachArtifact( Project project, String trim, String trim1, Path path );
+ List<String> getCompileSourceRoots( Project project );
+
+ void addCompileSourceRoot( Project project, String sourceRoot );
+
+ List<String> getTestCompileSourceRoots( Project project );
+
+ void addTestCompileSourceRoot( Project project, String sourceRoot );
+
+ List<RemoteRepository> getRepositories( Project project );
+
+ List<Artifact> getResolvedDependencies( Project project, ResolutionScope scope );
+
+ Node getCollectedDependencies( Project project, ResolutionScope scope );
+
+ enum ResolutionScope
+ {
+ Compile,
+ CompileRuntime,
+ Runtime,
+ RuntimeSystem,
+ Test
+ }
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/RepositoryFactory.java b/maven-core-api/src/main/java/org/apache/maven/api/services/RepositoryFactory.java
index 7318bd9..b59cb1f 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/RepositoryFactory.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/RepositoryFactory.java
@@ -23,6 +23,7 @@ import java.nio.file.Path;
import org.apache.maven.api.LocalRepository;
import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.model.Repository;
public interface RepositoryFactory extends Service
{
@@ -31,4 +32,6 @@ public interface RepositoryFactory extends Service
RemoteRepository createRemote( String id, String url );
+ RemoteRepository createRemote( Repository repository );
+
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java
index 73d481f..713619e 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java
@@ -50,4 +50,18 @@ public class DefaultRemoteRepository implements RemoteRepository
{
return repository.getContentType();
}
+
+ @Nonnull
+ @Override
+ public String getUrl()
+ {
+ return repository.getUrl();
+ }
+
+ @Nonnull
+ @Override
+ public String getProtocol()
+ {
+ return repository.getProtocol();
+ }
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
index 5e8e045..6198946 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
@@ -24,10 +24,19 @@ import java.nio.file.Path;
import org.apache.maven.api.LocalRepository;
import org.apache.maven.api.RemoteRepository;
import org.apache.maven.api.services.RepositoryFactory;
+import org.apache.maven.model.Repository;
+import org.eclipse.aether.RepositorySystem;
public class DefaultRepositoryFactory implements RepositoryFactory
{
+ private final RepositorySystem repositorySystem;
+
+ public DefaultRepositoryFactory( RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = repositorySystem;
+ }
+
@Override
public LocalRepository createLocal( Path path )
{
@@ -41,4 +50,37 @@ public class DefaultRepositoryFactory implements RepositoryFactory
new org.eclipse.aether.repository.RemoteRepository.Builder( id, "", url )
.build() );
}
+
+ @Override
+ public RemoteRepository createRemote( Repository repository )
+ throws IllegalArgumentException
+ {
+ return new DefaultRemoteRepository(
+ new org.eclipse.aether.repository.RemoteRepository.Builder(
+ repository.getId(), repository.getLayout(), repository.getUrl() )
+ .setReleasePolicy( buildRepositoryPolicy( repository.getReleases() ) )
+ .setSnapshotPolicy( buildRepositoryPolicy( repository.getSnapshots() ) )
+ .build() );
+ }
+
+ public static org.eclipse.aether.repository.RepositoryPolicy buildRepositoryPolicy(
+ org.apache.maven.model.RepositoryPolicy policy )
+ {
+ boolean enabled = true;
+ String updatePolicy = null;
+ String checksumPolicy = null;
+ if ( policy != null )
+ {
+ enabled = policy.isEnabled();
+ if ( policy.getUpdatePolicy() != null )
+ {
+ updatePolicy = policy.getUpdatePolicy();
+ }
+ if ( policy.getChecksumPolicy() != null )
+ {
+ checksumPolicy = policy.getChecksumPolicy();
+ }
+ }
+ return new org.eclipse.aether.repository.RepositoryPolicy( enabled, updatePolicy, checksumPolicy );
+ }
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
index 585987b..5edf26c 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
@@ -31,9 +31,11 @@ import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Properties;
import java.util.WeakHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Supplier;
import java.util.stream.Collectors;
+import org.apache.maven.api.Listener;
import org.apache.maven.api.SessionData;
import org.apache.maven.api.services.LocalRepositoryManager;
import org.apache.maven.api.services.RepositoryFactory;
@@ -77,6 +79,7 @@ public class DefaultSession implements Session
private final org.apache.maven.project.ProjectBuilder projectBuilder;
private final MavenRepositorySystem mavenRepositorySystem;
private LocalRepositoryProvider localRepositoryProvider;
+ private final List<Listener> listeners = new CopyOnWriteArrayList<>();
private final Map<org.eclipse.aether.graph.DependencyNode, Node> allNodes
= Collections.synchronizedMap( new WeakHashMap<>() );
@@ -260,7 +263,7 @@ public class DefaultSession implements Session
}
else if ( clazz == RepositoryFactory.class )
{
- return (T) new DefaultRepositoryFactory();
+ return (T) new DefaultRepositoryFactory( repositorySystem );
}
throw new NoSuchElementException( clazz.getName() );
}
@@ -457,4 +460,22 @@ public class DefaultSession implements Session
throw new UnsupportedOperationException( "Not implemented yet" );
}
+ @Override
+ public void registerListener( @Nonnull Listener listener )
+ {
+ listeners.add( listener );
+ }
+
+ @Override
+ public void unregisterListener( @Nonnull Listener listener )
+ {
+ listeners.remove( listener );
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Listener> getListeners()
+ {
+ return Collections.unmodifiableCollection( listeners );
+ }
}
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
index 2d4e1ef..7edcb35 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
@@ -19,8 +19,7 @@ package org.apache.maven.plugin.descriptor;
* under the License.
*/
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.ArtifactUtils;
+import org.apache.maven.api.Artifact;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.lifecycle.Lifecycle;
import org.apache.maven.plugin.lifecycle.LifecycleConfiguration;
@@ -30,18 +29,19 @@ import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.stream.Collectors;
/**
* @author Jason van Zyl
@@ -259,7 +259,8 @@ public class PluginDescriptor
{
if ( artifactMap == null )
{
- artifactMap = ArtifactUtils.artifactMapByVersionlessId( getArtifacts() );
+ artifactMap = getArtifacts().stream()
+ .collect( Collectors.toMap( a -> a.getGroupId() + ":" + a.getArtifactId(), a -> a ) );
}
return artifactMap;
@@ -397,17 +398,17 @@ public class PluginDescriptor
private InputStream getDescriptorStream( String descriptor )
throws IOException
{
- File pluginFile = ( pluginArtifact != null ) ? pluginArtifact.getFile() : null;
+ Path pluginFile = ( pluginArtifact != null ) ? pluginArtifact.getPath().orElse( null ) : null;
if ( pluginFile == null )
{
throw new IllegalStateException( "plugin main artifact has not been resolved for " + getId() );
}
- if ( pluginFile.isFile() )
+ if ( Files.isRegularFile( pluginFile ) )
{
try
{
- return new URL( "jar:" + pluginFile.toURI() + "!/" + descriptor ).openStream();
+ return new URL( "jar:" + pluginFile.toUri() + "!/" + descriptor ).openStream();
}
catch ( MalformedURLException e )
{
@@ -416,7 +417,7 @@ public class PluginDescriptor
}
else
{
- return new FileInputStream( new File( pluginFile, descriptor ) );
+ return Files.newInputStream( pluginFile.resolve( descriptor ) );
}
}
[maven] 04/12: Make all exceptions RuntimeException and introduce a common MavenException base type
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 5d4688fcdbf4dd3601a9ed8fe5d4c069e96ebe25
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Feb 15 13:21:00 2022 +0100
Make all exceptions RuntimeException and introduce a common MavenException base type
---
.../api/services/ArtifactDeployerException.java | 2 +-
.../api/services/ArtifactFactoryException.java | 2 +-
.../api/services/ArtifactInstallerException.java | 2 +-
.../api/services/ArtifactResolverException.java | 2 +-
.../api/services/DependencyCollectorException.java | 2 +-
.../api/services/DependencyFactoryException.java | 2 +-
.../api/services/DependencyResolverException.java | 2 +-
...CollectorException.java => MavenException.java} | 35 ++++++++++++----------
.../api/services/ProjectBuilderException.java | 2 +-
.../api/services/ProjectDeployerException.java | 2 +-
.../api/services/ProjectInstallerException.java | 2 +-
11 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java
index a5ac23a..ca9d9c4 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java
@@ -24,7 +24,7 @@ package org.apache.maven.api.services;
*
*/
public class ArtifactDeployerException
- extends Exception
+ extends MavenException
{
/**
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryException.java
index ee2f7a0..2a1cf37 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryException.java
@@ -20,7 +20,7 @@ package org.apache.maven.api.services;
*/
public class ArtifactFactoryException
- extends RuntimeException
+ extends MavenException
{
public ArtifactFactoryException( String message )
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java
index 77c3f20..18da90a 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java
@@ -23,7 +23,7 @@ package org.apache.maven.api.services;
*
*/
public class ArtifactInstallerException
- extends Exception
+ extends MavenException
{
/**
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverException.java
index d243fc9..d5e442b 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverException.java
@@ -23,7 +23,7 @@ package org.apache.maven.api.services;
*
*/
public class ArtifactResolverException
- extends Exception
+ extends MavenException
{
private static final long serialVersionUID = 7252294837746943917L;
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java
index 733e2f9..e04b557 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java
@@ -24,7 +24,7 @@ package org.apache.maven.api.services;
* dependency graph.
*/
public class DependencyCollectorException
- extends Exception
+ extends MavenException
{
/**
*
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryException.java
index 5ca1d43..e0c5f2f 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryException.java
@@ -20,7 +20,7 @@ package org.apache.maven.api.services;
*/
public class DependencyFactoryException
- extends RuntimeException
+ extends MavenException
{
public DependencyFactoryException( String message )
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverException.java
index 77ee118..74bc04e 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverException.java
@@ -23,7 +23,7 @@ package org.apache.maven.api.services;
* The Exception class in case a resolving does not work.
*/
public class DependencyResolverException
- extends Exception
+ extends MavenException
{
private static final long serialVersionUID = 5320065249974323888L;
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/MavenException.java
similarity index 63%
copy from maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java
copy to maven-core-api/src/main/java/org/apache/maven/api/services/MavenException.java
index 733e2f9..7b83387 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/MavenException.java
@@ -19,24 +19,29 @@ package org.apache.maven.api.services;
* under the License.
*/
-/**
- * Thrown in case of bad artifact descriptors, version ranges or other issues encountered during calculation of the
- * dependency graph.
- */
-public class DependencyCollectorException
- extends Exception
+public class MavenException extends RuntimeException
{
- /**
- *
- */
- private static final long serialVersionUID = -3134726259840210686L;
+ public MavenException()
+ {
+ }
+
+ public MavenException( String message )
+ {
+ super( message );
+ }
- /**
- * @param message The message you would give for the exception.
- * @param cause The cause which is related to the message.
- */
- public DependencyCollectorException( String message, Throwable cause )
+ public MavenException( String message, Throwable cause )
{
super( message, cause );
}
+
+ public MavenException( Throwable cause )
+ {
+ super( cause );
+ }
+
+ public MavenException( String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace )
+ {
+ super( message, cause, enableSuppression, writableStackTrace );
+ }
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderException.java
index a71c5e7..0189385 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderException.java
@@ -23,7 +23,7 @@ package org.apache.maven.api.services;
* The Exception class in case a resolving does not work.
*/
public class ProjectBuilderException
- extends Exception
+ extends MavenException
{
/**
* @param message The message to give.
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java
index 0884364..fd8ceb3 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java
@@ -23,7 +23,7 @@ package org.apache.maven.api.services;
* The Exception class in case a resolving does not work.
*/
public class ProjectDeployerException
- extends Exception
+ extends MavenException
{
/**
* @param message The message to give.
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java
index 1aaf536..f1c160f 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java
@@ -23,7 +23,7 @@ package org.apache.maven.api.services;
* The Exception class in case a resolving does not work.
*/
public class ProjectInstallerException
- extends Exception
+ extends MavenException
{
/**
* @param message The message to give.
[maven] 02/12: Maven API (draft)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 0db459779afcede4a2b005dd15f75075e64fd2b6
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Sun Feb 13 09:57:04 2022 +0100
Maven API (draft)
---
maven-bom/pom.xml | 5 +
maven-core-api/pom.xml | 41 ++
.../main/java/org/apache/maven/api/Artifact.java | 97 ++++
.../org/apache/maven/api/ArtifactMetadata.java | 24 +
.../main/java/org/apache/maven/api/Dependency.java | 73 +++
.../main/java/org/apache/maven/api/Exclusion.java | 32 ++
.../java/org/apache/maven/api/LocalRepository.java | 29 +
.../src/main/java/org/apache/maven/api/Node.java | 97 ++++
.../java/org/apache/maven/api/NodeVisitor.java | 48 ++
.../main/java/org/apache/maven/api/Project.java | 60 +++
.../org/apache/maven/api/RemoteRepository.java | 25 +
.../main/java/org/apache/maven/api/Repository.java | 43 ++
.../org/apache/maven/api/RepositoryMetadata.java | 24 +
.../main/java/org/apache/maven/api/Session.java | 175 ++++++
.../maven/api/services/ArtifactDeployer.java | 61 +++
.../api/services/ArtifactDeployerException.java | 44 ++
.../api/services/ArtifactDeployerRequest.java | 125 +++++
.../apache/maven/api/services/ArtifactFactory.java | 36 ++
.../api/services/ArtifactFactoryException.java | 36 ++
.../maven/api/services/ArtifactFactoryRequest.java | 183 +++++++
.../maven/api/services/ArtifactInstaller.java | 71 +++
.../api/services/ArtifactInstallerException.java | 43 ++
.../api/services/ArtifactInstallerRequest.java | 103 ++++
.../apache/maven/api/services/ArtifactManager.java | 46 ++
.../maven/api/services/ArtifactResolver.java | 56 ++
.../api/services/ArtifactResolverException.java | 40 ++
.../api/services/ArtifactResolverRequest.java | 101 ++++
.../maven/api/services/ArtifactResolverResult.java | 37 ++
.../org/apache/maven/api/services/BaseRequest.java | 66 +++
.../maven/api/services/DependencyCollector.java | 115 ++++
.../api/services/DependencyCollectorException.java | 42 ++
.../api/services/DependencyCollectorRequest.java | 288 ++++++++++
.../api/services/DependencyCollectorResult.java | 47 ++
.../maven/api/services/DependencyFactory.java | 37 ++
.../api/services/DependencyFactoryException.java | 36 ++
.../api/services/DependencyFactoryRequest.java | 167 ++++++
.../maven/api/services/DependencyResolver.java | 90 ++++
.../api/services/DependencyResolverException.java | 54 ++
.../api/services/DependencyResolverRequest.java | 327 ++++++++++++
.../api/services/DependencyResolverResult.java | 44 ++
.../apache/maven/api/services/ProjectBuilder.java | 57 ++
.../api/services/ProjectBuilderException.java | 37 ++
.../maven/api/services/ProjectBuilderProblem.java | 101 ++++
.../maven/api/services/ProjectBuilderRequest.java | 218 ++++++++
.../maven/api/services/ProjectBuilderResult.java | 76 +++
.../maven/api/services/ProjectBuilderSource.java | 30 ++
.../apache/maven/api/services/ProjectDeployer.java | 68 +++
.../api/services/ProjectDeployerException.java | 37 ++
.../maven/api/services/ProjectDeployerRequest.java | 142 +++++
.../maven/api/services/ProjectInstaller.java | 79 +++
.../api/services/ProjectInstallerException.java | 37 ++
.../api/services/ProjectInstallerRequest.java | 101 ++++
.../apache/maven/api/services/ProjectManager.java | 48 ++
.../org/apache/maven/api/services/Service.java | 27 +
maven-core-impl/pom.xml | 72 +++
.../org/apache/maven/impl/DefaultArtifact.java | 101 ++++
.../apache/maven/impl/DefaultArtifactDeployer.java | 76 +++
.../apache/maven/impl/DefaultArtifactFactory.java | 54 ++
.../maven/impl/DefaultArtifactInstaller.java | 111 ++++
.../apache/maven/impl/DefaultArtifactResolver.java | 73 +++
.../org/apache/maven/impl/DefaultDependency.java | 95 ++++
.../maven/impl/DefaultDependencyCollector.java | 93 ++++
.../maven/impl/DefaultDependencyFactory.java | 56 ++
.../maven/impl/DefaultDependencyResolver.java | 106 ++++
.../apache/maven/impl/DefaultLocalRepository.java | 67 +++
.../java/org/apache/maven/impl/DefaultNode.java | 102 ++++
.../java/org/apache/maven/impl/DefaultProject.java | 172 ++++++
.../apache/maven/impl/DefaultProjectBuilder.java | 258 +++++++++
.../apache/maven/impl/DefaultProjectDeployer.java | 142 +++++
.../apache/maven/impl/DefaultProjectInstaller.java | 77 +++
.../apache/maven/impl/DefaultRemoteRepository.java | 53 ++
.../java/org/apache/maven/impl/DefaultSession.java | 386 ++++++++++++++
.../org/apache/maven/impl/MappedCollection.java | 63 +++
.../java/org/apache/maven/impl/MappedList.java | 48 ++
.../test/java/org/apache/maven/impl/TestApi.java | 105 ++++
.../org/apache/maven/impl/TestArtifactHandler.java | 83 +++
.../apache/maven/impl/TestRepositorySystem.java | 341 ++++++++++++
.../2.0.2/commons-httpclient-2.0.2.jar | Bin 0 -> 225375 bytes
.../2.0.2/commons-httpclient-2.0.2.jar.sha1 | 1 +
.../2.0.2/commons-httpclient-2.0.2.pom | 220 ++++++++
.../2.0.2/commons-httpclient-2.0.2.pom.sha1 | 1 +
.../1.0.3/commons-logging-1.0.3.jar | Bin 0 -> 31605 bytes
.../1.0.3/commons-logging-1.0.3.jar.sha1 | 1 +
.../1.0.3/commons-logging-1.0.3.pom | 31 ++
.../1.0.3/commons-logging-1.0.3.pom.sha1 | 1 +
...logging-1.0.4-javadoc-resources.jar.lastUpdated | 4 +
.../1.0.4/commons-logging-1.0.4.jar | Bin 0 -> 38015 bytes
.../1.0.4/commons-logging-1.0.4.jar.sha1 | 1 +
.../1.0.4/commons-logging-1.0.4.pom | 165 ++++++
.../1.0.4/commons-logging-1.0.4.pom.sha1 | 1 +
.../xml-im-exporter/1.1/xml-im-exporter-1.1.jar | Bin 0 -> 24168 bytes
.../1.1/xml-im-exporter-1.1.jar.sha1 | 1 +
.../xml-im-exporter/1.1/xml-im-exporter-1.1.pom | 8 +
.../1.1/xml-im-exporter-1.1.pom.sha1 | 1 +
.../test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar | Bin 0 -> 153253 bytes
.../resources/repo/jdom/jdom/1.0/jdom-1.0.jar.sha1 | 1 +
.../test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom | 40 ++
.../resources/repo/jdom/jdom/1.0/jdom-1.0.pom.sha1 | 1 +
.../junit-4.13.1-javadoc-resources.jar.lastUpdated | 4 +
.../junit/junit/4.13.1/junit-4.13.1-javadoc.jar | Bin 0 -> 1674093 bytes
.../junit/4.13.1/junit-4.13.1-javadoc.jar.sha1 | 1 +
.../junit/junit/4.13.1/junit-4.13.1-sources.jar | Bin 0 -> 232161 bytes
.../junit/4.13.1/junit-4.13.1-sources.jar.sha1 | 1 +
.../repo/junit/junit/4.13.1/junit-4.13.1.jar | Bin 0 -> 382708 bytes
.../repo/junit/junit/4.13.1/junit-4.13.1.jar.sha1 | 1 +
.../repo/junit/junit/4.13.1/junit-4.13.1.pom | 587 +++++++++++++++++++++
.../repo/junit/junit/4.13.1/junit-4.13.1.pom.sha1 | 1 +
.../repo/org/apache/apache/3/apache-3.pom | 82 +++
.../repo/org/apache/apache/3/apache-3.pom.md5 | 1 +
.../repo/org/apache/apache/3/apache-3.pom.sha1 | 1 +
.../3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar | Bin 0 -> 163984 bytes
.../maven-artifact-3.0-SNAPSHOT.jar.md5 | 1 +
.../maven-artifact-3.0-SNAPSHOT.jar.sha1 | 1 +
.../3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom | 112 ++++
.../maven-artifact-3.0-SNAPSHOT.pom.md5 | 1 +
.../maven-artifact-3.0-SNAPSHOT.pom.sha1 | 1 +
.../test/test-extension/1/test-extension-1.jar | Bin 0 -> 4208 bytes
.../test/test-extension/1/test-extension-1.pom | 73 +++
.../test/test-extension/1/test-extension-1.pom.md5 | 1 +
.../test-extension/1/test-extension-1.pom.sha1 | 1 +
.../1/test-lifecycle-and-artifactHandler-1.jar | Bin 0 -> 2582 bytes
.../1/test-lifecycle-and-artifactHandler-1.pom | 44 ++
.../1/test-lifecycle-and-artifactHandler-1.pom.md5 | 1 +
.../test-lifecycle-and-artifactHandler-1.pom.sha1 | 1 +
.../apache/maven/maven-parent/4/maven-parent-4.pom | 304 +++++++++++
.../maven/maven-parent/4/maven-parent-4.pom.md5 | 1 +
.../maven/maven-parent/4/maven-parent-4.pom.sha1 | 1 +
.../apache/maven/maven-parent/5/maven-parent-5.pom | 466 ++++++++++++++++
.../maven/maven-parent/5/maven-parent-5.pom.md5 | 1 +
.../maven/maven-parent/5/maven-parent-5.pom.sha1 | 1 +
.../1.0-beta-2/wagon-provider-api-1.0-beta-2.jar | Bin 0 -> 46326 bytes
.../wagon-provider-api-1.0-beta-2.jar.md5 | 1 +
.../wagon-provider-api-1.0-beta-2.jar.sha1 | 1 +
.../1.0-beta-2/wagon-provider-api-1.0-beta-2.pom | 21 +
.../wagon-provider-api-1.0-beta-2.pom.md5 | 1 +
.../wagon-provider-api-1.0-beta-2.pom.sha1 | 1 +
.../1.0-beta-2/wagon-providers-1.0-beta-2.pom | 51 ++
.../1.0-beta-2/wagon-providers-1.0-beta-2.pom.md5 | 1 +
.../1.0-beta-2/wagon-providers-1.0-beta-2.pom.sha1 | 1 +
.../1.0-beta-2/wagon-webdav-1.0-beta-2.jar | Bin 0 -> 17297 bytes
.../1.0-beta-2/wagon-webdav-1.0-beta-2.jar.md5 | 1 +
.../1.0-beta-2/wagon-webdav-1.0-beta-2.jar.sha1 | 1 +
.../1.0-beta-2/wagon-webdav-1.0-beta-2.pom | 50 ++
.../1.0-beta-2/wagon-webdav-1.0-beta-2.pom.md5 | 1 +
.../1.0-beta-2/wagon-webdav-1.0-beta-2.pom.sha1 | 1 +
.../wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom | 170 ++++++
.../wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5 | 1 +
.../wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1 | 1 +
.../plexus-active-collections-1.0-beta-1.jar | Bin 0 -> 15961 bytes
.../plexus-active-collections-1.0-beta-1.jar.md5 | 1 +
.../plexus-active-collections-1.0-beta-1.jar.sha1 | 1 +
.../plexus-active-collections-1.0-beta-1.pom | 51 ++
.../plexus-active-collections-1.0-beta-1.pom.md5 | 1 +
.../plexus-active-collections-1.0-beta-1.pom.sha1 | 1 +
.../plexus-classworlds-1.2-alpha-10.jar | Bin 0 -> 42472 bytes
.../plexus-classworlds-1.2-alpha-10.jar.md5 | 1 +
.../plexus-classworlds-1.2-alpha-10.jar.sha1 | 1 +
.../plexus-classworlds-1.2-alpha-10.pom | 94 ++++
.../plexus-classworlds-1.2-alpha-10.pom.md5 | 1 +
.../plexus-classworlds-1.2-alpha-10.pom.sha1 | 1 +
.../1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar | Bin 0 -> 42636 bytes
.../plexus-classworlds-1.2-alpha-7.jar.md5 | 1 +
.../plexus-classworlds-1.2-alpha-7.jar.sha1 | 1 +
.../1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom | 78 +++
.../plexus-classworlds-1.2-alpha-7.pom.md5 | 1 +
.../plexus-classworlds-1.2-alpha-7.pom.sha1 | 1 +
.../plexus-component-api-1.0-alpha-16.jar | Bin 0 -> 33149 bytes
.../plexus-component-api-1.0-alpha-16.jar.md5 | 1 +
.../plexus-component-api-1.0-alpha-16.jar.sha1 | 1 +
.../plexus-component-api-1.0-alpha-16.pom | 63 +++
.../plexus-component-api-1.0-alpha-16.pom.md5 | 1 +
.../plexus-component-api-1.0-alpha-16.pom.sha1 | 1 +
.../plexus-component-api-1.0-alpha-32.jar | Bin 0 -> 36108 bytes
.../plexus-component-api-1.0-alpha-32.jar.md5 | 1 +
.../plexus-component-api-1.0-alpha-32.jar.sha1 | 1 +
.../plexus-component-api-1.0-alpha-32.pom | 61 +++
.../plexus-component-api-1.0-alpha-32.pom.md5 | 1 +
.../plexus-component-api-1.0-alpha-32.pom.sha1 | 1 +
.../1.1.6/plexus-components-1.1.6.pom | 60 +++
.../1.1.6/plexus-components-1.1.6.pom.md5 | 1 +
.../1.1.6/plexus-components-1.1.6.pom.sha1 | 1 +
.../plexus-container-default-1.0-alpha-16.jar | Bin 0 -> 210679 bytes
.../plexus-container-default-1.0-alpha-16.jar.md5 | 1 +
.../plexus-container-default-1.0-alpha-16.jar.sha1 | 1 +
.../plexus-container-default-1.0-alpha-16.pom | 56 ++
.../plexus-container-default-1.0-alpha-16.pom.md5 | 1 +
.../plexus-container-default-1.0-alpha-16.pom.sha1 | 1 +
.../plexus-container-default-1.0-alpha-32.jar | Bin 0 -> 238880 bytes
.../plexus-container-default-1.0-alpha-32.jar.md5 | 1 +
.../plexus-container-default-1.0-alpha-32.jar.sha1 | 1 +
.../plexus-container-default-1.0-alpha-32.pom | 98 ++++
.../plexus-container-default-1.0-alpha-32.pom.md5 | 1 +
.../plexus-container-default-1.0-alpha-32.pom.sha1 | 1 +
.../plexus-containers-1.0-alpha-16.pom | 49 ++
.../plexus-containers-1.0-alpha-16.pom.md5 | 1 +
.../plexus-containers-1.0-alpha-16.pom.sha1 | 1 +
.../plexus-containers-1.0-alpha-32.pom | 49 ++
.../plexus-containers-1.0-alpha-32.pom.md5 | 1 +
.../plexus-containers-1.0-alpha-32.pom.sha1 | 1 +
.../plexus-utils/1.0.4/plexus-utils-1.0.4.jar | Bin 0 -> 163803 bytes
.../plexus-utils/1.0.4/plexus-utils-1.0.4.jar.sha1 | 1 +
.../plexus-utils/1.0.4/plexus-utils-1.0.4.pom | 235 +++++++++
.../plexus-utils/1.0.4/plexus-utils-1.0.4.pom.sha1 | 1 +
.../plexus/plexus-utils/1.1/plexus-utils-1.1.jar | Bin 0 -> 168568 bytes
.../plexus-utils/1.1/plexus-utils-1.1.jar.md5 | 1 +
.../plexus-utils/1.1/plexus-utils-1.1.jar.sha1 | 1 +
.../plexus/plexus-utils/1.1/plexus-utils-1.1.pom | 27 +
.../plexus-utils/1.1/plexus-utils-1.1.pom.md5 | 1 +
.../plexus-utils/1.1/plexus-utils-1.1.pom.sha1 | 1 +
.../plexus-utils/1.4.5/plexus-utils-1.4.5.jar | Bin 0 -> 205043 bytes
.../plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5 | 1 +
.../plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1 | 1 +
.../plexus-utils/1.4.5/plexus-utils-1.4.5.pom | 61 +++
.../plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5 | 1 +
.../plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1 | 1 +
.../plexus/plexus/1.0.10/plexus-1.0.10.pom | 273 ++++++++++
.../plexus/plexus/1.0.10/plexus-1.0.10.pom.md5 | 1 +
.../plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1 | 1 +
.../plexus/plexus/1.0.11/plexus-1.0.11.pom | 308 +++++++++++
.../plexus/plexus/1.0.11/plexus-1.0.11.pom.md5 | 1 +
.../plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1 | 1 +
.../codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom | 205 +++++++
.../plexus/plexus/1.0.4/plexus-1.0.4.pom.md5 | 1 +
.../plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1 | 1 +
.../codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom | 259 +++++++++
.../plexus/plexus/1.0.8/plexus-1.0.8.pom.md5 | 1 +
.../plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1 | 1 +
.../codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom | 257 +++++++++
.../plexus/plexus/1.0.9/plexus-1.0.9.pom.md5 | 1 +
.../plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1 | 1 +
...rest-core-1.3-javadoc-resources.jar.lastUpdated | 4 +
.../1.3/hamcrest-core-1.3-javadoc.jar | Bin 0 -> 242519 bytes
.../1.3/hamcrest-core-1.3-javadoc.jar.sha1 | 1 +
.../1.3/hamcrest-core-1.3-sources.jar | Bin 0 -> 32624 bytes
.../1.3/hamcrest-core-1.3-sources.jar.sha1 | 1 +
.../hamcrest-core/1.3/hamcrest-core-1.3.jar | Bin 0 -> 45024 bytes
.../hamcrest-core/1.3/hamcrest-core-1.3.jar.sha1 | 1 +
.../hamcrest-core/1.3/hamcrest-core-1.3.pom | 18 +
.../hamcrest-core/1.3/hamcrest-core-1.3.pom.sha1 | 1 +
.../hamcrest-parent/1.3/hamcrest-parent-1.3.pom | 72 +++
.../1.3/hamcrest-parent-1.3.pom.sha1 | 1 +
.../slide-webdavlib/2.1/slide-webdavlib-2.1.jar | Bin 0 -> 172727 bytes
.../2.1/slide-webdavlib-2.1.jar.md5 | 1 +
.../2.1/slide-webdavlib-2.1.jar.sha1 | 1 +
.../slide-webdavlib/2.1/slide-webdavlib-2.1.pom | 23 +
.../2.1/slide-webdavlib-2.1.pom.md5 | 1 +
.../2.1/slide-webdavlib-2.1.pom.sha1 | 1 +
pom.xml | 2 +
248 files changed, 11798 insertions(+)
diff --git a/maven-bom/pom.xml b/maven-bom/pom.xml
index 1d8e708..88526dc 100644
--- a/maven-bom/pom.xml
+++ b/maven-bom/pom.xml
@@ -96,6 +96,11 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
+ <artifactId>maven-core-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/maven-core-api/pom.xml b/maven-core-api/pom.xml
new file mode 100644
index 0000000..853b64a
--- /dev/null
+++ b/maven-core-api/pom.xml
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven</artifactId>
+ <version>4.0.0-alpha-1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>maven-core-api</artifactId>
+ <name>Apache Maven Core API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <version>3.0.2</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Artifact.java b/maven-core-api/src/main/java/org/apache/maven/api/Artifact.java
new file mode 100644
index 0000000..6ef6856
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Artifact.java
@@ -0,0 +1,97 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.concurrent.Immutable;
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+@Immutable
+public interface Artifact
+{
+
+ /**
+ * The groupId of the artifact.
+ *
+ * @return The groupId.
+ */
+ @Nonnull
+ String getGroupId();
+
+ /**
+ * The artifactId of the artifact.
+ *
+ * @return The artifactId.
+ */
+ @Nonnull
+ String getArtifactId();
+
+ /**
+ * The version of the artifact.
+ *
+ * @return The version.
+ */
+ @Nonnull
+ String getVersion();
+
+ /**
+ * The file-extension of the artifact.
+ *
+ * @return The extension.
+ */
+ @Nonnull
+ String getExtension();
+
+ /**
+ * The classifier of the artifact.
+ *
+ * @return The classifier.
+ */
+ @Nonnull
+ String getClassifier();
+
+ /**
+ * Gets the base version of this artifact, for example "1.0-SNAPSHOT". In contrast to the {@link #getVersion()}, the
+ * base version will always refer to the unresolved meta version.
+ *
+ * @return The base version, never {@code null}.
+ */
+ @Nonnull
+ String getBaseVersion();
+
+ /**
+ * Determines whether this artifact uses a snapshot version.
+ *
+ * @return {@code true} if the artifact is a snapshot, {@code false} otherwise.
+ */
+ boolean isSnapshot();
+
+ /**
+ * Gets the file of this artifact. Note that only resolved artifacts have a file associated with them. In general,
+ * callers must not assume any relationship between an artifact's filename and its coordinates.
+ *
+ * @return The file or {@link Optional#empty()} if the artifact isn't resolved.
+ */
+ @Nonnull
+ Optional<Path> getPath();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java b/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
new file mode 100644
index 0000000..6cee8b6
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
@@ -0,0 +1,24 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public interface ArtifactMetadata
+{
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java b/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
new file mode 100644
index 0000000..b0e0fe3
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
@@ -0,0 +1,73 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.Immutable;
+
+import java.util.Collection;
+
+@Immutable
+public interface Dependency
+{
+ @Nonnull
+ Artifact getArtifact();
+
+ String getScope();
+
+ @Nullable
+ Boolean getOptional();
+
+ @Nonnull
+ Collection<Exclusion> getExclusions();
+
+ @Nonnull
+ default String getGroupId()
+ {
+ return getArtifact().getGroupId();
+ }
+
+ @Nonnull
+ default String getArtifactId()
+ {
+ return getArtifact().getArtifactId();
+ }
+
+ @Nonnull
+ default String getVersion()
+ {
+ return getArtifact().getVersion();
+ }
+
+ @Nonnull
+ default String getType()
+ {
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
+ }
+
+ @Nonnull
+ default String getClassifier()
+ {
+ return getArtifact().getClassifier();
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Exclusion.java b/maven-core-api/src/main/java/org/apache/maven/api/Exclusion.java
new file mode 100644
index 0000000..c87b99b
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Exclusion.java
@@ -0,0 +1,32 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nullable;
+
+public interface Exclusion
+{
+ @Nullable
+ String getGroupId();
+
+ @Nullable
+ String getArtifactId();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/LocalRepository.java b/maven-core-api/src/main/java/org/apache/maven/api/LocalRepository.java
new file mode 100644
index 0000000..d113567
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/LocalRepository.java
@@ -0,0 +1,29 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.nio.file.Path;
+
+public interface LocalRepository extends Repository
+{
+
+ Path getPath();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Node.java b/maven-core-api/src/main/java/org/apache/maven/api/Node.java
new file mode 100644
index 0000000..6b42a0a
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Node.java
@@ -0,0 +1,97 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.concurrent.Immutable;
+
+import java.util.List;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+
+/**
+ * Represents a dependency node within a Maven project's dependency collector.
+ *
+ * @author Pim Moerenhout
+ * @since 0.12
+ */
+@Immutable
+public interface Node
+{
+ /**
+ * @return artifact for this node
+ */
+ Artifact getArtifact();
+
+ /**
+ * @return dependency for this node
+ */
+ Dependency getDependency();
+
+ /**
+ * Gets the child nodes of this node.
+ *
+ * @return the child nodes of this node, never {@code null}
+ */
+ List<Node> getChildren();
+
+ /**
+ * @return repositories of this node
+ */
+ List<Repository> getRemoteRepositories();
+
+ /**
+ * @return true for an optional dependency.
+ */
+ Boolean getOptional();
+
+ /**
+ * @return The scope on the dependency.
+ */
+ String getScope();
+
+ /**
+ * Traverses this node and potentially its children using the specified visitor.
+ *
+ * @param visitor The visitor to call back, must not be {@code null}.
+ * @return {@code true} to visit siblings nodes of this node as well, {@code false} to skip siblings.
+ */
+ boolean accept( NodeVisitor visitor );
+
+ /**
+ * Returns a new tree starting at this node, filtering the children.
+ * Note that this node will not be filtered and only the children
+ * and its descendant will be checked.
+ *
+ * @param filter the filter to apply
+ * @return a new filtered graph
+ */
+ Node filter( Predicate<Node> filter );
+
+ /**
+ * Obtain a Stream containing this node and all its descendant.
+ *
+ * @return a stream containing this node and its descendant
+ */
+ default Stream<Node> stream()
+ {
+ return Stream.concat( Stream.of( this ), getChildren().stream().flatMap( Node::stream ) );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/NodeVisitor.java b/maven-core-api/src/main/java/org/apache/maven/api/NodeVisitor.java
new file mode 100644
index 0000000..102c13c
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/NodeVisitor.java
@@ -0,0 +1,48 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+/**
+ * Defines a hierarchical visitor for collecting dependency node trees.
+ *
+ * @author Pim Moerenhout
+ * @since 0.12
+ */
+public interface NodeVisitor
+{
+ /**
+ * Starts the visit to the specified dependency node.
+ *
+ * @param node the dependency node to visit
+ * @return <code>true</code> to visit the specified dependency node's children, <code>false</code> to skip the
+ * specified dependency node's children and proceed to its next sibling
+ */
+ boolean enter( Node node );
+
+ /**
+ * Ends the visit to the specified dependency node.
+ *
+ * @param node the dependency node to visit
+ * @return <code>true</code> to visit the specified dependency node's next sibling, <code>false</code> to skip the
+ * specified dependency node's next siblings and proceed to its parent
+ */
+ boolean leave( Node node );
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Project.java b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
new file mode 100644
index 0000000..037f718
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
@@ -0,0 +1,60 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.nio.file.Path;
+import java.util.List;
+
+/**
+ * Interface representing a Maven project.
+ */
+public interface Project
+{
+
+ @Nonnull
+ String getGroupId();
+
+ @Nonnull
+ String getArtifactId();
+
+ @Nonnull
+ String getVersion();
+
+ @Nonnull
+ String getPackaging();
+
+ @Nonnull
+ Artifact getArtifact();
+
+ @Nonnull
+ Object getModel();
+
+ @Nonnull
+ Path getPomPath();
+
+ @Nonnull
+ List<Dependency> getDependencies();
+
+ @Nonnull
+ List<Dependency> getManagedDependencies();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java b/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
new file mode 100644
index 0000000..6b8c3ea
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/RemoteRepository.java
@@ -0,0 +1,25 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public interface RemoteRepository extends Repository
+{
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Repository.java b/maven-core-api/src/main/java/org/apache/maven/api/Repository.java
new file mode 100644
index 0000000..dd7ac92
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Repository.java
@@ -0,0 +1,43 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+public interface Repository
+{
+
+ /**
+ * Gets the identifier of this repository.
+ *
+ * @return The (case-sensitive) identifier, never {@code null}.
+ */
+ @Nonnull
+ String getId();
+
+ /**
+ * Gets the type of the repository, for example "default".
+ *
+ * @return The (case-sensitive) type of the repository, never {@code null}.
+ */
+ @Nonnull
+ String getType();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/RepositoryMetadata.java b/maven-core-api/src/main/java/org/apache/maven/api/RepositoryMetadata.java
new file mode 100644
index 0000000..2ff856d
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/RepositoryMetadata.java
@@ -0,0 +1,24 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public interface RepositoryMetadata extends ArtifactMetadata
+{
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Session.java b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
new file mode 100644
index 0000000..6fbc7cd
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
@@ -0,0 +1,175 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.concurrent.ThreadSafe;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.apache.maven.api.services.ArtifactDeployer;
+import org.apache.maven.api.services.ArtifactDeployerException;
+import org.apache.maven.api.services.ArtifactFactory;
+import org.apache.maven.api.services.ArtifactFactoryException;
+import org.apache.maven.api.services.ArtifactInstaller;
+import org.apache.maven.api.services.ArtifactInstallerException;
+import org.apache.maven.api.services.ArtifactResolver;
+import org.apache.maven.api.services.ArtifactResolverException;
+import org.apache.maven.api.services.ArtifactResolverResult;
+import org.apache.maven.api.services.DependencyCollector;
+import org.apache.maven.api.services.DependencyCollectorException;
+import org.apache.maven.api.services.DependencyCollectorResult;
+import org.apache.maven.api.services.DependencyFactory;
+import org.apache.maven.api.services.DependencyResolver;
+import org.apache.maven.api.services.DependencyResolverException;
+import org.apache.maven.api.services.DependencyResolverResult;
+import org.apache.maven.api.services.Service;
+
+/**
+ * The session to install / deploy / resolve artifacts and dependencies.
+ */
+@ThreadSafe
+public interface Session
+{
+
+ @Nonnull
+ LocalRepository getLocalRepository();
+
+ @Nonnull
+ List<RemoteRepository> getRemoteRepositories();
+
+ /**
+ * Retrieves the service for the interface
+ *
+ * @throws NoSuchElementException if the service could not be found
+ */
+ @Nonnull
+ <T extends Service> T getService( Class<T> clazz ) throws NoSuchElementException;
+
+ /**
+ * Creates a derived session using the given local repository.
+ *
+ * @param localRepository the new local repository
+ * @return the derived session
+ */
+ @Nonnull
+ Session withLocalRepository( @Nonnull LocalRepository localRepository );
+
+ /**
+ * Creates a derived session using the given remote repositories.
+ *
+ * @param repositories the new list of remote repositories
+ * @return the derived session
+ */
+ @Nonnull
+ Session withRemoteRepositories( @Nonnull List<RemoteRepository> repositories );
+
+ /**
+ * Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
+ */
+ default Artifact createArtifact( String groupId, String artifactId, String version, String type )
+ throws ArtifactFactoryException, IllegalArgumentException
+ {
+ return getService( ArtifactFactory.class )
+ .create( this, groupId, artifactId, version, type );
+ }
+
+ /**
+ * Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
+ */
+ default ArtifactResolverResult resolveArtifact( Artifact artifact )
+ throws ArtifactResolverException, IllegalArgumentException
+ {
+ return getService( ArtifactResolver.class )
+ .resolve( this, artifact );
+ }
+
+ /**
+ * Shortcut for <code>getService(ArtifactResolver.class).install(...)</code>
+ */
+ default void installArtifact( Artifact... artifacts )
+ throws ArtifactInstallerException, IllegalArgumentException
+ {
+ getService( ArtifactInstaller.class )
+ .install( this, Arrays.asList( artifacts ) );
+ }
+
+ /**
+ * Shortcut for <code>getService(ArtifactResolver.class).deploy(...)</code>
+ */
+ default void deployArtifact( RemoteRepository repository, Artifact... artifacts )
+ throws ArtifactDeployerException, IllegalArgumentException
+ {
+ getService( ArtifactDeployer.class )
+ .deploy( this, repository, Arrays.asList( artifacts ) );
+ }
+
+ /**
+ * Shortcut for <code>getService(DependencyFactory.class).create(...)</code>
+ */
+ default Dependency createDependency( Artifact artifact )
+ {
+ return getService( DependencyFactory.class )
+ .create( this, artifact );
+ }
+
+ /**
+ * Shortcut for <code>getService(DependencyCollector.class).collect(...)</code>
+ */
+ default DependencyCollectorResult collectDependencies( Artifact artifact )
+ throws DependencyCollectorException, IllegalArgumentException
+ {
+ return getService( DependencyCollector.class )
+ .collect( this, artifact );
+ }
+
+ /**
+ * Shortcut for <code>getService(DependencyCollector.class).collect(...)</code>
+ */
+ default DependencyCollectorResult collectDependencies( Project project )
+ throws DependencyCollectorException, IllegalArgumentException
+ {
+ return getService( DependencyCollector.class )
+ .collect( this, project );
+ }
+
+ /**
+ * Shortcut for <code>getService(DependencyCollector.class).collect(...)</code>
+ */
+ default DependencyCollectorResult collectDependencies( Dependency dependency )
+ throws DependencyCollectorException, IllegalArgumentException
+ {
+ return getService( DependencyCollector.class )
+ .collect( this, dependency );
+ }
+
+ /**
+ * Shortcut for <code>getService(DependencyResolver.class).resolve(...)</code>
+ */
+ default DependencyResolverResult resolveDependencies( Dependency dependency )
+ throws DependencyResolverException, IllegalArgumentException
+ {
+ return getService( DependencyResolver.class )
+ .resolve( this, dependency, null );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployer.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployer.java
new file mode 100644
index 0000000..c78f1ad
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployer.java
@@ -0,0 +1,61 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collection;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.RemoteRepository;
+
+/**
+ *
+ */
+public interface ArtifactDeployer extends Service
+{
+
+ /**
+ * @param request {@link ArtifactDeployerRequest}
+ * @throws ArtifactDeployerException in case of an error.
+ * @throws IllegalArgumentException in case of parameter <code>request</code> is <code>null</code> or parameter
+ * <code>mavenArtifacts</code> is <code>null</code> or <code>mavenArtifacts.isEmpty()</code> is
+ * <code>true</code>.
+ */
+ void deploy( ArtifactDeployerRequest request )
+ throws ArtifactDeployerException, IllegalArgumentException;
+
+ /**
+ * @param session the repository session
+ * @param repository the repository to deploy to
+ * @param artifacts the collection of artifacts to deploy
+ * @throws ArtifactDeployerException in case of an error.
+ * @throws IllegalArgumentException in case of parameter <code>request</code> is <code>null</code> or parameter
+ * <code>artifacts</code> is <code>null</code> or <code>artifacts.isEmpty()</code> is
+ * <code>true</code>.
+ */
+ default void deploy( Session session,
+ RemoteRepository repository,
+ Collection<Artifact> artifacts )
+ throws ArtifactDeployerException, IllegalArgumentException
+ {
+ deploy( ArtifactDeployerRequest.build( session, repository, artifacts ) );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java
new file mode 100644
index 0000000..a5ac23a
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerException.java
@@ -0,0 +1,44 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * An artifact could not correctly being deployed.
+ *
+ */
+public class ArtifactDeployerException
+ extends Exception
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7421964724059077698L;
+
+ /**
+ * @param message The message of the error.
+ * @param e {@link Exception}
+ */
+ public ArtifactDeployerException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerRequest.java
new file mode 100644
index 0000000..f3363eb
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerRequest.java
@@ -0,0 +1,125 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.util.Collection;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.RemoteRepository;
+
+/**
+ * A request for deploying one or more artifacts to a remote repository.
+ */
+public interface ArtifactDeployerRequest
+{
+
+ @Nonnull
+ Session getSession();
+
+ @Nonnull
+ RemoteRepository getRepository();
+
+ @Nonnull
+ Collection<Artifact> getArtifacts();
+
+ @Nonnull
+ static ArtifactDeployerRequestBuilder builder()
+ {
+ return new ArtifactDeployerRequestBuilder();
+ }
+
+ @Nonnull
+ static ArtifactDeployerRequest build( Session session, RemoteRepository repository, Collection<Artifact> artifacts )
+ {
+ return builder()
+ .session( session )
+ .repository( repository )
+ .artifacts( artifacts )
+ .build();
+ }
+
+ class ArtifactDeployerRequestBuilder
+ {
+ Session session;
+ RemoteRepository repository;
+ Collection<Artifact> artifacts;
+
+ @Nonnull
+ public ArtifactDeployerRequestBuilder session( Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ @Nonnull
+ public ArtifactDeployerRequestBuilder repository( RemoteRepository repository )
+ {
+ this.repository = repository;
+ return this;
+ }
+
+ public ArtifactDeployerRequestBuilder artifacts( Collection<Artifact> artifacts )
+ {
+ this.artifacts = artifacts;
+ return this;
+ }
+
+ @Nonnull
+ public ArtifactDeployerRequest build()
+ {
+ return new DefaultArtifactDeployerRequest( session, repository, artifacts );
+ }
+
+ private static class DefaultArtifactDeployerRequest extends BaseRequest
+ implements ArtifactDeployerRequest
+ {
+
+ private final RemoteRepository repository;
+ private final Collection<Artifact> artifacts;
+
+ DefaultArtifactDeployerRequest( @Nonnull Session session,
+ @Nonnull RemoteRepository repository,
+ @Nonnull Collection<Artifact> artifacts )
+ {
+ super( session );
+ this.repository = requireNonNull( repository, "repository" );
+ this.artifacts = unmodifiable( artifacts, "artifacts" );
+ }
+
+ @Nonnull
+ @Override
+ public RemoteRepository getRepository()
+ {
+ return repository;
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Artifact> getArtifacts()
+ {
+ return artifacts;
+ }
+ }
+
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
new file mode 100644
index 0000000..2459409
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
@@ -0,0 +1,36 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+public interface ArtifactFactory extends Service
+{
+
+ Artifact create( ArtifactFactoryRequest request )
+ throws ArtifactFactoryException, IllegalArgumentException;
+
+ default Artifact create( Session session, String groupId, String artifactId, String version, String type )
+ throws ArtifactFactoryException, IllegalArgumentException
+ {
+ return create( ArtifactFactoryRequest.build( session, groupId, artifactId, version, type ) );
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryException.java
new file mode 100644
index 0000000..ee2f7a0
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryException.java
@@ -0,0 +1,36 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class ArtifactFactoryException
+ extends RuntimeException
+{
+
+ public ArtifactFactoryException( String message )
+ {
+ super( message );
+ }
+
+ public ArtifactFactoryException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
new file mode 100644
index 0000000..4bdf288
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
@@ -0,0 +1,183 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import org.apache.maven.api.Session;
+
+public interface ArtifactFactoryRequest
+{
+
+ @Nonnull
+ Session getSession();
+
+ String getGroupId();
+
+ String getArtifactId();
+
+ String getVersion();
+
+ String getType();
+
+ String getExtension();
+
+ String getClassifier();
+
+ static ArtifactFactoryRequest build( Session session, String groupId, String artifactId,
+ String version, String type )
+ {
+ return ArtifactFactoryRequest.builder()
+ .session( session )
+ .groupId( groupId )
+ .artifactId( artifactId )
+ .version( version )
+ .type( type )
+ .build();
+ }
+
+ static ArtifactFactoryRequestBuilder builder()
+ {
+ return new ArtifactFactoryRequestBuilder();
+ }
+
+ class ArtifactFactoryRequestBuilder
+ {
+ private Session session;
+ private String groupId;
+ private String artifactId;
+ private String version;
+ private String type;
+ private String extension;
+ private String classifier;
+
+ public ArtifactFactoryRequestBuilder session( Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ public ArtifactFactoryRequestBuilder groupId( String groupId )
+ {
+ this.groupId = groupId;
+ return this;
+ }
+
+ public ArtifactFactoryRequestBuilder artifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ return this;
+ }
+
+ public ArtifactFactoryRequestBuilder version( String version )
+ {
+ this.version = version;
+ return this;
+ }
+
+ public ArtifactFactoryRequestBuilder type( String type )
+ {
+ this.type = type;
+ return this;
+ }
+
+ public ArtifactFactoryRequestBuilder extension( String extension )
+ {
+ this.extension = extension;
+ return this;
+ }
+
+ public ArtifactFactoryRequestBuilder classifier( String classifier )
+ {
+ this.classifier = classifier;
+ return this;
+ }
+
+ public ArtifactFactoryRequest build()
+ {
+ return new DefaultArtifactFactoryRequest( session, groupId, artifactId,
+ version, type, extension, classifier );
+ }
+
+ private static class DefaultArtifactFactoryRequest extends BaseRequest implements ArtifactFactoryRequest
+ {
+ private final String groupId;
+ private final String artifactId;
+ private final String version;
+ private final String type;
+ private final String extension;
+ private final String classifier;
+
+ DefaultArtifactFactoryRequest( @Nonnull Session session,
+ String groupId,
+ String artifactId,
+ String version,
+ String type,
+ String extension,
+ String classifier )
+ {
+ super( session );
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.version = version;
+ this.type = type;
+ this.extension = extension;
+ this.classifier = classifier;
+ }
+
+ @Override
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ @Override
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ @Override
+ public String getVersion()
+ {
+ return version;
+ }
+
+ @Override
+ public String getType()
+ {
+ return type;
+ }
+
+ @Override
+ public String getExtension()
+ {
+ return extension;
+ }
+
+ @Override
+ public String getClassifier()
+ {
+ return classifier;
+ }
+ }
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstaller.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstaller.java
new file mode 100644
index 0000000..b440a28
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstaller.java
@@ -0,0 +1,71 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+/**
+ * @author Robert Scholte
+ */
+public interface ArtifactInstaller extends Service
+{
+ /**
+ * @param request {@link ArtifactInstallerRequest}
+ * @throws ArtifactInstallerException in case of an error.
+ * @throws IllegalArgumentException in case <code>request</code> is <code>null</code>.
+ */
+ void install( ArtifactInstallerRequest request )
+ throws ArtifactInstallerException, IllegalArgumentException;
+
+ /**
+ * @param session the repository session
+ * @param artifact the {@link Artifact} to install
+ * @throws ArtifactInstallerException In case of an error which can be the a given artifact can not be found or the
+ * installation has failed.
+ * @throws IllegalArgumentException in case of parameter <code>session</code> is <code>null</code> or
+ * <code>artifact</code> is <code>null</code>.
+ */
+ default void install( Session session, Artifact artifact )
+ throws ArtifactInstallerException, IllegalArgumentException
+ {
+ install( session, Collections.singletonList( artifact ) );
+ }
+
+ /**
+ * @param session the repository session
+ * @param artifacts Collection of {@link Artifact MavenArtifacts}
+ * @throws ArtifactInstallerException In case of an error which can be the a given artifact can not be found or the
+ * installation has failed.
+ * @throws IllegalArgumentException in case of parameter <code>request</code> is <code>null</code> or parameter
+ * <code>localRepository</code> is <code>null</code> or <code>localRepository</code> is not a directory
+ * or parameter <code>mavenArtifacts</code> is <code>null</code> or
+ * <code>mavenArtifacts.isEmpty()</code> is <code>true</code>.
+ */
+ default void install( Session session, Collection<Artifact> artifacts )
+ throws ArtifactInstallerException
+ {
+ install( ArtifactInstallerRequest.build( session, artifacts ) );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java
new file mode 100644
index 0000000..77c3f20
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerException.java
@@ -0,0 +1,43 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ *
+ */
+public class ArtifactInstallerException
+ extends Exception
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3652561971360586373L;
+
+ /**
+ * @param message The message of the error.
+ * @param e {@link Exception}
+ */
+ public ArtifactInstallerException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerRequest.java
new file mode 100644
index 0000000..dd6874e
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactInstallerRequest.java
@@ -0,0 +1,103 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+/**
+ * A request for installing one or more artifacts in the local repository.
+ */
+public interface ArtifactInstallerRequest
+{
+
+ @Nonnull
+ Session getSession();
+
+ @Nonnull
+ Collection<Artifact> getArtifacts();
+
+ static ArtifactInstallerRequestBuilder builder()
+ {
+ return new ArtifactInstallerRequestBuilder();
+ }
+
+ static ArtifactInstallerRequest build( Session session, Collection<Artifact> artifacts )
+ {
+ return builder()
+ .session( session )
+ .artifacts( artifacts )
+ .build();
+ }
+
+ class ArtifactInstallerRequestBuilder
+ {
+ Session session;
+ Collection<Artifact> artifacts = Collections.emptyList();
+
+ @Nonnull
+ public ArtifactInstallerRequestBuilder session( @Nonnull Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ @Nonnull
+ public ArtifactInstallerRequestBuilder artifacts( @Nullable Collection<Artifact> artifacts )
+ {
+ this.artifacts = artifacts != null ? artifacts : Collections.emptyList();
+ return this;
+ }
+
+ @Nonnull
+ public ArtifactInstallerRequest build()
+ {
+ return new DefaultArtifactInstallerRequest( session, artifacts );
+ }
+
+ static class DefaultArtifactInstallerRequest extends BaseRequest
+ implements ArtifactInstallerRequest
+ {
+
+ private final Collection<Artifact> artifacts;
+
+ DefaultArtifactInstallerRequest( @Nonnull Session session,
+ @Nonnull Collection<Artifact> artifacts )
+ {
+ super( session );
+ this.artifacts = unmodifiable( artifacts, "artifacts" );
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Artifact> getArtifacts()
+ {
+ return artifacts;
+ }
+ }
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
new file mode 100644
index 0000000..f96b014
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
@@ -0,0 +1,46 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Optional;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.ArtifactMetadata;
+
+public interface ArtifactManager extends Service
+{
+
+ /**
+ * Returns the path to the resolved file in the local repository
+ * if the artifact has been resolved.
+ *
+ * @return the path of the resolved artifact
+ */
+ @Nonnull
+ Optional<Path> getPath( Artifact artifact );
+
+ @Nonnull
+ Collection<ArtifactMetadata> getAttachedMetadatas( Artifact artifact );
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolver.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolver.java
new file mode 100644
index 0000000..25b6d13
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolver.java
@@ -0,0 +1,56 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+/**
+ * Resolves the artifact, i.e download the file when required and attach it to the artifact
+ */
+public interface ArtifactResolver extends Service
+{
+
+ /**
+ * @param request {@link ArtifactResolverRequest}
+ * @return {@link ArtifactResolverResult}
+ * @throws ArtifactResolverException in case of an error.
+ * @throws NullPointerException in case of parameter <code>buildingRequest</code> is <code>null</code> or
+ * parameter <code>mavenArtifact</code> is <code>null</code>.
+ */
+ ArtifactResolverResult resolve( ArtifactResolverRequest request )
+ throws ArtifactResolverException, IllegalArgumentException;
+
+ /**
+ * @param session {@link Session}
+ * @param artifact {@link Artifact}
+ * @return {@link ArtifactResolverResult}
+ * @throws ArtifactResolverException in case of an error.
+ * @throws NullPointerException in case of parameter <code>buildingRequest</code> is <code>null</code> or
+ * parameter <code>coordinate</code> is <code>null</code>.
+ */
+ default ArtifactResolverResult resolve( Session session,
+ Artifact artifact )
+ throws ArtifactResolverException, IllegalArgumentException
+ {
+ return resolve( ArtifactResolverRequest.build( session, artifact ) );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverException.java
new file mode 100644
index 0000000..d243fc9
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverException.java
@@ -0,0 +1,40 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ *
+ */
+public class ArtifactResolverException
+ extends Exception
+{
+
+ private static final long serialVersionUID = 7252294837746943917L;
+
+ /**
+ * @param message The message for the exception.
+ * @param e The exception itself.
+ */
+ public ArtifactResolverException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverRequest.java
new file mode 100644
index 0000000..b902d56
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverRequest.java
@@ -0,0 +1,101 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.util.Objects;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+/**
+ * A request for resolving an artifact.
+ */
+public interface ArtifactResolverRequest
+{
+ @Nonnull
+ Session getSession();
+
+ @Nonnull
+ Artifact getArtifact();
+
+ @Nonnull
+ static ArtifactResolverRequestBuilder builder()
+ {
+ return new ArtifactResolverRequestBuilder();
+ }
+
+ @Nonnull
+ static ArtifactResolverRequest build( Session session, Artifact artifact )
+ {
+ return builder()
+ .session( session )
+ .artifact( artifact )
+ .build();
+ }
+
+ class ArtifactResolverRequestBuilder
+ {
+ Session session;
+ Artifact artifact;
+
+ @Nonnull
+ public ArtifactResolverRequestBuilder session( Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ @Nonnull
+ public ArtifactResolverRequestBuilder artifact( Artifact artifact )
+ {
+ this.artifact = artifact;
+ return this;
+ }
+
+ @Nonnull
+ public ArtifactResolverRequest build()
+ {
+ return new DefaultArtifactResolverRequest( session, artifact );
+ }
+
+ private static class DefaultArtifactResolverRequest extends BaseRequest implements ArtifactResolverRequest
+ {
+ @Nonnull
+ private final Artifact artifact;
+
+ DefaultArtifactResolverRequest( @Nonnull Session session,
+ @Nonnull Artifact artifact )
+ {
+ super( session );
+ this.artifact = Objects.requireNonNull( artifact );
+ }
+
+ @Nonnull
+ @Override
+ public Artifact getArtifact()
+ {
+ return artifact;
+ }
+ }
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverResult.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverResult.java
new file mode 100644
index 0000000..9011405
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactResolverResult.java
@@ -0,0 +1,37 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.api.Artifact;
+
+/**
+ * The Artifact Result
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public interface ArtifactResolverResult
+{
+ /**
+ * @return {@link Artifact}
+ */
+ Artifact getArtifact();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/BaseRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/BaseRequest.java
new file mode 100644
index 0000000..c5eb047
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/BaseRequest.java
@@ -0,0 +1,66 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.apache.maven.api.Session;
+
+/**
+ * Base class for requests.
+ */
+abstract class BaseRequest
+{
+
+ private final Session session;
+
+ protected BaseRequest( @Nonnull Session session )
+ {
+ this.session = requireNonNull( session, "session" );
+ }
+
+ @Nonnull
+ public Session getSession()
+ {
+ return session;
+ }
+
+ public static <T> T requireNonNull( T obj, String message )
+ {
+ if ( obj == null )
+ {
+ throw new IllegalArgumentException( message + " must mot be null" );
+ }
+ return obj;
+ }
+
+ protected static <T> Collection<T> unmodifiable( Collection<T> obj, String message )
+ {
+ if ( requireNonNull( obj, message ).isEmpty() )
+ {
+ throw new IllegalArgumentException( message + " must not be empty" );
+ }
+ return Collections.unmodifiableCollection( new ArrayList<>( obj ) );
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollector.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollector.java
new file mode 100644
index 0000000..8c8cc53
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollector.java
@@ -0,0 +1,115 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Project;
+
+/**
+ * The DependencyCollector service can be used to collect dependencies
+ * for a given artifact and builds a graph of them.
+ * The dependencies collection mechanism will not download any artifacts,
+ * and only the pom files will be downloaded.
+ *
+ * @author Robert Scholte
+ * @author Guillaume Nodet
+ */
+public interface DependencyCollector extends Service
+{
+
+ /**
+ * Collects the transitive dependencies and builds a dependency graph.
+ * Note that this operation is only concerned about determining the coordinates of the
+ * transitive dependencies and does not actually resolve the artifact files.
+ *
+ * @param request The dependency collection request, must not be {@code null}.
+ * @return The collection result, never {@code null}.
+ * @throws DependencyCollectorException If the dependency tree could not be built.
+ *
+ * @see DependencyCollector#collect(Session, Project)
+ * @see DependencyCollector#collect(Session, Dependency)
+ * @see DependencyCollector#collect(Session, Artifact)
+ */
+ @Nonnull
+ DependencyCollectorResult collect( @Nonnull DependencyCollectorRequest request )
+ throws DependencyCollectorException, IllegalArgumentException;
+
+ /**
+ * Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is
+ * only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the
+ * artifact files.
+ *
+ * @param session The {@link Session}, must not be {@code null}.
+ * @param root The Maven Dependency, must not be {@code null}.
+ * @return The collection result, never {@code null}.
+ * @throws DependencyCollectorException If the dependency tree could not be built.
+ * @see #collect(DependencyCollectorRequest)
+ */
+ @Nonnull
+ default DependencyCollectorResult collect( @Nonnull Session session,
+ @Nonnull Dependency root )
+ throws DependencyCollectorException
+ {
+ return collect( DependencyCollectorRequest.build( session, root ) );
+ }
+
+ /**
+ * Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is
+ * only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the
+ * artifact files.
+ *
+ * @param session The {@link Session}, must not be {@code null}.
+ * @param project The {@link Project}, must not be {@code null}.
+ * @return The collection result, never {@code null}.
+ * @throws DependencyCollectorException If the dependency tree could not be built.
+ * @see #collect(DependencyCollectorRequest)
+ */
+ @Nonnull
+ default DependencyCollectorResult collect( @Nonnull Session session,
+ @Nonnull Project project )
+ throws DependencyCollectorException
+ {
+ return collect( DependencyCollectorRequest.build( session, project ) );
+ }
+
+ /**
+ * Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is
+ * only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the
+ * artifact files.
+ *
+ * @param session The {@link Session}, must not be {@code null}.
+ * @param artifact The {@link Artifact}, must not be {@code null}.
+ * @return The collection result, never {@code null}.
+ * @throws DependencyCollectorException If the dependency tree could not be built.
+ * @see #collect(DependencyCollectorRequest)
+ */
+ @Nonnull
+ default DependencyCollectorResult collect( @Nonnull Session session,
+ @Nonnull Artifact artifact )
+ throws DependencyCollectorException
+ {
+ return collect( DependencyCollectorRequest.build( session, artifact ) );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java
new file mode 100644
index 0000000..733e2f9
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorException.java
@@ -0,0 +1,42 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Thrown in case of bad artifact descriptors, version ranges or other issues encountered during calculation of the
+ * dependency graph.
+ */
+public class DependencyCollectorException
+ extends Exception
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3134726259840210686L;
+
+ /**
+ * @param message The message you would give for the exception.
+ * @param cause The cause which is related to the message.
+ */
+ public DependencyCollectorException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorRequest.java
new file mode 100644
index 0000000..d3e2aaa
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorRequest.java
@@ -0,0 +1,288 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Project;
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+/**
+ * A request to collect the transitive dependencies and to build a dependency graph from them. There are three ways to
+ * create a dependency graph. First, only the root dependency can be given. Second, a root dependency and direct
+ * dependencies can be specified in which case the specified direct dependencies are merged with the direct dependencies
+ * retrieved from the artifact descriptor of the root dependency. And last, only direct dependencies can be specified in
+ * which case the root node of the resulting graph has no associated dependency.
+ *
+ * @see DependencyCollector#collect(DependencyCollectorRequest)
+ */
+public interface DependencyCollectorRequest
+{
+
+ @Nonnull
+ Session getSession();
+
+ @Nonnull
+ Optional<Artifact> getRootArtifact();
+
+ @Nonnull
+ Optional<Dependency> getRoot();
+
+ @Nonnull
+ Collection<Dependency> getDependencies();
+
+ @Nonnull
+ Collection<Dependency> getManagedDependencies();
+
+ static DependencyCollectorRequest build( Session session, Artifact root )
+ {
+ BaseRequest.requireNonNull( session, "session" );
+ return builder()
+ .session( session )
+ .root( session.createDependency( root ) )
+ .build();
+ }
+
+ static DependencyCollectorRequest build( Session session, Dependency root )
+ {
+ return builder()
+ .session( session )
+ .root( root )
+ .build();
+ }
+
+ static DependencyCollectorRequest build( Session session, Project project )
+ {
+ BaseRequest.requireNonNull( session, "session" );
+ return builder()
+ .session( session )
+ .root( session.createDependency( project.getArtifact() ) )
+ .dependencies( project.getDependencies() )
+ .managedDependencies( project.getManagedDependencies() )
+ .build();
+ }
+
+ static DependencyCollectorRequestBuilder builder()
+ {
+ return new DependencyCollectorRequestBuilder();
+ }
+
+ class DependencyCollectorRequestBuilder
+ {
+
+ Session session;
+ Artifact rootArtifact;
+ Dependency root;
+ List<Dependency> dependencies = Collections.emptyList();
+ List<Dependency> managedDependencies = Collections.emptyList();
+
+ @Nonnull
+ public DependencyCollectorRequestBuilder session( @Nonnull Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ /**
+ * Sets the root artifact for the dependency graph.
+ * This must not be confused with {@link #root(Dependency)}: The root <em>dependency</em>, like any
+ * other specified dependency, will be subject to dependency collection/resolution, i.e. should have an artifact
+ * descriptor and a corresponding artifact file. The root <em>artifact</em> on the other hand is only used
+ * as a label for the root node of the graph in case no root dependency was specified. As such, the configured
+ * root artifact is ignored if {@link #root(Dependency)} has been set.
+ *
+ * @param rootArtifact The root artifact for the dependency graph, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyCollectorRequestBuilder rootArtifact( Artifact rootArtifact )
+ {
+ this.rootArtifact = rootArtifact;
+ return this;
+ }
+
+ /**
+ * @param root The root dependency
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyCollectorRequestBuilder root( @Nonnull Dependency root )
+ {
+ this.root = root;
+ return this;
+ }
+
+ /**
+ * Sets the direct dependencies. If both a root dependency and direct dependencies are given in the request, the
+ * direct dependencies from the request will be merged with the direct dependencies from the root dependency's
+ * artifact descriptor, giving higher priority to the dependencies from the request.
+ *
+ * @param dependencies The direct dependencies, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyCollectorRequestBuilder dependencies( List<Dependency> dependencies )
+ {
+ this.dependencies = ( dependencies != null ) ? dependencies : Collections.emptyList();
+ return this;
+ }
+
+ /**
+ * Adds the specified direct dependency.
+ *
+ * @param dependency The dependency to add, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ public DependencyCollectorRequestBuilder dependency( Dependency dependency )
+ {
+ if ( dependency != null )
+ {
+ if ( this.dependencies.isEmpty() )
+ {
+ this.dependencies = new ArrayList<>();
+ }
+ this.dependencies.add( dependency );
+ }
+ return this;
+ }
+
+
+ /**
+ * Sets the dependency management to apply to transitive dependencies. To clarify, this management does not
+ * apply to
+ * the direct dependencies of the root node.
+ *
+ * @param managedDependencies The dependency management, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ public DependencyCollectorRequestBuilder managedDependencies( List<Dependency> managedDependencies )
+ {
+ this.managedDependencies = ( managedDependencies != null ) ? managedDependencies : Collections.emptyList();
+ return this;
+ }
+
+ /**
+ * Adds the specified managed dependency.
+ *
+ * @param managedDependency The managed dependency to add, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ public DependencyCollectorRequestBuilder managedDependency( Dependency managedDependency )
+ {
+ if ( managedDependency != null )
+ {
+ if ( this.managedDependencies.isEmpty() )
+ {
+ this.managedDependencies = new ArrayList<>();
+ }
+ this.managedDependencies.add( managedDependency );
+ }
+ return this;
+ }
+
+ public DependencyCollectorRequest build()
+ {
+ return new DefaultDependencyCollectorRequest(
+ session,
+ rootArtifact,
+ root,
+ dependencies,
+ managedDependencies );
+ }
+
+ static class DefaultDependencyCollectorRequest extends BaseRequest
+ implements DependencyCollectorRequest
+ {
+ private final Artifact rootArtifact;
+ private final Dependency root;
+ private final Collection<Dependency> dependencies;
+ private final Collection<Dependency> managedDependencies;
+
+
+ /**
+ * Creates a request with the specified properties.
+ *
+ * @param session {@link Session}
+ * @param rootArtifact The root dependency whose transitive dependencies should be collected, may be {@code
+ * null}.
+ */
+ DefaultDependencyCollectorRequest(
+ Session session,
+ Artifact rootArtifact,
+ Dependency root,
+ Collection<Dependency> dependencies,
+ Collection<Dependency> managedDependencies )
+ {
+ super( session );
+ this.rootArtifact = rootArtifact;
+ this.root = root;
+ this.dependencies = dependencies != null && !dependencies.isEmpty()
+ ? unmodifiable( dependencies, "dependencies" ) : Collections.emptyList();
+ this.managedDependencies = managedDependencies != null && !managedDependencies.isEmpty()
+ ? unmodifiable( managedDependencies, "managedDependencies" ) : Collections.emptyList();
+
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Artifact> getRootArtifact()
+ {
+ return Optional.ofNullable( rootArtifact );
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Dependency> getRoot()
+ {
+ return Optional.ofNullable( root );
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Dependency> getDependencies()
+ {
+ return dependencies;
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Dependency> getManagedDependencies()
+ {
+ return managedDependencies;
+ }
+
+ @Override
+ public String toString()
+ {
+ return getRoot() + " -> " + getDependencies();
+ }
+
+ }
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorResult.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorResult.java
new file mode 100644
index 0000000..6020bff
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyCollectorResult.java
@@ -0,0 +1,47 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.maven.api.Node;
+
+/**
+ * The result of a dependency collection request.
+ *
+ * @see DependencyCollector#collect(DependencyCollectorRequest)
+ */
+public interface DependencyCollectorResult
+{
+ /**
+ * Gets the exceptions that occurred while building the dependency graph.
+ *
+ * @return The exceptions that occurred, never {@code null}.
+ */
+ List<Exception> getExceptions();
+
+ /**
+ * Gets the root node of the dependency graph.
+ *
+ * @return The root node of the dependency graph or {@code null} if none.
+ */
+ Node getRoot();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactory.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactory.java
new file mode 100644
index 0000000..50e5849
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactory.java
@@ -0,0 +1,37 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Dependency;
+
+public interface DependencyFactory extends Service
+{
+
+ Dependency create( DependencyFactoryRequest request )
+ throws DependencyFactoryException, IllegalArgumentException;
+
+ default Dependency create( Session session, Artifact artifact )
+ throws DependencyFactoryException, IllegalArgumentException
+ {
+ return create( DependencyFactoryRequest.build( session, artifact ) );
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryException.java
new file mode 100644
index 0000000..5ca1d43
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryException.java
@@ -0,0 +1,36 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class DependencyFactoryException
+ extends RuntimeException
+{
+
+ public DependencyFactoryException( String message )
+ {
+ super( message );
+ }
+
+ public DependencyFactoryException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryRequest.java
new file mode 100644
index 0000000..85b079d
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyFactoryRequest.java
@@ -0,0 +1,167 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Exclusion;
+
+public interface DependencyFactoryRequest
+{
+
+ @Nonnull
+ Session getSession();
+
+ Artifact getArtifact();
+
+ String getScope();
+
+ boolean isOptional();
+
+ @Nonnull
+ Collection<Exclusion> getExclusions();
+
+ static DependencyFactoryRequest build( Session session, Artifact artifact )
+ {
+ return builder()
+ .session( session )
+ .artifact( artifact )
+ .build();
+ }
+
+ static DependencyFactoryRequestBuilder builder()
+ {
+ return new DependencyFactoryRequestBuilder();
+ }
+
+ class DependencyFactoryRequestBuilder
+ {
+ private Session session;
+ private Artifact artifact;
+ private String scope;
+ private boolean optional;
+ private Collection<Exclusion> exclusions = Collections.emptyList();
+
+ public DependencyFactoryRequestBuilder session( Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ public DependencyFactoryRequestBuilder artifact( Artifact artifact )
+ {
+ this.artifact = artifact;
+ return this;
+ }
+
+ public DependencyFactoryRequestBuilder scope( String scope )
+ {
+ this.scope = scope;
+ return this;
+ }
+
+ public DependencyFactoryRequestBuilder optional( boolean optional )
+ {
+ this.optional = optional;
+ return this;
+ }
+
+ public DependencyFactoryRequestBuilder exclusions( Collection<Exclusion> exclusions )
+ {
+ if ( exclusions != null )
+ {
+ if ( this.exclusions.isEmpty() )
+ {
+ this.exclusions = new ArrayList<>();
+ }
+ this.exclusions.addAll( exclusions );
+ }
+ return this;
+ }
+
+ public DependencyFactoryRequestBuilder exclusion( Exclusion exclusion )
+ {
+ if ( exclusion != null )
+ {
+ if ( this.exclusions.isEmpty() )
+ {
+ this.exclusions = new ArrayList<>();
+ }
+ this.exclusions.add( exclusion );
+ }
+ return this;
+ }
+
+ public DependencyFactoryRequest build()
+ {
+ return new DefaultDependencyFactoryRequest( session, artifact, scope, optional, exclusions );
+ }
+
+ private static class DefaultDependencyFactoryRequest extends BaseRequest implements DependencyFactoryRequest
+ {
+ private final Artifact artifact;
+ private final String scope;
+ private final boolean optional;
+ private final Collection<Exclusion> exclusions;
+
+ private DefaultDependencyFactoryRequest( @Nonnull Session session, Artifact artifact, String scope,
+ boolean optional, Collection<Exclusion> exclusions )
+ {
+ super( session );
+ this.artifact = artifact;
+ this.scope = scope;
+ this.optional = optional;
+ this.exclusions = exclusions;
+ }
+
+ @Override
+ public Artifact getArtifact()
+ {
+ return artifact;
+ }
+
+ @Override
+ public String getScope()
+ {
+ return scope;
+ }
+
+ @Override
+ public boolean isOptional()
+ {
+ return optional;
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Exclusion> getExclusions()
+ {
+ return exclusions;
+ }
+ }
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolver.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolver.java
new file mode 100644
index 0000000..c4549d5
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolver.java
@@ -0,0 +1,90 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+import java.util.function.Predicate;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Node;
+import org.apache.maven.api.Project;
+
+/**
+ * The DependencyResolver service can be used to collect the dependencies
+ * and download the artifacts.
+ *
+ * @author Robert Scholte
+ * @author Guillaume Nodet
+ */
+public interface DependencyResolver extends Service
+{
+ /**
+ * Collect dependencies and resolve the artifacts.
+ *
+ * @param request {@link DependencyResolverRequest}
+ * @return the resolved dependencies.
+ * @throws DependencyResolverException in case of an error.
+ */
+ DependencyResolverResult resolve( DependencyResolverRequest request )
+ throws DependencyResolverException;
+
+ /**
+ * This will resolve the dependencies of the coordinate, not resolving the artifact of the coordinate itself. If
+ * the coordinate needs to be resolved too, use
+ * {@link #resolveDependencies(Session, List, List, Predicate< Node >)} passing
+ * {@code Collections.singletonList(coordinate)}
+ *
+ * @param session The {@link Session}, must not be {@code null}.
+ * @param root {@link Dependency}
+ * @param filter {@link Predicate} used to eventually filter out some dependencies
+ * when downloading (can be {@code null}).
+ * @return the resolved dependencies.
+ * @throws DependencyResolverException in case of an error.
+ */
+ default DependencyResolverResult resolve( Session session,
+ Dependency root,
+ Predicate<Node> filter )
+ throws DependencyResolverException
+ {
+ return resolve( DependencyResolverRequest.build( session, root, filter ) );
+ }
+
+ /**
+ * This will resolve the dependencies of the coordinate, not resolving the artifact of the coordinate itself. If
+ * the coordinate needs to be resolved too, use
+ * {@link #resolveDependencies(Session, List, List, Predicate< Node >)} passing
+ * {@code Collections.singletonList(coordinate)}
+ *
+ * @param session The {@link Session}, must not be {@code null}.
+ * @param project {@link Project}
+ * @param filter {@link Predicate< Node >} (can be {@code null}).
+ * @return the resolved dependencies.
+ * @throws DependencyResolverException in case of an error.
+ */
+ default DependencyResolverResult resolve( Session session,
+ Project project,
+ Predicate<Node> filter )
+ throws DependencyResolverException
+ {
+ return resolve( DependencyResolverRequest.build( session, project, filter ) );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverException.java
new file mode 100644
index 0000000..77ee118
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverException.java
@@ -0,0 +1,54 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The Exception class in case a resolving does not work.
+ */
+public class DependencyResolverException
+ extends Exception
+{
+ private static final long serialVersionUID = 5320065249974323888L;
+
+ /**
+ * @param cause The {@link Exception cause} of the problem.
+ */
+ protected DependencyResolverException( Exception cause )
+ {
+ super( cause );
+ }
+
+ /**
+ * @param message The message to give.
+ * @param e The {@link Exception}.
+ */
+ public DependencyResolverException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+ /**
+ * @return {@link DependencyResolverResult}
+ */
+ public DependencyResolverResult getResult()
+ {
+ return null;
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverRequest.java
new file mode 100644
index 0000000..0f8c67c
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverRequest.java
@@ -0,0 +1,327 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Node;
+import org.apache.maven.api.Project;
+
+/**
+ * A request to collect and resolve a dependency graph.
+ */
+public interface DependencyResolverRequest extends DependencyCollectorRequest
+{
+
+ @Nonnull
+ Optional<Predicate<Node>> getFilter();
+
+ @Nonnull
+ static DependencyResolverRequest build( @Nonnull Session session,
+ @Nonnull Artifact root )
+ {
+ return build( session, root , null );
+ }
+
+ @Nonnull
+ static DependencyResolverRequest build( @Nonnull Session session,
+ @Nonnull Artifact root,
+ @Nullable Predicate<Node> filter )
+ {
+ return builder()
+ .session( session )
+ .rootArtifact( root )
+ .filter( filter )
+ .build();
+ }
+
+ @Nonnull
+ static DependencyResolverRequest build( @Nonnull Session session,
+ @Nonnull Dependency root )
+ {
+ return build( session, root, null );
+ }
+
+ @Nonnull
+ static DependencyResolverRequest build( @Nonnull Session session,
+ @Nonnull Dependency root,
+ @Nullable Predicate<Node> filter )
+ {
+ return builder()
+ .session( session )
+ .root( root )
+ .filter( filter )
+ .build();
+ }
+
+ @Nonnull
+ static DependencyResolverRequest build( @Nonnull Session session,
+ @Nonnull Project project )
+ {
+ return build( session, project, null );
+ }
+
+ @Nonnull
+ static DependencyResolverRequest build( @Nonnull Session session,
+ @Nonnull Project project,
+ @Nullable Predicate<Node> filter )
+ {
+ BaseRequest.requireNonNull( session, "session" );
+ return builder()
+ .session( session )
+ .root( session.createDependency( project.getArtifact() ) )
+ .dependencies( project.getDependencies() )
+ .managedDependencies( project.getManagedDependencies() )
+ .filter( filter )
+ .build();
+ }
+
+ @Nonnull
+ static DependencyResolverRequestBuilder builder()
+ {
+ return new DependencyResolverRequestBuilder();
+ }
+
+ class DependencyResolverRequestBuilder
+ {
+ Session session;
+ Artifact rootArtifact;
+ Dependency root;
+ List<Dependency> dependencies = Collections.emptyList();
+ List<Dependency> managedDependencies = Collections.emptyList();
+ Predicate<Node> filter;
+
+ @Nonnull
+ public DependencyResolverRequestBuilder session( @Nonnull Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ /**
+ * Sets the root artifact for the dependency graph.
+ * This must not be confused with {@link #root(Dependency)}: The root <em>dependency</em>, like
+ * any other specified dependency, will be subject to dependency collection/resolution, i.e. should have an
+ * artifact descriptor and a corresponding artifact file. The root <em>artifact</em> on the other hand is only
+ * used as a label for the root node of the graph in case no root dependency was specified. As such, the
+ * configured root artifact is ignored if {@link #root(Dependency)} has not been called.
+ *
+ * @param rootArtifact The root artifact for the dependency graph, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyResolverRequestBuilder rootArtifact( Artifact rootArtifact )
+ {
+ this.rootArtifact = rootArtifact;
+ return this;
+ }
+
+ /**
+ *
+ * @param root The root dependency
+ * @return
+ */
+ @Nonnull
+ public DependencyResolverRequestBuilder root( @Nonnull Dependency root )
+ {
+ this.root = root;
+ return this;
+ }
+
+ /**
+ * Sets the direct dependencies. If both a root dependency and direct dependencies are given in the request, the
+ * direct dependencies from the request will be merged with the direct dependencies from the root dependency's
+ * artifact descriptor, giving higher priority to the dependencies from the request.
+ *
+ * @param dependencies The direct dependencies, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyResolverRequestBuilder dependencies( List<Dependency> dependencies )
+ {
+ this.dependencies = ( dependencies != null ) ? dependencies : Collections.emptyList();
+ return this;
+ }
+
+ /**
+ * Adds the specified direct dependency.
+ *
+ * @param dependency The dependency to add, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyResolverRequestBuilder dependency( Dependency dependency )
+ {
+ if ( dependency != null )
+ {
+ if ( this.dependencies.isEmpty() )
+ {
+ this.dependencies = new ArrayList<>();
+ }
+ this.dependencies.add( dependency );
+ }
+ return this;
+ }
+
+
+ /**
+ * Sets the dependency management to apply to transitive dependencies. To clarify, this management does not
+ * apply to
+ * the direct dependencies of the root node.
+ *
+ * @param managedDependencies The dependency management, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyResolverRequestBuilder managedDependencies( List<Dependency> managedDependencies )
+ {
+ this.managedDependencies = ( managedDependencies != null ) ? managedDependencies : Collections.emptyList();
+ return this;
+ }
+
+ /**
+ * Adds the specified managed dependency.
+ *
+ * @param managedDependency The managed dependency to add, may be {@code null}.
+ * @return This request for chaining, never {@code null}.
+ */
+ @Nonnull
+ public DependencyResolverRequestBuilder managedDependency( Dependency managedDependency )
+ {
+ if ( managedDependency != null )
+ {
+ if ( this.managedDependencies.isEmpty() )
+ {
+ this.managedDependencies = new ArrayList<>();
+ }
+ this.managedDependencies.add( managedDependency );
+ }
+ return this;
+ }
+
+ @Nonnull
+ public DependencyResolverRequestBuilder filter( Predicate<Node> filter )
+ {
+ this.filter = filter;
+ return this;
+ }
+
+ @Nonnull
+ public DependencyResolverRequest build()
+ {
+ return new DefaultDependencyResolverRequest(
+ session,
+ rootArtifact,
+ root,
+ dependencies,
+ managedDependencies,
+ filter );
+ }
+
+ private static class DefaultDependencyResolverRequest extends BaseRequest
+ implements DependencyResolverRequest
+ {
+ private final Artifact rootArtifact;
+ private final Dependency root;
+ private final Collection<Dependency> dependencies;
+ private final Collection<Dependency> managedDependencies;
+ private final Predicate<Node> filter;
+
+
+ /**
+ * Creates a request with the specified properties.
+ *
+ * @param session {@link Session}
+ * @param rootArtifact The root dependency whose transitive dependencies should be collected, may be {@code
+ * null}.
+ */
+ DefaultDependencyResolverRequest(
+ @Nonnull Session session,
+ @Nullable Artifact rootArtifact,
+ @Nullable Dependency root,
+ @Nullable Collection<Dependency> dependencies,
+ @Nullable Collection<Dependency> managedDependencies,
+ @Nullable Predicate<Node> filter )
+ {
+ super( session );
+ this.rootArtifact = rootArtifact;
+ this.root = root;
+ this.dependencies = dependencies != null && !dependencies.isEmpty()
+ ? unmodifiable( dependencies, "dependencies" ) : Collections.emptyList();
+ this.managedDependencies = managedDependencies != null && !managedDependencies.isEmpty()
+ ? unmodifiable( managedDependencies, "managedDependencies" ) : Collections.emptyList();
+ this.filter = filter;
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Artifact> getRootArtifact()
+ {
+ return Optional.ofNullable( rootArtifact );
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Dependency> getRoot()
+ {
+ return Optional.ofNullable( root );
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Dependency> getDependencies()
+ {
+ return dependencies;
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Dependency> getManagedDependencies()
+ {
+ return managedDependencies;
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Predicate<Node>> getFilter()
+ {
+ return Optional.ofNullable( filter );
+ }
+
+ @Override
+ public String toString()
+ {
+ return getRoot() + " -> " + getDependencies();
+ }
+
+ }
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverResult.java b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverResult.java
new file mode 100644
index 0000000..ff24cf6
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/DependencyResolverResult.java
@@ -0,0 +1,44 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.maven.api.Node;
+
+/**
+ *
+ * @author Robert Scholte
+ *
+ */
+public interface DependencyResolverResult
+{
+ /**
+ * Gets the exceptions that occurred while building the dependency graph.
+ *
+ * @return The list of exceptions {@link Exception}.
+ */
+ List<Exception> getCollectorExceptions();
+
+ Node getRoot();
+
+ List<ArtifactResolverResult> getArtifactResults();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilder.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilder.java
new file mode 100644
index 0000000..58d479c
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilder.java
@@ -0,0 +1,57 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.nio.file.Path;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+public interface ProjectBuilder extends Service
+{
+
+ @Nonnull
+ ProjectBuilderResult build( ProjectBuilderRequest request )
+ throws ProjectBuilderException, IllegalArgumentException;
+
+ @Nonnull
+ default ProjectBuilderResult build( @Nonnull Session session, @Nonnull ProjectBuilderSource source )
+ throws ProjectBuilderException, IllegalArgumentException
+ {
+ return build( ProjectBuilderRequest.build( session, source ) );
+ }
+
+ @Nonnull
+ default ProjectBuilderResult build( @Nonnull Session session, @Nonnull Path path )
+ throws ProjectBuilderException, IllegalArgumentException
+ {
+ return build( ProjectBuilderRequest.build( session, path ) );
+ }
+
+ @Nonnull
+ default ProjectBuilderResult build( @Nonnull Session session, @Nonnull Artifact artifact )
+ throws ProjectBuilderException, IllegalArgumentException
+ {
+ return build( ProjectBuilderRequest.build( session, artifact ) );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderException.java
new file mode 100644
index 0000000..a71c5e7
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderException.java
@@ -0,0 +1,37 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The Exception class in case a resolving does not work.
+ */
+public class ProjectBuilderException
+ extends Exception
+{
+ /**
+ * @param message The message to give.
+ * @param e The {@link Exception}.
+ */
+ public ProjectBuilderException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderProblem.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderProblem.java
new file mode 100644
index 0000000..af9dc47
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderProblem.java
@@ -0,0 +1,101 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Describes a problem that was encountered during settings building. A problem can either be an exception that was
+ * thrown or a simple string message. In addition, a problem carries a hint about its source, e.g. the settings file
+ * that exhibits the problem.
+ *
+ * @author Benjamin Bentmann
+ * @author Robert Scholte
+ */
+public interface ProjectBuilderProblem
+{
+
+ /**
+ * The different severity levels for a problem, in decreasing order.
+ */
+ enum Severity
+ {
+
+ FATAL, //
+ ERROR, //
+ WARNING //
+
+ }
+
+ /**
+ * Gets the hint about the source of the problem. While the syntax of this hint is unspecified and depends on the
+ * creator of the problem, the general expectation is that the hint provides sufficient information to the user to
+ * track the problem back to its origin. A concrete example for such a source hint can be the file path or URL from
+ * which the settings were read.
+ *
+ * @return The hint about the source of the problem or an empty string if unknown, never {@code null}.
+ */
+ String getSource();
+
+ /**
+ * Gets the one-based index of the line containing the problem. The line number should refer to some text file that
+ * is given by {@link #getSource()}.
+ *
+ * @return The one-based index of the line containing the problem or a non-positive value if unknown.
+ */
+ int getLineNumber();
+
+ /**
+ * Gets the one-based index of the column containing the problem. The column number should refer to some text file
+ * that is given by {@link #getSource()}.
+ *
+ * @return The one-based index of the column containing the problem or non-positive value if unknown.
+ */
+ int getColumnNumber();
+
+ /**
+ * Gets the location of the problem. The location is a user-friendly combination of the values from
+ * {@link #getSource()}, {@link #getLineNumber()} and {@link #getColumnNumber()}. The exact syntax of the returned
+ * value is undefined.
+ *
+ * @return The location of the problem, never {@code null}.
+ */
+ String getLocation();
+
+ /**
+ * Gets the exception that caused this problem (if any).
+ *
+ * @return The exception that caused this problem or {@code null} if not applicable.
+ */
+ Exception getException();
+
+ /**
+ * Gets the message that describes this problem.
+ *
+ * @return The message describing this problem, never {@code null}.
+ */
+ String getMessage();
+
+ /**
+ * Gets the severity level of this problem.
+ *
+ * @return The severity level of this problem, never {@code null}.
+ */
+ Severity getSeverity();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderRequest.java
new file mode 100644
index 0000000..2c36c56
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderRequest.java
@@ -0,0 +1,218 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import java.nio.file.Path;
+import java.util.Optional;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+
+public interface ProjectBuilderRequest
+{
+
+ @Nonnull
+ Session getSession();
+
+ @Nonnull
+ Optional<Path> getPath();
+
+ @Nonnull
+ Optional<ProjectBuilderSource> getSource();
+
+ @Nonnull
+ Optional<Artifact> getArtifact();
+
+ boolean isAllowStubModel();
+
+ boolean isRecursive();
+
+ boolean isProcessPlugins();
+
+ boolean isResolveDependencies();
+
+ @Nonnull
+ static ProjectBuilderRequest build( @Nonnull Session session, @Nonnull ProjectBuilderSource source )
+ {
+ return builder()
+ .session( session )
+ .source( source )
+ .build();
+ }
+
+ @Nonnull
+ static ProjectBuilderRequest build( @Nonnull Session session, @Nonnull Path path )
+ {
+ return builder()
+ .session( session )
+ .path( path )
+ .build();
+ }
+
+ @Nonnull
+ static ProjectBuilderRequest build( @Nonnull Session session, @Nonnull Artifact artifact )
+ {
+ return builder()
+ .session( session )
+ .artifact( artifact )
+ .build();
+ }
+
+ @Nonnull
+ static ProjectBuilderRequestBuilder builder()
+ {
+ return new ProjectBuilderRequestBuilder();
+ }
+
+ class ProjectBuilderRequestBuilder
+ {
+ Session session;
+ Path path;
+ ProjectBuilderSource source;
+ Artifact artifact;
+ boolean allowStubModel;
+ boolean recursive;
+ boolean processPlugins = true;
+ boolean resolveDependencies = true;
+
+ public ProjectBuilderRequestBuilder session( Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ public ProjectBuilderRequestBuilder path( Path path )
+ {
+ this.path = path;
+ return this;
+ }
+
+ public ProjectBuilderRequestBuilder source( ProjectBuilderSource source )
+ {
+ this.source = source;
+ return this;
+ }
+
+ public ProjectBuilderRequestBuilder artifact( Artifact artifact )
+ {
+ this.artifact = artifact;
+ return this;
+ }
+
+ public ProjectBuilderRequestBuilder processPlugins( boolean processPlugins )
+ {
+ this.processPlugins = processPlugins;
+ return this;
+ }
+
+ public ProjectBuilderRequestBuilder resolveDependencies( boolean resolveDependencies )
+ {
+ this.resolveDependencies = resolveDependencies;
+ return this;
+ }
+
+ public ProjectBuilderRequest build()
+ {
+ return new DefaultProjectBuilderRequest( session, path, source, artifact,
+ allowStubModel, recursive, processPlugins, resolveDependencies );
+ }
+
+ private static class DefaultProjectBuilderRequest extends BaseRequest
+ implements ProjectBuilderRequest
+ {
+ private final Path path;
+ private final ProjectBuilderSource source;
+ private final Artifact artifact;
+ private final boolean allowStubModel;
+ private final boolean recursive;
+ private final boolean processPlugins;
+ private final boolean resolveDependencies;
+
+ @SuppressWarnings( "checkstyle:ParameterNumber" )
+ DefaultProjectBuilderRequest( @Nonnull Session session,
+ @Nullable Path path,
+ @Nullable ProjectBuilderSource source,
+ @Nullable Artifact artifact,
+ boolean allowStubModel,
+ boolean recursive,
+ boolean processPlugins,
+ boolean resolveDependencies )
+ {
+ super( session );
+ this.path = path;
+ this.source = source;
+ this.artifact = artifact;
+ this.allowStubModel = allowStubModel;
+ this.recursive = recursive;
+ this.processPlugins = processPlugins;
+ this.resolveDependencies = resolveDependencies;
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Path> getPath()
+ {
+ return Optional.ofNullable( path );
+ }
+
+ @Nonnull
+ @Override
+ public Optional<ProjectBuilderSource> getSource()
+ {
+ return Optional.ofNullable( source );
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Artifact> getArtifact()
+ {
+ return Optional.ofNullable( artifact );
+ }
+
+ @Override
+ public boolean isAllowStubModel()
+ {
+ return allowStubModel;
+ }
+
+ @Override
+ public boolean isRecursive()
+ {
+ return recursive;
+ }
+
+ @Override
+ public boolean isProcessPlugins()
+ {
+ return processPlugins;
+ }
+
+ @Override
+ public boolean isResolveDependencies()
+ {
+ return resolveDependencies;
+ }
+ }
+
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderResult.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderResult.java
new file mode 100644
index 0000000..6476a85
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderResult.java
@@ -0,0 +1,76 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Optional;
+
+import org.apache.maven.api.Project;
+
+public interface ProjectBuilderResult
+{
+
+ /**
+ * Gets the identifier of the project that could not be built. The general format of the identifier is {@code
+ * <groupId>:<artifactId>:<version>} but some of these coordinates may still be unknown at the point the exception
+ * is thrown so this information is merely meant to assist the user.
+ *
+ * @return The identifier of the project or an empty string if not known, never {@code null}.
+ */
+ @Nonnull
+ String getProjectId();
+
+ /**
+ * Gets the POM file from which the project was built.
+ *
+ * @return The optional POM file.
+ */
+ @Nonnull
+ Optional<Path> getPomFile();
+
+ /**
+ * Gets the project that was built.
+ *
+ * @return The project that was built or {@code null} if an error occurred and this result accompanies a
+ * {@link ProjectBuilderException}.
+ */
+ @Nonnull
+ Optional<Project> getProject();
+
+ /**
+ * Gets the problems that were encountered during the project building.
+ *
+ * @return The problems that were encountered during the project building, can be empty but never {@code null}.
+ */
+ @Nonnull
+ Collection<ProjectBuilderProblem> getProblems();
+
+ /**
+ * Gets the result of the dependency resolution for the project.
+ *
+ * @return The result of the dependency resolution for the project.
+ */
+ @Nonnull
+ Optional<DependencyResolverResult> getDependencyResolverResult();
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderSource.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderSource.java
new file mode 100644
index 0000000..fd8c50d
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectBuilderSource.java
@@ -0,0 +1,30 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public interface ProjectBuilderSource
+{
+ InputStream getInputStream() throws IOException;
+
+ String getLocation();
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java
new file mode 100644
index 0000000..8fc5281
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java
@@ -0,0 +1,68 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Project;
+
+/**
+ * This defines the interface to deploy a single Maven Project.
+ *
+ * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
+ */
+public interface ProjectDeployer extends Service
+{
+ /**
+ * This will deploy a single project which may contain several artifacts. Those artifacts will be deployed into the
+ * appropriate remote repository.
+ *
+ * <pre class="java">
+ * @Parameter( defaultValue = "${session}", required = true, readonly = true )
+ * MavenSession session;
+ * @Parameter( defaultValue = "${project}", required = true, readonly = true )
+ * MavenProject project;
+ * ..
+ * @Component
+ * ProjectDeployer deployer;
+ * ...
+ * public void execute()
+ * {
+ * ProjectDeployerRequest pdr =
+ * new ProjectDeployerRequest()
+ * .setProject( project );
+ *
+ * deployer.deploy( session.getProjectBuildingRequest(), pdr, artifactRepository );
+ * }
+ * </pre>
+ *
+ * @param request {@link ProjectDeployerRequest}
+ * @throws ProjectDeployerException in case of artifact could not correctly deployed.
+ * @throws IllegalArgumentException in case <code>buildingRequest</code> is <code>null</code>, <code>request</code>
+ * is <code>null</code> or <code>artifactRepository</code> is <code>null</code>.
+ */
+ void deploy( ProjectDeployerRequest request )
+ throws ProjectDeployerException, IllegalArgumentException;
+
+ default void deploy( Session session, Project project )
+ throws ProjectDeployerException, IllegalArgumentException
+ {
+ deploy( ProjectDeployerRequest.build( session, project ) );
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java
new file mode 100644
index 0000000..0884364
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java
@@ -0,0 +1,37 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The Exception class in case a resolving does not work.
+ */
+public class ProjectDeployerException
+ extends Exception
+{
+ /**
+ * @param message The message to give.
+ * @param e The {@link Exception}.
+ */
+ public ProjectDeployerException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java
new file mode 100644
index 0000000..27eeffc
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java
@@ -0,0 +1,142 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Project;
+import org.apache.maven.api.RemoteRepository;
+
+public interface ProjectDeployerRequest
+{
+ @Nonnull
+ Session getSession();
+
+ @Nonnull
+ Project getProject();
+
+ @Nonnull
+ RemoteRepository getRepository();
+
+ int getRetryFailedDeploymentCount();
+
+// @Nonnull
+// Optional<String> getAltDeploymentRepository();
+
+// @Nonnull
+// Optional<String> getAltSnapshotDeploymentRepository();
+
+// @Nonnull
+// Optional<String> getAltReleaseDeploymentRepository();
+
+ static ProjectDeployerRequest build( Session session, Project project )
+ {
+ return builder()
+ .session( session )
+ .project( project )
+ .build();
+ }
+
+ static ProjectDeployerRequestBuilder builder()
+ {
+ return new ProjectDeployerRequestBuilder();
+ }
+
+ class ProjectDeployerRequestBuilder
+ {
+ Session session;
+ Project project;
+ RemoteRepository repository;
+ int retryFailedDeploymentCount;
+
+ @Nonnull
+ public ProjectDeployerRequestBuilder session( @Nonnull Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ @Nonnull
+ public ProjectDeployerRequestBuilder project( @Nonnull Project project )
+ {
+ this.project = project;
+ return this;
+ }
+
+ @Nonnull
+ public ProjectDeployerRequestBuilder repository( @Nonnull RemoteRepository repository )
+ {
+ this.repository = repository;
+ return this;
+ }
+
+ @Nonnull
+ public ProjectDeployerRequestBuilder retryFailedDeploymentCount( int retryFailedDeploymentCount )
+ {
+ this.retryFailedDeploymentCount = retryFailedDeploymentCount;
+ return this;
+ }
+
+ public ProjectDeployerRequest build()
+ {
+ return new DefaultProjectDeployerRequest( session, project, repository, retryFailedDeploymentCount );
+ }
+
+ private static class DefaultProjectDeployerRequest extends BaseRequest
+ implements ProjectDeployerRequest
+ {
+ private final Project project;
+ private final RemoteRepository repository;
+ private final int retryFailedDeploymentCount;
+
+ DefaultProjectDeployerRequest( @Nonnull Session session,
+ @Nonnull Project project,
+ @Nonnull RemoteRepository repository,
+ int retryFailedDeploymentCount )
+ {
+ super( session );
+ this.project = requireNonNull( project, "project" );
+ this.repository = requireNonNull( repository, "repository" );
+ this.retryFailedDeploymentCount = retryFailedDeploymentCount;
+ }
+
+ @Nonnull
+ @Override
+ public Project getProject()
+ {
+ return project;
+ }
+
+ @Nonnull
+ @Override
+ public RemoteRepository getRepository()
+ {
+ return repository;
+ }
+
+ @Override
+ public int getRetryFailedDeploymentCount()
+ {
+ return retryFailedDeploymentCount;
+ }
+ }
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstaller.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstaller.java
new file mode 100644
index 0000000..0095bed
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstaller.java
@@ -0,0 +1,79 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Project;
+
+/**
+ * This defines the interface to install a single Maven Project.
+ *
+ * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
+ */
+public interface ProjectInstaller extends Service
+{
+ /**
+ * This will install a single project which may contain several artifacts. Those artifacts will be installed into
+ * the appropriate repository.
+ *
+ * <pre class="java">
+ * @Parameter( defaultValue = "${session}", required = true, readonly = true )
+ * private MavenSession session;
+ * @Parameter( defaultValue = "${project}", required = true, readonly = true )
+ * private MavenProject project;
+ * ..
+ * @Component
+ * private ProjectInstaller installer;
+ * ...
+ * public void execute()
+ * {
+ * ProjectInstallerRequest pir =
+ * new ProjectInstallerRequest()
+ * .setProject( mavenProject );
+ *
+ * installer.install( session.getProjectBuildingRequest(), pir );
+ * }
+ * </pre>
+ *
+ * To set a different local repository than the current one in the Maven session, you can inject an instance of the
+ * <code>RepositoryManager</code> and set the path to the local repository, called <code>localRepositoryPath</code>,
+ * as such:
+ *
+ * <pre class="java">
+ * @Component
+ * private RepositoryManager repositoryManager;
+ *
+ * buildingRequest = repositoryManager.setLocalRepositoryBasedir( buildingRequest, localRepositoryPath );
+ * </pre>
+ *
+ * @param request {@link ProjectInstallerRequest}
+ * @throws ProjectInstallerException In case of problems to install artifacts.
+ * @throws IllegalArgumentException in case of parameter <code>projectBuildingRequest</code> is <code>null</code> or
+ * parameter <code>projectInstallerRequest</code> is <code>null</code>.
+ */
+ void install( ProjectInstallerRequest request )
+ throws ProjectInstallerException, IllegalArgumentException;
+
+ default void install( Session session, Project project )
+ throws ProjectInstallerException, IllegalArgumentException
+ {
+ install( ProjectInstallerRequest.build( session, project ) );
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java
new file mode 100644
index 0000000..1aaf536
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java
@@ -0,0 +1,37 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The Exception class in case a resolving does not work.
+ */
+public class ProjectInstallerException
+ extends Exception
+{
+ /**
+ * @param message The message to give.
+ * @param e The {@link Exception}.
+ */
+ public ProjectInstallerException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerRequest.java
new file mode 100644
index 0000000..ca545b8
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerRequest.java
@@ -0,0 +1,101 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Project;
+
+/**
+ * @author Guillaume Nodet
+ */
+
+public interface ProjectInstallerRequest
+{
+
+ @Nonnull
+ Session getSession();
+
+ @Nonnull
+ Project getProject();
+
+ @Nonnull
+ static ProjectInstallerRequest build( @Nonnull Session session, @Nonnull Project project )
+ {
+ return builder()
+ .session( session )
+ .project( project )
+ .build();
+ }
+
+ @Nonnull
+ static ProjectInstallerRequestBuilder builder()
+ {
+ return new ProjectInstallerRequestBuilder();
+ }
+
+ class ProjectInstallerRequestBuilder
+ {
+ Session session;
+ Project project;
+
+ @Nonnull
+ public ProjectInstallerRequestBuilder session( Session session )
+ {
+ this.session = session;
+ return this;
+ }
+
+ @Nonnull
+ public ProjectInstallerRequestBuilder project( Project project )
+ {
+ this.project = project;
+ return this;
+ }
+
+ @Nonnull
+ public ProjectInstallerRequest build()
+ {
+ return new DefaultProjectInstallerRequest( session, project );
+ }
+
+ private static class DefaultProjectInstallerRequest extends BaseRequest
+ implements ProjectInstallerRequest
+ {
+
+ final Project project;
+
+ DefaultProjectInstallerRequest( @Nonnull Session session, @Nonnull Project project )
+ {
+ super( session );
+ this.project = requireNonNull( project, "project" );
+ }
+
+ @Nonnull
+ @Override
+ public Project getProject()
+ {
+ return project;
+ }
+ }
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
new file mode 100644
index 0000000..494882a
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
@@ -0,0 +1,48 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Optional;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Project;
+
+/**
+ * Interface to manage the project during its lifecycle
+ */
+public interface ProjectManager extends Service
+{
+ /**
+ * Returns the path to the resolved file in the local repository
+ * if the artifact has been resolved.
+ *
+ * @return the path of the resolved artifact
+ */
+ @Nonnull
+ Optional<Path> getPath( Project project );
+
+ @Nonnull
+ Collection<Artifact> getAttachedArtifacts( Project project );
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/Service.java b/maven-core-api/src/main/java/org/apache/maven/api/services/Service.java
new file mode 100644
index 0000000..d43da3a
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/Service.java
@@ -0,0 +1,27 @@
+package org.apache.maven.api.services;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.concurrent.ThreadSafe;
+
+@ThreadSafe
+public interface Service
+{
+}
diff --git a/maven-core-impl/pom.xml b/maven-core-impl/pom.xml
new file mode 100644
index 0000000..df573ad
--- /dev/null
+++ b/maven-core-impl/pom.xml
@@ -0,0 +1,72 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven</artifactId>
+ <version>4.0.0-alpha-1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>maven-core-api-impl</artifactId>
+ <name>Apache Maven Core API Implementation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ </dependency>
+
+ <!-- Testing -->
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-testing</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.resolver</groupId>
+ <artifactId>maven-resolver-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.resolver</groupId>
+ <artifactId>maven-resolver-connector-basic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.resolver</groupId>
+ <artifactId>maven-resolver-transport-http</artifactId>
+ <version>${resolverVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.resolver</groupId>
+ <artifactId>maven-resolver-transport-file</artifactId>
+ <version>${resolverVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifact.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifact.java
new file mode 100644
index 0000000..5f5917c
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifact.java
@@ -0,0 +1,101 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.util.Objects;
+import java.util.Optional;
+
+import org.apache.maven.api.Artifact;
+
+public class DefaultArtifact implements Artifact
+{
+ private final DefaultSession session;
+ private final org.eclipse.aether.artifact.Artifact artifact;
+
+ public DefaultArtifact( @Nonnull DefaultSession session, @Nonnull org.eclipse.aether.artifact.Artifact artifact )
+ {
+ this.session = Objects.requireNonNull( session );
+ this.artifact = Objects.requireNonNull( artifact );
+ }
+
+ public org.eclipse.aether.artifact.Artifact getArtifact()
+ {
+ return artifact;
+ }
+
+ @Nonnull
+ @Override
+ public String getGroupId()
+ {
+ return artifact.getGroupId();
+ }
+
+ @Nonnull
+ @Override
+ public String getArtifactId()
+ {
+ return artifact.getArtifactId();
+ }
+
+ @Nonnull
+ @Override
+ public String getVersion()
+ {
+ return artifact.getVersion();
+ }
+
+ @Nonnull
+ @Override
+ public String getExtension()
+ {
+ return artifact.getExtension();
+ }
+
+ @Nonnull
+ @Override
+ public String getClassifier()
+ {
+ return artifact.getClassifier();
+ }
+
+ @Nonnull
+ @Override
+ public String getBaseVersion()
+ {
+ return artifact.getBaseVersion();
+ }
+
+ @Override
+ public boolean isSnapshot()
+ {
+ return artifact.isSnapshot();
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Path> getPath()
+ {
+ return Optional.ofNullable( artifact.getFile() ).map( File::toPath );
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactDeployer.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactDeployer.java
new file mode 100644
index 0000000..bc4d9a2
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactDeployer.java
@@ -0,0 +1,76 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import org.apache.maven.api.services.ArtifactDeployer;
+import org.apache.maven.api.services.ArtifactDeployerException;
+import org.apache.maven.api.services.ArtifactDeployerRequest;
+import org.apache.maven.api.services.ArtifactManager;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeployResult;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.metadata.Metadata;
+
+@Named
+public class DefaultArtifactDeployer implements ArtifactDeployer
+{
+ private final RepositorySystem repositorySystem;
+
+ @Inject
+ DefaultArtifactDeployer( @Nonnull RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = Objects.requireNonNull( repositorySystem );
+ }
+
+ @Override
+ public void deploy( ArtifactDeployerRequest request ) throws ArtifactDeployerException, IllegalArgumentException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+ try
+ {
+ ArtifactManager artifactManager = session.getService( ArtifactManager.class );
+ List<Metadata> metadatas = request.getArtifacts().stream()
+ .map( artifactManager::getAttachedMetadatas )
+ .flatMap( Collection::stream )
+ .map( session::toMetadata )
+ .collect( Collectors.toList() );
+ DeployRequest deployRequest = new DeployRequest()
+ .setRepository( session.toRepository( request.getRepository() ) )
+ .setArtifacts( session.toArtifacts( request.getArtifacts() ) )
+ .setMetadata( metadatas );
+
+ DeployResult result = repositorySystem.deploy( session.getSession(), deployRequest );
+ }
+ catch ( DeploymentException e )
+ {
+ throw new ArtifactDeployerException( "Unable to deploy artifacts", e );
+ }
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactFactory.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactFactory.java
new file mode 100644
index 0000000..c1fa7ca
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactFactory.java
@@ -0,0 +1,54 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Named;
+
+import java.security.InvalidParameterException;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.services.ArtifactFactory;
+import org.apache.maven.api.services.ArtifactFactoryException;
+import org.apache.maven.api.services.ArtifactFactoryRequest;
+import org.eclipse.aether.artifact.ArtifactType;
+
+@Named
+public class DefaultArtifactFactory implements ArtifactFactory
+{
+ @Override
+ public Artifact create( ArtifactFactoryRequest request ) throws ArtifactFactoryException, InvalidParameterException
+ {
+ DefaultSession session = (DefaultSession) request.getSession();
+ ArtifactType type = null;
+ if ( request.getType() != null )
+ {
+ type = session.getSession().getArtifactTypeRegistry().get( request.getType() );
+ }
+ return new DefaultArtifact(
+ session,
+ new org.eclipse.aether.artifact.DefaultArtifact(
+ request.getGroupId(),
+ request.getArtifactId(),
+ request.getClassifier(),
+ request.getExtension(),
+ request.getVersion(),
+ type ) );
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactInstaller.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactInstaller.java
new file mode 100644
index 0000000..2c45534
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactInstaller.java
@@ -0,0 +1,111 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import org.apache.maven.api.services.ArtifactInstaller;
+import org.apache.maven.api.services.ArtifactInstallerException;
+import org.apache.maven.api.services.ArtifactInstallerRequest;
+import org.apache.maven.api.services.ArtifactManager;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.installation.InstallRequest;
+import org.eclipse.aether.installation.InstallResult;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.metadata.Metadata;
+
+@Named
+public class DefaultArtifactInstaller implements ArtifactInstaller
+{
+
+ private final RepositorySystem repositorySystem;
+
+ @Inject
+ DefaultArtifactInstaller( @Nonnull RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = Objects.requireNonNull( repositorySystem );
+ }
+
+ @Override
+ public void install( ArtifactInstallerRequest request ) throws ArtifactInstallerException, IllegalArgumentException
+ {
+
+ /*
+ // prepare installRequest
+ InstallRequest request = new InstallRequest();
+
+ // transform artifacts
+ for ( org.apache.maven.artifact.Artifact mavenArtifact : mavenArtifacts )
+ {
+ Artifact mainArtifact = RepositoryUtils.toArtifact( mavenArtifact );
+ request.addArtifact( mainArtifact );
+
+ for ( ArtifactMetadata metadata : mavenArtifact.getMetadataList() )
+ {
+ if ( metadata instanceof ProjectArtifactMetadata )
+ {
+ Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
+ pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() );
+ request.addArtifact( pomArtifact );
+ }
+ else if ( // metadata instanceof SnapshotArtifactRepositoryMetadata ||
+ metadata instanceof ArtifactRepositoryMetadata )
+ {
+ // eaten, handled by repo system
+ }
+ else if ( metadata instanceof org.apache.maven.shared.transfer.metadata.ArtifactMetadata )
+ {
+ org.apache.maven.shared.transfer.metadata.ArtifactMetadata transferMetadata =
+ (org.apache.maven.shared.transfer.metadata.ArtifactMetadata) metadata;
+
+ request.addMetadata( new Maven31MetadataBridge( metadata ).setFile( transferMetadata.getFile() ) );
+ }
+ }
+ }
+ */
+
+ DefaultSession session = ( DefaultSession ) request.getSession();
+ try
+ {
+ ArtifactManager artifactManager = session.getService( ArtifactManager.class );
+ List<Metadata> metadatas = request.getArtifacts().stream()
+ .map( artifactManager::getAttachedMetadatas )
+ .flatMap( Collection::stream )
+ .map( session::toMetadata )
+ .collect( Collectors.toList() );
+ InstallRequest installRequest = new InstallRequest()
+ .setArtifacts( session.toArtifacts( request.getArtifacts() ) )
+ .setMetadata( metadatas );
+
+ InstallResult result = repositorySystem.install( session.getSession(), installRequest );
+ }
+ catch ( InstallationException e )
+ {
+ throw new ArtifactInstallerException( e.getMessage(), e );
+ }
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactResolver.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactResolver.java
new file mode 100644
index 0000000..0f87137
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactResolver.java
@@ -0,0 +1,73 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+
+import java.util.Objects;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.services.ArtifactResolver;
+import org.apache.maven.api.services.ArtifactResolverException;
+import org.apache.maven.api.services.ArtifactResolverRequest;
+import org.apache.maven.api.services.ArtifactResolverResult;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+
+public class DefaultArtifactResolver implements ArtifactResolver
+{
+ private final RepositorySystem repositorySystem;
+
+ @Inject
+ DefaultArtifactResolver( @Nonnull RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = Objects.requireNonNull( repositorySystem );
+ }
+
+ @Override
+ public ArtifactResolverResult resolve( ArtifactResolverRequest request )
+ throws ArtifactResolverException, IllegalArgumentException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+ try
+ {
+ ArtifactRequest req = new ArtifactRequest()
+ .setArtifact( session.toArtifact( request.getArtifact() ) )
+ .setRepositories( session.toRepositories( session.getRemoteRepositories() ) );
+ ArtifactResult res = repositorySystem.resolveArtifact( session.getSession(), req );
+ return new ArtifactResolverResult()
+ {
+ @Override
+ public Artifact getArtifact()
+ {
+ return session.getArtifact( res.getArtifact() );
+ }
+ };
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new ArtifactResolverException( "Unable to resolve artifact", e );
+ }
+ }
+
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java
new file mode 100644
index 0000000..27c76c4
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java
@@ -0,0 +1,95 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import java.util.Collection;
+import java.util.Objects;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Exclusion;
+
+public class DefaultDependency implements Dependency
+{
+ private final DefaultSession session;
+ private final org.eclipse.aether.graph.Dependency dependency;
+
+ public DefaultDependency( @Nonnull DefaultSession session, @Nonnull org.eclipse.aether.graph.Dependency dependency )
+ {
+ this.session = Objects.requireNonNull( session, "session" );
+ this.dependency = Objects.requireNonNull( dependency, "dependency" );
+ }
+
+ @Nonnull
+ public org.eclipse.aether.graph.Dependency getDependency()
+ {
+ return dependency;
+ }
+
+ @Nonnull
+ @Override
+ public Artifact getArtifact()
+ {
+ return session.getArtifact( dependency.getArtifact() );
+ }
+
+ @Override
+ public String getScope()
+ {
+ return dependency.getScope();
+ }
+
+ @Nullable
+ @Override
+ public Boolean getOptional()
+ {
+ return dependency.getOptional();
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Exclusion> getExclusions()
+ {
+ return new MappedCollection<>( dependency.getExclusions(), this::toExclusion );
+ }
+
+ private Exclusion toExclusion( org.eclipse.aether.graph.Exclusion exclusion )
+ {
+ return new Exclusion()
+ {
+ @Nullable
+ @Override
+ public String getGroupId()
+ {
+ return exclusion.getGroupId();
+ }
+
+ @Nullable
+ @Override
+ public String getArtifactId()
+ {
+ return exclusion.getArtifactId();
+ }
+ };
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyCollector.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyCollector.java
new file mode 100644
index 0000000..469b541
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyCollector.java
@@ -0,0 +1,93 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import java.util.List;
+
+import org.apache.maven.api.Node;
+import org.apache.maven.api.services.DependencyCollector;
+import org.apache.maven.api.services.DependencyCollectorException;
+import org.apache.maven.api.services.DependencyCollectorRequest;
+import org.apache.maven.api.services.DependencyCollectorResult;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.collection.CollectResult;
+import org.eclipse.aether.collection.DependencyCollectionException;
+import org.eclipse.aether.graph.Dependency;
+
+@Named
+public class DefaultDependencyCollector implements DependencyCollector
+{
+
+ private final RepositorySystem repositorySystem;
+
+ @Inject
+ DefaultDependencyCollector( @Nonnull RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = repositorySystem;
+ }
+
+ @Nonnull
+ @Override
+ public DependencyCollectorResult collect( @Nonnull DependencyCollectorRequest request )
+ throws DependencyCollectorException, IllegalArgumentException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+
+ Artifact rootArtifact = request.getRootArtifact().map( session::toArtifact ).orElse( null );
+ Dependency root = request.getRoot().map( session::toDependency ).orElse( null );
+ CollectRequest collectRequest = new CollectRequest()
+ .setRootArtifact( rootArtifact )
+ .setRoot( root != null ? root : new Dependency( rootArtifact, null ) )
+ .setDependencies( session.toDependencies( request.getDependencies() ) )
+ .setManagedDependencies( session.toDependencies( request.getManagedDependencies() ) )
+ .setRepositories( session.toRepositories( session.getRemoteRepositories() ) );
+
+ try
+ {
+ final CollectResult
+ result = repositorySystem.collectDependencies( session.getSession(), collectRequest );
+ return new DependencyCollectorResult()
+ {
+ @Override
+ public List<Exception> getExceptions()
+ {
+ return result.getExceptions();
+ }
+
+ @Override
+ public Node getRoot()
+ {
+ return session.getNode( result.getRoot() );
+ }
+ };
+ }
+ catch ( DependencyCollectionException e )
+ {
+ throw new DependencyCollectorException( "Unable to collect dependencies", e );
+ }
+ }
+
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyFactory.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyFactory.java
new file mode 100644
index 0000000..7424b22
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyFactory.java
@@ -0,0 +1,56 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Named;
+
+import java.util.stream.Collectors;
+
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Exclusion;
+import org.apache.maven.api.services.DependencyFactory;
+import org.apache.maven.api.services.DependencyFactoryException;
+import org.apache.maven.api.services.DependencyFactoryRequest;
+
+@Named
+public class DefaultDependencyFactory implements DependencyFactory
+{
+
+ @Override
+ public Dependency create( DependencyFactoryRequest request )
+ throws DependencyFactoryException, IllegalArgumentException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+ return new DefaultDependency(
+ session,
+ new org.eclipse.aether.graph.Dependency(
+ session.toArtifact( request.getArtifact() ),
+ request.getScope(),
+ request.isOptional(),
+ request.getExclusions().stream().map( this::toExclusion ).collect( Collectors.toList() ) ) );
+ }
+
+ private org.eclipse.aether.graph.Exclusion toExclusion( Exclusion exclusion )
+ {
+ return new org.eclipse.aether.graph.Exclusion(
+ exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" );
+ }
+
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolver.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolver.java
new file mode 100644
index 0000000..ab7af8c
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolver.java
@@ -0,0 +1,106 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import java.util.List;
+import java.util.function.Predicate;
+
+import org.apache.maven.api.Node;
+import org.apache.maven.api.services.ArtifactResolverResult;
+import org.apache.maven.api.services.DependencyResolver;
+import org.apache.maven.api.services.DependencyResolverException;
+import org.apache.maven.api.services.DependencyResolverRequest;
+import org.apache.maven.api.services.DependencyResolverResult;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.resolution.DependencyRequest;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.resolution.DependencyResult;
+
+@Named
+public class DefaultDependencyResolver implements DependencyResolver
+{
+
+ private final RepositorySystem repositorySystem;
+
+ @Inject
+ DefaultDependencyResolver( RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = repositorySystem;
+ }
+
+ @Override
+ public DependencyResolverResult resolve( DependencyResolverRequest request )
+ throws DependencyResolverException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+
+ CollectRequest collectRequest = new CollectRequest()
+ .setRootArtifact( request.getRootArtifact().map( session::toArtifact ).orElse( null ) )
+ .setRoot( request.getRoot().map( session::toDependency ).orElse( null ) )
+ .setDependencies( session.toDependencies( request.getDependencies() ) )
+ .setManagedDependencies( session.toDependencies( request.getManagedDependencies() ) )
+ .setRepositories( session.toRepositories( request.getSession().getRemoteRepositories() ) );
+ DependencyFilter filter = request.getFilter()
+ .map( f -> toDependencyFilter( session, f ) )
+ .orElse( null );
+ DependencyRequest dependencyRequest = new DependencyRequest()
+ .setCollectRequest( collectRequest )
+ .setFilter( filter );
+
+ try
+ {
+ DependencyResult result = repositorySystem.resolveDependencies( session.getSession(), dependencyRequest );
+ return new DependencyResolverResult()
+ {
+ @Override
+ public List<Exception> getCollectorExceptions()
+ {
+ return result.getCollectExceptions();
+ }
+
+ @Override
+ public Node getRoot()
+ {
+ return session.getNode( result.getRoot() );
+ }
+
+ @Override
+ public List<ArtifactResolverResult> getArtifactResults()
+ {
+ return null;
+ }
+ };
+ }
+ catch ( DependencyResolutionException e )
+ {
+ throw new DependencyResolverException( "Unable to resolve dependencies", e );
+ }
+ }
+
+ private DependencyFilter toDependencyFilter( DefaultSession session, Predicate<Node> filter )
+ {
+ return ( node, parents ) -> filter.test( session.getNode( node ) );
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepository.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepository.java
new file mode 100644
index 0000000..5867af8
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepository.java
@@ -0,0 +1,67 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+
+import java.nio.file.Path;
+import java.util.Objects;
+
+import org.apache.maven.api.LocalRepository;
+
+public class DefaultLocalRepository implements LocalRepository
+{
+
+ private final org.eclipse.aether.repository.LocalRepository repository;
+
+ @Inject
+ DefaultLocalRepository( @Nonnull org.eclipse.aether.repository.LocalRepository repository )
+ {
+ this.repository = Objects.requireNonNull( repository, "repository" );
+ }
+
+ public org.eclipse.aether.repository.LocalRepository getRepository()
+ {
+ return repository;
+ }
+
+ @Nonnull
+ @Override
+ public String getId()
+ {
+ return repository.getId();
+ }
+
+ @Nonnull
+ @Override
+ public String getType()
+ {
+ return repository.getContentType();
+ }
+
+ @Nonnull
+ @Override
+ public Path getPath()
+ {
+ return repository.getBasedir().toPath();
+ }
+
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java
new file mode 100644
index 0000000..6d97e94
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java
@@ -0,0 +1,102 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+import java.util.function.Predicate;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Node;
+import org.apache.maven.api.NodeVisitor;
+import org.apache.maven.api.Repository;
+
+public class DefaultNode implements Node
+{
+
+ private final DefaultSession session;
+ private final org.eclipse.aether.graph.DependencyNode node;
+
+ public DefaultNode( DefaultSession session,
+ org.eclipse.aether.graph.DependencyNode node )
+ {
+ this.session = session;
+ this.node = node;
+ }
+
+ @Override
+ public Artifact getArtifact()
+ {
+ return session.getArtifact( node.getArtifact() );
+ }
+
+ @Override
+ public Dependency getDependency()
+ {
+ return session.getDependency( node.getDependency() );
+ }
+
+ @Override
+ public List<Node> getChildren()
+ {
+ return new MappedList<>( node.getChildren(), session::getNode );
+ }
+
+ @Override
+ public List<Repository> getRemoteRepositories()
+ {
+ return new MappedList<>( node.getRepositories(), session::getRemoteRepository );
+ }
+
+ @Override
+ public Boolean getOptional()
+ {
+ return node.getDependency().getOptional();
+ }
+
+ @Override
+ public String getScope()
+ {
+ return node.getDependency().getScope();
+ }
+
+ @Override
+ public boolean accept( NodeVisitor visitor )
+ {
+ if ( visitor.enter( this ) )
+ {
+ for ( Node child : getChildren() )
+ {
+ if ( !child.accept( visitor ) )
+ {
+ break;
+ }
+ }
+ }
+ return visitor.leave( this );
+ }
+
+ @Override
+ public Node filter( Predicate<Node> filter )
+ {
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java
new file mode 100644
index 0000000..e9b90df
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java
@@ -0,0 +1,172 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Exclusion;
+import org.apache.maven.api.Project;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.Model;
+import org.apache.maven.project.MavenProject;
+
+public class DefaultProject implements Project
+{
+
+ private final DefaultSession session;
+ private final MavenProject project;
+
+ public DefaultProject( DefaultSession session, MavenProject project )
+ {
+ this.session = session;
+ this.project = project;
+ }
+
+ @Nonnull
+ @Override
+ public String getGroupId()
+ {
+ return project.getGroupId();
+ }
+
+ @Nonnull
+ @Override
+ public String getArtifactId()
+ {
+ return project.getArtifactId();
+ }
+
+ @Nonnull
+ @Override
+ public String getVersion()
+ {
+ return project.getVersion();
+ }
+
+ @Nonnull
+ @Override
+ public Artifact getArtifact()
+ {
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
+ }
+
+ @Nonnull
+ @Override
+ public String getPackaging()
+ {
+ return project.getPackaging();
+ }
+
+ @Nonnull
+ @Override
+ public Model getModel()
+ {
+ return project.getModel();
+ }
+
+ @Nonnull
+ @Override
+ public Path getPomPath()
+ {
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
+ }
+
+ @Nonnull
+ @Override
+ public List<Dependency> getDependencies()
+ {
+ return new MappedList<>( project.getDependencies(), this::toDependency );
+ }
+
+ @Nonnull
+ @Override
+ public List<Dependency> getManagedDependencies()
+ {
+ DependencyManagement dependencyManagement = project.getModel().getDependencyManagement();
+ if ( dependencyManagement != null )
+ {
+ return new MappedList<>( dependencyManagement.getDependencies(), this::toDependency );
+ }
+ return Collections.emptyList();
+ }
+
+ private Dependency toDependency( org.apache.maven.model.Dependency dependency )
+ {
+ return new Dependency()
+ {
+ @Nonnull
+ @Override
+ public Artifact getArtifact()
+ {
+ return session.createArtifact( dependency.getGroupId(), dependency.getArtifactId(),
+ dependency.getVersion(), dependency.getType() );
+ }
+
+ @Override
+ public String getScope()
+ {
+ return dependency.getScope();
+ }
+
+ @Override
+ public Boolean getOptional()
+ {
+ return dependency.isOptional();
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Exclusion> getExclusions()
+ {
+ return new MappedCollection<>( dependency.getExclusions(), this::toExclusion );
+ }
+
+ private Exclusion toExclusion( org.apache.maven.model.Exclusion exclusion )
+ {
+ return new Exclusion()
+ {
+ @Nullable
+ @Override
+ public String getGroupId()
+ {
+ return exclusion.getGroupId();
+ }
+
+ @Nullable
+ @Override
+ public String getArtifactId()
+ {
+ return exclusion.getArtifactId();
+ }
+ };
+ }
+ };
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectBuilder.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectBuilder.java
new file mode 100644
index 0000000..e287ccf
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectBuilder.java
@@ -0,0 +1,258 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Node;
+import org.apache.maven.api.Project;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.building.ModelProblem;
+import org.apache.maven.model.building.ModelSource;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.project.ProjectBuildingResult;
+import org.apache.maven.api.services.ArtifactResolverResult;
+import org.apache.maven.api.services.DependencyResolverResult;
+import org.apache.maven.api.services.ProjectBuilder;
+import org.apache.maven.api.services.ProjectBuilderException;
+import org.apache.maven.api.services.ProjectBuilderProblem;
+import org.apache.maven.api.services.ProjectBuilderRequest;
+import org.apache.maven.api.services.ProjectBuilderResult;
+import org.apache.maven.api.services.ProjectBuilderSource;
+
+public class DefaultProjectBuilder implements ProjectBuilder
+{
+
+ private final org.apache.maven.project.ProjectBuilder builder;
+
+ @Inject
+ public DefaultProjectBuilder( org.apache.maven.project.ProjectBuilder builder )
+ {
+ this.builder = builder;
+ }
+
+ @SuppressWarnings( "MethodLength" )
+ @Nonnull
+ @Override
+ public ProjectBuilderResult build( ProjectBuilderRequest request )
+ throws ProjectBuilderException, IllegalArgumentException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+ try
+ {
+ List<ArtifactRepository> repositories =
+ session.toArtifactRepositories( session.getRemoteRepositories() );
+ ProjectBuildingRequest req = new DefaultProjectBuildingRequest()
+ .setRepositorySession( session.getSession() )
+ .setRemoteRepositories( repositories )
+ .setPluginArtifactRepositories( repositories )
+ .setProcessPlugins( request.isProcessPlugins() );
+ ProjectBuildingResult res;
+ if ( request.getPath().isPresent() )
+ {
+ Path path = request.getPath().get();
+ res = builder.build( path.toFile(), req );
+ }
+ else if ( request.getSource().isPresent() )
+ {
+ ProjectBuilderSource source = request.getSource().get();
+ ModelSource modelSource = new ModelSource()
+ {
+ @Override
+ public InputStream getInputStream() throws IOException
+ {
+ return source.getInputStream();
+ }
+
+ @Override
+ public String getLocation()
+ {
+ return source.getLocation();
+ }
+ };
+ res = builder.build( modelSource, req );
+ }
+ else if ( request.getArtifact().isPresent() )
+ {
+ Artifact a = request.getArtifact().get();
+ org.eclipse.aether.artifact.Artifact aetherArtifact = session.toArtifact( a );
+ org.apache.maven.artifact.Artifact artifact = RepositoryUtils.toArtifact( aetherArtifact );
+ res = builder.build( artifact, request.isAllowStubModel(), req );
+ }
+ else
+ {
+ throw new IllegalArgumentException( "Invalid request" );
+ }
+ return new ProjectBuilderResult()
+ {
+ @Nonnull
+ @Override
+ public String getProjectId()
+ {
+ return res.getProjectId();
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Path> getPomFile()
+ {
+ return Optional.ofNullable( res.getPomFile() ).map( File::toPath );
+ }
+
+ @Nonnull
+ @Override
+ public Optional<Project> getProject()
+ {
+ return Optional.ofNullable( res.getProject() )
+ .map( session::getProject );
+ }
+
+ @Nonnull
+ @Override
+ public Collection<ProjectBuilderProblem> getProblems()
+ {
+ return new MappedCollection<>( res.getProblems(), this::toProblem );
+ }
+
+ private ProjectBuilderProblem toProblem( ModelProblem problem )
+ {
+ return new ProjectBuilderProblem()
+ {
+ @Override
+ public String getSource()
+ {
+ return problem.getSource();
+ }
+
+ @Override
+ public int getLineNumber()
+ {
+ return problem.getLineNumber();
+ }
+
+ @Override
+ public int getColumnNumber()
+ {
+ return problem.getColumnNumber();
+ }
+
+ @Override
+ public String getLocation()
+ {
+ StringBuilder buffer = new StringBuilder( 256 );
+
+ if ( getSource().length() > 0 )
+ {
+ if ( buffer.length() > 0 )
+ {
+ buffer.append( ", " );
+ }
+ buffer.append( getSource() );
+ }
+
+ if ( getLineNumber() > 0 )
+ {
+ if ( buffer.length() > 0 )
+ {
+ buffer.append( ", " );
+ }
+ buffer.append( "line " ).append( getLineNumber() );
+ }
+
+ if ( getColumnNumber() > 0 )
+ {
+ if ( buffer.length() > 0 )
+ {
+ buffer.append( ", " );
+ }
+ buffer.append( "column " ).append( getColumnNumber() );
+ }
+
+ return buffer.toString();
+ }
+
+ @Override
+ public Exception getException()
+ {
+ return problem.getException();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return problem.getMessage();
+ }
+
+ @Override
+ public Severity getSeverity()
+ {
+ return Severity.valueOf( problem.getSeverity().name() );
+ }
+ };
+ }
+
+ @Nonnull
+ @Override
+ public Optional<DependencyResolverResult> getDependencyResolverResult()
+ {
+ return Optional.ofNullable( res.getDependencyResolutionResult() )
+ .map( r -> new DependencyResolverResult()
+ {
+ @Override
+ public List<Exception> getCollectorExceptions()
+ {
+ return r.getCollectionErrors();
+ }
+
+ @Override
+ public Node getRoot()
+ {
+ return session.getNode( r.getDependencyGraph() );
+ }
+
+ @Override
+ public List<ArtifactResolverResult> getArtifactResults()
+ {
+ return Collections.emptyList();
+ }
+ } );
+ }
+ };
+ }
+ catch ( ProjectBuildingException e )
+ {
+ throw new ProjectBuilderException( "Unable to build project", e );
+ }
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectDeployer.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectDeployer.java
new file mode 100644
index 0000000..b8aabd6
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectDeployer.java
@@ -0,0 +1,142 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.services.ArtifactManager;
+import org.apache.maven.api.services.ProjectDeployer;
+import org.apache.maven.api.services.ProjectDeployerException;
+import org.apache.maven.api.services.ProjectDeployerRequest;
+import org.apache.maven.api.services.ProjectManager;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.deployment.DeployRequest;
+import org.eclipse.aether.deployment.DeployResult;
+import org.eclipse.aether.deployment.DeploymentException;
+import org.eclipse.aether.metadata.Metadata;
+
+@Named
+public class DefaultProjectDeployer implements ProjectDeployer
+{
+
+ private final RepositorySystem repositorySystem;
+
+ @Inject
+ DefaultProjectDeployer( @Nonnull RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = repositorySystem;
+ }
+
+ @Override
+ public void deploy( ProjectDeployerRequest request ) throws ProjectDeployerException, IllegalArgumentException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+ try
+ {
+ ArtifactManager artifactManager = session.getService( ArtifactManager.class );
+ Collection<Artifact> artifacts = session.getService( ProjectManager.class )
+ .getAttachedArtifacts( request.getProject() );
+ List<Metadata> metadatas = artifacts.stream()
+ .map( artifactManager::getAttachedMetadatas )
+ .flatMap( Collection::stream )
+ .map( session::toMetadata )
+ .collect( Collectors.toList() );
+ DeployRequest deployRequest = new DeployRequest()
+ .setRepository( session.toRepository( request.getRepository() ) )
+ .setArtifacts( session.toArtifacts( artifacts ) )
+ .setMetadata( metadatas );
+
+ DeployResult result = repositorySystem.deploy( session.getSession(), deployRequest );
+ }
+ catch ( DeploymentException e )
+ {
+ throw new ProjectDeployerException( "Unable to deploy project", e );
+ }
+ }
+
+ void dumb()
+ {
+ /*
+ Artifact artifact = projectDeployerRequest.getProject().getArtifact();
+ String packaging = projectDeployerRequest.getProject().getPackaging();
+ File pomFile = projectDeployerRequest.getProject().getFile();
+
+ List<Artifact> attachedArtifacts = projectDeployerRequest.getProject().getAttachedArtifacts();
+
+ // Deploy the POM
+ boolean isPomArtifact = "pom".equals( packaging );
+ if ( isPomArtifact )
+ {
+ artifact.setFile( pomFile );
+ }
+ else
+ {
+ ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
+ artifact.addMetadata( metadata );
+ }
+
+ // What consequence does this have?
+ // artifact.setRelease( true );
+
+ artifact.setRepository( artifactRepository );
+
+ int retryFailedDeploymentCount = projectDeployerRequest.getRetryFailedDeploymentCount();
+
+ List<Artifact> deployableArtifacts = new ArrayList<>();
+ if ( isPomArtifact )
+ {
+ deployableArtifacts.add( artifact );
+ }
+ else
+ {
+ File file = artifact.getFile();
+
+ if ( file != null && file.isFile() )
+ {
+ deployableArtifacts.add( artifact );
+ }
+ else if ( !attachedArtifacts.isEmpty() )
+ {
+ // TODO: Reconsider this exception? Better Exception type?
+ throw new NoFileAssignedException( "The packaging plugin for this project did not assign "
+ + "a main file to the project but it has attachments. Change packaging to 'pom'." );
+ }
+ else
+ {
+ // TODO: Reconsider this exception? Better Exception type?
+ throw new NoFileAssignedException( "The packaging for this project did not assign "
+ + "a file to the build artifact" );
+ }
+ }
+
+ deployableArtifacts.addAll( attachedArtifacts );
+
+ deploy( buildingRequest, deployableArtifacts, artifactRepository, retryFailedDeploymentCount );
+
+ */
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectInstaller.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectInstaller.java
new file mode 100644
index 0000000..ed87e56
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectInstaller.java
@@ -0,0 +1,77 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.services.ArtifactManager;
+import org.apache.maven.api.services.ProjectInstaller;
+import org.apache.maven.api.services.ProjectInstallerException;
+import org.apache.maven.api.services.ProjectInstallerRequest;
+import org.apache.maven.api.services.ProjectManager;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.installation.InstallRequest;
+import org.eclipse.aether.installation.InstallResult;
+import org.eclipse.aether.installation.InstallationException;
+import org.eclipse.aether.metadata.Metadata;
+
+@Named
+public class DefaultProjectInstaller implements ProjectInstaller
+{
+ private final RepositorySystem repositorySystem;
+
+ @Inject
+ DefaultProjectInstaller( RepositorySystem repositorySystem )
+ {
+ this.repositorySystem = repositorySystem;
+ }
+
+ @Override
+ public void install( ProjectInstallerRequest request ) throws ProjectInstallerException, IllegalArgumentException
+ {
+ DefaultSession session = ( DefaultSession ) request.getSession();
+ try
+ {
+ ArtifactManager artifactManager = session.getService( ArtifactManager.class );
+ Collection<Artifact> artifacts = session.getService( ProjectManager.class )
+ .getAttachedArtifacts( request.getProject() );
+ List<Metadata> metadatas = artifacts.stream()
+ .map( artifactManager::getAttachedMetadatas )
+ .flatMap( Collection::stream )
+ .map( session::toMetadata )
+ .collect( Collectors.toList() );
+ InstallRequest installRequest = new InstallRequest()
+ .setArtifacts( session.toArtifacts( artifacts ) )
+ .setMetadata( metadatas );
+
+ InstallResult result = repositorySystem.install( session.getSession(), installRequest );
+ }
+ catch ( InstallationException e )
+ {
+ throw new ProjectInstallerException( "Unable to install project", e );
+ }
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java
new file mode 100644
index 0000000..73d481f
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java
@@ -0,0 +1,53 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import org.apache.maven.api.RemoteRepository;
+
+public class DefaultRemoteRepository implements RemoteRepository
+{
+ private final org.eclipse.aether.repository.RemoteRepository repository;
+
+ public DefaultRemoteRepository( org.eclipse.aether.repository.RemoteRepository repository )
+ {
+ this.repository = repository;
+ }
+
+ public org.eclipse.aether.repository.RemoteRepository getRepository()
+ {
+ return repository;
+ }
+
+ @Nonnull
+ @Override
+ public String getId()
+ {
+ return repository.getId();
+ }
+
+ @Nonnull
+ @Override
+ public String getType()
+ {
+ return repository.getContentType();
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
new file mode 100644
index 0000000..6b37f63
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
@@ -0,0 +1,386 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.WeakHashMap;
+import java.util.stream.Collectors;
+
+import org.apache.maven.api.services.Service;
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.ArtifactMetadata;
+import org.apache.maven.api.Dependency;
+import org.apache.maven.api.Node;
+import org.apache.maven.api.Project;
+import org.apache.maven.api.LocalRepository;
+import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.bridge.MavenRepositorySystem;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.api.services.ArtifactResolver;
+import org.apache.maven.api.services.ArtifactDeployer;
+import org.apache.maven.api.services.ArtifactFactory;
+import org.apache.maven.api.services.ArtifactInstaller;
+import org.apache.maven.api.services.DependencyCollector;
+import org.apache.maven.api.services.DependencyFactory;
+import org.apache.maven.api.services.DependencyResolver;
+import org.apache.maven.api.services.ProjectBuilder;
+import org.apache.maven.api.services.ProjectDeployer;
+import org.apache.maven.api.services.ProjectInstaller;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.repository.LocalRepositoryManager;
+import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
+import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory;
+
+public class DefaultSession implements Session
+{
+
+ private final RepositorySystemSession session;
+ private final RepositorySystem repositorySystem;
+ private final LocalRepositoryManagerFactory localRepositoryManagerFactory;
+ private final List<RemoteRepository> repositories;
+ private final org.apache.maven.project.ProjectBuilder projectBuilder;
+ private final MavenRepositorySystem mavenRepositorySystem;
+
+ private final Map<org.eclipse.aether.graph.DependencyNode, Node> allNodes
+ = Collections.synchronizedMap( new WeakHashMap<>() );
+ private final Map<org.eclipse.aether.artifact.Artifact, Artifact> allArtifacts
+ = Collections.synchronizedMap( new WeakHashMap<>() );
+ private final Map<org.eclipse.aether.repository.RemoteRepository, RemoteRepository> allRepositories
+ = Collections.synchronizedMap( new WeakHashMap<>() );
+ private final Map<MavenProject, Project> allProjects
+ = Collections.synchronizedMap( new WeakHashMap<>() );
+ private final Map<org.eclipse.aether.graph.Dependency, Dependency> allDependencies
+ = Collections.synchronizedMap( new WeakHashMap<>() );
+
+ public DefaultSession( @Nonnull RepositorySystemSession session,
+ @Nonnull RepositorySystem repositorySystem,
+ @Nonnull LocalRepositoryManagerFactory localRepositoryManagerFactory,
+ @Nonnull List<RemoteRepository> repositories,
+ @Nonnull org.apache.maven.project.ProjectBuilder projectBuilder,
+ @Nonnull MavenRepositorySystem mavenRepositorySystem )
+ {
+ this.session = Objects.requireNonNull( session );
+ this.repositorySystem = Objects.requireNonNull( repositorySystem );
+ this.localRepositoryManagerFactory = Objects.requireNonNull( localRepositoryManagerFactory );
+ this.repositories = Objects.requireNonNull( repositories );
+ this.projectBuilder = projectBuilder;
+ this.mavenRepositorySystem = mavenRepositorySystem;
+ }
+
+ @Nonnull
+ @Override
+ public LocalRepository getLocalRepository()
+ {
+ return new DefaultLocalRepository( session.getLocalRepository() );
+ }
+
+ @Nonnull
+ @Override
+ public List<RemoteRepository> getRemoteRepositories()
+ {
+ return Collections.unmodifiableList( repositories );
+ }
+
+ @Nonnull
+ @Override
+ public Session withLocalRepository( @Nonnull LocalRepository localRepository )
+ {
+ Objects.requireNonNull( localRepository, "localRepository" );
+ if ( session.getLocalRepository() != null
+ && Objects.equals( session.getLocalRepository().getBasedir().toPath(),
+ localRepository.getPath() ) )
+ {
+ return this;
+ }
+ try
+ {
+ org.eclipse.aether.repository.LocalRepository repository = toRepository( localRepository );
+ LocalRepositoryManager localRepositoryManager
+ = localRepositoryManagerFactory.newInstance( session, repository );
+
+ RepositorySystemSession newSession = new DefaultRepositorySystemSession( session )
+ .setLocalRepositoryManager( localRepositoryManager );
+
+ return new DefaultSession( newSession, repositorySystem, localRepositoryManagerFactory,
+ repositories, projectBuilder, mavenRepositorySystem );
+ }
+ catch ( NoLocalRepositoryManagerException e )
+ {
+ throw new IllegalArgumentException( "Unsupported repository layout", e );
+ }
+
+ }
+
+ @Nonnull
+ @Override
+ public Session withRemoteRepositories( @Nonnull List<RemoteRepository> repositories )
+ {
+ return new DefaultSession( session, repositorySystem, localRepositoryManagerFactory,
+ repositories, projectBuilder, mavenRepositorySystem );
+ }
+
+ @Nonnull
+ @Override
+ @SuppressWarnings( "unchecked" )
+ public <T extends Service> T getService( Class<T> clazz ) throws NoSuchElementException
+ {
+ if ( clazz == ArtifactFactory.class )
+ {
+ return (T) new DefaultArtifactFactory();
+ }
+ else if ( clazz == ArtifactResolver.class )
+ {
+ return (T) new DefaultArtifactResolver( repositorySystem );
+ }
+ else if ( clazz == ArtifactDeployer.class )
+ {
+ return (T) new DefaultArtifactDeployer( repositorySystem );
+ }
+ else if ( clazz == ArtifactInstaller.class )
+ {
+ return (T) new DefaultArtifactInstaller( repositorySystem );
+ }
+ else if ( clazz == DependencyFactory.class )
+ {
+ return (T) new DefaultDependencyFactory();
+ }
+ else if ( clazz == DependencyCollector.class )
+ {
+ return (T) new DefaultDependencyCollector( repositorySystem );
+ }
+ else if ( clazz == DependencyResolver.class )
+ {
+ return (T) new DefaultDependencyResolver( repositorySystem );
+ }
+ else if ( clazz == ProjectBuilder.class )
+ {
+ return (T) new DefaultProjectBuilder( projectBuilder );
+ }
+ else if ( clazz == ProjectDeployer.class )
+ {
+ return (T) new DefaultProjectDeployer( repositorySystem );
+ }
+ else if ( clazz == ProjectInstaller.class )
+ {
+ return (T) new DefaultProjectInstaller( repositorySystem );
+ }
+ throw new NoSuchElementException( clazz.getName() );
+ }
+
+ public RepositorySystemSession getSession()
+ {
+ return session;
+ }
+
+ public RemoteRepository getRemoteRepository( org.eclipse.aether.repository.RemoteRepository repository )
+ {
+ return allRepositories.computeIfAbsent( repository, DefaultRemoteRepository::new );
+ }
+
+ public Node getNode( org.eclipse.aether.graph.DependencyNode node )
+ {
+ return allNodes.computeIfAbsent( node, n -> new DefaultNode( this, n ) );
+ }
+
+ public Artifact getArtifact( org.eclipse.aether.artifact.Artifact artifact )
+ {
+ return allArtifacts.computeIfAbsent( artifact, a -> new DefaultArtifact( this, a ) );
+ }
+
+ public Dependency getDependency( org.eclipse.aether.graph.Dependency dependency )
+ {
+ return allDependencies.computeIfAbsent( dependency, d -> new DefaultDependency( this, d ) );
+ }
+
+ public Project getProject( MavenProject project )
+ {
+ return allProjects.computeIfAbsent( project, p -> new DefaultProject( this, p ) );
+ }
+
+ public List<org.eclipse.aether.repository.RemoteRepository> toRepositories( List<RemoteRepository> repositories )
+ {
+ return repositories == null ? null : repositories.stream()
+ .map( this::toRepository )
+ .collect( Collectors.toList() );
+ }
+
+ public org.eclipse.aether.repository.RemoteRepository toRepository( RemoteRepository repository )
+ {
+ if ( repository instanceof DefaultRemoteRepository )
+ {
+ return ( (DefaultRemoteRepository) repository ).getRepository();
+ }
+ else
+ {
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
+ }
+ }
+
+ public org.eclipse.aether.repository.LocalRepository toRepository( LocalRepository repository )
+ {
+ if ( repository instanceof DefaultLocalRepository )
+ {
+ return ( ( DefaultLocalRepository ) repository ).getRepository();
+ }
+ else
+ {
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
+ }
+ }
+
+ public List<ArtifactRepository> toArtifactRepositories( List<RemoteRepository> repositories )
+ {
+ return repositories == null ? null : repositories.stream()
+ .map( this::toArtifactRepository )
+ .collect( Collectors.toList() );
+ }
+
+ private ArtifactRepository toArtifactRepository( RemoteRepository repository )
+ {
+ if ( repository instanceof DefaultRemoteRepository )
+ {
+ org.eclipse.aether.repository.RemoteRepository rr
+ = ( (DefaultRemoteRepository) repository ).getRepository();
+
+ try
+ {
+ return mavenRepositorySystem.createRepository(
+ rr.getUrl(),
+ rr.getId(),
+ rr.getPolicy( false ).isEnabled(),
+ rr.getPolicy( false ).getUpdatePolicy(),
+ rr.getPolicy( true ).isEnabled(),
+ rr.getPolicy( true ).getUpdatePolicy(),
+ rr.getPolicy( false ).getChecksumPolicy()
+
+ );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Unable to create repository", e );
+ }
+ }
+ else
+ {
+ // TODO
+ throw new UnsupportedOperationException( "Not yet implemented" );
+ }
+ }
+
+ public List<org.eclipse.aether.graph.Dependency> toDependencies( Collection<Dependency> dependencies )
+ {
+ return dependencies == null ? null : dependencies.stream()
+ .map( this::toDependency )
+ .collect( Collectors.toList() );
+ }
+
+ public org.eclipse.aether.graph.Dependency toDependency( Dependency dependency )
+ {
+ if ( dependency instanceof DefaultDependency )
+ {
+ return ( ( DefaultDependency ) dependency ).getDependency();
+ }
+ else
+ {
+ String typeId = dependency.getType();
+ org.eclipse.aether.artifact.ArtifactType type = typeId != null
+ ? session.getArtifactTypeRegistry().get( typeId ) : null;
+ String extension = type != null ? type.getExtension() : null;
+ return new org.eclipse.aether.graph.Dependency(
+ new org.eclipse.aether.artifact.DefaultArtifact(
+ dependency.getGroupId(),
+ dependency.getArtifactId(),
+ dependency.getClassifier(),
+ extension,
+ dependency.getVersion(),
+ type
+ ), null );
+ }
+ }
+
+ public List<org.eclipse.aether.artifact.Artifact> toArtifacts( Collection<Artifact> artifacts )
+ {
+ return artifacts == null ? null : artifacts.stream()
+ .map( this::toArtifact )
+ .collect( Collectors.toList() );
+ }
+
+ public org.eclipse.aether.artifact.Artifact toArtifact( Artifact artifact )
+ {
+ if ( artifact instanceof DefaultArtifact )
+ {
+ return ( ( DefaultArtifact ) artifact ).getArtifact();
+ }
+ else
+ {
+ return new org.eclipse.aether.artifact.DefaultArtifact(
+ artifact.getGroupId(),
+ artifact.getArtifactId(),
+ artifact.getClassifier(),
+ artifact.getExtension(),
+ artifact.getVersion(),
+ null,
+ ( (Artifact) artifact ).getPath().map( Path::toFile ).orElse( null )
+ );
+ }
+ }
+
+ public org.eclipse.aether.metadata.Metadata toMetadata( ArtifactMetadata metadata )
+ {
+ /*
+ if ( metadata instanceof ProjectArtifactMetadata )
+ {
+ Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
+ pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() );
+ request.addArtifact( pomArtifact );
+ }
+ else if ( // metadata instanceof SnapshotArtifactRepositoryMetadata ||
+ metadata instanceof ArtifactRepositoryMetadata )
+ {
+ // eaten, handled by repo system
+ }
+ else if ( metadata instanceof org.apache.maven.shared.transfer.metadata.ArtifactMetadata )
+ {
+ org.apache.maven.shared.transfer.metadata.ArtifactMetadata transferMetadata =
+ (org.apache.maven.shared.transfer.metadata.ArtifactMetadata) metadata;
+
+ request.addMetadata( new Maven31MetadataBridge( metadata ).setFile( transferMetadata.getFile() ) );
+ }
+
+ */
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
+ }
+
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/MappedCollection.java b/maven-core-impl/src/main/java/org/apache/maven/impl/MappedCollection.java
new file mode 100644
index 0000000..1fd3248
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/MappedCollection.java
@@ -0,0 +1,63 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.AbstractCollection;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.function.Function;
+
+public class MappedCollection<U, V> extends AbstractCollection<U>
+{
+ private final Collection<V> list;
+ private final Function<V, U> mapper;
+
+ public MappedCollection( Collection<V> list, Function<V, U> mapper )
+ {
+ this.list = list;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator<U> iterator()
+ {
+ Iterator<V> it = list.iterator();
+ return new Iterator<U>()
+ {
+ @Override
+ public boolean hasNext()
+ {
+ return it.hasNext();
+ }
+
+ @Override
+ public U next()
+ {
+ return mapper.apply( it.next() );
+ }
+ };
+ }
+
+ @Override
+ public int size()
+ {
+ return list.size();
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/MappedList.java b/maven-core-impl/src/main/java/org/apache/maven/impl/MappedList.java
new file mode 100644
index 0000000..a5e8e71
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/MappedList.java
@@ -0,0 +1,48 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.AbstractList;
+import java.util.List;
+import java.util.function.Function;
+
+public class MappedList<U, V> extends AbstractList<U>
+{
+ private final List<V> list;
+ private final Function<V, U> mapper;
+
+ public MappedList( List<V> list, Function<V, U> mapper )
+ {
+ this.list = list;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public U get( int index )
+ {
+ return mapper.apply( list.get( index ) );
+ }
+
+ @Override
+ public int size()
+ {
+ return list.size();
+ }
+}
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java b/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
new file mode 100644
index 0000000..7736f81
--- /dev/null
+++ b/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
@@ -0,0 +1,105 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+
+import java.util.Collections;
+
+import org.apache.maven.api.Project;
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Node;
+import org.apache.maven.api.services.ProjectBuilder;
+import org.apache.maven.api.services.ProjectBuilderRequest;
+import org.apache.maven.bridge.MavenRepositorySystem;
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
+import org.codehaus.plexus.testing.PlexusTest;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@PlexusTest
+public class TestApi
+{
+
+ Session session;
+
+ @Inject
+ RepositorySystem repositorySystem;
+
+ @Inject
+ LocalRepositoryManagerFactory localRepositoryManagerFactory;
+
+ @Inject
+ org.apache.maven.project.ProjectBuilder projectBuilder;
+
+ @Inject
+ MavenRepositorySystem mavenRepositorySystem;
+
+ @BeforeEach
+ void setup()
+ {
+ RepositorySystemSession rss = MavenRepositorySystemUtils.newSession();
+ DefaultSession session = new DefaultSession( rss, repositorySystem, localRepositoryManagerFactory,
+ Collections.emptyList(), projectBuilder, mavenRepositorySystem );
+ DefaultLocalRepository localRepository = new DefaultLocalRepository(
+ new LocalRepository( "target/repo" ) );
+ org.apache.maven.api.RemoteRepository remoteRepository = session.getRemoteRepository(
+ new RemoteRepository.Builder( "mirror", "default",
+ "file:target/test-classes/repo" ).build() );
+ this.session = session
+ .withLocalRepository( localRepository )
+ .withRemoteRepositories( Collections.singletonList( remoteRepository ) );
+ }
+
+ @Test
+ void testCreateAndResolveArtifact() throws Exception
+ {
+ Artifact artifact = session.createArtifact( "org.codehaus.plexus", "plexus-utils", "1.4.5", "pom" );
+ assertFalse( artifact.getPath().isPresent() );
+
+ Artifact resolved = session.resolveArtifact( artifact ).getArtifact();
+ assertNotSame( resolved, artifact );
+ assertTrue( resolved.getPath().isPresent() );
+ assertNotNull( resolved.getPath().get() );
+
+ Project project = session.getService( ProjectBuilder.class ).build(
+ ProjectBuilderRequest.builder().session( session ).path( resolved.getPath().get() )
+ .processPlugins( false ).resolveDependencies( false ).build() )
+ .getProject().get();
+ assertNotNull( project );
+
+ artifact = session.createArtifact( "org.codehaus.plexus", "plexus-container-default", "1.0-alpha-32", "jar" );
+ Node root = session.collectDependencies( artifact ).getRoot();
+ assertNotNull( root );
+ }
+
+
+}
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestArtifactHandler.java b/maven-core-impl/src/test/java/org/apache/maven/impl/TestArtifactHandler.java
new file mode 100644
index 0000000..1411364
--- /dev/null
+++ b/maven-core-impl/src/test/java/org/apache/maven/impl/TestArtifactHandler.java
@@ -0,0 +1,83 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+
+/**
+ * Assists unit testing.
+ *
+ * @author Benjamin Bentmann
+ */
+class TestArtifactHandler
+ implements ArtifactHandler
+{
+
+ private String type;
+
+ private String extension;
+
+ public TestArtifactHandler( String type )
+ {
+ this( type, type );
+ }
+
+ public TestArtifactHandler( String type, String extension )
+ {
+ this.type = type;
+ this.extension = extension;
+ }
+
+ public String getClassifier()
+ {
+ return null;
+ }
+
+ public String getDirectory()
+ {
+ return getPackaging() + "s";
+ }
+
+ public String getExtension()
+ {
+ return extension;
+ }
+
+ public String getLanguage()
+ {
+ return "java";
+ }
+
+ public String getPackaging()
+ {
+ return type;
+ }
+
+ public boolean isAddedToClasspath()
+ {
+ return true;
+ }
+
+ public boolean isIncludesDependencies()
+ {
+ return false;
+ }
+
+}
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestRepositorySystem.java b/maven-core-impl/src/test/java/org/apache/maven/impl/TestRepositorySystem.java
new file mode 100644
index 0000000..824ac27
--- /dev/null
+++ b/maven-core-impl/src/test/java/org/apache/maven/impl/TestRepositorySystem.java
@@ -0,0 +1,341 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.InvalidRepositoryException;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
+import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.Repository;
+import org.apache.maven.model.io.ModelReader;
+import org.apache.maven.project.artifact.ArtifactWithDependencies;
+import org.apache.maven.repository.ArtifactDoesNotExistException;
+import org.apache.maven.repository.ArtifactTransferFailedException;
+import org.apache.maven.repository.ArtifactTransferListener;
+import org.apache.maven.repository.RepositorySystem;
+import org.apache.maven.settings.Mirror;
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
+import org.eclipse.aether.RepositorySystemSession;
+
+/**
+ * @author Benjamin Bentmann
+ */
+@Named
+@Singleton
+public class TestRepositorySystem
+ implements RepositorySystem
+{
+
+ private final ModelReader modelReader;
+
+ private final ArtifactFactory artifactFactory;
+
+ @Inject
+ public TestRepositorySystem( ModelReader modelReader, ArtifactFactory artifactFactory )
+ {
+ this.modelReader = modelReader;
+ this.artifactFactory = artifactFactory;
+ }
+
+ public ArtifactRepository buildArtifactRepository( Repository repository )
+ throws InvalidRepositoryException
+ {
+ return new MavenArtifactRepository( repository.getId(), repository.getUrl(), new DefaultRepositoryLayout(),
+ new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy() );
+ }
+
+ public Artifact createArtifact( String groupId, String artifactId, String version, String packaging )
+ {
+ return createArtifact( groupId, artifactId, version, null, packaging );
+ }
+
+ public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
+ {
+ return new DefaultArtifact( groupId, artifactId, version, scope, type, null, new TestArtifactHandler( type ) );
+ }
+
+ public ArtifactRepository createArtifactRepository( String id, String url,
+ ArtifactRepositoryLayout repositoryLayout,
+ ArtifactRepositoryPolicy snapshots,
+ ArtifactRepositoryPolicy releases )
+ {
+ return new MavenArtifactRepository( id, url, repositoryLayout, snapshots, releases );
+ }
+
+ public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type,
+ String classifier )
+ {
+ return new DefaultArtifact( groupId, artifactId, version, null, type, classifier,
+ new TestArtifactHandler( type ) );
+ }
+
+ public ArtifactRepository createDefaultLocalRepository()
+ throws InvalidRepositoryException
+ {
+ return createLocalRepository( new File( System.getProperty( "basedir", "." ), "target/local-repo" ).getAbsoluteFile() );
+ }
+
+ public ArtifactRepository createDefaultRemoteRepository()
+ throws InvalidRepositoryException
+ {
+ return new MavenArtifactRepository( DEFAULT_REMOTE_REPO_ID, "file://"
+ + new File( System.getProperty( "basedir", "." ), "src/test/remote-repo" ).getAbsoluteFile().toURI().getPath(),
+ new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(),
+ new ArtifactRepositoryPolicy() );
+ }
+
+ public Artifact createDependencyArtifact( Dependency dependency )
+ {
+ Artifact artifact =
+ new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(),
+ dependency.getScope(), dependency.getType(), dependency.getClassifier(),
+ new TestArtifactHandler( dependency.getType() ) );
+
+ if ( Artifact.SCOPE_SYSTEM.equals( dependency.getScope() ) )
+ {
+ artifact.setFile( new File( dependency.getSystemPath() ) );
+ artifact.setResolved( true );
+ }
+
+ return artifact;
+ }
+
+ public ArtifactRepository createLocalRepository( File localRepository )
+ throws InvalidRepositoryException
+ {
+ return new MavenArtifactRepository( DEFAULT_LOCAL_REPO_ID, "file://" + localRepository.toURI().getPath(),
+ new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(),
+ new ArtifactRepositoryPolicy() );
+ }
+
+ public Artifact createPluginArtifact( Plugin plugin )
+ {
+ VersionRange versionRange;
+ try
+ {
+ String version = plugin.getVersion();
+ if ( StringUtils.isEmpty( version ) )
+ {
+ version = "RELEASE";
+ }
+ versionRange = VersionRange.createFromVersionSpec( version );
+ }
+ catch ( InvalidVersionSpecificationException e )
+ {
+ return null;
+ }
+
+ return artifactFactory.createPluginArtifact( plugin.getGroupId(), plugin.getArtifactId(), versionRange );
+ }
+
+ public Artifact createProjectArtifact( String groupId, String artifactId, String version )
+ {
+ return createArtifact( groupId, artifactId, version, "pom" );
+ }
+
+ public List<ArtifactRepository> getEffectiveRepositories( List<ArtifactRepository> repositories )
+ {
+ return repositories;
+ }
+
+ public Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors )
+ {
+ return null;
+ }
+
+ public void injectAuthentication( List<ArtifactRepository> repositories, List<Server> servers )
+ {
+ }
+
+ public void injectMirror( List<ArtifactRepository> repositories, List<Mirror> mirrors )
+ {
+ }
+
+ public void injectProxy( List<ArtifactRepository> repositories, List<Proxy> proxies )
+ {
+ }
+
+ public void publish( ArtifactRepository repository, File source, String remotePath,
+ ArtifactTransferListener transferListener )
+ throws ArtifactTransferFailedException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
+ {
+ ArtifactResolutionResult result = new ArtifactResolutionResult();
+
+ if ( request.isResolveRoot() )
+ {
+ try
+ {
+ resolve( request.getArtifact(), request );
+ result.addArtifact( request.getArtifact() );
+ }
+ catch ( IOException e )
+ {
+ result.addMissingArtifact( request.getArtifact() );
+ }
+ }
+
+ if ( request.isResolveTransitively() )
+ {
+ Map<String, Artifact> artifacts = new LinkedHashMap<>();
+
+ if ( request.getArtifactDependencies() != null )
+ {
+ for ( Artifact artifact : request.getArtifactDependencies() )
+ {
+ artifacts.put( artifact.getDependencyConflictId(), artifact );
+ }
+ }
+
+ List<Dependency> dependencies = new ArrayList<>();
+ if ( request.getArtifact() instanceof ArtifactWithDependencies )
+ {
+ dependencies = ( (ArtifactWithDependencies) request.getArtifact() ).getDependencies();
+ }
+ else
+ {
+ Artifact pomArtifact =
+ createProjectArtifact( request.getArtifact().getGroupId(), request.getArtifact().getArtifactId(),
+ request.getArtifact().getVersion() );
+ File pomFile =
+ new File( request.getLocalRepository().getBasedir(),
+ request.getLocalRepository().pathOf( pomArtifact ) );
+
+ try
+ {
+ Model model = modelReader.read( pomFile, null );
+
+ dependencies = model.getDependencies();
+ }
+ catch ( IOException e )
+ {
+ e.printStackTrace();
+ }
+ }
+
+ for ( Dependency dependency : dependencies )
+ {
+ Artifact artifact = createDependencyArtifact( dependency );
+ if ( !artifacts.containsKey( artifact.getDependencyConflictId() ) )
+ {
+ artifacts.put( artifact.getDependencyConflictId(), artifact );
+ }
+ }
+
+ for ( Artifact artifact : artifacts.values() )
+ {
+ try
+ {
+ resolve( artifact, request );
+ result.addArtifact( artifact );
+ }
+ catch ( IOException e )
+ {
+ result.addMissingArtifact( artifact );
+ }
+ }
+ }
+
+ return result;
+ }
+
+ private void resolve( Artifact artifact, ArtifactResolutionRequest request )
+ throws IOException
+ {
+ if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
+ {
+ return;
+ }
+
+ ArtifactRepository localRepo = request.getLocalRepository();
+
+ File localFile = new File( localRepo.getBasedir(), localRepo.pathOf( artifact ) );
+
+ artifact.setFile( localFile );
+
+ if ( !localFile.exists() )
+ {
+ if ( request.getRemoteRepositories().isEmpty() )
+ {
+ throw new IOException( localFile + " does not exist and no remote repositories are configured" );
+ }
+
+ ArtifactRepository remoteRepo = request.getRemoteRepositories().get( 0 );
+
+ File remoteFile = new File( remoteRepo.getBasedir(), remoteRepo.pathOf( artifact ) );
+
+ FileUtils.copyFile( remoteFile, localFile );
+ }
+
+ artifact.setResolved( true );
+ }
+
+ public void retrieve( ArtifactRepository repository, File destination, String remotePath,
+ ArtifactTransferListener transferListener )
+ throws ArtifactTransferFailedException, ArtifactDoesNotExistException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void injectMirror( RepositorySystemSession session, List<ArtifactRepository> repositories )
+ {
+ }
+
+ public void injectProxy( RepositorySystemSession session, List<ArtifactRepository> repositories )
+ {
+ }
+
+ public void injectAuthentication( RepositorySystemSession session, List<ArtifactRepository> repositories )
+ {
+ }
+
+}
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar
new file mode 100644
index 0000000..c5c52ad
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar.sha1 b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar.sha1
new file mode 100644
index 0000000..a52569f
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar.sha1
@@ -0,0 +1 @@
+48856bef6c64eb9689eab125197fdefc399c7858
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom
new file mode 100644
index 0000000..ecf6fcf
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom
@@ -0,0 +1,220 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <name>HttpClient</name>
+ <version>2.0.2</version>
+ <description>The HttpClient component supports the client-side of RFC 1945 (HTTP/1.0) and RFC 2616 (HTTP/1.1) , several related specifications (RFC 2109 (Cookies) , RFC 2617 (HTTP Authentication) , etc.), and provides a framework by which new request types (methods) or HTTP extensions can be created easily.</description>
+ <url>http://jakarta.apache.org/commons/httpclient/</url>
+ <issueManagement>
+ <url>http://nagoya.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&component=HttpClient</url>
+ </issueManagement>
+ <ciManagement>
+ <notifiers>
+ <notifier>
+ <configuration>
+ <address>commons-httpclient-dev@jakarta.apache.org</address>
+ </configuration>
+ </notifier>
+ </notifiers>
+ </ciManagement>
+ <inceptionYear>2001</inceptionYear>
+ <mailingLists>
+ <mailingList>
+ <name>HttpClient Mailing List</name>
+ <subscribe>commons-httpclient-dev-subscribe@jakarta.apache.org</subscribe>
+ <unsubscribe>commons-httpclient-dev-unsubscribe@jakarta.apache.org</unsubscribe>
+ <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listId=128</archive>
+ </mailingList>
+ <mailingList>
+ <name>Commons Developer List</name>
+ <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe>
+ <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe>
+ <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listId=15</archive>
+ </mailingList>
+ <mailingList>
+ <name>Commons User List</name>
+ <subscribe>commons-user-subscribe@jakarta.apache.org</subscribe>
+ <unsubscribe>commons-user-unsubscribe@jakarta.apache.org</unsubscribe>
+ <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listId=105</archive>
+ </mailingList>
+ </mailingLists>
+ <developers>
+ <developer>
+ <id>mbecke</id>
+ <name>Michael Becke</name>
+ <email>mbecke -at- apache.org</email>
+ <organization></organization>
+ <roles>
+ <role>Release Prime</role>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>jsdever</id>
+ <name>Jeff Dever</name>
+ <email>jsdever -at- apache.org</email>
+ <organization>Vault Technologies</organization>
+ <roles>
+ <role>List Moderator</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>dion</id>
+ <name>dIon Gillard</name>
+ <email>dion -at- apache.org</email>
+ <organization>Multitask Consulting</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>oglueck</id>
+ <name>Ortwin Glueck</name>
+ <email>oglueck -at -apache.org</email>
+ <organization>Nose Applied Intelligence AG</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>jericho</id>
+ <name>Sung-Gu</name>
+ <email>jericho -at- apache.org</email>
+ <organization></organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>olegk</id>
+ <name>Oleg Kalnichevski</name>
+ <email>olegk -at- apache.org</email>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>sullis</id>
+ <name>Sean C. Sullivan</name>
+ <email>sullis -at- apache.org</email>
+ <organization>Independent consultant</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>adrian</id>
+ <name>Adrian Sutton</name>
+ <email>adrian.sutton -at- ephox.com</email>
+ <organization>Intencha</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>rwaldhoff</id>
+ <name>Rodney Waldhoff</name>
+ <email>rwaldhoff -at- apache</email>
+ <organization>Britannica</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ </developers>
+ <contributors>
+ <contributor>
+ <name>Armando Anton</name>
+ <email>armando.anton -at- newknow.com</email>
+ </contributor>
+ <contributor>
+ <name>Ola Berg</name>
+ <email></email>
+ </contributor>
+ <contributor>
+ <name>Sam Berlin</name>
+ <email>sberlin -at- limepeer.com</email>
+ </contributor>
+ <contributor>
+ <name>Mike Bowler</name>
+ <email></email>
+ </contributor>
+ <contributor>
+ <name>Eric Johnson</name>
+ <email>eric -at- tibco.com</email>
+ </contributor>
+ <contributor>
+ <name>Christian Kohlschuetter</name>
+ <email>ck -at- newsclub.de</email>
+ </contributor>
+ <contributor>
+ <name>Ryan Lubke</name>
+ <email>Ryan.Lubke -at- Sun.COM</email>
+ </contributor>
+ <contributor>
+ <name>Sam Maloney</name>
+ <email>sam.maloney -at- filogix.com</email>
+ </contributor>
+ <contributor>
+ <name>Rob Di Marco</name>
+ <email>rdimarco -at- hmsonline.com</email>
+ </contributor>
+ <contributor>
+ <name>Juergen Pill</name>
+ <email>Juergen.Pill -at- softwareag.com</email>
+ </contributor>
+ <contributor>
+ <name>Mohammad Rezaei</name>
+ <email>mohammad.rezaei -at- gs.com</email>
+ </contributor>
+ <contributor>
+ <name>Roland Weber</name>
+ <email>ROLWEBER -at- de.ibm.com</email>
+ </contributor>
+ <contributor>
+ <name>Laura Werner</name>
+ <email>laura -at- lwerner.org</email>
+ </contributor>
+ </contributors>
+ <scm>
+ <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/httpclient/</connection>
+ <url>http://cvs.apache.org/viewcvs.cgi/jakarta-commons/httpclient/</url>
+ </scm>
+ <organization>
+ <name>Apache Software Foundation</name>
+ <url>http://jakarta.apache.org/</url>
+ </organization>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <testSourceDirectory>src/test</testSourceDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/TestNoHost.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.3</version>
+ </dependency>
+ </dependencies>
+ <distributionManagement>
+ <repository>
+ <id>default</id>
+ <name>Default Repository</name>
+ <url>file:///www/jakarta.apache.org/builds/jakarta-commons/httpclient</url>
+ </repository>
+ <site>
+ <id>default</id>
+ <name>Default Site</name>
+ <url>scp://jakarta.apache.org//www/jakarta.apache.org/commons/httpclient/</url>
+ </site>
+ </distributionManagement>
+</project>
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom.sha1 b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom.sha1
new file mode 100644
index 0000000..df64d3d
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom.sha1
@@ -0,0 +1 @@
+550c92401ae1458d4a4a1be4b8ab8ec19ce34e07 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar
new file mode 100644
index 0000000..b99c937
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1 b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1
new file mode 100644
index 0000000..9e50b25
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1
@@ -0,0 +1 @@
+760c711c71588bc273d3e56d196d720a7678cd93
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom
new file mode 100644
index 0000000..c46b27f
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom
@@ -0,0 +1,31 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <name>Logging</name>
+ <version>1.0.3</version>
+ <description>Commons Logging</description>
+ <url>http://jakarta.apache.org/commons/logging/</url>
+ <inceptionYear>2001</inceptionYear>
+ <build />
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.6</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ <version>1.0.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.7</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1 b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1
new file mode 100644
index 0000000..d135fea
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1
@@ -0,0 +1 @@
+b7de43bb310eb1dbfd00a34cec30500fa13cb577 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc-resources.jar.lastUpdated b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc-resources.jar.lastUpdated
new file mode 100644
index 0000000..6dcdbc7
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc-resources.jar.lastUpdated
@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Thu Sep 24 16:40:08 CEST 2020
+https\://repo.maven.apache.org/maven2/.lastUpdated=1600958408640
+https\://repo.maven.apache.org/maven2/.error=
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
new file mode 100644
index 0000000..b73a80f
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1 b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1
new file mode 100644
index 0000000..7e0a60e
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1
@@ -0,0 +1 @@
+f029a2aefe2b3e1517573c580f948caac31b1056
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom
new file mode 100644
index 0000000..7c1017d
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom
@@ -0,0 +1,165 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <name>Logging</name>
+ <version>1.0.4</version>
+ <description>Commons Logging is a thin adapter allowing configurable bridging to other,
+ well known logging systems.</description>
+ <url>http://jakarta.apache.org/commons/logging/</url>
+ <issueManagement>
+ <url>http://issues.apache.org/bugzilla/</url>
+ </issueManagement>
+ <ciManagement>
+ <notifiers>
+ <notifier>
+ <configuration>
+ <address>commons-dev@jakarta.apache.org</address>
+ </configuration>
+ </notifier>
+ </notifiers>
+ </ciManagement>
+ <inceptionYear>2001</inceptionYear>
+ <mailingLists>
+ <mailingList>
+ <name>Commons Dev List</name>
+ <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe>
+ <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe>
+ <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org</archive>
+ </mailingList>
+ <mailingList>
+ <name>Commons User List</name>
+ <subscribe>commons-user-subscribe@jakarta.apache.org</subscribe>
+ <unsubscribe>commons-user-unsubscribe@jakarta.apache.org</unsubscribe>
+ <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-user@jakarta.apache.org</archive>
+ </mailingList>
+ </mailingLists>
+ <developers>
+ <developer>
+ <id>morgand</id>
+ <name>Morgan Delagrange</name>
+ <email>morgand at apache dot org</email>
+ <organization>Apache</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>rwaldhoff</id>
+ <name>Rodney Waldhoff</name>
+ <email>rwaldhoff at apache org</email>
+ <organization>Apache Software Foundation</organization>
+ </developer>
+ <developer>
+ <id>craigmcc</id>
+ <name>Craig McClanahan</name>
+ <email>craigmcc at apache org</email>
+ <organization>Apache Software Foundation</organization>
+ </developer>
+ <developer>
+ <id>sanders</id>
+ <name>Scott Sanders</name>
+ <email>sanders at apache dot org</email>
+ <organization>Apache Software Foundation</organization>
+ </developer>
+ <developer>
+ <id>rdonkin</id>
+ <name>Robert Burrell Donkin</name>
+ <email>rdonkin at apache dot org</email>
+ <organization>Apache Software Foundation</organization>
+ </developer>
+ <developer>
+ <id>donaldp</id>
+ <name>Peter Donald</name>
+ <email>donaldp at apache dot org</email>
+ <organization></organization>
+ </developer>
+ <developer>
+ <id>costin</id>
+ <name>Costin Manolache</name>
+ <email>costin at apache dot org</email>
+ <organization>Apache Software Foundation</organization>
+ </developer>
+ <developer>
+ <id>rsitze</id>
+ <name>Richard Sitze</name>
+ <email>rsitze at apache dot org</email>
+ <organization>Apache Software Foundation</organization>
+ </developer>
+ <developer>
+ <id>baliuka</id>
+ <name>Juozas Baliuka</name>
+ <email>baliuka@apache.org</email>
+ <organization></organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
+ </developers>
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>/LICENSE.txt</url>
+ </license>
+ </licenses>
+ <scm>
+ <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons/logging</connection>
+ <url>http://cvs.apache.org/viewcvs/jakarta-commons/logging/</url>
+ </scm>
+ <organization>
+ <name>The Apache Software Foundation</name>
+ <url>http://jakarta.apache.org</url>
+ </organization>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <testSourceDirectory>src/test</testSourceDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/AvalonLoggerTest.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.6</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>logkit</groupId>
+ <artifactId>logkit</artifactId>
+ <version>1.0.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>avalon-framework</groupId>
+ <artifactId>avalon-framework</artifactId>
+ <version>4.1.3</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+ <distributionManagement>
+ <repository>
+ <id>default</id>
+ <name>Default Repository</name>
+ <url>file:///www/jakarta.apache.org/builds/jakarta-commons/logging/</url>
+ </repository>
+ <site>
+ <id>default</id>
+ <name>Default Site</name>
+ <url>scp://jakarta.apache.org//www/jakarta.apache.org/commons/logging/</url>
+ </site>
+ </distributionManagement>
+</project>
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1 b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1
new file mode 100644
index 0000000..92265fb
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1
@@ -0,0 +1 @@
+7d32e7520b801cabc3dc704d2afe59d020d00c45 /home/projects/maven/repository-staging/to-ibiblio/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar
new file mode 100644
index 0000000..66bf3d8
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar.sha1 b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar.sha1
new file mode 100644
index 0000000..0e206f2
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar.sha1
@@ -0,0 +1 @@
+c27b09f985eef162b5d335f0460a130cc117596a
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom
new file mode 100644
index 0000000..293102d
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom
@@ -0,0 +1,8 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>de.zeigermann.xml</groupId>
+ <artifactId>xml-im-exporter</artifactId>
+ <name>XML Im-/Exporter</name>
+ <version>1.1</version>
+ <url>http://xml-im-exporter.sourceforge.net</url>
+</project>
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom.sha1 b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom.sha1
new file mode 100644
index 0000000..5745f44
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom.sha1
@@ -0,0 +1 @@
+9bb0e7f3066fdfe0978de52b2082211a65b9c70f /home/projects/maven/repository-staging/to-ibiblio/maven2/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar
new file mode 100644
index 0000000..288e64c
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar.sha1 b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar.sha1
new file mode 100644
index 0000000..da5395e
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar.sha1
@@ -0,0 +1 @@
+a2ac1cd690ab4c80defe7f9bce14d35934c35cec
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom
new file mode 100644
index 0000000..48bfb49
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom
@@ -0,0 +1,40 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.6.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ <optional>true</optional>
+ </dependency>
+ <!-- should be replaced jaxen-jdom provided with jdom -->
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <version>1.0-FCS</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>saxpath</groupId>
+ <artifactId>saxpath</artifactId>
+ <version>1.0-FCS</version>
+ <optional>true</optional>
+ </dependency>
+ <!-- should be replaced by xalan.jar from jdom, their version was 2.5.D1 -->
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.5.0</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom.sha1 b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom.sha1
new file mode 100644
index 0000000..5da1a33
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom.sha1
@@ -0,0 +1 @@
+7d57cf1fa9e1cd07ac40d86b9ce4e4de1b753aa2 /home/projects/maven/repository-staging/to-ibiblio/maven2/jdom/jdom/1.0/jdom-1.0.pom
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc-resources.jar.lastUpdated b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc-resources.jar.lastUpdated
new file mode 100644
index 0000000..d1d0e80
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc-resources.jar.lastUpdated
@@ -0,0 +1,4 @@
+#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
+#Wed Jan 05 14:06:51 CET 2022
+https\://repo.maven.apache.org/maven2/.lastUpdated=1641388011966
+https\://repo.maven.apache.org/maven2/.error=
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar
new file mode 100644
index 0000000..d284bd0
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar.sha1 b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar.sha1
new file mode 100644
index 0000000..730c504
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar.sha1
@@ -0,0 +1 @@
+9d466b5eabb0cb144c8c9ef8b4ee6db15d46d6e6
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar
new file mode 100644
index 0000000..b68ac35
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar.sha1 b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar.sha1
new file mode 100644
index 0000000..323daab
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar.sha1
@@ -0,0 +1 @@
+523bdce923a13622132b263550d06519fc591ec4
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar
new file mode 100644
index 0000000..b376ffc
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar.sha1 b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar.sha1
new file mode 100644
index 0000000..a0369ca
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar.sha1
@@ -0,0 +1 @@
+cdd00374f1fee76b11e2a9d127405aa3f6be5b6a
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom
new file mode 100644
index 0000000..4287158
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom
@@ -0,0 +1,587 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.1</version>
+
+ <name>JUnit</name>
+ <description>JUnit is a unit testing framework for Java, created by Erich Gamma and Kent Beck.</description>
+ <url>http://junit.org</url>
+ <inceptionYear>2002</inceptionYear>
+ <organization>
+ <name>JUnit</name>
+ <url>http://www.junit.org</url>
+ </organization>
+ <licenses>
+ <license>
+ <name>Eclipse Public License 1.0</name>
+ <url>http://www.eclipse.org/legal/epl-v10.html</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <id>dsaff</id>
+ <name>David Saff</name>
+ <email>david@saff.net</email>
+ </developer>
+ <developer>
+ <id>kcooney</id>
+ <name>Kevin Cooney</name>
+ <email>kcooney@google.com</email>
+ </developer>
+ <developer>
+ <id>stefanbirkner</id>
+ <name>Stefan Birkner</name>
+ <email>mail@stefan-birkner.de</email>
+ </developer>
+ <developer>
+ <id>marcphilipp</id>
+ <name>Marc Philipp</name>
+ <email>mail@marcphilipp.de</email>
+ </developer>
+ </developers>
+ <contributors>
+ <contributor>
+ <name>JUnit contributors</name>
+ <organization>JUnit</organization>
+ <email>team@junit.org</email>
+ <url>https://github.com/junit-team/junit4/graphs/contributors</url>
+ <roles>
+ <role>developers</role>
+ </roles>
+ </contributor>
+ </contributors>
+
+ <prerequisites>
+ <maven>3.0.4</maven>
+ </prerequisites>
+
+ <scm>
+ <connection>scm:git:git://github.com/junit-team/junit4.git</connection>
+ <developerConnection>scm:git:git@github.com:junit-team/junit4.git</developerConnection>
+ <url>https://github.com/junit-team/junit4</url>
+ <tag>r4.13.1</tag>
+ </scm>
+ <issueManagement>
+ <system>github</system>
+ <url>https://github.com/junit-team/junit4/issues</url>
+ </issueManagement>
+ <ciManagement>
+ <system>travis</system>
+ <url>https://travis-ci.org/junit-team/junit4</url>
+ </ciManagement>
+ <distributionManagement>
+ <downloadUrl>https://github.com/junit-team/junit4/wiki/Download-and-Install</downloadUrl>
+ <snapshotRepository>
+ <id>junit-snapshot-repo</id>
+ <name>Nexus Snapshot Repository</name>
+ <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+ </snapshotRepository>
+ <repository>
+ <id>junit-releases-repo</id>
+ <name>Nexus Release Repository</name>
+ <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ </repository>
+ <site>
+ <id>junit.github.io</id>
+ <url>gitsite:git@github.com/junit-team/junit4.git</url>
+ </site>
+ </distributionManagement>
+
+ <properties>
+ <jdkVersion>1.5</jdkVersion>
+ <surefireVersion>2.19.1</surefireVersion>
+ <hamcrestVersion>1.3</hamcrestVersion>
+ <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
+ <arguments />
+ <gpg.keyname>67893CC4</gpg.keyname>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <version>${hamcrestVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>${hamcrestVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>${project.basedir}</directory>
+ <includes>
+ <include>LICENSE-junit.txt</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <!--
+ Both "org.apache" and "org.codehaus" are default providers of MOJO plugins
+ which are especially dedicated to Maven projects.
+ The MOJO stands for "Maven plain Old Java Object".
+ Each mojo is an executable goal in Maven, and a plugin is a distribution of
+ one or more related mojos.
+ For more information see http://maven.apache.org/plugin-developers/index.html
+
+ The following plugins are ordered according the Maven build lifecycle.
+ http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
+ -->
+ <plugin>
+ <!--
+ Checks that the version of user's maven installation is 3.0.4,
+ the JDK is 1.5+, no non-standard repositories are specified in
+ the project, requires only release versions of dependencies of other artifacts.
+ -->
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.4</version>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <fail>true</fail>
+ <rules>
+ <requireMavenVersion>
+ <!-- Some plugin features require a recent Maven runtime to work properly -->
+ <message>Current version of Maven ${maven.version} required to build the project
+ should be ${project.prerequisites.maven}, or higher!
+ </message>
+ <version>[${project.prerequisites.maven},)</version>
+ </requireMavenVersion>
+ <requireJavaVersion>
+ <message>Current JDK version ${java.version} should be ${jdkVersion}, or higher!
+ </message>
+ <version>${jdkVersion}</version>
+ </requireJavaVersion>
+ <requireNoRepositories>
+ <message>Best Practice is to never define repositories in pom.xml (use a repository
+ manager instead).
+ </message>
+ </requireNoRepositories>
+ <requireReleaseDeps>
+ <message>No Snapshots Dependencies Allowed!</message>
+ </requireReleaseDeps>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!--
+ Updates Version#id().
+ -->
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>replacer</artifactId>
+ <version>1.5.3</version>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <ignoreMissingFile>false</ignoreMissingFile>
+ <file>${project.build.sourceDirectory}/junit/runner/Version.java.template</file>
+ <outputFile>${project.build.sourceDirectory}/junit/runner/Version.java</outputFile>
+ <regex>false</regex>
+ <token>@version@</token>
+ <value>${project.version}</value>
+ </configuration>
+ </plugin>
+ <plugin><!-- Using jdk 1.5.0_22, package-info.java files are compiled correctly. -->
+ <!--
+ java compiler plugin forked in extra process
+ -->
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ <source>${jdkVersion}</source>
+ <target>${jdkVersion}</target>
+ <testSource>${jdkVersion}</testSource>
+ <testTarget>${jdkVersion}</testTarget>
+ <compilerVersion>1.5</compilerVersion>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <debug>true</debug>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-Xlint:unchecked</arg>
+ </compilerArgs>
+ <maxmem>128m</maxmem>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ <version>1.14</version>
+ <executions>
+ <execution>
+ <id>signature-check</id>
+ <phase>test</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <signature>
+ <groupId>org.codehaus.mojo.signature</groupId>
+ <artifactId>java15</artifactId>
+ <version>1.0</version>
+ </signature>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!--
+ A plugin which uses the JUnit framework in order to start
+ our junit suite "AllTests" after the sources are compiled.
+ -->
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefireVersion}</version>
+ <configuration>
+ <test>org/junit/tests/AllTests.java</test>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <enableAssertions>false</enableAssertions>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-junit47</artifactId>
+ <version>${surefireVersion}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <!--
+ This plugin can package the main artifact's sources (src/main/java)
+ in to jar archive. See target/junit-*-sources.jar.
+ -->
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <!--
+ This plugin can generate Javadoc by a forked
+ process and then package the Javadoc
+ in jar archive target/junit-*-javadoc.jar.
+ -->
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.3</version>
+ <configuration>
+ <stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
+ <show>protected</show>
+ <author>false</author>
+ <version>false</version>
+ <detectLinks>false</detectLinks>
+ <linksource>true</linksource>
+ <keywords>true</keywords>
+ <use>true</use>
+ <windowtitle>JUnit API</windowtitle>
+ <encoding>UTF-8</encoding>
+ <locale>en</locale>
+ <javadocVersion>${jdkVersion}</javadocVersion>
+ <javaApiLinks>
+ <property>
+ <name>api_${jdkVersion}</name>
+ <value>http://docs.oracle.com/javase/${jdkVersion}.0/docs/api/</value>
+ </property>
+ </javaApiLinks>
+ <excludePackageNames>*.internal.*</excludePackageNames>
+ <verbose>true</verbose>
+ <minmemory>32m</minmemory>
+ <maxmemory>128m</maxmemory>
+ <failOnError>true</failOnError>
+ <includeDependencySources>true</includeDependencySources>
+ <dependencySourceIncludes>
+ <dependencySourceInclude>org.hamcrest:hamcrest-core:*</dependencySourceInclude>
+ </dependencySourceIncludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.5.2</version>
+ <configuration>
+ <mavenExecutorId>forked-path</mavenExecutorId>
+ <useReleaseProfile>false</useReleaseProfile>
+ <arguments>-Pgenerate-docs,junit-release ${arguments}</arguments>
+ <tagNameFormat>r@{project.version}</tagNameFormat>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.4</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.github.stephenc.wagon</groupId>
+ <artifactId>wagon-gitsite</artifactId>
+ <version>0.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-markdown</artifactId>
+ <version>1.5</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Automatic-Module-Name>junit</Automatic-Module-Name>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.6.1</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8.2</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.5.2</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.7</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
+ <!-- waiting for MPIR-267 -->
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>index</report>
+ <report>dependency-info</report>
+ <report>modules</report>
+ <report>license</report>
+ <report>project-team</report>
+ <report>scm</report>
+ <report>issue-tracking</report>
+ <report>mailing-list</report>
+ <report>dependency-management</report>
+ <report>dependencies</report>
+ <report>dependency-convergence</report>
+ <report>cim</report>
+ <report>distribution-management</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.3</version>
+ <configuration>
+ <destDir>javadoc/latest</destDir>
+ <stylesheetfile>${basedir}/src/main/javadoc/stylesheet.css</stylesheetfile>
+ <show>protected</show>
+ <author>false</author>
+ <version>false</version>
+ <detectLinks>false</detectLinks>
+ <linksource>true</linksource>
+ <keywords>true</keywords>
+ <use>true</use>
+ <windowtitle>JUnit API</windowtitle>
+ <encoding>UTF-8</encoding>
+ <locale>en</locale>
+ <javadocVersion>${jdkVersion}</javadocVersion>
+ <javaApiLinks>
+ <property>
+ <name>api_${jdkVersion}</name>
+ <value>http://docs.oracle.com/javase/${jdkVersion}.0/docs/api/</value>
+ </property>
+ </javaApiLinks>
+ <excludePackageNames>junit.*,*.internal.*</excludePackageNames>
+ <verbose>true</verbose>
+ <minmemory>32m</minmemory>
+ <maxmemory>128m</maxmemory>
+ <failOnError>true</failOnError>
+ <includeDependencySources>true</includeDependencySources>
+ <dependencySourceIncludes>
+ <dependencySourceInclude>org.hamcrest:hamcrest-core:*</dependencySourceInclude>
+ </dependencySourceIncludes>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>javadoc</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>junit-release</id>
+ <!--
+ Signs all artifacts before deploying to Maven Central.
+ -->
+ <build>
+ <plugins>
+ <plugin>
+ <!--
+ The goal is to sign all artifacts so that the user may verify them before downloading.
+ The automatic build system may reuire your key ID, and passphrase specified using system properties:
+ -Dgpg.passphrase="<passphrase>" -Dgpg.keyname="<your key ID>"
+ In order to create the key pair, use the command "gpg ––gen-key".
+ (–– stands for double dash)
+ -->
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <id>gpg-sign</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>generate-docs</id>
+ <!--
+ Generate the documentation artifacts.
+ Note: this profile is also required to be active for release
+ builds due to the packaging requirements of the Central repo
+ -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>restrict-doclint</id>
+ <!-- doclint is only supported by JDK 8 -->
+ <activation>
+ <jdk>[1.8,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgs>
+ <arg>-Xlint:unchecked</arg>
+ <arg>-Xdoclint:accessibility,reference,syntax</arg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam>-Xdoclint:accessibility -Xdoclint:reference</additionalparam>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <additionalparam>-Xdoclint:accessibility -Xdoclint:reference</additionalparam>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>java9</id>
+ <activation>
+ <jdk>[1.9,)</jdk>
+ </activation>
+ <properties>
+ <!-- JDK 9 minimal source and target versions are 1.6 -->
+ <jdkVersion>1.6</jdkVersion>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ </profiles>
+</project>
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom.sha1 b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom.sha1
new file mode 100644
index 0000000..d843b12
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom.sha1
@@ -0,0 +1 @@
+643e8b4c40dca9f0b0abd8125d378d9f47d7d69e
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom b/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom
new file mode 100644
index 0000000..9593e9e
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright 2005-2006 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- Shared parent. Doesn't define a lot of things about Apache like general mailing lists, but does
+ define the settings common to all projects at Apache -->
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>3</version>
+ <packaging>pom</packaging>
+ <name>The Apache Software Foundation</name>
+ <description>
+ The Apache Software Foundation provides support for the Apache community of open-source software projects.
+ The Apache projects are characterized by a collaborative, consensus based development process, an open and
+ pragmatic software license, and a desire to create high quality software that leads the way in its field.
+ We consider ourselves not simply a group of projects sharing a server, but rather a community of developers
+ and users.
+ </description>
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <organization>
+ <name>Apache Software Foundation</name>
+ <url>http://www.apache.org/</url>
+ </organization>
+ <url>http://www.apache.org/</url>
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <distributionManagement>
+ <!-- Site omitted - each project must provide their own -->
+ <repository>
+ <id>apache.releases</id>
+ <name>Apache Release Distribution Repository</name>
+ <url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
+ </repository>
+ <snapshotRepository>
+ <id>apache.snapshots</id>
+ <name>Apache Development Snapshot Repository</name>
+ <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+ </snapshotRepository>
+ </distributionManagement>
+ <mailingLists>
+ <mailingList>
+ <name>Apache Announce List</name>
+ <subscribe>announce-subscribe@apache.org</subscribe>
+ <unsubscribe>announce-unsubscribe@apache.org</unsubscribe>
+ <post>announce@apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/www-announce/</archive>
+ </mailingList>
+ </mailingLists>
+</project>
+
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.md5 b/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.md5
new file mode 100644
index 0000000..b9d0ea1
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.md5
@@ -0,0 +1 @@
+c857ebbb5f303f435495e40e6c9e45a2
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.sha1 b/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.sha1
new file mode 100644
index 0000000..ffb57bb
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.sha1
@@ -0,0 +1 @@
+1bc0010136a890e2fd38d901a0b7ecdf0e3f9871
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar
new file mode 100644
index 0000000..5bc9c06
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5 b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5
new file mode 100644
index 0000000..5ff89e8
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5
@@ -0,0 +1 @@
+430da483dcfb2964a9dcd619c29a6c78
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1 b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1
new file mode 100644
index 0000000..a341880
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1
@@ -0,0 +1 @@
+ea9e3f3fdc25f386d5f9ac861a55b6c3bb773d91
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom
new file mode 100644
index 0000000..4c344c8
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>maven-parent</artifactId>
+ <groupId>org.apache.maven</groupId>
+ <version>5</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.artifact</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.0-SNAPSHOT</version>
+ <name>Maven Artifact</name>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/artifact/trunk</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/artifact/trunk</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/maven/artifact/trunk</url>
+ </scm>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.4.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ <version>1.0-alpha-32</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-active-collections</artifactId>
+ <version>1.0-beta-1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-provider-api</artifactId>
+ <version>1.0-beta-2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-file</artifactId>
+ <version>1.0-beta-2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>1.2_Java1.3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.modello</groupId>
+ <artifactId>modello-maven-plugin</artifactId>
+ <version>1.0-alpha-17</version>
+ <configuration>
+ <version>1.0.0</version>
+ <model>src/main/mdo/metadata.mdo</model>
+ </configuration>
+ <executions>
+ <execution>
+ <id>site-docs</id>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>xdoc</goal>
+ <goal>xsd</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>standard</id>
+ <goals>
+ <goal>java</goal>
+ <goal>xpp3-reader</goal>
+ <goal>xpp3-writer</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/testutils/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5 b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5
new file mode 100644
index 0000000..11e3536
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5
@@ -0,0 +1 @@
+794377b5385c68c660ee9ca26e6b5cf1
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1 b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1
new file mode 100644
index 0000000..4beb688
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1
@@ -0,0 +1 @@
+358254e73f075bcfb9d587d0da553083abd0cc45
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar
new file mode 100644
index 0000000..0272ee3
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom
new file mode 100644
index 0000000..fee83c9
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom
@@ -0,0 +1,73 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.core.test</groupId>
+ <artifactId>test-extension</artifactId>
+ <packaging>jar</packaging>
+ <version>1</version>
+ <name>test-extension</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.artifact</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus</artifactId>
+ <version>1.0.11</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ <version>1.0-alpha-16</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ <version>1.0-alpha-16</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>repo-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>repo.xml</descriptor>
+ </descriptors>
+ <finalName>test-extension</finalName>
+ <appendAssemblyId>true</appendAssemblyId>
+ <outputDirectory>${pom.basedir}/../../resources/org/apache/maven/extension</outputDirectory>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <id>dummy</id>
+ <url>file:///tmp/dummy-repo</url>
+ </repository>
+ </distributionManagement>
+
+</project>
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5 b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5
new file mode 100644
index 0000000..ad06718
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5
@@ -0,0 +1 @@
+e8f6e0f4ef9c2ed3fb185ef44165fb40
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1 b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1
new file mode 100644
index 0000000..6065ee0
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1
@@ -0,0 +1 @@
+88ace5d78ee32fa0ce59714a4a42a73af3b52bd3
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar
new file mode 100644
index 0000000..04fe384
Binary files /dev/null and b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar differ
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom
new file mode 100644
index 0000000..01aaa42
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom
@@ -0,0 +1,44 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.core.test</groupId>
+ <artifactId>test-lifecycle-and-artifactHandler</artifactId>
+ <packaging>jar</packaging>
+ <version>1</version>
+ <name>test-lifecycle-and-artifactHandler</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>repo-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>repo.xml</descriptor>
+ </descriptors>
+ <finalName>test-extension</finalName>
+ <appendAssemblyId>true</appendAssemblyId>
+ <outputDirectory>${pom.basedir}/../../resources/org/apache/maven/extension</outputDirectory>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <id>dummy</id>
+ <url>file:///tmp/dummy-repo</url>
+ </repository>
+ </distributionManagement>
+
+</project>
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5 b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5
new file mode 100644
index 0000000..01d5194
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5
@@ -0,0 +1 @@
+7f10427af029d20cbea57c21d1aec65e
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1 b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1
new file mode 100644
index 0000000..dac1e45
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1
@@ -0,0 +1 @@
+ed98c808239aefb0ec51a8b9e96f191da7fd92e6
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom
new file mode 100644
index 0000000..b41037f
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ Copyright 2005-2006 The Apache Software Foundation.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>3</version>
+ <relativePath>../asf/pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-parent</artifactId>
+ <version>4</version>
+ <packaging>pom</packaging>
+ <name>Apache Maven</name>
+ <description>
+ Maven is a software project management and comprehension tool. Based on the concept of a project object model
+ (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
+ </description>
+ <url>http://maven.apache.org/</url>
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.codehaus.org/browse/MPA</url>
+ </issueManagement>
+ <ciManagement>
+ <system>continuum</system>
+ <url>http://maven.zones.apache.org:8080/continuum</url>
+ <notifiers>
+ <notifier>
+ <type>mail</type>
+ <configuration>
+ <address>notifications@maven.apache.org</address>
+ </configuration>
+ </notifier>
+ </notifiers>
+ </ciManagement>
+ <inceptionYear>2002</inceptionYear>
+ <mailingLists>
+ <mailingList>
+ <name>Maven Announcements List</name>
+ <post>announce@maven.apache.org</post>
+ <subscribe>announce-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>announce-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-announce/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Maven Issues List</name>
+ <post>issues@maven.apache.org</post>
+ <subscribe>issues-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>issues-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-issues/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Maven Notifications List</name>
+ <post>notifications@maven.apache.org</post>
+ <subscribe>notifications-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>notifications-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-notifications/</archive>
+ </mailingList>
+ </mailingLists>
+
+ <developers>
+ <developer>
+ <id>jvanzyl</id>
+ <name>Jason van Zyl</name>
+ <email>jason@maven.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Chair</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>brett</id>
+ <name>Brett Porter</name>
+ <email>brett@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+10</timezone>
+ </developer>
+ <developer>
+ <id>evenisse</id>
+ <name>Emmanuel Venisse</name>
+ <email>evenisse@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>kenney</id>
+ <name>Kenney Westerhof</name>
+ <email>kenney@apache.org</email>
+ <organization>Neonics</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ </developer>
+ <developer>
+ <id>snicoll</id>
+ <name>Stephane Nicoll</name>
+ <email>snicoll@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>vmassol</id>
+ <name>Vincent Massol</name>
+ <email>vmassol@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>fgiust</id>
+ <name>Fabrizio Giustina</name>
+ <email>fgiust@apache.org</email>
+ <organization>openmind</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>epunzalan</id>
+ <name>Edwin Punzalan</name>
+ <email>epunzalan@mergere.com</email>
+ <organization>Mergere</organization>
+ <roles>
+ <role>Committer</role>
+ </roles>
+ <timezone>+8</timezone>
+ </developer>
+ <developer>
+ <id>mperham</id>
+ <name>Mike Perham</name>
+ <email>mperham@gmail.com</email>
+ <organization>IBM</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-6</timezone>
+ </developer>
+ <developer>
+ <id>jdcasey</id>
+ <name>John Casey</name>
+ <email>jdcasey@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>trygvis</id>
+ <name>Trygve Laugstol</name>
+ <email>trygvis@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>vsiveton</id>
+ <name>Vincent Siveton</name>
+ <email>vsiveton@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>carlos</id>
+ <name>Carlos Sanchez</name>
+ <email>carlos@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>dennisl</id>
+ <name>Dennis Lundberg</name>
+ <email>dennisl@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ </developers>
+
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <url>scp://people.apache.org/www/maven.apache.org</url>
+ </site>
+ </distributionManagement>
+
+<!-- Disabled until projects have been made to comply
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>cpd-check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+-->
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml</configLocation>
+ <headerLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt</headerLocation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/j2ee/1.4/docs/api</link>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
+ <link>http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/</link>
+ <link>http://jakarta.apache.org/commons/dbcp/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/fileupload/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/httpclient/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/logging/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/pool/apidocs/</link>
+ <link>http://www.junit.org/junit/javadoc/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ <link>http://jakarta.apache.org/regexp/apidocs/</link>
+ <link>http://jakarta.apache.org/velocity/api/</link>
+ </links>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4</developerConnection>
+ <url>http://svn.apache.org/viewvc/maven/pom/maven/tags/maven-parent-4</url>
+ </scm>
+</project>
+
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5 b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5
new file mode 100644
index 0000000..9c41764
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5
@@ -0,0 +1 @@
+2a4e926f3a76c6e74b0b126f513ad4e7
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1
new file mode 100644
index 0000000..b6caacf
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1
@@ -0,0 +1 @@
+0fc039b0bd4d17d7c147a30e1d83994629c5297c
\ No newline at end of file
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom
new file mode 100644
index 0000000..a512366
--- /dev/null
+++ b/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom
@@ -0,0 +1,466 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>3</version>
+ <relativePath>../asf/pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-parent</artifactId>
+ <version>5</version>
+ <packaging>pom</packaging>
+ <name>Apache Maven</name>
+ <description>
+ Maven is a software project management and comprehension tool. Based on the concept of a project object model
+ (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
+ </description>
+ <url>http://maven.apache.org/</url>
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.codehaus.org/browse/MPA</url>
+ </issueManagement>
+ <ciManagement>
+ <system>continuum</system>
+ <url>http://maven.zones.apache.org/continuum</url>
+ <notifiers>
+ <notifier>
+ <type>mail</type>
+ <configuration>
+ <address>notifications@maven.apache.org</address>
+ </configuration>
+ </notifier>
+ </notifiers>
+ </ciManagement>
+ <inceptionYear>2002</inceptionYear>
+ <mailingLists>
+ <mailingList>
+ <name>Maven Announcements List</name>
+ <post>announce@maven.apache.org</post>
+ <subscribe>announce-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>announce-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-announce/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Maven Issues List</name>
+ <post>issues@maven.apache.org</post>
+ <subscribe>issues-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>issues-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-issues/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Maven Notifications List</name>
+ <post>notifications@maven.apache.org</post>
+ <subscribe>notifications-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>notifications-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-notifications/</archive>
+ </mailingList>
+ </mailingLists>
+
+ <developers>
+ <developer>
+ <id>jvanzyl</id>
+ <name>Jason van Zyl</name>
+ <email>jason@maven.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Chair</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>brett</id>
+ <name>Brett Porter</name>
+ <email>brett@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+10</timezone>
+ </developer>
+ <developer>
+ <id>evenisse</id>
+ <name>Emmanuel Venisse</name>
+ <email>evenisse@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>kenney</id>
+ <name>Kenney Westerhof</name>
+ <email>kenney@apache.org</email>
+ <organization>Neonics</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>snicoll</id>
+ <name>Stephane Nicoll</name>
+ <email>snicoll@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>vmassol</id>
+ <name>Vincent Massol</name>
+ <email>vmassol@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>fgiust</id>
+ <name>Fabrizio Giustina</name>
+ <email>fgiust@apache.org</email>
+ <organization>openmind</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>epunzalan</id>
+ <name>Edwin Punzalan</name>
+ <email>epunzalan@mergere.com</email>
+ <organization>Mergere</organization>
+ <roles>
+ <role>Committer</role>
+ </roles>
+ <timezone>+8</timezone>
+ </developer>
+ <developer>
+ <id>mperham</id>
+ <name>Mike Perham</name>
+ <email>mperham@gmail.com</email>
+ <organization>IBM</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-6</timezone>
+ </developer>
+ <developer>
+ <id>jdcasey</id>
+ <name>John Casey</name>
+ <email>jdcasey@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>trygvis</id>
+ <name>Trygve Laugstol</name>
+ <email>trygvis@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>vsiveton</id>
+ <name>Vincent Siveton</name>
+ <email>vsiveton@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>carlos</id>
+ <name>Carlos Sanchez</name>
+ <email>carlos@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>dennisl</id>
+ <name>Dennis Lundberg</name>
+ <email>dennisl@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>aheritier</id>
+ <name>Arnaud Heritier</name>
+ <email>aheritier@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>handyande</id>
+ <name>Andrew Williams</name>
+ <email>handyande@apache.org</email>
+ <roles>
+ <role>Committer</role>
+ </roles>
+ <timezone>0</timezone>
+ </developer>
+ <developer>
+ <id>jtolentino</id>
+ <name>Ernesto Tolentino Jr.</name>
+ <email>jtolentino@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>+8</timezone>
+ </developer>
+ <developer>
+ <id>joakime</id>
+ <name>Joakim Erdfelt</name>
+ <email>joakime@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>jmcconnell</id>
+ <name>Jesse McConnell</name>
+ <email>jmcconnell@apache.org</email>
+ <organization>ASF</organization>
+ <roles>
+ <role>PMC Member</role>
+ </roles>
+ <timezone>-6</timezone>
+ </developer>
+ <developer>
+ <id>wsmoak</id>
+ <name>Wendy Smoak</name>
+ <email>wsmoak@apache.org</email>
+ <roles>
+ <role>Committer</role>
+ </roles>
+ <timezone>-7</timezone>
+ </developer>
+
+ </developers>
+
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <url>scp://people.apache.org/www/maven.apache.org</url>
+ </site>
+ </distributionManagement>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-4</version>
+ <configuration>
+ <!-- This element will be overridden by children -->
+ <tagBase>https://svn.apache.org/repos/asf/maven/pom/tags</tagBase>
+ <useReleaseProfile>false</useReleaseProfile>
+ <goals>deploy</goals>
+ <arguments>-Prelease</arguments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>ci</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>cpd-check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>reporting</id>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml</configLocation>
+ <headerLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt</headerLocation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/j2ee/1.4/docs/api</link>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
+ <link>http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/</link>
+ <link>http://jakarta.apache.org/commons/dbcp/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/fileupload/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/httpclient/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/logging/apidocs/</link>
+ <link>http://jakarta.apache.org/commons/pool/apidocs/</link>
+ <link>http://www.junit.org/junit/javadoc/</link>
+ <link>http://logging.apache.org/log4j/docs/api/</link>
+ <link>http://jakarta.apache.org/regexp/apidocs/</link>
+ <link>http://jakarta.apache.org/velocity/api/</link>
+ </links>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <!-- We want to sign the artifact, the POM, and all attached artifacts -->
+ <plugin>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.0-alpha-1</version>
+ <configuration>
+ <passphrase>${gpg.passphrase}</passphrase>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- We want to deploy the artifact to a staging location for perusal -->
+ <plugin>
+ <inherited>true</inherited>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <altDeploymentRepository>${deploy.altRepository}</altDeploymentRepository>
+ <updateReleaseInfo>true</updateReleaseInfo>
+ </configuration>
... 3606 lines suppressed ...
[maven] 07/12: Switch a few core plugins to the new api
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 6179bc1e952fbde14849603c01663b1c8a8761de
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Feb 24 17:00:55 2022 +0100
Switch a few core plugins to the new api
---
.../main/java/org/apache/maven/api/Artifact.java | 35 ++++--
.../main/java/org/apache/maven/api/Dependency.java | 1 +
.../java/org/apache/maven/api/MojoExecution.java | 6 ++
.../src/main/java/org/apache/maven/api/Node.java | 13 +--
.../main/java/org/apache/maven/api/Project.java | 4 +
.../main/java/org/apache/maven/api/Toolchain.java | 10 ++
.../api/services/ArtifactDeployerRequest.java | 22 +++-
.../apache/maven/api/services/ProjectManager.java | 7 +-
.../maven/api/services/ToolchainManager.java | 12 ++-
...Manager.java => ToolchainManagerException.java} | 22 ++--
maven-core-impl/pom.xml | 2 +-
.../org/apache/maven/impl/DefaultDependency.java | 1 +
.../java/org/apache/maven/impl/DefaultNode.java | 13 +--
.../java/org/apache/maven/impl/DefaultProject.java | 1 +
.../java/org/apache/maven/impl/DefaultSession.java | 22 +++-
.../apache/maven/impl/DefaultToolchainManager.java | 120 +++++++++++++++++++++
.../test/java/org/apache/maven/impl/TestApi.java | 7 +-
maven-core/pom.xml | 2 +-
.../toolchain/DefaultToolchainManagerPrivate.java | 9 +-
maven-model/pom.xml | 9 ++
maven-resolver-provider/pom.xml | 9 ++
pom.xml | 17 ++-
22 files changed, 289 insertions(+), 55 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Artifact.java b/maven-core-api/src/main/java/org/apache/maven/api/Artifact.java
index 6ef6856..9dcaaa2 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Artifact.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Artifact.java
@@ -25,6 +25,9 @@ import javax.annotation.concurrent.Immutable;
import java.nio.file.Path;
import java.util.Optional;
+/**
+ * TODO: split between Coordinates / AttachedArtifact / ResolvedArtifact
+ */
@Immutable
public interface Artifact
{
@@ -46,32 +49,32 @@ public interface Artifact
String getArtifactId();
/**
- * The version of the artifact.
+ * The classifier of the artifact.
*
- * @return The version.
+ * @return The classifier or an empty string if none, never {@code null}.
*/
@Nonnull
- String getVersion();
+ String getClassifier();
/**
- * The file-extension of the artifact.
+ * The version of the artifact.
*
- * @return The extension.
+ * @return The version.
*/
@Nonnull
- String getExtension();
+ String getVersion();
/**
- * The classifier of the artifact.
+ * The file extension of the artifact.
*
- * @return The classifier.
+ * @return The extension.
*/
@Nonnull
- String getClassifier();
+ String getExtension();
/**
* Gets the base version of this artifact, for example "1.0-SNAPSHOT". In contrast to the {@link #getVersion()}, the
- * base version will always refer to the unresolved meta version.
+ * base version will always refer to the unresolved version.
*
* @return The base version, never {@code null}.
*/
@@ -94,4 +97,16 @@ public interface Artifact
@Nonnull
Optional<Path> getPath();
+ /**
+ * Unique id identifying this artifact
+ */
+ default String getId()
+ {
+ return getGroupId()
+ + ":" + getArtifactId()
+ + ":" + getExtension()
+ + ( getClassifier().isEmpty() ? "" : ":" + getClassifier() )
+ + ":" + getBaseVersion();
+ }
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java b/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
index 0e672f6..d0a966d 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Dependency.java
@@ -32,6 +32,7 @@ public interface Dependency
Artifact getArtifact();
// TODO: make that en enum ?
+ @Nonnull
String getScope();
@Nullable
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/MojoExecution.java b/maven-core-api/src/main/java/org/apache/maven/api/MojoExecution.java
index 30574b9..cc0d621 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/MojoExecution.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/MojoExecution.java
@@ -27,4 +27,10 @@ public interface MojoExecution
{
@Nonnull
Plugin getPlugin();
+
+ @Nonnull
+ String getExecutionId();
+
+ @Nonnull
+ String getGoal();
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Node.java b/maven-core-api/src/main/java/org/apache/maven/api/Node.java
index 6b42a0a..e475268 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Node.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Node.java
@@ -22,14 +22,12 @@ package org.apache.maven.api;
import javax.annotation.concurrent.Immutable;
import java.util.List;
+import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;
/**
* Represents a dependency node within a Maven project's dependency collector.
- *
- * @author Pim Moerenhout
- * @since 0.12
*/
@Immutable
public interface Node
@@ -57,14 +55,9 @@ public interface Node
List<Repository> getRemoteRepositories();
/**
- * @return true for an optional dependency.
- */
- Boolean getOptional();
-
- /**
- * @return The scope on the dependency.
+ * The repository where this artifact has been downloaded from.
*/
- String getScope();
+ Optional<RemoteRepository> getRepository();
/**
* Traverses this node and potentially its children using the specified visitor.
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Project.java b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
index 4d313e4..d8cb6f0 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Project.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
@@ -64,4 +64,8 @@ public interface Project
@Nonnull
List<Dependency> getManagedDependencies();
+ default String getId()
+ {
+ return getModel().getId();
+ }
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Toolchain.java b/maven-core-api/src/main/java/org/apache/maven/api/Toolchain.java
index a31e5bc..51dcb3b 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Toolchain.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Toolchain.java
@@ -19,6 +19,8 @@ package org.apache.maven.api;
* under the License.
*/
+import java.util.Map;
+
/**
* Toolchain interface.
*/
@@ -38,4 +40,12 @@ public interface Toolchain
* @return file representing the tool executable, or null if the tool can not be found
*/
String findTool( String toolName );
+
+ /**
+ * Let the toolchain decide if it matches requirements defined
+ * in the toolchain plugin configuration.
+ * @param requirements Map<String, String> key value pair, may not be {@code null}
+ * @return {@code true} if the requirements match, otherwise {@code false}
+ */
+ boolean matchesRequirements( Map<String, String> requirements );
}
\ No newline at end of file
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerRequest.java
index f3363eb..f3d865b 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerRequest.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactDeployerRequest.java
@@ -42,6 +42,8 @@ public interface ArtifactDeployerRequest
@Nonnull
Collection<Artifact> getArtifacts();
+ int getRetryFailedDeploymentCount();
+
@Nonnull
static ArtifactDeployerRequestBuilder builder()
{
@@ -63,6 +65,7 @@ public interface ArtifactDeployerRequest
Session session;
RemoteRepository repository;
Collection<Artifact> artifacts;
+ int retryFailedDeploymentCount;
@Nonnull
public ArtifactDeployerRequestBuilder session( Session session )
@@ -84,10 +87,16 @@ public interface ArtifactDeployerRequest
return this;
}
+ public ArtifactDeployerRequestBuilder retryFailedDeploymentCount( int retryFailedDeploymentCount )
+ {
+ this.retryFailedDeploymentCount = retryFailedDeploymentCount;
+ return this;
+ }
+
@Nonnull
public ArtifactDeployerRequest build()
{
- return new DefaultArtifactDeployerRequest( session, repository, artifacts );
+ return new DefaultArtifactDeployerRequest( session, repository, artifacts, retryFailedDeploymentCount );
}
private static class DefaultArtifactDeployerRequest extends BaseRequest
@@ -96,14 +105,17 @@ public interface ArtifactDeployerRequest
private final RemoteRepository repository;
private final Collection<Artifact> artifacts;
+ private final int retryFailedDeploymentCount;
DefaultArtifactDeployerRequest( @Nonnull Session session,
@Nonnull RemoteRepository repository,
- @Nonnull Collection<Artifact> artifacts )
+ @Nonnull Collection<Artifact> artifacts,
+ int retryFailedDeploymentCount )
{
super( session );
this.repository = requireNonNull( repository, "repository" );
this.artifacts = unmodifiable( artifacts, "artifacts" );
+ this.retryFailedDeploymentCount = retryFailedDeploymentCount;
}
@Nonnull
@@ -119,6 +131,12 @@ public interface ArtifactDeployerRequest
{
return artifacts;
}
+
+ @Override
+ public int getRetryFailedDeploymentCount()
+ {
+ return retryFailedDeploymentCount;
+ }
}
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
index a8456c6..8b6e96b 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
@@ -48,9 +48,12 @@ public interface ProjectManager extends Service
@Nonnull
Collection<Artifact> getAttachedArtifacts( Project project );
- void attachArtifact( Project project, String type, Path path );
+ default void attachArtifact( Project project, String type, Path path )
+ {
+ attachArtifact( project, type, "", path );
+ }
- void attachArtifact( Project project, String trim, String trim1, Path path );
+ void attachArtifact( Project project, String type, String classifier, Path path );
List<String> getCompileSourceRoots( Project project );
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
index b92ef4f..2740477 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
@@ -27,7 +27,15 @@ import org.apache.maven.api.Toolchain;
public interface ToolchainManager extends Service
{
- List<Toolchain> getToolchains( Session session, String jdk, Map<String, String> jdkToolchain );
+ List<Toolchain> getToolchains( Session session, String type, Map<String, String> requirements )
+ throws ToolchainManagerException;
- Toolchain getToolchainFromBuildContext( Session session, String jdk );
+ Toolchain getToolchainFromBuildContext( Session session, String type )
+ throws ToolchainManagerException;
+
+ List<Toolchain> getToolchainsForType( Session session, String type )
+ throws ToolchainManagerException;
+
+ void storeToolchainToBuildContext( Session session, Toolchain toolchain )
+ throws ToolchainManagerException;
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManagerException.java
similarity index 71%
copy from maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
copy to maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManagerException.java
index b92ef4f..727e66d 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManagerException.java
@@ -19,15 +19,19 @@ package org.apache.maven.api.services;
* under the License.
*/
-import java.util.List;
-import java.util.Map;
-
-import org.apache.maven.api.Session;
-import org.apache.maven.api.Toolchain;
-
-public interface ToolchainManager extends Service
+/**
+ * The Exception class in case a resolving does not work.
+ */
+public class ToolchainManagerException
+ extends MavenException
{
- List<Toolchain> getToolchains( Session session, String jdk, Map<String, String> jdkToolchain );
+ /**
+ * @param message The message to give.
+ * @param e The {@link Exception}.
+ */
+ public ToolchainManagerException( String message, Exception e )
+ {
+ super( message, e );
+ }
- Toolchain getToolchainFromBuildContext( Session session, String jdk );
}
diff --git a/maven-core-impl/pom.xml b/maven-core-impl/pom.xml
index 8fc09bc..65551b4 100644
--- a/maven-core-impl/pom.xml
+++ b/maven-core-impl/pom.xml
@@ -26,7 +26,7 @@
<version>4.0.0-alpha-1-SNAPSHOT</version>
</parent>
- <artifactId>maven-core-api-impl</artifactId>
+ <artifactId>maven-core-impl</artifactId>
<name>Apache Maven Core API Implementation</name>
<dependencies>
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java
index 27c76c4..5822d8c 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java
@@ -53,6 +53,7 @@ public class DefaultDependency implements Dependency
return session.getArtifact( dependency.getArtifact() );
}
+ @Nonnull
@Override
public String getScope()
{
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java
index 6d97e94..85d95b4 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java
@@ -20,12 +20,14 @@ package org.apache.maven.impl;
*/
import java.util.List;
+import java.util.Optional;
import java.util.function.Predicate;
import org.apache.maven.api.Artifact;
import org.apache.maven.api.Dependency;
import org.apache.maven.api.Node;
import org.apache.maven.api.NodeVisitor;
+import org.apache.maven.api.RemoteRepository;
import org.apache.maven.api.Repository;
public class DefaultNode implements Node
@@ -66,15 +68,10 @@ public class DefaultNode implements Node
}
@Override
- public Boolean getOptional()
+ public Optional<RemoteRepository> getRepository()
{
- return node.getDependency().getOptional();
- }
-
- @Override
- public String getScope()
- {
- return node.getDependency().getScope();
+ // TODO
+ throw new UnsupportedOperationException( "Not implemented yet" );
}
@Override
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java
index e9b90df..bc0de16 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java
@@ -129,6 +129,7 @@ public class DefaultProject implements Project
dependency.getVersion(), dependency.getType() );
}
+ @Nonnull
@Override
public String getScope()
{
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
index 5edf26c..291ea13 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
@@ -48,8 +48,10 @@ import org.apache.maven.api.Node;
import org.apache.maven.api.Project;
import org.apache.maven.api.LocalRepository;
import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.api.services.ToolchainManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.bridge.MavenRepositorySystem;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
import org.apache.maven.api.services.ArtifactResolver;
import org.apache.maven.api.services.ArtifactDeployer;
@@ -62,6 +64,7 @@ import org.apache.maven.api.services.ProjectBuilder;
import org.apache.maven.api.services.ProjectDeployer;
import org.apache.maven.api.services.ProjectInstaller;
import org.apache.maven.settings.Settings;
+import org.apache.maven.toolchain.DefaultToolchainManagerPrivate;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
@@ -78,6 +81,7 @@ public class DefaultSession implements Session
private final List<RemoteRepository> repositories;
private final org.apache.maven.project.ProjectBuilder projectBuilder;
private final MavenRepositorySystem mavenRepositorySystem;
+ private final DefaultToolchainManagerPrivate toolchainManagerPrivate;
private LocalRepositoryProvider localRepositoryProvider;
private final List<Listener> listeners = new CopyOnWriteArrayList<>();
@@ -97,7 +101,8 @@ public class DefaultSession implements Session
@Nonnull LocalRepositoryManagerFactory localRepositoryManagerFactory,
@Nonnull List<RemoteRepository> repositories,
@Nonnull org.apache.maven.project.ProjectBuilder projectBuilder,
- @Nonnull MavenRepositorySystem mavenRepositorySystem )
+ @Nonnull MavenRepositorySystem mavenRepositorySystem,
+ @Nonnull DefaultToolchainManagerPrivate toolchainManagerPrivate )
{
this.session = Objects.requireNonNull( session );
this.repositorySystem = Objects.requireNonNull( repositorySystem );
@@ -105,6 +110,12 @@ public class DefaultSession implements Session
this.repositories = Objects.requireNonNull( repositories );
this.projectBuilder = projectBuilder;
this.mavenRepositorySystem = mavenRepositorySystem;
+ this.toolchainManagerPrivate = toolchainManagerPrivate;
+ }
+
+ MavenSession getMavenSession()
+ {
+ return null;
}
@Nonnull
@@ -195,7 +206,7 @@ public class DefaultSession implements Session
.setLocalRepositoryManager( localRepositoryManager );
return new DefaultSession( newSession, repositorySystem, localRepositoryManagerFactory,
- repositories, projectBuilder, mavenRepositorySystem );
+ repositories, projectBuilder, mavenRepositorySystem, toolchainManagerPrivate );
}
catch ( NoLocalRepositoryManagerException e )
{
@@ -209,7 +220,7 @@ public class DefaultSession implements Session
public Session withRemoteRepositories( @Nonnull List<RemoteRepository> repositories )
{
return new DefaultSession( session, repositorySystem, localRepositoryManagerFactory,
- repositories, projectBuilder, mavenRepositorySystem );
+ repositories, projectBuilder, mavenRepositorySystem, toolchainManagerPrivate );
}
@Nonnull
@@ -265,6 +276,10 @@ public class DefaultSession implements Session
{
return (T) new DefaultRepositoryFactory( repositorySystem );
}
+ else if ( clazz == ToolchainManager.class )
+ {
+ return (T) new DefaultToolchainManager( toolchainManagerPrivate );
+ }
throw new NoSuchElementException( clazz.getName() );
}
@@ -478,4 +493,5 @@ public class DefaultSession implements Session
{
return Collections.unmodifiableCollection( listeners );
}
+
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultToolchainManager.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultToolchainManager.java
new file mode 100644
index 0000000..a8912f7
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultToolchainManager.java
@@ -0,0 +1,120 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Toolchain;
+import org.apache.maven.api.services.ToolchainManager;
+import org.apache.maven.api.services.ToolchainManagerException;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.toolchain.DefaultToolchainManagerPrivate;
+import org.apache.maven.toolchain.MisconfiguredToolchainException;
+import org.apache.maven.toolchain.ToolchainPrivate;
+
+public class DefaultToolchainManager implements ToolchainManager
+{
+ private final DefaultToolchainManagerPrivate toolchainManagerPrivate;
+
+ public DefaultToolchainManager( DefaultToolchainManagerPrivate toolchainManagerPrivate )
+ {
+ this.toolchainManagerPrivate = toolchainManagerPrivate;
+ }
+
+ @Override
+ public List<Toolchain> getToolchains( Session session, String type, Map<String, String> requirements )
+ throws ToolchainManagerException
+ {
+ MavenSession s = ( ( DefaultSession ) session ).getMavenSession();
+ List<org.apache.maven.toolchain.Toolchain> toolchains =
+ toolchainManagerPrivate.getToolchains( s, type, requirements );
+ return new MappedList<>( toolchains, this::toToolchain );
+ }
+
+ @Override
+ public Toolchain getToolchainFromBuildContext( Session session, String type )
+ throws ToolchainManagerException
+ {
+ MavenSession s = ( ( DefaultSession ) session ).getMavenSession();
+ return toToolchain( toolchainManagerPrivate.getToolchainFromBuildContext( type, s ) );
+ }
+
+ @Override
+ public List<Toolchain> getToolchainsForType( Session session, String type )
+ throws ToolchainManagerException
+ {
+ try
+ {
+ MavenSession s = ( (DefaultSession) session ).getMavenSession();
+ ToolchainPrivate[] toolchains = toolchainManagerPrivate.getToolchainsForType( type, s );
+ return new MappedList<>( Arrays.asList( toolchains ), this::toToolchain );
+ }
+ catch ( MisconfiguredToolchainException e )
+ {
+ throw new ToolchainManagerException( "Unable to get toochains for type " + type, e );
+ }
+ }
+
+ @Override
+ public void storeToolchainToBuildContext( Session session, Toolchain toolchain )
+ throws ToolchainManagerException
+ {
+ MavenSession s = ( ( DefaultSession ) session ).getMavenSession();
+ org.apache.maven.toolchain.ToolchainPrivate tc =
+ (org.apache.maven.toolchain.ToolchainPrivate) ( (ToolchainWrapper) toolchain ).toolchain;
+ toolchainManagerPrivate.storeToolchainToBuildContext( tc, s );
+ }
+
+ private Toolchain toToolchain( org.apache.maven.toolchain.Toolchain toolchain )
+ {
+ return new ToolchainWrapper( toolchain );
+ }
+
+ private static class ToolchainWrapper implements Toolchain
+ {
+ private final org.apache.maven.toolchain.Toolchain toolchain;
+
+ ToolchainWrapper( org.apache.maven.toolchain.Toolchain toolchain )
+ {
+ this.toolchain = toolchain;
+ }
+
+ @Override
+ public String getType()
+ {
+ return toolchain.getType();
+ }
+
+ @Override
+ public String findTool( String toolName )
+ {
+ return toolchain.findTool( toolName );
+ }
+
+ @Override
+ public boolean matchesRequirements( Map<String, String> requirements )
+ {
+ return ( (ToolchainPrivate) toolchain ).matchesRequirements( requirements );
+ }
+ }
+}
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java b/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
index b91dcf0..dc8a383 100644
--- a/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
+++ b/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
@@ -33,6 +33,7 @@ import org.apache.maven.api.services.ProjectBuilderRequest;
import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.bridge.MavenRepositorySystem;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
+import org.apache.maven.toolchain.DefaultToolchainManagerPrivate;
import org.codehaus.plexus.testing.PlexusTest;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
@@ -65,12 +66,16 @@ public class TestApi
@Inject
MavenRepositorySystem mavenRepositorySystem;
+ @Inject
+ DefaultToolchainManagerPrivate toolchainManagerPrivate;
+
@BeforeEach
void setup()
{
RepositorySystemSession rss = MavenRepositorySystemUtils.newSession();
DefaultSession session = new DefaultSession( rss, repositorySystem, localRepositoryManagerFactory,
- Collections.emptyList(), projectBuilder, mavenRepositorySystem );
+ Collections.emptyList(), projectBuilder, mavenRepositorySystem,
+ toolchainManagerPrivate );
DefaultLocalRepository localRepository = new DefaultLocalRepository(
new LocalRepository( "target/repo" ) );
org.apache.maven.api.RemoteRepository remoteRepository = session.getRemoteRepository(
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index f46fdeb..39f2e5f 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -219,7 +219,7 @@ under the License.
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<configuration>
- <version>1.1.0</version>
+ <version>2.0.0</version>
<!-- This is a required attribute and is intentionally left empty -->
<models></models>
</configuration>
diff --git a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
index 8a90f18..732d3f6 100644
--- a/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
+++ b/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java
@@ -22,6 +22,7 @@ package org.apache.maven.toolchain;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Named;
@@ -77,13 +78,17 @@ public class DefaultToolchainManagerPrivate
{
for ( ToolchainModel toolchainModel : availableToolchains )
{
- toRet.add( fact.createToolchain( toolchainModel ) );
+ ToolchainPrivate tool = fact.createToolchain( toolchainModel );
+ if ( tool != null && Objects.equals( type, tool.getType() ) )
+ {
+ toRet.add( tool );
+ }
}
}
// add default toolchain
ToolchainPrivate tool = fact.createDefaultToolchain();
- if ( tool != null )
+ if ( tool != null && Objects.equals( type, tool.getType() ) )
{
toRet.add( tool );
}
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index 83f4bf5..5fa60a5 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -69,6 +69,15 @@ under the License.
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/package-info.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/maven-resolver-provider/pom.xml b/maven-resolver-provider/pom.xml
index 0027e34..1227764 100644
--- a/maven-resolver-provider/pom.xml
+++ b/maven-resolver-provider/pom.xml
@@ -152,6 +152,15 @@ under the License.
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/package-info.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/pom.xml b/pom.xml
index 667eeeb..cff1735 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,17 +53,18 @@ under the License.
<commonsLangVersion>3.12.0</commonsLangVersion>
<junitVersion>5.8.1</junitVersion>
<mockitoVersion>3.2.0</mockitoVersion>
- <plexusVersion>2.1.0</plexusVersion>
+ <plexusVersion>2.2.0-SNAPSHOT</plexusVersion>
<plexusInterpolationVersion>1.26</plexusInterpolationVersion>
<plexusUtilsVersion>3.3.0</plexusUtilsVersion>
<guiceVersion>4.2.3</guiceVersion>
<guavaVersion>30.1-jre</guavaVersion>
<guavafailureaccessVersion>1.0.1</guavafailureaccessVersion>
<sisuVersion>0.3.5</sisuVersion>
+ <sisuPluginVersion>0.9.0-SNAPSHOT</sisuPluginVersion>
<wagonVersion>3.5.2-SNAPSHOT</wagonVersion>
<securityDispatcherVersion>2.0</securityDispatcherVersion>
<cipherVersion>2.0</cipherVersion>
- <modelloVersion>1.11</modelloVersion>
+ <modelloVersion>2.0.0</modelloVersion>
<jxpathVersion>1.3</jxpathVersion>
<resolverVersion>1.8.0-SNAPSHOT</resolverVersion>
<slf4jVersion>1.7.32</slf4jVersion>
@@ -474,6 +475,14 @@ under the License.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <version>1.7.1-SNAPSHOT</version>
+ <configuration>
+ <useProjectsHash>true</useProjectsHash>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<dependencies>
@@ -505,7 +514,7 @@ under the License.
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
- <version>${sisuVersion}</version>
+ <version>${sisuPluginVersion}</version>
<executions>
<execution>
<goals>
@@ -585,7 +594,7 @@ under the License.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.20</version>
+ <version>1.21</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
[maven] 01/12: mvn4 aggregator
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit cf56704421db75596241b9462ed4b52c2ca3b6cd
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Jan 28 23:11:31 2022 +0100
mvn4 aggregator
---
build/checkstyle-suppressions.xml | 1 -
maven-bom/pom.xml | 2 +-
maven-core/src/main/java/org/apache/maven/DefaultMaven.java | 1 +
.../maven/artifact/handler/DefaultArtifactHandler.java | 1 +
.../maven/plugin/internal/DefaultMavenPluginManager.java | 1 +
.../apache/maven/model/building/DefaultModelBuilder.java | 1 +
.../main/java/org/apache/maven/model/merge/ModelMerger.java | 2 +-
.../repository/internal/PluginsMetadataInfoProvider.java | 3 +++
.../apache/maven/repository/internal/RelocatedArtifact.java | 6 ++++++
pom.xml | 13 +++++++------
10 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/build/checkstyle-suppressions.xml b/build/checkstyle-suppressions.xml
index 78e9e3c..4570299 100644
--- a/build/checkstyle-suppressions.xml
+++ b/build/checkstyle-suppressions.xml
@@ -26,5 +26,4 @@ under the License.
<suppressions>
<suppress checks="JavadocVariable|JavadocMethod" files=".*" />
<suppress checks="HiddenField" files=".*" />
- <suppress checks="FileLength" files="ModelMerger\.java" />
</suppressions>
diff --git a/maven-bom/pom.xml b/maven-bom/pom.xml
index 4f9b6e3..1d8e708 100644
--- a/maven-bom/pom.xml
+++ b/maven-bom/pom.xml
@@ -24,7 +24,7 @@ under the License.
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
- <version>35</version>
+ <version>35-SNAPSHOT</version>
<relativePath />
</parent>
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index 56a42b7..a43d0d3 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -108,6 +108,7 @@ public class DefaultMaven
private final SuperPomProvider superPomProvider;
@Inject
+ @SuppressWarnings( "checkstyle:ParameterNumber" )
public DefaultMaven(
ProjectBuilder projectBuilder,
LifecycleStarter lifecycleStarter,
diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
index bb90aff..d0d2bf4 100644
--- a/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java
@@ -70,6 +70,7 @@ public class DefaultArtifactHandler
);
}
+ @SuppressWarnings( "checkstyle:ParameterNumber" )
public DefaultArtifactHandler( final String type,
final String extension,
final String classifier,
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
index 88813e6..8b3e176 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
@@ -148,6 +148,7 @@ public class DefaultMavenPluginManager
private final PluginDescriptorBuilder builder = new PluginDescriptorBuilder();
@Inject
+ @SuppressWarnings( "checkstyle:ParameterNumber" )
public DefaultMavenPluginManager(
PlexusContainer container,
ClassRealmManager classRealmManager,
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
index de84b90..b5242e3 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
@@ -100,6 +100,7 @@ import org.eclipse.sisu.Nullable;
*/
@Named
@Singleton
+@SuppressWarnings( {"checkstyle:JavaDocMethod", "checkstyle:HiddenField", "checkstyle:ParameterNumber" } )
public class DefaultModelBuilder
implements ModelBuilder
{
diff --git a/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java b/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java
index 2ac6fbf..84ccc80 100644
--- a/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java
+++ b/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java
@@ -1,3 +1,4 @@
+// CHECKSTYLE_OFF: RegexpHeader|FileLength|MethodName
package org.apache.maven.model.merge;
/*
@@ -94,7 +95,6 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
*
* @author Benjamin Bentmann
*/
-@SuppressWarnings( { "checkstyle:methodname" } )
public class ModelMerger
{
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataInfoProvider.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataInfoProvider.java
index 629a23f..49b3aab 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataInfoProvider.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataInfoProvider.java
@@ -39,6 +39,9 @@ public interface PluginsMetadataInfoProvider
/**
* Returns {@link PluginInfo} corresponding for passed in {@link Artifact}, or {@code null}.
+ *
+ * @param artifact the artifact
+ * @return the plugin info
*/
PluginInfo getPluginInfo( Artifact artifact );
}
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
index a0a21e9..6dd05d6 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
@@ -152,4 +152,10 @@ public final class RelocatedArtifact
{
return message;
}
+
+ @Override
+ protected Artifact newInstance( String version, Map<String, String> properties, File file )
+ {
+ throw new IllegalStateException();
+ }
}
diff --git a/pom.xml b/pom.xml
index c42deb4..2ea8f0f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
- <version>35</version>
+ <version>35-SNAPSHOT</version>
<relativePath />
</parent>
@@ -60,12 +60,12 @@ under the License.
<guavaVersion>30.1-jre</guavaVersion>
<guavafailureaccessVersion>1.0.1</guavafailureaccessVersion>
<sisuVersion>0.3.5</sisuVersion>
- <wagonVersion>3.5.1</wagonVersion>
+ <wagonVersion>3.5.2-SNAPSHOT</wagonVersion>
<securityDispatcherVersion>2.0</securityDispatcherVersion>
<cipherVersion>2.0</cipherVersion>
<modelloVersion>1.11</modelloVersion>
<jxpathVersion>1.3</jxpathVersion>
- <resolverVersion>1.7.2</resolverVersion>
+ <resolverVersion>1.8.0-SNAPSHOT</resolverVersion>
<slf4jVersion>1.7.32</slf4jVersion>
<xmlunitVersion>2.6.4</xmlunitVersion>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
@@ -301,7 +301,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
- <version>3.3.4</version>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
@@ -583,7 +583,7 @@ under the License.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.18</version>
+ <version>1.20</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
@@ -660,7 +660,8 @@ under the License.
<version>3.1.2</version>
<configuration>
<violationSeverity>info</violationSeverity>
- <suppressionsLocation>${maven.multiModuleProjectDirectory}/build/checkstyle-suppressions.xml</suppressionsLocation>
+ <violationIgnore>JavadocVariable,JavadocMethod,HiddenField</violationIgnore>
+<!-- <suppressionsLocation>${maven.multiModuleProjectDirectory}/build/checkstyle-suppressions.xml</suppressionsLocation>-->
</configuration>
<dependencies>
<dependency>
[maven] 03/12: Add some missing bits
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit e7bab869c775610e0b804e98ec1d5bb5ca29d699
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Feb 15 02:47:38 2022 +0100
Add some missing bits
---
maven-core-api/pom.xml | 8 +++
.../api/{ArtifactMetadata.java => Metadata.java} | 16 ++++-
.../main/java/org/apache/maven/api/Project.java | 9 ++-
.../org/apache/maven/api/RepositoryMetadata.java | 2 +-
.../main/java/org/apache/maven/api/Session.java | 35 +++++++++
.../java/org/apache/maven/api/SessionData.java | 84 ++++++++++++++++++++++
.../api/{ArtifactMetadata.java => Toolchain.java} | 21 +++++-
.../apache/maven/api/services/ArtifactFactory.java | 7 ++
.../maven/api/services/ArtifactFactoryRequest.java | 13 ++++
.../apache/maven/api/services/ArtifactManager.java | 7 +-
...actFactory.java => LocalRepositoryManager.java} | 25 ++++---
.../apache/maven/api/services/ProjectDeployer.java | 5 +-
.../maven/api/services/ProjectDeployerRequest.java | 12 +---
.../apache/maven/api/services/ProjectManager.java | 4 ++
.../RepositoryFactory.java} | 14 +++-
.../ToolchainManager.java} | 13 +++-
maven-core-impl/pom.xml | 9 ++-
.../maven/impl/DefaultLocalRepositoryManager.java | 82 +++++++++++++++++++++
.../maven/impl/DefaultRepositoryFactory.java | 24 ++++++-
.../java/org/apache/maven/impl/DefaultSession.java | 82 +++++++++++++++++++--
.../test/java/org/apache/maven/impl/TestApi.java | 3 +
21 files changed, 431 insertions(+), 44 deletions(-)
diff --git a/maven-core-api/pom.xml b/maven-core-api/pom.xml
index 853b64a..e70bbca 100644
--- a/maven-core-api/pom.xml
+++ b/maven-core-api/pom.xml
@@ -31,6 +31,14 @@
<dependencies>
<dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-settings</artifactId>
+ </dependency>
+ <dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java b/maven-core-api/src/main/java/org/apache/maven/api/Metadata.java
similarity index 80%
copy from maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
copy to maven-core-api/src/main/java/org/apache/maven/api/Metadata.java
index 6cee8b6..b3575d2 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Metadata.java
@@ -19,6 +19,20 @@ package org.apache.maven.api;
* under the License.
*/
-public interface ArtifactMetadata
+public interface Metadata
{
+
+ String getGroupId();
+
+ String getArtifactId();
+
+ String getVersion();
+
+ enum Storage
+ {
+ Group, Artifact, Version
+ }
+
+ Storage getStorage();
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Project.java b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
index 037f718..4d313e4 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Project.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
@@ -24,6 +24,8 @@ import javax.annotation.Nonnull;
import java.nio.file.Path;
import java.util.List;
+import org.apache.maven.model.Model;
+
/**
* Interface representing a Maven project.
*/
@@ -46,11 +48,16 @@ public interface Project
Artifact getArtifact();
@Nonnull
- Object getModel();
+ Model getModel();
@Nonnull
Path getPomPath();
+ default Path getBasedir()
+ {
+ return getPomPath().getParent();
+ }
+
@Nonnull
List<Dependency> getDependencies();
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/RepositoryMetadata.java b/maven-core-api/src/main/java/org/apache/maven/api/RepositoryMetadata.java
index 2ff856d..e45a31e 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/RepositoryMetadata.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/RepositoryMetadata.java
@@ -19,6 +19,6 @@ package org.apache.maven.api;
* under the License.
*/
-public interface RepositoryMetadata extends ArtifactMetadata
+public interface RepositoryMetadata extends Metadata
{
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Session.java b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
index 6fbc7cd..b4f9dc0 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Session.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Session.java
@@ -22,9 +22,11 @@ package org.apache.maven.api;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.ThreadSafe;
+import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.NoSuchElementException;
+import java.util.Properties;
import org.apache.maven.api.services.ArtifactDeployer;
import org.apache.maven.api.services.ArtifactDeployerException;
@@ -42,7 +44,9 @@ import org.apache.maven.api.services.DependencyFactory;
import org.apache.maven.api.services.DependencyResolver;
import org.apache.maven.api.services.DependencyResolverException;
import org.apache.maven.api.services.DependencyResolverResult;
+import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.api.services.Service;
+import org.apache.maven.settings.Settings;
/**
* The session to install / deploy / resolve artifacts and dependencies.
@@ -52,11 +56,23 @@ public interface Session
{
@Nonnull
+ Settings getSettings();
+
+ @Nonnull
LocalRepository getLocalRepository();
@Nonnull
List<RemoteRepository> getRemoteRepositories();
+ @Nonnull
+ SessionData getData();
+
+ @Nonnull
+ Properties getUserProperties();
+
+ @Nonnull
+ Properties getSystemProperties();
+
/**
* Retrieves the service for the interface
*
@@ -84,6 +100,15 @@ public interface Session
Session withRemoteRepositories( @Nonnull List<RemoteRepository> repositories );
/**
+ * Shortcut for <code>getService(RepositoryFactory.class).createLocal(...)</code>
+ */
+ default LocalRepository createLocalRepository( Path path )
+ throws ArtifactFactoryException, IllegalArgumentException
+ {
+ return getService( RepositoryFactory.class ).createLocal( path );
+ }
+
+ /**
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
*/
default Artifact createArtifact( String groupId, String artifactId, String version, String type )
@@ -94,6 +119,16 @@ public interface Session
}
/**
+ * Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
+ */
+ default Artifact createArtifact( String groupId, String artifactId, String classifier, String version, String type )
+ throws ArtifactFactoryException, IllegalArgumentException
+ {
+ return getService( ArtifactFactory.class )
+ .create( this, groupId, artifactId, classifier, version, type );
+ }
+
+ /**
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
*/
default ArtifactResolverResult resolveArtifact( Artifact artifact )
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/SessionData.java b/maven-core-api/src/main/java/org/apache/maven/api/SessionData.java
new file mode 100644
index 0000000..bc4d688
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/SessionData.java
@@ -0,0 +1,84 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.ThreadSafe;
+
+import java.util.function.Supplier;
+
+/**
+ * A container for data that is specific to a session.
+ * All components may use this storage to associate arbitrary data with a session.
+ * <p>
+ * Unlike a cache, this session data is not subject to purging. For this same reason, session data should also not be
+ * abused as a cache (i.e. for storing values that can be re-calculated) to avoid memory exhaustion.
+ * <p>
+ * <strong>Note:</strong> Actual implementations must be thread-safe.
+ *
+ * @see Session#getData()
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @noextend This interface is not intended to be extended by clients.
+ */
+@ThreadSafe
+public interface SessionData
+{
+
+ /**
+ * Associates the specified session data with the given key.
+ *
+ * @param key The key under which to store the session data, must not be {@code null}.
+ * @param value The data to associate with the key, may be {@code null} to remove the mapping.
+ */
+ void set( @Nonnull Object key, @Nullable Object value );
+
+ /**
+ * Associates the specified session data with the given key if the key is currently mapped to the given value. This
+ * method provides an atomic compare-and-update of some key's value.
+ *
+ * @param key The key under which to store the session data, must not be {@code null}.
+ * @param oldValue The expected data currently associated with the key, may be {@code null}.
+ * @param newValue The data to associate with the key, may be {@code null} to remove the mapping.
+ * @return {@code true} if the key mapping was successfully updated from the old value to the new value,
+ * {@code false} if the current key mapping didn't match the expected value and was not updated.
+ */
+ boolean set( @Nonnull Object key, @Nullable Object oldValue, @Nullable Object newValue );
+
+ /**
+ * Gets the session data associated with the specified key.
+ *
+ * @param key The key for which to retrieve the session data, must not be {@code null}.
+ * @return The session data associated with the key or {@code null} if none.
+ */
+ @Nullable
+ Object get( @Nonnull Object key );
+
+ /**
+ * Retrieve of compute the data associated with the specified key.
+ *
+ * @param key The key for which to retrieve the session data, must not be {@code null}.
+ * @param supplier The supplier will compute the new value.
+ * @return The session data associated with the key.
+ */
+ @Nullable
+ Object computeIfAbsent( @Nonnull Object key, @Nonnull Supplier<Object> supplier );
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java b/maven-core-api/src/main/java/org/apache/maven/api/Toolchain.java
similarity index 65%
copy from maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
copy to maven-core-api/src/main/java/org/apache/maven/api/Toolchain.java
index 6cee8b6..a31e5bc 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Toolchain.java
@@ -19,6 +19,23 @@ package org.apache.maven.api;
* under the License.
*/
-public interface ArtifactMetadata
+/**
+ * Toolchain interface.
+ */
+public interface Toolchain
{
-}
+ /**
+ * get the type of toolchain.
+ *
+ * @return the toolchain type
+ */
+ String getType();
+
+ /**
+ * Gets the platform tool executable.
+ *
+ * @param toolName the tool platform independent tool name.
+ * @return file representing the tool executable, or null if the tool can not be found
+ */
+ String findTool( String toolName );
+}
\ No newline at end of file
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
index 2459409..c1ab305 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
@@ -33,4 +33,11 @@ public interface ArtifactFactory extends Service
{
return create( ArtifactFactoryRequest.build( session, groupId, artifactId, version, type ) );
}
+
+ default Artifact create( Session session, String groupId, String artifactId,
+ String classifier, String version, String type )
+ throws ArtifactFactoryException, IllegalArgumentException
+ {
+ return create( ArtifactFactoryRequest.build( session, groupId, artifactId, classifier, version, type ) );
+ }
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
index 4bdf288..4032330 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactoryRequest.java
@@ -53,6 +53,19 @@ public interface ArtifactFactoryRequest
.build();
}
+ static ArtifactFactoryRequest build( Session session, String groupId, String artifactId,
+ String classifier, String version, String type )
+ {
+ return ArtifactFactoryRequest.builder()
+ .session( session )
+ .groupId( groupId )
+ .artifactId( artifactId )
+ .classifier( classifier )
+ .version( version )
+ .type( type )
+ .build();
+ }
+
static ArtifactFactoryRequestBuilder builder()
{
return new ArtifactFactoryRequestBuilder();
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
index f96b014..609a9ac 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
@@ -26,7 +26,7 @@ import java.util.Collection;
import java.util.Optional;
import org.apache.maven.api.Artifact;
-import org.apache.maven.api.ArtifactMetadata;
+import org.apache.maven.api.Metadata;
public interface ArtifactManager extends Service
{
@@ -41,6 +41,9 @@ public interface ArtifactManager extends Service
Optional<Path> getPath( Artifact artifact );
@Nonnull
- Collection<ArtifactMetadata> getAttachedMetadatas( Artifact artifact );
+ Collection<Metadata> getAttachedMetadatas( Artifact artifact );
+ void attachMetadata( @Nonnull Artifact artifact, @Nonnull Metadata metadata );
+
+ void setPath( Artifact artifact, Path path );
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java b/maven-core-api/src/main/java/org/apache/maven/api/services/LocalRepositoryManager.java
similarity index 55%
copy from maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
copy to maven-core-api/src/main/java/org/apache/maven/api/services/LocalRepositoryManager.java
index 2459409..fc9d3b1 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactFactory.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/LocalRepositoryManager.java
@@ -9,7 +9,7 @@ package org.apache.maven.api.services;
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -19,18 +19,23 @@ package org.apache.maven.api.services;
* under the License.
*/
-import org.apache.maven.api.Session;
+import java.nio.file.Path;
+
import org.apache.maven.api.Artifact;
+import org.apache.maven.api.LocalRepository;
+import org.apache.maven.api.Metadata;
+import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.api.Session;
-public interface ArtifactFactory extends Service
+public interface LocalRepositoryManager extends Service
{
- Artifact create( ArtifactFactoryRequest request )
- throws ArtifactFactoryException, IllegalArgumentException;
+ Path getPathForLocalArtifact( Session session, LocalRepository local, Artifact artifact );
+
+ Path getPathForLocalMetadata( Session session, LocalRepository local, Metadata metadata );
+
+ Path getPathForRemoteArtifact( Session session, LocalRepository local, RemoteRepository remote, Artifact artifact );
+
+ Path getPathForRemoteMetadata( Session session, LocalRepository local, RemoteRepository remote, Metadata metadata );
- default Artifact create( Session session, String groupId, String artifactId, String version, String type )
- throws ArtifactFactoryException, IllegalArgumentException
- {
- return create( ArtifactFactoryRequest.build( session, groupId, artifactId, version, type ) );
- }
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java
index 8fc5281..5f21e4c 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java
@@ -19,6 +19,7 @@ package org.apache.maven.api.services;
* under the License.
*/
+import org.apache.maven.api.RemoteRepository;
import org.apache.maven.api.Session;
import org.apache.maven.api.Project;
@@ -60,9 +61,9 @@ public interface ProjectDeployer extends Service
void deploy( ProjectDeployerRequest request )
throws ProjectDeployerException, IllegalArgumentException;
- default void deploy( Session session, Project project )
+ default void deploy( Session session, Project project, RemoteRepository repository )
throws ProjectDeployerException, IllegalArgumentException
{
- deploy( ProjectDeployerRequest.build( session, project ) );
+ deploy( ProjectDeployerRequest.build( session, project, repository ) );
}
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java
index 27eeffc..e343e86 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java
@@ -38,20 +38,12 @@ public interface ProjectDeployerRequest
int getRetryFailedDeploymentCount();
-// @Nonnull
-// Optional<String> getAltDeploymentRepository();
-
-// @Nonnull
-// Optional<String> getAltSnapshotDeploymentRepository();
-
-// @Nonnull
-// Optional<String> getAltReleaseDeploymentRepository();
-
- static ProjectDeployerRequest build( Session session, Project project )
+ static ProjectDeployerRequest build( Session session, Project project, RemoteRepository repository )
{
return builder()
.session( session )
.project( project )
+ .repository( repository )
.build();
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
index 494882a..0651a26 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
@@ -45,4 +45,8 @@ public interface ProjectManager extends Service
@Nonnull
Collection<Artifact> getAttachedArtifacts( Project project );
+ void attachArtifact( Project project, String type, Path path );
+
+ void attachArtifact( Project project, String trim, String trim1, Path path );
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java b/maven-core-api/src/main/java/org/apache/maven/api/services/RepositoryFactory.java
similarity index 71%
copy from maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
copy to maven-core-api/src/main/java/org/apache/maven/api/services/RepositoryFactory.java
index 6cee8b6..7318bd9 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/RepositoryFactory.java
@@ -1,4 +1,4 @@
-package org.apache.maven.api;
+package org.apache.maven.api.services;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,6 +19,16 @@ package org.apache.maven.api;
* under the License.
*/
-public interface ArtifactMetadata
+import java.nio.file.Path;
+
+import org.apache.maven.api.LocalRepository;
+import org.apache.maven.api.RemoteRepository;
+
+public interface RepositoryFactory extends Service
{
+
+ LocalRepository createLocal( Path path );
+
+ RemoteRepository createRemote( String id, String url );
+
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
similarity index 67%
copy from maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
copy to maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
index 6cee8b6..b92ef4f 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ToolchainManager.java
@@ -1,4 +1,4 @@
-package org.apache.maven.api;
+package org.apache.maven.api.services;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,6 +19,15 @@ package org.apache.maven.api;
* under the License.
*/
-public interface ArtifactMetadata
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.api.Toolchain;
+
+public interface ToolchainManager extends Service
{
+ List<Toolchain> getToolchains( Session session, String jdk, Map<String, String> jdkToolchain );
+
+ Toolchain getToolchainFromBuildContext( Session session, String jdk );
}
diff --git a/maven-core-impl/pom.xml b/maven-core-impl/pom.xml
index df573ad..8fc09bc 100644
--- a/maven-core-impl/pom.xml
+++ b/maven-core-impl/pom.xml
@@ -38,6 +38,10 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.resolver</groupId>
+ <artifactId>maven-resolver-impl</artifactId>
+ </dependency>
<!-- Testing -->
<dependency>
@@ -47,11 +51,6 @@
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<scope>test</scope>
</dependency>
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java
new file mode 100644
index 0000000..41bd191
--- /dev/null
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java
@@ -0,0 +1,82 @@
+package org.apache.maven.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.LocalRepository;
+import org.apache.maven.api.Metadata;
+import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.api.Session;
+import org.apache.maven.api.services.LocalRepositoryManager;
+import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
+
+public class DefaultLocalRepositoryManager implements LocalRepositoryManager
+{
+
+ @Override
+ public Path getPathForLocalArtifact( Session session, LocalRepository local, Artifact artifact )
+ {
+ DefaultSession s = (DefaultSession) session;
+ return Paths.get( getManager( s, local ).getPathForLocalArtifact( s.toArtifact( artifact ) ) );
+ }
+
+ @Override
+ public Path getPathForLocalMetadata( Session session, LocalRepository local, Metadata metadata )
+ {
+ DefaultSession s = (DefaultSession) session;
+ return Paths.get( getManager( s, local ).getPathForLocalMetadata( s.toMetadata( metadata ) ) );
+ }
+
+ @Override
+ public Path getPathForRemoteArtifact( Session session, LocalRepository local,
+ RemoteRepository remote, Artifact artifact )
+ {
+ DefaultSession s = (DefaultSession) session;
+ return Paths.get( getManager( s, local ).getPathForRemoteArtifact(
+ s.toArtifact( artifact ), s.toRepository( remote ), null ) );
+ }
+
+ @Override
+ public Path getPathForRemoteMetadata( Session session, LocalRepository local,
+ RemoteRepository remote, Metadata metadata )
+ {
+ DefaultSession s = (DefaultSession) session;
+ return Paths.get( getManager( s, local ).getPathForRemoteMetadata(
+ s.toMetadata( metadata ), s.toRepository( remote ), null ) );
+ }
+
+ private org.eclipse.aether.repository.LocalRepositoryManager getManager(
+ DefaultSession session, LocalRepository local )
+ {
+ try
+ {
+ return session.getLocalRepositoryProvider()
+ .newLocalRepositoryManager( session.getSession(), session.toRepository( local ) );
+ }
+ catch ( NoLocalRepositoryManagerException e )
+ {
+ throw new IllegalStateException( e );
+ }
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
similarity index 52%
rename from maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
rename to maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
index 6cee8b6..5e8e045 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/ArtifactMetadata.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
@@ -1,4 +1,4 @@
-package org.apache.maven.api;
+package org.apache.maven.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,6 +19,26 @@ package org.apache.maven.api;
* under the License.
*/
-public interface ArtifactMetadata
+import java.nio.file.Path;
+
+import org.apache.maven.api.LocalRepository;
+import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.api.services.RepositoryFactory;
+
+public class DefaultRepositoryFactory implements RepositoryFactory
{
+
+ @Override
+ public LocalRepository createLocal( Path path )
+ {
+ return new DefaultLocalRepository( new org.eclipse.aether.repository.LocalRepository( "target/repo" ) );
+ }
+
+ @Override
+ public RemoteRepository createRemote( String id, String url )
+ {
+ return new DefaultRemoteRepository(
+ new org.eclipse.aether.repository.RemoteRepository.Builder( id, "", url )
+ .build() );
+ }
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
index 6b37f63..585987b 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
@@ -20,6 +20,7 @@ package org.apache.maven.impl;
*/
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.nio.file.Path;
import java.util.Collection;
@@ -28,13 +29,18 @@ import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
+import java.util.Properties;
import java.util.WeakHashMap;
+import java.util.function.Supplier;
import java.util.stream.Collectors;
+import org.apache.maven.api.SessionData;
+import org.apache.maven.api.services.LocalRepositoryManager;
+import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.api.services.Service;
import org.apache.maven.api.Session;
import org.apache.maven.api.Artifact;
-import org.apache.maven.api.ArtifactMetadata;
+import org.apache.maven.api.Metadata;
import org.apache.maven.api.Dependency;
import org.apache.maven.api.Node;
import org.apache.maven.api.Project;
@@ -53,12 +59,13 @@ import org.apache.maven.api.services.DependencyResolver;
import org.apache.maven.api.services.ProjectBuilder;
import org.apache.maven.api.services.ProjectDeployer;
import org.apache.maven.api.services.ProjectInstaller;
+import org.apache.maven.settings.Settings;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.repository.LocalRepositoryManager;
import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory;
+import org.eclipse.aether.impl.LocalRepositoryProvider;
public class DefaultSession implements Session
{
@@ -69,6 +76,7 @@ public class DefaultSession implements Session
private final List<RemoteRepository> repositories;
private final org.apache.maven.project.ProjectBuilder projectBuilder;
private final MavenRepositorySystem mavenRepositorySystem;
+ private LocalRepositoryProvider localRepositoryProvider;
private final Map<org.eclipse.aether.graph.DependencyNode, Node> allNodes
= Collections.synchronizedMap( new WeakHashMap<>() );
@@ -112,6 +120,59 @@ public class DefaultSession implements Session
@Nonnull
@Override
+ public Settings getSettings()
+ {
+ return null;
+ }
+
+ @Nonnull
+ @Override
+ public Properties getUserProperties()
+ {
+ return null;
+ }
+
+ @Nonnull
+ @Override
+ public Properties getSystemProperties()
+ {
+ return null;
+ }
+
+ @Nonnull
+ @Override
+ public SessionData getData()
+ {
+ org.eclipse.aether.SessionData data = session.getData();
+ return new SessionData()
+ {
+ @Override
+ public void set( @Nonnull Object key, @Nullable Object value )
+ {
+ data.set( key, value );
+ }
+ @Override
+ public boolean set( @Nonnull Object key, @Nullable Object oldValue, @Nullable Object newValue )
+ {
+ return data.set( key, oldValue, newValue );
+ }
+ @Nullable
+ @Override
+ public Object get( @Nonnull Object key )
+ {
+ return data.get( key );
+ }
+ @Nullable
+ @Override
+ public Object computeIfAbsent( @Nonnull Object key, @Nonnull Supplier<Object> supplier )
+ {
+ return data.computeIfAbsent( key, supplier );
+ }
+ };
+ }
+
+ @Nonnull
+ @Override
public Session withLocalRepository( @Nonnull LocalRepository localRepository )
{
Objects.requireNonNull( localRepository, "localRepository" );
@@ -124,7 +185,7 @@ public class DefaultSession implements Session
try
{
org.eclipse.aether.repository.LocalRepository repository = toRepository( localRepository );
- LocalRepositoryManager localRepositoryManager
+ org.eclipse.aether.repository.LocalRepositoryManager localRepositoryManager
= localRepositoryManagerFactory.newInstance( session, repository );
RepositorySystemSession newSession = new DefaultRepositorySystemSession( session )
@@ -193,6 +254,14 @@ public class DefaultSession implements Session
{
return (T) new DefaultProjectInstaller( repositorySystem );
}
+ else if ( clazz == LocalRepositoryManager.class )
+ {
+ return (T) new DefaultLocalRepositoryManager();
+ }
+ else if ( clazz == RepositoryFactory.class )
+ {
+ return (T) new DefaultRepositoryFactory();
+ }
throw new NoSuchElementException( clazz.getName() );
}
@@ -201,6 +270,11 @@ public class DefaultSession implements Session
return session;
}
+ public LocalRepositoryProvider getLocalRepositoryProvider()
+ {
+ return localRepositoryProvider;
+ }
+
public RemoteRepository getRemoteRepository( org.eclipse.aether.repository.RemoteRepository repository )
{
return allRepositories.computeIfAbsent( repository, DefaultRemoteRepository::new );
@@ -356,7 +430,7 @@ public class DefaultSession implements Session
}
}
- public org.eclipse.aether.metadata.Metadata toMetadata( ArtifactMetadata metadata )
+ public org.eclipse.aether.metadata.Metadata toMetadata( Metadata metadata )
{
/*
if ( metadata instanceof ProjectArtifactMetadata )
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java b/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
index 7736f81..b91dcf0 100644
--- a/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
+++ b/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
@@ -21,6 +21,7 @@ package org.apache.maven.impl;
import javax.inject.Inject;
+import java.nio.file.Paths;
import java.util.Collections;
import org.apache.maven.api.Project;
@@ -29,6 +30,7 @@ import org.apache.maven.api.Artifact;
import org.apache.maven.api.Node;
import org.apache.maven.api.services.ProjectBuilder;
import org.apache.maven.api.services.ProjectBuilderRequest;
+import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.bridge.MavenRepositorySystem;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.codehaus.plexus.testing.PlexusTest;
@@ -75,6 +77,7 @@ public class TestApi
new RemoteRepository.Builder( "mirror", "default",
"file:target/test-classes/repo" ).build() );
this.session = session
+ .withLocalRepository( session.getService( RepositoryFactory.class ).createLocal( Paths.get( "target/repo" ) ) )
.withLocalRepository( localRepository )
.withRemoteRepositories( Collections.singletonList( remoteRepository ) );
}
[maven] 08/12: Add runtime support
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 3f9c7368641f26bca0b36c552350838c556d3641
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Mar 7 22:49:47 2022 +0100
Add runtime support
---
.../main/java/org/apache/maven/api/Project.java | 2 +
.../apache/maven/api/services/ArtifactManager.java | 15 ++-
.../apache/maven/api/services/ProjectDeployer.java | 69 ----------
.../api/services/ProjectDeployerException.java | 37 ------
.../maven/api/services/ProjectDeployerRequest.java | 134 -------------------
.../maven/api/services/ProjectInstaller.java | 79 ------------
.../api/services/ProjectInstallerException.java | 37 ------
.../api/services/ProjectInstallerRequest.java | 101 ---------------
.../apache/maven/api/services/ProjectManager.java | 14 +-
.../apache/maven/impl/DefaultProjectDeployer.java | 142 ---------------------
.../apache/maven/impl/DefaultProjectInstaller.java | 77 -----------
maven-core/pom.xml | 4 +
.../main/java/org/apache/maven/DefaultMaven.java | 10 +-
.../org/apache/maven/execution/MavenSession.java | 12 ++
.../apache/maven/execution/MojoExecutionEvent.java | 11 +-
.../maven/internal}/impl/DefaultArtifact.java | 2 +-
.../internal}/impl/DefaultArtifactDeployer.java | 2 +-
.../internal}/impl/DefaultArtifactFactory.java | 2 +-
.../internal}/impl/DefaultArtifactInstaller.java | 2 +-
.../internal/impl/DefaultArtifactManager.java | 89 +++++++++++++
.../internal}/impl/DefaultArtifactResolver.java | 2 +-
.../maven/internal}/impl/DefaultDependency.java | 2 +-
.../internal}/impl/DefaultDependencyCollector.java | 2 +-
.../internal}/impl/DefaultDependencyFactory.java | 2 +-
.../internal}/impl/DefaultDependencyResolver.java | 2 +-
.../internal}/impl/DefaultLocalRepository.java | 4 +-
.../impl/DefaultLocalRepositoryManager.java | 14 +-
.../apache/maven/internal}/impl/DefaultNode.java | 2 +-
.../maven/internal}/impl/DefaultProject.java | 15 ++-
.../internal}/impl/DefaultProjectBuilder.java | 2 +-
.../maven/internal/impl/DefaultProjectManager.java | 99 ++++++++++++++
.../internal}/impl/DefaultRemoteRepository.java | 2 +-
.../internal}/impl/DefaultRepositoryFactory.java | 2 +-
.../maven/internal}/impl/DefaultSession.java | 82 ++++++------
.../maven/internal/impl/DefaultSessionFactory.java | 67 ++++++++++
.../internal}/impl/DefaultToolchainManager.java | 2 +-
.../maven/internal}/impl/MappedCollection.java | 2 +-
.../apache/maven/internal}/impl/MappedList.java | 2 +-
.../lifecycle/internal/LifecycleModuleBuilder.java | 2 +
.../maven/plugin/DefaultBuildPluginManager.java | 37 ++++--
.../plugin/PluginParameterExpressionEvaluator.java | 9 +-
.../session/scope/internal/SessionScopeModule.java | 2 +
.../main/resources/META-INF/maven/extension.xml | 2 +
.../org/apache/maven/internal}/impl/TestApi.java | 16 +--
.../maven/internal}/impl/TestArtifactHandler.java | 2 +-
.../maven/internal}/impl/TestRepositorySystem.java | 2 +-
.../DefaultToolchainManagerPrivateTest.java | 11 ++
.../test/resources/apiv4-repo}/1.0/jdom-1.0.jar | Bin
.../resources/apiv4-repo}/1.0/jdom-1.0.jar.sha1 | 0
.../test/resources/apiv4-repo}/1.0/jdom-1.0.pom | 0
.../resources/apiv4-repo}/1.0/jdom-1.0.pom.sha1 | 0
.../apiv4-repo}/1.1/xml-im-exporter-1.1.jar | Bin
.../apiv4-repo}/1.1/xml-im-exporter-1.1.jar.sha1 | 0
.../apiv4-repo}/1.1/xml-im-exporter-1.1.pom | 0
.../apiv4-repo}/1.1/xml-im-exporter-1.1.pom.sha1 | 0
.../apiv4-repo}/2.0.2/commons-httpclient-2.0.2.jar | Bin
.../2.0.2/commons-httpclient-2.0.2.jar.sha1 | 0
.../apiv4-repo}/2.0.2/commons-httpclient-2.0.2.pom | 0
.../2.0.2/commons-httpclient-2.0.2.pom.sha1 | 0
.../apiv4-repo}/2.1/slide-webdavlib-2.1.jar | Bin
.../apiv4-repo}/2.1/slide-webdavlib-2.1.jar.md5 | 0
.../apiv4-repo}/2.1/slide-webdavlib-2.1.jar.sha1 | 0
.../apiv4-repo}/2.1/slide-webdavlib-2.1.pom | 0
.../apiv4-repo}/2.1/slide-webdavlib-2.1.pom.md5 | 0
.../apiv4-repo}/2.1/slide-webdavlib-2.1.pom.sha1 | 0
.../junit-4.13.1-javadoc-resources.jar.lastUpdated | 0
.../apiv4-repo}/4.13.1/junit-4.13.1-javadoc.jar | Bin
.../4.13.1/junit-4.13.1-javadoc.jar.sha1 | 0
.../apiv4-repo}/4.13.1/junit-4.13.1-sources.jar | Bin
.../4.13.1/junit-4.13.1-sources.jar.sha1 | 0
.../resources/apiv4-repo}/4.13.1/junit-4.13.1.jar | Bin
.../apiv4-repo}/4.13.1/junit-4.13.1.jar.sha1 | 0
.../resources/apiv4-repo}/4.13.1/junit-4.13.1.pom | 0
.../apiv4-repo}/4.13.1/junit-4.13.1.pom.sha1 | 0
.../1.0.3/commons-logging-1.0.3.jar | Bin
.../1.0.3/commons-logging-1.0.3.jar.sha1 | 0
.../1.0.3/commons-logging-1.0.3.pom | 0
.../1.0.3/commons-logging-1.0.3.pom.sha1 | 0
...logging-1.0.4-javadoc-resources.jar.lastUpdated | 0
.../1.0.4/commons-logging-1.0.4.jar | Bin
.../1.0.4/commons-logging-1.0.4.jar.sha1 | 0
.../1.0.4/commons-logging-1.0.4.pom | 0
.../1.0.4/commons-logging-1.0.4.pom.sha1 | 0
.../apiv4-repo}/org/apache/apache/3/apache-3.pom | 0
.../org/apache/apache/3/apache-3.pom.md5 | 0
.../org/apache/apache/3/apache-3.pom.sha1 | 0
.../3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar | Bin
.../maven-artifact-3.0-SNAPSHOT.jar.md5 | 0
.../maven-artifact-3.0-SNAPSHOT.jar.sha1 | 0
.../3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom | 0
.../maven-artifact-3.0-SNAPSHOT.pom.md5 | 0
.../maven-artifact-3.0-SNAPSHOT.pom.sha1 | 0
.../test/test-extension/1/test-extension-1.jar | Bin
.../test/test-extension/1/test-extension-1.pom | 0
.../test/test-extension/1/test-extension-1.pom.md5 | 0
.../test-extension/1/test-extension-1.pom.sha1 | 0
.../1/test-lifecycle-and-artifactHandler-1.jar | Bin
.../1/test-lifecycle-and-artifactHandler-1.pom | 0
.../1/test-lifecycle-and-artifactHandler-1.pom.md5 | 0
.../test-lifecycle-and-artifactHandler-1.pom.sha1 | 0
.../apache/maven/maven-parent/4/maven-parent-4.pom | 0
.../maven/maven-parent/4/maven-parent-4.pom.md5 | 0
.../maven/maven-parent/4/maven-parent-4.pom.sha1 | 0
.../apache/maven/maven-parent/5/maven-parent-5.pom | 0
.../maven/maven-parent/5/maven-parent-5.pom.md5 | 0
.../maven/maven-parent/5/maven-parent-5.pom.sha1 | 0
.../1.0-beta-2/wagon-provider-api-1.0-beta-2.jar | Bin
.../wagon-provider-api-1.0-beta-2.jar.md5 | 0
.../wagon-provider-api-1.0-beta-2.jar.sha1 | 0
.../1.0-beta-2/wagon-provider-api-1.0-beta-2.pom | 0
.../wagon-provider-api-1.0-beta-2.pom.md5 | 0
.../wagon-provider-api-1.0-beta-2.pom.sha1 | 0
.../1.0-beta-2/wagon-providers-1.0-beta-2.pom | 0
.../1.0-beta-2/wagon-providers-1.0-beta-2.pom.md5 | 0
.../1.0-beta-2/wagon-providers-1.0-beta-2.pom.sha1 | 0
.../1.0-beta-2/wagon-webdav-1.0-beta-2.jar | Bin
.../1.0-beta-2/wagon-webdav-1.0-beta-2.jar.md5 | 0
.../1.0-beta-2/wagon-webdav-1.0-beta-2.jar.sha1 | 0
.../1.0-beta-2/wagon-webdav-1.0-beta-2.pom | 0
.../1.0-beta-2/wagon-webdav-1.0-beta-2.pom.md5 | 0
.../1.0-beta-2/wagon-webdav-1.0-beta-2.pom.sha1 | 0
.../wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom | 0
.../wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5 | 0
.../wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1 | 0
.../plexus-active-collections-1.0-beta-1.jar | Bin
.../plexus-active-collections-1.0-beta-1.jar.md5 | 0
.../plexus-active-collections-1.0-beta-1.jar.sha1 | 0
.../plexus-active-collections-1.0-beta-1.pom | 0
.../plexus-active-collections-1.0-beta-1.pom.md5 | 0
.../plexus-active-collections-1.0-beta-1.pom.sha1 | 0
.../plexus-classworlds-1.2-alpha-10.jar | Bin
.../plexus-classworlds-1.2-alpha-10.jar.md5 | 0
.../plexus-classworlds-1.2-alpha-10.jar.sha1 | 0
.../plexus-classworlds-1.2-alpha-10.pom | 0
.../plexus-classworlds-1.2-alpha-10.pom.md5 | 0
.../plexus-classworlds-1.2-alpha-10.pom.sha1 | 0
.../1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar | Bin
.../plexus-classworlds-1.2-alpha-7.jar.md5 | 0
.../plexus-classworlds-1.2-alpha-7.jar.sha1 | 0
.../1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom | 0
.../plexus-classworlds-1.2-alpha-7.pom.md5 | 0
.../plexus-classworlds-1.2-alpha-7.pom.sha1 | 0
.../plexus-component-api-1.0-alpha-16.jar | Bin
.../plexus-component-api-1.0-alpha-16.jar.md5 | 0
.../plexus-component-api-1.0-alpha-16.jar.sha1 | 0
.../plexus-component-api-1.0-alpha-16.pom | 0
.../plexus-component-api-1.0-alpha-16.pom.md5 | 0
.../plexus-component-api-1.0-alpha-16.pom.sha1 | 0
.../plexus-component-api-1.0-alpha-32.jar | Bin
.../plexus-component-api-1.0-alpha-32.jar.md5 | 0
.../plexus-component-api-1.0-alpha-32.jar.sha1 | 0
.../plexus-component-api-1.0-alpha-32.pom | 0
.../plexus-component-api-1.0-alpha-32.pom.md5 | 0
.../plexus-component-api-1.0-alpha-32.pom.sha1 | 0
.../1.1.6/plexus-components-1.1.6.pom | 0
.../1.1.6/plexus-components-1.1.6.pom.md5 | 0
.../1.1.6/plexus-components-1.1.6.pom.sha1 | 0
.../plexus-container-default-1.0-alpha-16.jar | Bin
.../plexus-container-default-1.0-alpha-16.jar.md5 | 0
.../plexus-container-default-1.0-alpha-16.jar.sha1 | 0
.../plexus-container-default-1.0-alpha-16.pom | 0
.../plexus-container-default-1.0-alpha-16.pom.md5 | 0
.../plexus-container-default-1.0-alpha-16.pom.sha1 | 0
.../plexus-container-default-1.0-alpha-32.jar | Bin
.../plexus-container-default-1.0-alpha-32.jar.md5 | 0
.../plexus-container-default-1.0-alpha-32.jar.sha1 | 0
.../plexus-container-default-1.0-alpha-32.pom | 0
.../plexus-container-default-1.0-alpha-32.pom.md5 | 0
.../plexus-container-default-1.0-alpha-32.pom.sha1 | 0
.../plexus-containers-1.0-alpha-16.pom | 0
.../plexus-containers-1.0-alpha-16.pom.md5 | 0
.../plexus-containers-1.0-alpha-16.pom.sha1 | 0
.../plexus-containers-1.0-alpha-32.pom | 0
.../plexus-containers-1.0-alpha-32.pom.md5 | 0
.../plexus-containers-1.0-alpha-32.pom.sha1 | 0
.../plexus-utils/1.0.4/plexus-utils-1.0.4.jar | Bin
.../plexus-utils/1.0.4/plexus-utils-1.0.4.jar.sha1 | 0
.../plexus-utils/1.0.4/plexus-utils-1.0.4.pom | 0
.../plexus-utils/1.0.4/plexus-utils-1.0.4.pom.sha1 | 0
.../plexus/plexus-utils/1.1/plexus-utils-1.1.jar | Bin
.../plexus-utils/1.1/plexus-utils-1.1.jar.md5 | 0
.../plexus-utils/1.1/plexus-utils-1.1.jar.sha1 | 0
.../plexus/plexus-utils/1.1/plexus-utils-1.1.pom | 0
.../plexus-utils/1.1/plexus-utils-1.1.pom.md5 | 0
.../plexus-utils/1.1/plexus-utils-1.1.pom.sha1 | 0
.../plexus-utils/1.4.5/plexus-utils-1.4.5.jar | Bin
.../plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5 | 0
.../plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1 | 0
.../plexus-utils/1.4.5/plexus-utils-1.4.5.pom | 0
.../plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5 | 0
.../plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1 | 0
.../plexus/plexus/1.0.10/plexus-1.0.10.pom | 0
.../plexus/plexus/1.0.10/plexus-1.0.10.pom.md5 | 0
.../plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1 | 0
.../plexus/plexus/1.0.11/plexus-1.0.11.pom | 0
.../plexus/plexus/1.0.11/plexus-1.0.11.pom.md5 | 0
.../plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1 | 0
.../codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom | 0
.../plexus/plexus/1.0.4/plexus-1.0.4.pom.md5 | 0
.../plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1 | 0
.../codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom | 0
.../plexus/plexus/1.0.8/plexus-1.0.8.pom.md5 | 0
.../plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1 | 0
.../codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom | 0
.../plexus/plexus/1.0.9/plexus-1.0.9.pom.md5 | 0
.../plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1 | 0
...rest-core-1.3-javadoc-resources.jar.lastUpdated | 0
.../1.3/hamcrest-core-1.3-javadoc.jar | Bin
.../1.3/hamcrest-core-1.3-javadoc.jar.sha1 | 0
.../1.3/hamcrest-core-1.3-sources.jar | Bin
.../1.3/hamcrest-core-1.3-sources.jar.sha1 | 0
.../hamcrest-core/1.3/hamcrest-core-1.3.jar | Bin
.../hamcrest-core/1.3/hamcrest-core-1.3.jar.sha1 | 0
.../hamcrest-core/1.3/hamcrest-core-1.3.pom | 0
.../hamcrest-core/1.3/hamcrest-core-1.3.pom.sha1 | 0
.../hamcrest-parent/1.3/hamcrest-parent-1.3.pom | 0
.../1.3/hamcrest-parent-1.3.pom.sha1 | 0
.../maven/plugin/descriptor/MojoDescriptor.java | 14 +-
.../plugin/descriptor/PluginDescriptorBuilder.java | 7 +
pom.xml | 1 -
220 files changed, 455 insertions(+), 796 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Project.java b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
index d8cb6f0..9fa9c79 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Project.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
@@ -68,4 +68,6 @@ public interface Project
{
return getModel().getId();
}
+
+ boolean isExecutionRoot();
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
index a354458..949a50e 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ArtifactManager.java
@@ -32,18 +32,19 @@ public interface ArtifactManager extends Service
{
/**
- * Returns the path to the resolved file in the local repository
- * if the artifact has been resolved.
- *
- * @return the path of the resolved artifact
+ * Returns the path of the file previously associated to this artifact
+ * or <code>Optional.empty()</code> if no path has been associated.
*/
@Nonnull
- Optional<Path> getPath( Artifact artifact );
+ Optional<Path> getPath( @Nonnull Artifact artifact );
- void setPath( Artifact artifact, Path path );
+ /**
+ * Associates the given file path to the artifact.
+ */
+ void setPath( @Nonnull Artifact artifact, Path path );
@Nonnull
- Collection<Metadata> getAttachedMetadatas( Artifact artifact );
+ Collection<Metadata> getAttachedMetadatas( @Nonnull Artifact artifact );
void attachMetadata( @Nonnull Artifact artifact, @Nonnull Metadata metadata );
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java
deleted file mode 100644
index 5f21e4c..0000000
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.apache.maven.api.services;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.api.RemoteRepository;
-import org.apache.maven.api.Session;
-import org.apache.maven.api.Project;
-
-/**
- * This defines the interface to deploy a single Maven Project.
- *
- * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
- */
-public interface ProjectDeployer extends Service
-{
- /**
- * This will deploy a single project which may contain several artifacts. Those artifacts will be deployed into the
- * appropriate remote repository.
- *
- * <pre class="java">
- * @Parameter( defaultValue = "${session}", required = true, readonly = true )
- * MavenSession session;
- * @Parameter( defaultValue = "${project}", required = true, readonly = true )
- * MavenProject project;
- * ..
- * @Component
- * ProjectDeployer deployer;
- * ...
- * public void execute()
- * {
- * ProjectDeployerRequest pdr =
- * new ProjectDeployerRequest()
- * .setProject( project );
- *
- * deployer.deploy( session.getProjectBuildingRequest(), pdr, artifactRepository );
- * }
- * </pre>
- *
- * @param request {@link ProjectDeployerRequest}
- * @throws ProjectDeployerException in case of artifact could not correctly deployed.
- * @throws IllegalArgumentException in case <code>buildingRequest</code> is <code>null</code>, <code>request</code>
- * is <code>null</code> or <code>artifactRepository</code> is <code>null</code>.
- */
- void deploy( ProjectDeployerRequest request )
- throws ProjectDeployerException, IllegalArgumentException;
-
- default void deploy( Session session, Project project, RemoteRepository repository )
- throws ProjectDeployerException, IllegalArgumentException
- {
- deploy( ProjectDeployerRequest.build( session, project, repository ) );
- }
-}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java
deleted file mode 100644
index fd8ceb3..0000000
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.maven.api.services;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * The Exception class in case a resolving does not work.
- */
-public class ProjectDeployerException
- extends MavenException
-{
- /**
- * @param message The message to give.
- * @param e The {@link Exception}.
- */
- public ProjectDeployerException( String message, Exception e )
- {
- super( message, e );
- }
-
-}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java
deleted file mode 100644
index e343e86..0000000
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectDeployerRequest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package org.apache.maven.api.services;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.annotation.Nonnull;
-
-import org.apache.maven.api.Session;
-import org.apache.maven.api.Project;
-import org.apache.maven.api.RemoteRepository;
-
-public interface ProjectDeployerRequest
-{
- @Nonnull
- Session getSession();
-
- @Nonnull
- Project getProject();
-
- @Nonnull
- RemoteRepository getRepository();
-
- int getRetryFailedDeploymentCount();
-
- static ProjectDeployerRequest build( Session session, Project project, RemoteRepository repository )
- {
- return builder()
- .session( session )
- .project( project )
- .repository( repository )
- .build();
- }
-
- static ProjectDeployerRequestBuilder builder()
- {
- return new ProjectDeployerRequestBuilder();
- }
-
- class ProjectDeployerRequestBuilder
- {
- Session session;
- Project project;
- RemoteRepository repository;
- int retryFailedDeploymentCount;
-
- @Nonnull
- public ProjectDeployerRequestBuilder session( @Nonnull Session session )
- {
- this.session = session;
- return this;
- }
-
- @Nonnull
- public ProjectDeployerRequestBuilder project( @Nonnull Project project )
- {
- this.project = project;
- return this;
- }
-
- @Nonnull
- public ProjectDeployerRequestBuilder repository( @Nonnull RemoteRepository repository )
- {
- this.repository = repository;
- return this;
- }
-
- @Nonnull
- public ProjectDeployerRequestBuilder retryFailedDeploymentCount( int retryFailedDeploymentCount )
- {
- this.retryFailedDeploymentCount = retryFailedDeploymentCount;
- return this;
- }
-
- public ProjectDeployerRequest build()
- {
- return new DefaultProjectDeployerRequest( session, project, repository, retryFailedDeploymentCount );
- }
-
- private static class DefaultProjectDeployerRequest extends BaseRequest
- implements ProjectDeployerRequest
- {
- private final Project project;
- private final RemoteRepository repository;
- private final int retryFailedDeploymentCount;
-
- DefaultProjectDeployerRequest( @Nonnull Session session,
- @Nonnull Project project,
- @Nonnull RemoteRepository repository,
- int retryFailedDeploymentCount )
- {
- super( session );
- this.project = requireNonNull( project, "project" );
- this.repository = requireNonNull( repository, "repository" );
- this.retryFailedDeploymentCount = retryFailedDeploymentCount;
- }
-
- @Nonnull
- @Override
- public Project getProject()
- {
- return project;
- }
-
- @Nonnull
- @Override
- public RemoteRepository getRepository()
- {
- return repository;
- }
-
- @Override
- public int getRetryFailedDeploymentCount()
- {
- return retryFailedDeploymentCount;
- }
- }
- }
-}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstaller.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstaller.java
deleted file mode 100644
index 0095bed..0000000
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstaller.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.apache.maven.api.services;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.api.Session;
-import org.apache.maven.api.Project;
-
-/**
- * This defines the interface to install a single Maven Project.
- *
- * @author Karl Heinz Marbaise <a href="mailto:khmarbaise@apache.org">khmarbaise@apache.org</a>
- */
-public interface ProjectInstaller extends Service
-{
- /**
- * This will install a single project which may contain several artifacts. Those artifacts will be installed into
- * the appropriate repository.
- *
- * <pre class="java">
- * @Parameter( defaultValue = "${session}", required = true, readonly = true )
- * private MavenSession session;
- * @Parameter( defaultValue = "${project}", required = true, readonly = true )
- * private MavenProject project;
- * ..
- * @Component
- * private ProjectInstaller installer;
- * ...
- * public void execute()
- * {
- * ProjectInstallerRequest pir =
- * new ProjectInstallerRequest()
- * .setProject( mavenProject );
- *
- * installer.install( session.getProjectBuildingRequest(), pir );
- * }
- * </pre>
- *
- * To set a different local repository than the current one in the Maven session, you can inject an instance of the
- * <code>RepositoryManager</code> and set the path to the local repository, called <code>localRepositoryPath</code>,
- * as such:
- *
- * <pre class="java">
- * @Component
- * private RepositoryManager repositoryManager;
- *
- * buildingRequest = repositoryManager.setLocalRepositoryBasedir( buildingRequest, localRepositoryPath );
- * </pre>
- *
- * @param request {@link ProjectInstallerRequest}
- * @throws ProjectInstallerException In case of problems to install artifacts.
- * @throws IllegalArgumentException in case of parameter <code>projectBuildingRequest</code> is <code>null</code> or
- * parameter <code>projectInstallerRequest</code> is <code>null</code>.
- */
- void install( ProjectInstallerRequest request )
- throws ProjectInstallerException, IllegalArgumentException;
-
- default void install( Session session, Project project )
- throws ProjectInstallerException, IllegalArgumentException
- {
- install( ProjectInstallerRequest.build( session, project ) );
- }
-}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java
deleted file mode 100644
index f1c160f..0000000
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.maven.api.services;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * The Exception class in case a resolving does not work.
- */
-public class ProjectInstallerException
- extends MavenException
-{
- /**
- * @param message The message to give.
- * @param e The {@link Exception}.
- */
- public ProjectInstallerException( String message, Exception e )
- {
- super( message, e );
- }
-
-}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerRequest.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerRequest.java
deleted file mode 100644
index ca545b8..0000000
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectInstallerRequest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.apache.maven.api.services;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.annotation.Nonnull;
-
-import org.apache.maven.api.Session;
-import org.apache.maven.api.Project;
-
-/**
- * @author Guillaume Nodet
- */
-
-public interface ProjectInstallerRequest
-{
-
- @Nonnull
- Session getSession();
-
- @Nonnull
- Project getProject();
-
- @Nonnull
- static ProjectInstallerRequest build( @Nonnull Session session, @Nonnull Project project )
- {
- return builder()
- .session( session )
- .project( project )
- .build();
- }
-
- @Nonnull
- static ProjectInstallerRequestBuilder builder()
- {
- return new ProjectInstallerRequestBuilder();
- }
-
- class ProjectInstallerRequestBuilder
- {
- Session session;
- Project project;
-
- @Nonnull
- public ProjectInstallerRequestBuilder session( Session session )
- {
- this.session = session;
- return this;
- }
-
- @Nonnull
- public ProjectInstallerRequestBuilder project( Project project )
- {
- this.project = project;
- return this;
- }
-
- @Nonnull
- public ProjectInstallerRequest build()
- {
- return new DefaultProjectInstallerRequest( session, project );
- }
-
- private static class DefaultProjectInstallerRequest extends BaseRequest
- implements ProjectInstallerRequest
- {
-
- final Project project;
-
- DefaultProjectInstallerRequest( @Nonnull Session session, @Nonnull Project project )
- {
- super( session );
- this.project = requireNonNull( project, "project" );
- }
-
- @Nonnull
- @Override
- public Project getProject()
- {
- return project;
- }
- }
- }
-
-}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
index 8b6e96b..ccc58c2 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/services/ProjectManager.java
@@ -30,6 +30,7 @@ import org.apache.maven.api.Artifact;
import org.apache.maven.api.Node;
import org.apache.maven.api.Project;
import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.api.Session;
/**
* Interface to manage the project during its lifecycle
@@ -48,12 +49,19 @@ public interface ProjectManager extends Service
@Nonnull
Collection<Artifact> getAttachedArtifacts( Project project );
- default void attachArtifact( Project project, String type, Path path )
+ default void attachArtifact( Session session, Project project, String type, Path path )
{
- attachArtifact( project, type, "", path );
+ attachArtifact( session, project, type, "", path );
}
- void attachArtifact( Project project, String type, String classifier, Path path );
+ default void attachArtifact( Session session, Project project, String type, String classifier, Path path )
+ {
+ Artifact artifact = session.createArtifact( project.getGroupId(), project.getArtifactId(),
+ classifier, project.getVersion(), type );
+ attachArtifact( project, artifact, path );
+ }
+
+ void attachArtifact( Project project, Artifact artifact, Path path );
List<String> getCompileSourceRoots( Project project );
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectDeployer.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectDeployer.java
deleted file mode 100644
index b8aabd6..0000000
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectDeployer.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package org.apache.maven.impl;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.annotation.Nonnull;
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.apache.maven.api.Artifact;
-import org.apache.maven.api.services.ArtifactManager;
-import org.apache.maven.api.services.ProjectDeployer;
-import org.apache.maven.api.services.ProjectDeployerException;
-import org.apache.maven.api.services.ProjectDeployerRequest;
-import org.apache.maven.api.services.ProjectManager;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.deployment.DeployRequest;
-import org.eclipse.aether.deployment.DeployResult;
-import org.eclipse.aether.deployment.DeploymentException;
-import org.eclipse.aether.metadata.Metadata;
-
-@Named
-public class DefaultProjectDeployer implements ProjectDeployer
-{
-
- private final RepositorySystem repositorySystem;
-
- @Inject
- DefaultProjectDeployer( @Nonnull RepositorySystem repositorySystem )
- {
- this.repositorySystem = repositorySystem;
- }
-
- @Override
- public void deploy( ProjectDeployerRequest request ) throws ProjectDeployerException, IllegalArgumentException
- {
- DefaultSession session = ( DefaultSession ) request.getSession();
- try
- {
- ArtifactManager artifactManager = session.getService( ArtifactManager.class );
- Collection<Artifact> artifacts = session.getService( ProjectManager.class )
- .getAttachedArtifacts( request.getProject() );
- List<Metadata> metadatas = artifacts.stream()
- .map( artifactManager::getAttachedMetadatas )
- .flatMap( Collection::stream )
- .map( session::toMetadata )
- .collect( Collectors.toList() );
- DeployRequest deployRequest = new DeployRequest()
- .setRepository( session.toRepository( request.getRepository() ) )
- .setArtifacts( session.toArtifacts( artifacts ) )
- .setMetadata( metadatas );
-
- DeployResult result = repositorySystem.deploy( session.getSession(), deployRequest );
- }
- catch ( DeploymentException e )
- {
- throw new ProjectDeployerException( "Unable to deploy project", e );
- }
- }
-
- void dumb()
- {
- /*
- Artifact artifact = projectDeployerRequest.getProject().getArtifact();
- String packaging = projectDeployerRequest.getProject().getPackaging();
- File pomFile = projectDeployerRequest.getProject().getFile();
-
- List<Artifact> attachedArtifacts = projectDeployerRequest.getProject().getAttachedArtifacts();
-
- // Deploy the POM
- boolean isPomArtifact = "pom".equals( packaging );
- if ( isPomArtifact )
- {
- artifact.setFile( pomFile );
- }
- else
- {
- ProjectArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pomFile );
- artifact.addMetadata( metadata );
- }
-
- // What consequence does this have?
- // artifact.setRelease( true );
-
- artifact.setRepository( artifactRepository );
-
- int retryFailedDeploymentCount = projectDeployerRequest.getRetryFailedDeploymentCount();
-
- List<Artifact> deployableArtifacts = new ArrayList<>();
- if ( isPomArtifact )
- {
- deployableArtifacts.add( artifact );
- }
- else
- {
- File file = artifact.getFile();
-
- if ( file != null && file.isFile() )
- {
- deployableArtifacts.add( artifact );
- }
- else if ( !attachedArtifacts.isEmpty() )
- {
- // TODO: Reconsider this exception? Better Exception type?
- throw new NoFileAssignedException( "The packaging plugin for this project did not assign "
- + "a main file to the project but it has attachments. Change packaging to 'pom'." );
- }
- else
- {
- // TODO: Reconsider this exception? Better Exception type?
- throw new NoFileAssignedException( "The packaging for this project did not assign "
- + "a file to the build artifact" );
- }
- }
-
- deployableArtifacts.addAll( attachedArtifacts );
-
- deploy( buildingRequest, deployableArtifacts, artifactRepository, retryFailedDeploymentCount );
-
- */
- }
-}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectInstaller.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectInstaller.java
deleted file mode 100644
index ed87e56..0000000
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectInstaller.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.apache.maven.impl;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.apache.maven.api.Artifact;
-import org.apache.maven.api.services.ArtifactManager;
-import org.apache.maven.api.services.ProjectInstaller;
-import org.apache.maven.api.services.ProjectInstallerException;
-import org.apache.maven.api.services.ProjectInstallerRequest;
-import org.apache.maven.api.services.ProjectManager;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.installation.InstallRequest;
-import org.eclipse.aether.installation.InstallResult;
-import org.eclipse.aether.installation.InstallationException;
-import org.eclipse.aether.metadata.Metadata;
-
-@Named
-public class DefaultProjectInstaller implements ProjectInstaller
-{
- private final RepositorySystem repositorySystem;
-
- @Inject
- DefaultProjectInstaller( RepositorySystem repositorySystem )
- {
- this.repositorySystem = repositorySystem;
- }
-
- @Override
- public void install( ProjectInstallerRequest request ) throws ProjectInstallerException, IllegalArgumentException
- {
- DefaultSession session = ( DefaultSession ) request.getSession();
- try
- {
- ArtifactManager artifactManager = session.getService( ArtifactManager.class );
- Collection<Artifact> artifacts = session.getService( ProjectManager.class )
- .getAttachedArtifacts( request.getProject() );
- List<Metadata> metadatas = artifacts.stream()
- .map( artifactManager::getAttachedMetadatas )
- .flatMap( Collection::stream )
- .map( session::toMetadata )
- .collect( Collectors.toList() );
- InstallRequest installRequest = new InstallRequest()
- .setArtifacts( session.toArtifacts( artifacts ) )
- .setMetadata( metadatas );
-
- InstallResult result = repositorySystem.install( session.getSession(), installRequest );
- }
- catch ( InstallationException e )
- {
- throw new ProjectInstallerException( "Unable to install project", e );
- }
- }
-}
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index 39f2e5f..4789889 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -85,6 +85,10 @@ under the License.
<artifactId>maven-resolver-provider</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
</dependency>
diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
index a43d0d3..65bf646 100644
--- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
+++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
@@ -19,6 +19,7 @@ package org.apache.maven;
* under the License.
*/
+import org.apache.maven.api.Session;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.execution.BuildResumptionAnalyzer;
import org.apache.maven.execution.BuildResumptionDataRepository;
@@ -32,6 +33,7 @@ import org.apache.maven.execution.ProfileActivation;
import org.apache.maven.execution.ProjectDependencyGraph;
import org.apache.maven.graph.GraphBuilder;
import org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory;
+import org.apache.maven.internal.impl.DefaultSessionFactory;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.lifecycle.internal.ExecutionEventCatapult;
import org.apache.maven.lifecycle.internal.LifecycleStarter;
@@ -107,6 +109,8 @@ public class DefaultMaven
private final SuperPomProvider superPomProvider;
+ private final DefaultSessionFactory defaultSessionFactory;
+
@Inject
@SuppressWarnings( "checkstyle:ParameterNumber" )
public DefaultMaven(
@@ -120,7 +124,8 @@ public class DefaultMaven
@Named( GraphBuilder.HINT ) GraphBuilder graphBuilder,
BuildResumptionAnalyzer buildResumptionAnalyzer,
BuildResumptionDataRepository buildResumptionDataRepository,
- SuperPomProvider superPomProvider )
+ SuperPomProvider superPomProvider,
+ DefaultSessionFactory defaultSessionFactory )
{
this.projectBuilder = projectBuilder;
this.lifecycleStarter = lifecycleStarter;
@@ -133,6 +138,7 @@ public class DefaultMaven
this.buildResumptionAnalyzer = buildResumptionAnalyzer;
this.buildResumptionDataRepository = buildResumptionDataRepository;
this.superPomProvider = superPomProvider;
+ this.defaultSessionFactory = defaultSessionFactory;
}
@Override
@@ -224,8 +230,10 @@ public class DefaultMaven
DefaultRepositorySystemSession repoSession =
(DefaultRepositorySystemSession) newRepositorySession( request );
MavenSession session = new MavenSession( container, repoSession, request, result );
+ session.setSession( defaultSessionFactory.getSession( session ) );
sessionScope.seed( MavenSession.class, session );
+ sessionScope.seed( Session.class, session.getSession() );
legacySupport.setSession( session );
diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
index c2f0c89..f6d0409 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
@@ -28,6 +28,7 @@ import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import org.apache.maven.api.Session;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.RepositoryCache;
import org.apache.maven.monitor.event.EventDispatcher;
@@ -297,6 +298,8 @@ public class MavenSession
private final Settings settings;
+ private Session session;
+
@Deprecated
/** @deprecated This appears not to be used anywhere within Maven itself. */
public Map<String, MavenProject> getProjectMap()
@@ -439,5 +442,14 @@ public class MavenSession
return container.lookupMap( role );
}
+ public Session getSession()
+ {
+ return session;
+ }
+
+ public void setSession( Session session )
+ {
+ this.session = session;
+ }
/*end[MAVEN4]*/
}
diff --git a/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionEvent.java b/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionEvent.java
index 85a58cb..1426083 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionEvent.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionEvent.java
@@ -19,7 +19,6 @@ package org.apache.maven.execution;
* under the License.
*/
-import org.apache.maven.plugin.Mojo;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.project.MavenProject;
@@ -42,17 +41,17 @@ public class MojoExecutionEvent
private final MojoExecution mojoExecution;
- private final Mojo mojo;
+ private final Object mojo;
private final Throwable cause;
- public MojoExecutionEvent( MavenSession session, MavenProject project, MojoExecution mojoExecution, Mojo mojo )
+ public MojoExecutionEvent( MavenSession session, MavenProject project, MojoExecution mojoExecution, Object mojo )
{
this( session, project, mojoExecution, mojo, null );
}
- public MojoExecutionEvent( MavenSession session, MavenProject project, MojoExecution mojoExecution, Mojo mojo,
- Throwable cause )
+ public MojoExecutionEvent( MavenSession session, MavenProject project, MojoExecution mojoExecution,
+ Object mojo, Throwable cause )
{
this.session = session;
this.project = project;
@@ -76,7 +75,7 @@ public class MojoExecutionEvent
return mojoExecution;
}
- public Mojo getMojo()
+ public Object getMojo()
{
return mojo;
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifact.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifact.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
index 5f5917c..fd902fb 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifact.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactDeployer.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactDeployer.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactDeployer.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactDeployer.java
index bc4d9a2..9dde305 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactDeployer.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactDeployer.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactFactory.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactFactory.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactFactory.java
index c1fa7ca..c0a6f6c 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactFactory.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactInstaller.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java
similarity index 99%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactInstaller.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java
index 2c45534..f9df047 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactInstaller.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
new file mode 100644
index 0000000..6d7706f
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactManager.java
@@ -0,0 +1,89 @@
+package org.apache.maven.internal.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+import javax.inject.Named;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.regex.Pattern;
+
+import org.apache.maven.SessionScoped;
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Metadata;
+import org.apache.maven.api.services.ArtifactManager;
+
+@Named
+@SessionScoped
+public class DefaultArtifactManager implements ArtifactManager
+{
+ private static final String SNAPSHOT = "SNAPSHOT";
+ private static final Pattern SNAPSHOT_TIMESTAMP = Pattern.compile( "^(.*-)?([0-9]{8}\\.[0-9]{6}-[0-9]+)$" );
+
+
+ private final Map<Artifact, Path> paths = new ConcurrentHashMap<>();
+ private final Map<Artifact, Collection<Metadata>> metadatas = new ConcurrentHashMap<>();
+
+ @Nonnull
+ @Override
+ public Optional<Path> getPath( @Nonnull Artifact artifact )
+ {
+ return Optional.ofNullable( paths.get( artifact ) );
+ }
+
+ @Override
+ public void setPath( @Nonnull Artifact artifact, Path path )
+ {
+ if ( path == null )
+ {
+ paths.remove( artifact );
+ }
+ else
+ {
+ paths.put( artifact, path );
+ }
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Metadata> getAttachedMetadatas( @Nonnull Artifact artifact )
+ {
+ Collection<Metadata> m = metadatas.get( artifact );
+ return m != null ? Collections.unmodifiableCollection( m ) : Collections.emptyList();
+ }
+
+ @Override
+ public void attachMetadata( @Nonnull Artifact artifact, @Nonnull Metadata metadata )
+ {
+ metadatas.computeIfAbsent( artifact, a -> new CopyOnWriteArrayList<>() ).add( metadata );
+ }
+
+ @Override
+ public boolean isSnapshot( String version )
+ {
+ return version.endsWith( SNAPSHOT ) || SNAPSHOT_TIMESTAMP.matcher( version ).matches();
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactResolver.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactResolver.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactResolver.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactResolver.java
index 0f87137..a084055 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultArtifactResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifactResolver.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependency.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependency.java
index 5822d8c..190ab9e 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependency.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependency.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyCollector.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyCollector.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyCollector.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyCollector.java
index 469b541..74045d6 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyCollector.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyCollector.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyFactory.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyFactory.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyFactory.java
index 7424b22..aa83ffb 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyFactory.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolver.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java
similarity index 99%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolver.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java
index ab7af8c..e520512 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultDependencyResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepository.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepository.java
similarity index 92%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepository.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepository.java
index 5867af8..2207bb9 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepository.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepository.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -33,7 +33,7 @@ public class DefaultLocalRepository implements LocalRepository
private final org.eclipse.aether.repository.LocalRepository repository;
@Inject
- DefaultLocalRepository( @Nonnull org.eclipse.aether.repository.LocalRepository repository )
+ public DefaultLocalRepository( @Nonnull org.eclipse.aether.repository.LocalRepository repository )
{
this.repository = Objects.requireNonNull( repository, "repository" );
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepositoryManager.java
similarity index 87%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepositoryManager.java
index 00ac3dc..54d6c06 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultLocalRepositoryManager.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -27,7 +27,6 @@ import org.apache.maven.api.Metadata;
import org.apache.maven.api.RemoteRepository;
import org.apache.maven.api.Session;
import org.apache.maven.api.services.LocalRepositoryManager;
-import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
public class DefaultLocalRepositoryManager implements LocalRepositoryManager
{
@@ -71,15 +70,8 @@ public class DefaultLocalRepositoryManager implements LocalRepositoryManager
private org.eclipse.aether.repository.LocalRepositoryManager getManager(
DefaultSession session, LocalRepository local )
{
- try
- {
- return session.getLocalRepositoryProvider()
- .newLocalRepositoryManager( session.getSession(), session.toRepository( local ) );
- }
- catch ( NoLocalRepositoryManagerException e )
- {
- throw new IllegalStateException( e );
- }
+ return session.getRepositorySystem()
+ .newLocalRepositoryManager( session.getSession(), session.toRepository( local ) );
}
}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultNode.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultNode.java
index 85d95b4..375758c 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultNode.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultNode.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
similarity index 93%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
index bc0de16..e15386b 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProject.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -27,6 +27,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import org.apache.maven.RepositoryUtils;
import org.apache.maven.api.Artifact;
import org.apache.maven.api.Dependency;
import org.apache.maven.api.Exclusion;
@@ -72,8 +73,7 @@ public class DefaultProject implements Project
@Override
public Artifact getArtifact()
{
- // TODO
- throw new UnsupportedOperationException( "Not implemented yet" );
+ return session.getArtifact( RepositoryUtils.toArtifact( project.getArtifact() ) );
}
@Nonnull
@@ -94,8 +94,7 @@ public class DefaultProject implements Project
@Override
public Path getPomPath()
{
- // TODO
- throw new UnsupportedOperationException( "Not implemented yet" );
+ return project.getFile().toPath();
}
@Nonnull
@@ -117,6 +116,12 @@ public class DefaultProject implements Project
return Collections.emptyList();
}
+ @Override
+ public boolean isExecutionRoot()
+ {
+ return project.isExecutionRoot();
+ }
+
private Dependency toDependency( org.apache.maven.model.Dependency dependency )
{
return new Dependency()
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectBuilder.java
similarity index 99%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectBuilder.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectBuilder.java
index e287ccf..819d35d 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultProjectBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectBuilder.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
new file mode 100644
index 0000000..aeb0c9e
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
@@ -0,0 +1,99 @@
+package org.apache.maven.internal.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+
+import org.apache.maven.api.Artifact;
+import org.apache.maven.api.Node;
+import org.apache.maven.api.Project;
+import org.apache.maven.api.RemoteRepository;
+import org.apache.maven.api.services.ProjectManager;
+
+public class DefaultProjectManager implements ProjectManager
+{
+
+ @Nonnull
+ @Override
+ public Optional<Path> getPath( Project project )
+ {
+ return Optional.empty();
+ }
+
+ @Nonnull
+ @Override
+ public Collection<Artifact> getAttachedArtifacts( Project project )
+ {
+ return null;
+ }
+
+ @Override
+ public void attachArtifact( Project project, Artifact artifact, Path path )
+ {
+
+ }
+
+ @Override
+ public List<String> getCompileSourceRoots( Project project )
+ {
+ return null;
+ }
+
+ @Override
+ public void addCompileSourceRoot( Project project, String sourceRoot )
+ {
+
+ }
+
+ @Override
+ public List<String> getTestCompileSourceRoots( Project project )
+ {
+ return null;
+ }
+
+ @Override
+ public void addTestCompileSourceRoot( Project project, String sourceRoot )
+ {
+
+ }
+
+ @Override
+ public List<RemoteRepository> getRepositories( Project project )
+ {
+ return null;
+ }
+
+ @Override
+ public List<Artifact> getResolvedDependencies( Project project, ResolutionScope scope )
+ {
+ return null;
+ }
+
+ @Override
+ public Node getCollectedDependencies( Project project, ResolutionScope scope )
+ {
+ return null;
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRemoteRepository.java
similarity index 97%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRemoteRepository.java
index 713619e..68bc32d 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRemoteRepository.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRemoteRepository.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
similarity index 98%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
index 6198946..e6595f7 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultRepositoryFactory.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultRepositoryFactory.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
similarity index 86%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
index 291ea13..72c6dba 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultSession.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -35,9 +35,12 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Supplier;
import java.util.stream.Collectors;
+import org.apache.maven.RepositoryUtils;
import org.apache.maven.api.Listener;
import org.apache.maven.api.SessionData;
+import org.apache.maven.api.services.ArtifactManager;
import org.apache.maven.api.services.LocalRepositoryManager;
+import org.apache.maven.api.services.ProjectManager;
import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.api.services.Service;
import org.apache.maven.api.Session;
@@ -61,29 +64,25 @@ import org.apache.maven.api.services.DependencyCollector;
import org.apache.maven.api.services.DependencyFactory;
import org.apache.maven.api.services.DependencyResolver;
import org.apache.maven.api.services.ProjectBuilder;
-import org.apache.maven.api.services.ProjectDeployer;
-import org.apache.maven.api.services.ProjectInstaller;
import org.apache.maven.settings.Settings;
import org.apache.maven.toolchain.DefaultToolchainManagerPrivate;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
-import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory;
-import org.eclipse.aether.impl.LocalRepositoryProvider;
public class DefaultSession implements Session
{
+ private final MavenSession mavenSession;
private final RepositorySystemSession session;
private final RepositorySystem repositorySystem;
- private final LocalRepositoryManagerFactory localRepositoryManagerFactory;
private final List<RemoteRepository> repositories;
private final org.apache.maven.project.ProjectBuilder projectBuilder;
private final MavenRepositorySystem mavenRepositorySystem;
private final DefaultToolchainManagerPrivate toolchainManagerPrivate;
- private LocalRepositoryProvider localRepositoryProvider;
private final List<Listener> listeners = new CopyOnWriteArrayList<>();
+ private final ArtifactManager artifactManager = new DefaultArtifactManager();
+ private final ProjectManager projectManager = new DefaultProjectManager();
private final Map<org.eclipse.aether.graph.DependencyNode, Node> allNodes
= Collections.synchronizedMap( new WeakHashMap<>() );
@@ -96,18 +95,20 @@ public class DefaultSession implements Session
private final Map<org.eclipse.aether.graph.Dependency, Dependency> allDependencies
= Collections.synchronizedMap( new WeakHashMap<>() );
- public DefaultSession( @Nonnull RepositorySystemSession session,
+ public DefaultSession( @Nonnull MavenSession session,
@Nonnull RepositorySystem repositorySystem,
- @Nonnull LocalRepositoryManagerFactory localRepositoryManagerFactory,
- @Nonnull List<RemoteRepository> repositories,
+ @Nullable List<RemoteRepository> repositories,
@Nonnull org.apache.maven.project.ProjectBuilder projectBuilder,
@Nonnull MavenRepositorySystem mavenRepositorySystem,
@Nonnull DefaultToolchainManagerPrivate toolchainManagerPrivate )
{
- this.session = Objects.requireNonNull( session );
+ this.mavenSession = Objects.requireNonNull( session );
+ this.session = mavenSession.getRepositorySession();
this.repositorySystem = Objects.requireNonNull( repositorySystem );
- this.localRepositoryManagerFactory = Objects.requireNonNull( localRepositoryManagerFactory );
- this.repositories = Objects.requireNonNull( repositories );
+ this.repositories = repositories != null
+ ? repositories
+ : mavenSession.getRequest().getRemoteRepositories().stream()
+ .map( RepositoryUtils::toRepo ).map( this::getRemoteRepository ).collect( Collectors.toList() );
this.projectBuilder = projectBuilder;
this.mavenRepositorySystem = mavenRepositorySystem;
this.toolchainManagerPrivate = toolchainManagerPrivate;
@@ -136,21 +137,21 @@ public class DefaultSession implements Session
@Override
public Settings getSettings()
{
- return null;
+ return mavenSession.getSettings();
}
@Nonnull
@Override
public Properties getUserProperties()
{
- return null;
+ return mavenSession.getUserProperties();
}
@Nonnull
@Override
public Properties getSystemProperties()
{
- return null;
+ return mavenSession.getSystemProperties();
}
@Nonnull
@@ -196,30 +197,23 @@ public class DefaultSession implements Session
{
return this;
}
- try
- {
- org.eclipse.aether.repository.LocalRepository repository = toRepository( localRepository );
- org.eclipse.aether.repository.LocalRepositoryManager localRepositoryManager
- = localRepositoryManagerFactory.newInstance( session, repository );
-
- RepositorySystemSession newSession = new DefaultRepositorySystemSession( session )
- .setLocalRepositoryManager( localRepositoryManager );
-
- return new DefaultSession( newSession, repositorySystem, localRepositoryManagerFactory,
- repositories, projectBuilder, mavenRepositorySystem, toolchainManagerPrivate );
- }
- catch ( NoLocalRepositoryManagerException e )
- {
- throw new IllegalArgumentException( "Unsupported repository layout", e );
- }
-
+ org.eclipse.aether.repository.LocalRepository repository = toRepository( localRepository );
+ org.eclipse.aether.repository.LocalRepositoryManager localRepositoryManager
+ = repositorySystem.newLocalRepositoryManager( session, repository );
+
+ RepositorySystemSession repoSession = new DefaultRepositorySystemSession( session )
+ .setLocalRepositoryManager( localRepositoryManager );
+ MavenSession newSession = new MavenSession( mavenSession.getContainer(), repoSession,
+ mavenSession.getRequest(), mavenSession.getResult() );
+ return new DefaultSession( newSession, repositorySystem,
+ repositories, projectBuilder, mavenRepositorySystem, toolchainManagerPrivate );
}
@Nonnull
@Override
public Session withRemoteRepositories( @Nonnull List<RemoteRepository> repositories )
{
- return new DefaultSession( session, repositorySystem, localRepositoryManagerFactory,
+ return new DefaultSession( mavenSession, repositorySystem,
repositories, projectBuilder, mavenRepositorySystem, toolchainManagerPrivate );
}
@@ -244,6 +238,10 @@ public class DefaultSession implements Session
{
return (T) new DefaultArtifactInstaller( repositorySystem );
}
+ else if ( clazz == ArtifactManager.class )
+ {
+ return (T) artifactManager;
+ }
else if ( clazz == DependencyFactory.class )
{
return (T) new DefaultDependencyFactory();
@@ -260,13 +258,9 @@ public class DefaultSession implements Session
{
return (T) new DefaultProjectBuilder( projectBuilder );
}
- else if ( clazz == ProjectDeployer.class )
- {
- return (T) new DefaultProjectDeployer( repositorySystem );
- }
- else if ( clazz == ProjectInstaller.class )
+ else if ( clazz == ProjectManager.class )
{
- return (T) new DefaultProjectInstaller( repositorySystem );
+ return (T) projectManager;
}
else if ( clazz == LocalRepositoryManager.class )
{
@@ -288,9 +282,9 @@ public class DefaultSession implements Session
return session;
}
- public LocalRepositoryProvider getLocalRepositoryProvider()
+ public RepositorySystem getRepositorySystem()
{
- return localRepositoryProvider;
+ return repositorySystem;
}
public RemoteRepository getRemoteRepository( org.eclipse.aether.repository.RemoteRepository repository )
@@ -443,7 +437,7 @@ public class DefaultSession implements Session
artifact.getExtension(),
artifact.getVersion(),
null,
- ( (Artifact) artifact ).getPath().map( Path::toFile ).orElse( null )
+ getService( ArtifactManager.class ).getPath( artifact ).map( Path::toFile ).orElse( null )
);
}
}
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSessionFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSessionFactory.java
new file mode 100644
index 0000000..dc7e84b
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSessionFactory.java
@@ -0,0 +1,67 @@
+package org.apache.maven.internal.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import org.apache.maven.api.Session;
+import org.apache.maven.bridge.MavenRepositorySystem;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.toolchain.DefaultToolchainManagerPrivate;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.SessionData;
+
+@Singleton
+@Named
+public class DefaultSessionFactory
+{
+ private final RepositorySystem repositorySystem;
+ private final org.apache.maven.project.ProjectBuilder projectBuilder;
+ private final MavenRepositorySystem mavenRepositorySystem;
+ private final DefaultToolchainManagerPrivate toolchainManagerPrivate;
+
+ @Inject
+ public DefaultSessionFactory( RepositorySystem repositorySystem,
+ ProjectBuilder projectBuilder,
+ MavenRepositorySystem mavenRepositorySystem,
+ DefaultToolchainManagerPrivate toolchainManagerPrivate )
+ {
+ this.repositorySystem = repositorySystem;
+ this.projectBuilder = projectBuilder;
+ this.mavenRepositorySystem = mavenRepositorySystem;
+ this.toolchainManagerPrivate = toolchainManagerPrivate;
+ }
+
+ public Session getSession( MavenSession mavenSession )
+ {
+ SessionData data = mavenSession.getRepositorySession().getData();
+ return (Session) data.computeIfAbsent( DefaultSession.class, () -> newSession( mavenSession ) );
+ }
+
+ private Session newSession( MavenSession mavenSession )
+ {
+ return new DefaultSession(
+ mavenSession, repositorySystem, null,
+ projectBuilder, mavenRepositorySystem, toolchainManagerPrivate );
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultToolchainManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultToolchainManager.java
similarity index 99%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/DefaultToolchainManager.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/DefaultToolchainManager.java
index a8912f7..6c285cd 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultToolchainManager.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultToolchainManager.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/MappedCollection.java b/maven-core/src/main/java/org/apache/maven/internal/impl/MappedCollection.java
similarity index 97%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/MappedCollection.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/MappedCollection.java
index 1fd3248..3231080 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/MappedCollection.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/MappedCollection.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/MappedList.java b/maven-core/src/main/java/org/apache/maven/internal/impl/MappedList.java
similarity index 97%
rename from maven-core-impl/src/main/java/org/apache/maven/impl/MappedList.java
rename to maven-core/src/main/java/org/apache/maven/internal/impl/MappedList.java
index a5e8e71..e68f259 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/MappedList.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/MappedList.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
index 405ab5f..970c906 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
@@ -26,6 +26,7 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
+import org.apache.maven.api.Session;
import org.apache.maven.execution.BuildSuccess;
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.MavenSession;
@@ -94,6 +95,7 @@ public class LifecycleModuleBuilder
{
sessionScope.enter();
sessionScope.seed( MavenSession.class, session );
+ sessionScope.seed( Session.class, session.getSession() );
}
try
{
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java
index 272371a..4db9028 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java
@@ -97,7 +97,7 @@ public class DefaultBuildPluginManager
MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
- Mojo mojo = null;
+ Object mojo = null;
ClassRealm pluginRealm;
try
@@ -121,7 +121,15 @@ public class DefaultBuildPluginManager
scope.seed( MavenProject.class, project );
scope.seed( MojoExecution.class, mojoExecution );
- mojo = mavenPluginManager.getConfiguredMojo( Mojo.class, session, mojoExecution );
+ if ( mojoDescriptor.isV4Api() )
+ {
+ mojo = mavenPluginManager.getConfiguredMojo(
+ org.apache.maven.api.plugin.Mojo.class, session, mojoExecution );
+ }
+ else
+ {
+ mojo = mavenPluginManager.getConfiguredMojo( Mojo.class, session, mojoExecution );
+ }
legacySupport.setSession( session );
@@ -134,7 +142,14 @@ public class DefaultBuildPluginManager
mojoExecutionListener.beforeMojoExecution( mojoExecutionEvent );
- mojo.execute();
+ if ( mojoDescriptor.isV4Api() )
+ {
+ ( ( org.apache.maven.api.plugin.Mojo ) mojo ).execute();
+ }
+ else
+ {
+ ( ( Mojo ) mojo ).execute();
+ }
mojoExecutionListener.afterMojoExecutionSuccess( mojoExecutionEvent );
}
@@ -150,15 +165,15 @@ public class DefaultBuildPluginManager
}
catch ( PluginContainerException e )
{
- mojoExecutionListener.afterExecutionFailure( new MojoExecutionEvent( session, project, mojoExecution, mojo,
- e ) );
+ mojoExecutionListener.afterExecutionFailure(
+ new MojoExecutionEvent( session, project, mojoExecution, mojo, e ) );
throw new PluginExecutionException( mojoExecution, project, e );
}
catch ( NoClassDefFoundError e )
{
- mojoExecutionListener.afterExecutionFailure( new MojoExecutionEvent( session, project, mojoExecution, mojo,
- e ) );
+ mojoExecutionListener.afterExecutionFailure(
+ new MojoExecutionEvent( session, project, mojoExecution, mojo, e ) );
ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 );
PrintStream ps = new PrintStream( os );
@@ -172,8 +187,8 @@ public class DefaultBuildPluginManager
}
catch ( LinkageError e )
{
- mojoExecutionListener.afterExecutionFailure( new MojoExecutionEvent( session, project, mojoExecution, mojo,
- e ) );
+ mojoExecutionListener.afterExecutionFailure(
+ new MojoExecutionEvent( session, project, mojoExecution, mojo, e ) );
ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 );
PrintStream ps = new PrintStream( os );
@@ -187,8 +202,8 @@ public class DefaultBuildPluginManager
}
catch ( ClassCastException e )
{
- mojoExecutionListener.afterExecutionFailure( new MojoExecutionEvent( session, project, mojoExecution, mojo,
- e ) );
+ mojoExecutionListener.afterExecutionFailure(
+ new MojoExecutionEvent( session, project, mojoExecution, mojo, e ) );
ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 );
PrintStream ps = new PrintStream( os );
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
index f621b63..6f00873 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
@@ -200,7 +200,14 @@ public class PluginParameterExpressionEvaluator
}
else if ( "session".equals( expression ) )
{
- value = session;
+ if ( mojoDescriptor.isV4Api() )
+ {
+ value = session.getSession();
+ }
+ else
+ {
+ value = session;
+ }
}
else if ( expression.startsWith( "session" ) )
{
diff --git a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java
index b00c588..ba93ad9 100644
--- a/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java
+++ b/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java
@@ -23,6 +23,7 @@ import javax.inject.Inject;
import javax.inject.Named;
import org.apache.maven.SessionScoped;
+import org.apache.maven.api.Session;
import org.apache.maven.execution.MavenSession;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -62,5 +63,6 @@ public class SessionScopeModule
bind( SessionScope.class ).toInstance( scope );
bind( MavenSession.class ).toProvider( SessionScope.seededKeyProvider() ).in( scope );
+ bind( Session.class ).toProvider( SessionScope.seededKeyProvider() ).in( scope );
}
}
diff --git a/maven-core/src/main/resources/META-INF/maven/extension.xml b/maven-core/src/main/resources/META-INF/maven/extension.xml
index aa890cc..b6b1d3f 100644
--- a/maven-core/src/main/resources/META-INF/maven/extension.xml
+++ b/maven-core/src/main/resources/META-INF/maven/extension.xml
@@ -22,6 +22,8 @@ under the License.
<extension>
<exportedPackages>
<!-- maven-* -->
+ <exportedPackage>org.apache.maven.api</exportedPackage>
+
<exportedPackage>org.apache.maven.*</exportedPackage>
<exportedPackage>org.apache.maven.artifact</exportedPackage>
<exportedPackage>org.apache.maven.classrealm</exportedPackage>
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java b/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java
similarity index 89%
rename from maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
rename to maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java
index dc8a383..7eec899 100644
--- a/maven-core-impl/src/test/java/org/apache/maven/impl/TestApi.java
+++ b/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -24,6 +24,7 @@ import javax.inject.Inject;
import java.nio.file.Paths;
import java.util.Collections;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.api.Project;
import org.apache.maven.api.Session;
import org.apache.maven.api.Artifact;
@@ -39,7 +40,6 @@ import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -58,9 +58,6 @@ public class TestApi
RepositorySystem repositorySystem;
@Inject
- LocalRepositoryManagerFactory localRepositoryManagerFactory;
-
- @Inject
org.apache.maven.project.ProjectBuilder projectBuilder;
@Inject
@@ -73,11 +70,12 @@ public class TestApi
void setup()
{
RepositorySystemSession rss = MavenRepositorySystemUtils.newSession();
- DefaultSession session = new DefaultSession( rss, repositorySystem, localRepositoryManagerFactory,
- Collections.emptyList(), projectBuilder, mavenRepositorySystem,
- toolchainManagerPrivate );
+ MavenSession ms = new MavenSession( null, rss, null, null );
+ DefaultSession session = new DefaultSession( ms, repositorySystem,
+ Collections.emptyList(), projectBuilder,
+ mavenRepositorySystem, toolchainManagerPrivate );
DefaultLocalRepository localRepository = new DefaultLocalRepository(
- new LocalRepository( "target/repo" ) );
+ new LocalRepository( "target/apiv4-repo" ) );
org.apache.maven.api.RemoteRepository remoteRepository = session.getRemoteRepository(
new RemoteRepository.Builder( "mirror", "default",
"file:target/test-classes/repo" ).build() );
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestArtifactHandler.java b/maven-core/src/test/java/org/apache/maven/internal/impl/TestArtifactHandler.java
similarity index 97%
rename from maven-core-impl/src/test/java/org/apache/maven/impl/TestArtifactHandler.java
rename to maven-core/src/test/java/org/apache/maven/internal/impl/TestArtifactHandler.java
index 1411364..3db6e83 100644
--- a/maven-core-impl/src/test/java/org/apache/maven/impl/TestArtifactHandler.java
+++ b/maven-core/src/test/java/org/apache/maven/internal/impl/TestArtifactHandler.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core-impl/src/test/java/org/apache/maven/impl/TestRepositorySystem.java b/maven-core/src/test/java/org/apache/maven/internal/impl/TestRepositorySystem.java
similarity index 99%
rename from maven-core-impl/src/test/java/org/apache/maven/impl/TestRepositorySystem.java
rename to maven-core/src/test/java/org/apache/maven/internal/impl/TestRepositorySystem.java
index 824ac27..d47d76a 100644
--- a/maven-core-impl/src/test/java/org/apache/maven/impl/TestRepositorySystem.java
+++ b/maven-core/src/test/java/org/apache/maven/internal/impl/TestRepositorySystem.java
@@ -1,4 +1,4 @@
-package org.apache.maven.impl;
+package org.apache.maven.internal.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java
index 04ab6f1..4423182 100644
--- a/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java
+++ b/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java
@@ -79,8 +79,10 @@ public class DefaultToolchainManagerPrivateTest
when( session.getRequest() ).thenReturn( req );
ToolchainPrivate basicToolchain = mock( ToolchainPrivate.class );
+ when( basicToolchain.getType() ).thenReturn( "basic" );
when( toolchainFactory_basicType.createDefaultToolchain() ).thenReturn( basicToolchain );
ToolchainPrivate rareToolchain = mock( ToolchainPrivate.class );
+ when( rareToolchain.getType() ).thenReturn( "rare" );
when( toolchainFactory_rareType.createDefaultToolchain() ).thenReturn( rareToolchain );
// execute
@@ -101,8 +103,10 @@ public class DefaultToolchainManagerPrivateTest
when( session.getRequest() ).thenReturn( req );
ToolchainPrivate basicToolchain = mock( ToolchainPrivate.class );
+ when( basicToolchain.getType() ).thenReturn( "basic" );
when( toolchainFactory_basicType.createDefaultToolchain() ).thenReturn( basicToolchain );
ToolchainPrivate rareToolchain = mock( ToolchainPrivate.class );
+ when( rareToolchain.getType() ).thenReturn( "rare" );
when( toolchainFactory_rareType.createDefaultToolchain() ).thenReturn( rareToolchain );
// execute
@@ -124,18 +128,25 @@ public class DefaultToolchainManagerPrivateTest
Map<String, List<ToolchainModel>> groupedToolchains = new HashMap<>();
req.setToolchains( groupedToolchains );
+ ToolchainPrivate basicToolchain = mock( ToolchainPrivate.class );
+ when( basicToolchain.getType() ).thenReturn( "basic" );
+ ToolchainPrivate rareToolchain = mock( ToolchainPrivate.class );
+ when( rareToolchain.getType() ).thenReturn( "rare" );
+
List<ToolchainModel> basicToolchains = new ArrayList<>();
ToolchainModel basicToolchainModel = new ToolchainModel();
basicToolchainModel.setType( "basic" );
basicToolchains.add( basicToolchainModel );
basicToolchains.add( basicToolchainModel );
groupedToolchains.put( "basic", basicToolchains );
+ when( toolchainFactory_basicType.createToolchain( basicToolchainModel ) ).thenReturn( basicToolchain );
List<ToolchainModel> rareToolchains = new ArrayList<>();
ToolchainModel rareToolchainModel = new ToolchainModel();
rareToolchainModel.setType( "rare" );
rareToolchains.add( rareToolchainModel );
groupedToolchains.put( "rare", rareToolchains );
+ when( toolchainFactory_rareType.createToolchain( rareToolchainModel ) ).thenReturn( rareToolchain );
// execute
ToolchainPrivate[] toolchains = toolchainManager.getToolchainsForType( "basic", session );
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar b/maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar
rename to maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.jar
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom b/maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom
rename to maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.pom
diff --git a/maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/jdom/jdom/1.0/jdom-1.0.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/1.0/jdom-1.0.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar b/maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar
rename to maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.jar
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom b/maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom
rename to maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.pom
diff --git a/maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/de/zeigermann/xml/xml-im-exporter/1.1/xml-im-exporter-1.1.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/1.1/xml-im-exporter-1.1.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar b/maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar
rename to maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.jar
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom b/maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom
rename to maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.pom
diff --git a/maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/2.0.2/commons-httpclient-2.0.2.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.jar b/maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.jar
rename to maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.jar
diff --git a/maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.jar.md5 b/maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom b/maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom
rename to maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.pom
diff --git a/maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom.md5 b/maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/slide/slide-webdavlib/2.1/slide-webdavlib-2.1.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/2.1/slide-webdavlib-2.1.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc-resources.jar.lastUpdated b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-javadoc-resources.jar.lastUpdated
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc-resources.jar.lastUpdated
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-javadoc-resources.jar.lastUpdated
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-javadoc.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-javadoc.jar
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-javadoc.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-javadoc.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-javadoc.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-sources.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-sources.jar
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-sources.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1-sources.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1-sources.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.jar
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.pom
diff --git a/maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/junit/junit/4.13.1/junit-4.13.1.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/4.13.1/junit-4.13.1.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.jar
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.pom
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc-resources.jar.lastUpdated b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4-javadoc-resources.jar.lastUpdated
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc-resources.jar.lastUpdated
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4-javadoc-resources.jar.lastUpdated
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.jar
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.pom
diff --git a/maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/apache/3/apache-3.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/apache/3/apache-3.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/apache/3/apache-3.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/apache/3/apache-3.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/apache/3/apache-3.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/apache/3/apache-3.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/apache/3/apache-3.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-providers/1.0-beta-2/wagon-providers-1.0-beta-2.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.md5 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.md5
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.md5
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.md5
diff --git a/maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc-resources.jar.lastUpdated b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc-resources.jar.lastUpdated
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc-resources.jar.lastUpdated
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc-resources.jar.lastUpdated
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar.sha1 b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom.sha1
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
diff --git a/maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom.sha1 b/maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom.sha1
similarity index 100%
rename from maven-core-impl/src/test/resources/repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom.sha1
rename to maven-core/src/test/resources/apiv4-repo/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom.sha1
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java
index b41eba9..52d1f5e 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java
@@ -139,6 +139,8 @@ public class MojoDescriptor
*/
private boolean threadSafe = false;
+ private boolean v4Api = false;
+
/**
* Default constructor.
*/
@@ -455,7 +457,7 @@ public class MojoDescriptor
/** {@inheritDoc} */
public String getRole()
{
- return Mojo.ROLE;
+ return isV4Api() ? "org.apache.maven.api.plugin.Mojo" : Mojo.ROLE;
}
/** {@inheritDoc} */
@@ -656,6 +658,16 @@ public class MojoDescriptor
|| ( getExecutePhase() != null && getExecutePhase().length() > 0 );
}
+ public boolean isV4Api()
+ {
+ return v4Api;
+ }
+
+ public void setV4Api( boolean v4Api )
+ {
+ this.v4Api = v4Api;
+ }
+
/**
* Creates a shallow copy of this mojo descriptor.
*/
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java
index 5747d16..a3413a0 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java
@@ -309,6 +309,13 @@ public class PluginDescriptorBuilder
mojo.setThreadSafe( Boolean.parseBoolean( threadSafe ) );
}
+ String v4Api = c.getChild( "v4Api" ).getValue();
+
+ if ( v4Api != null )
+ {
+ mojo.setV4Api( Boolean.parseBoolean( v4Api ) );
+ }
+
// ----------------------------------------------------------------------
// Configuration
// ----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cff1735..d0f3b56 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,6 @@ under the License.
<module>maven-model-transform</module>
<module>maven-core-api</module>
<module>maven-core</module>
- <module>maven-core-impl</module>
<module>maven-settings</module>
<module>maven-settings-builder</module>
<module>maven-artifact</module>
[maven] 06/12: Add the mojo plugin api
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 36efde0625e20ad03cb6e61b13be804363bda2a4
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Feb 15 17:10:14 2022 +0100
Add the mojo plugin api
---
.../src/main/java/org/apache/maven/api/Event.java | 21 +++--
.../java/org/apache/maven/api/MojoExecution.java | 30 +++++++
.../java/org/apache/maven/api/plugin/Mojo.java | 43 ++++++++++
.../org/apache/maven/api/plugin/MojoException.java | 94 ++++++++++++++++++++++
.../maven/api/plugin/annotations/Component.java | 54 +++++++++++++
.../maven/api/plugin/annotations/Execute.java | 62 ++++++++++++++
.../plugin/annotations/InstantiationStrategy.java | 46 +++++++++++
.../api/plugin/annotations/LifecyclePhase.java | 77 ++++++++++++++++++
.../apache/maven/api/plugin/annotations/Mojo.java | 89 ++++++++++++++++++++
.../maven/api/plugin/annotations/Parameter.java | 92 +++++++++++++++++++++
.../api/plugin/annotations/ResolutionScope.java | 76 +++++++++++++++++
.../maven/impl/DefaultLocalRepositoryManager.java | 17 ++--
.../maven/plugin/descriptor/PluginDescriptor.java | 19 +++--
13 files changed, 696 insertions(+), 24 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Event.java b/maven-core-api/src/main/java/org/apache/maven/api/Event.java
index 9e2c1f6..77c30ae 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Event.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Event.java
@@ -19,6 +19,10 @@ package org.apache.maven.api;
* under the License.
*/
+import javax.annotation.Nonnull;
+
+import java.util.Optional;
+
/**
* Event
*/
@@ -54,6 +58,7 @@ public interface Event
*
* @return The type of the event, never {@code null}.
*/
+ @Nonnull
Type getType();
/**
@@ -61,28 +66,30 @@ public interface Event
*
* @return The current session, never {@code null}.
*/
+ @Nonnull
Session getSession();
/**
* Gets the current project (if any).
*
- * @return The current project or {@code null} if not applicable.
+ * @return The current project or {@code empty()} if not applicable.
*/
- Project getProject();
+ @Nonnull
+ Optional<Project> getProject();
/**
* Gets the current mojo execution (if any).
*
- * @return The current mojo execution or {@code null} if not applicable.
- * TODO: return MojoExecution
+ * @return The current mojo execution or {@code empty()} if not applicable.
*/
- Object getMojoExecution();
+ @Nonnull
+ Optional<MojoExecution> getMojoExecution();
/**
* Gets the exception that caused the event (if any).
*
- * @return The exception or {@code null} if none.
+ * @return The exception or {@code empty()} if none.
*/
- Exception getException();
+ Optional<Exception> getException();
}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/MojoExecution.java b/maven-core-api/src/main/java/org/apache/maven/api/MojoExecution.java
new file mode 100644
index 0000000..30574b9
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/MojoExecution.java
@@ -0,0 +1,30 @@
+package org.apache.maven.api;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.annotation.Nonnull;
+
+import org.apache.maven.model.Plugin;
+
+public interface MojoExecution
+{
+ @Nonnull
+ Plugin getPlugin();
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/Mojo.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/Mojo.java
new file mode 100644
index 0000000..80819b1
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/Mojo.java
@@ -0,0 +1,43 @@
+package org.apache.maven.api.plugin;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * This interface forms the contract required for <code>Mojos</code> to interact with the <code>Maven</code>
+ * infrastructure.<br>
+ * It features an <code>execute()</code> method, which triggers the Mojo's build-process behavior, and can throw
+ * a MojoExecutionException or MojoFailureException if error conditions occur.<br>
+ * Also included is the <code>setLog(...)</code> method, which simply allows Maven to inject a logging mechanism which
+ * will allow the Mojo to communicate to the outside world through standard Maven channels.
+ */
+@FunctionalInterface
+public interface Mojo
+{
+ /**
+ * Perform whatever build-process behavior this <code>Mojo</code> implements.<br>
+ * This is the main trigger for the <code>Mojo</code> inside the <code>Maven</code> system, and allows
+ * the <code>Mojo</code> to communicate errors.
+ *
+ * @throws MojoException if a problem occurs.
+ */
+ void execute()
+ throws MojoException;
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/MojoException.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/MojoException.java
new file mode 100644
index 0000000..2d50ca4
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/MojoException.java
@@ -0,0 +1,94 @@
+package org.apache.maven.api.plugin;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.api.services.MavenException;
+
+/**
+ * An exception occurring during the execution of a plugin.<br>
+ */
+public class MojoException
+ extends MavenException
+{
+
+ protected Object source;
+
+ protected String longMessage;
+
+ /**
+ * Construct a new <code>MojoExecutionException</code> exception providing the source and a short and long message:
+ * these messages are used to improve the message written at the end of Maven build.
+ */
+ public MojoException( Object source, String shortMessage, String longMessage )
+ {
+ super( shortMessage );
+ this.source = source;
+ this.longMessage = longMessage;
+ }
+
+ /**
+ * Construct a new <code>MojoExecutionException</code> exception wrapping an underlying <code>Exception</code>
+ * and providing a <code>message</code>.
+ */
+ public MojoException( String message, Exception cause )
+ {
+ super( message, cause );
+ }
+
+ /**
+ * Construct a new <code>MojoExecutionException</code> exception wrapping an underlying <code>Throwable</code>
+ * and providing a <code>message</code>.
+ */
+ public MojoException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ /**
+ * Construct a new <code>MojoExecutionException</code> exception providing a <code>message</code>.
+ */
+ public MojoException( String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Constructs a new {@code MojoExecutionException} exception wrapping an underlying {@code Throwable}.
+ *
+ * @param cause the cause which is saved for later retrieval by the {@link #getCause()} method.
+ * A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.
+ * @since 3.8.3
+ */
+ public MojoException( Throwable cause )
+ {
+ super( cause );
+ }
+
+ public String getLongMessage()
+ {
+ return longMessage;
+ }
+
+ public Object getSource()
+ {
+ return source;
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Component.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Component.java
new file mode 100644
index 0000000..d5f89ed
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Component.java
@@ -0,0 +1,54 @@
+package org.apache.maven.api.plugin.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Used to configure injection of Plexus components by
+ * <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/MavenPluginManager.html">
+ * <code>MavenPluginManager.getConfiguredMojo(...)</code></a>.
+ *
+ * @author Olivier Lamy
+ * @since 3.0
+ */
+@Documented
+@Retention( RetentionPolicy.CLASS )
+@Target( { ElementType.FIELD } )
+@Inherited
+public @interface Component
+{
+ /**
+ * role of the component to inject.
+ * @return the role
+ */
+ Class<?> role() default Object.class;
+
+ /**
+ * hint of the component to inject.
+ * @return the hint
+ */
+ String hint() default "";
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java
new file mode 100644
index 0000000..81ce2df
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Execute.java
@@ -0,0 +1,62 @@
+package org.apache.maven.api.plugin.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Used if your Mojo needs to fork a <a href="/ref/3.0.4/maven-core/lifecycles.html">lifecycle</a>.
+ *
+ * @author Olivier Lamy
+ * @since 3.0
+ */
+@Documented
+@Retention( RetentionPolicy.CLASS )
+@Target( ElementType.TYPE )
+@Inherited
+public @interface Execute
+{
+ /**
+ * lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
+ * @return the phase
+ */
+ LifecyclePhase phase() default LifecyclePhase.NONE;
+
+ /**
+ * goal to fork. Note that specifying a phase overrides specifying a goal. The specified <code>goal</code> must be
+ * another goal of the same plugin.
+ * @return the goal
+ */
+ String goal() default "";
+
+ /**
+ * lifecycle id of the lifecycle that defines {@link #phase()}. Only valid in combination with {@link #phase()}. If
+ * not specified, Maven will use the lifecycle of the current build.
+ *
+ * @see <a href="https://maven.apache.org/maven-plugin-api/lifecycle-mappings.html">Lifecycle Mappings</a>
+ * @return the lifecycle id
+ */
+ String lifecycle() default "";
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/InstantiationStrategy.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/InstantiationStrategy.java
new file mode 100644
index 0000000..7cac629
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/InstantiationStrategy.java
@@ -0,0 +1,46 @@
+package org.apache.maven.api.plugin.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Component instantiation strategy.
+ *
+ * @author Hervé Boutemy
+ * @since 3.0
+ */
+public enum InstantiationStrategy
+{
+ PER_LOOKUP( "per-lookup" ),
+ SINGLETON( "singleton" ),
+ KEEP_ALIVE( "keep-alive" ),
+ POOLABLE( "poolable" );
+
+ private final String id;
+
+ InstantiationStrategy( String id )
+ {
+ this.id = id;
+ }
+
+ public String id()
+ {
+ return this.id;
+ }
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/LifecyclePhase.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/LifecyclePhase.java
new file mode 100644
index 0000000..a2bee4d
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/LifecyclePhase.java
@@ -0,0 +1,77 @@
+package org.apache.maven.api.plugin.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * <a href="/ref/3.0.4/maven-core/lifecycles.html">Lifecycle phases</a>.
+ * @author Olivier Lamy
+ * @since 3.0
+ */
+public enum LifecyclePhase
+{
+
+ VALIDATE( "validate" ),
+ INITIALIZE( "initialize" ),
+ GENERATE_SOURCES( "generate-sources" ),
+ PROCESS_SOURCES( "process-sources" ),
+ GENERATE_RESOURCES( "generate-resources" ),
+ PROCESS_RESOURCES( "process-resources" ),
+ COMPILE( "compile" ),
+ PROCESS_CLASSES( "process-classes" ),
+ GENERATE_TEST_SOURCES( "generate-test-sources" ),
+ PROCESS_TEST_SOURCES( "process-test-sources" ),
+ GENERATE_TEST_RESOURCES( "generate-test-resources" ),
+ PROCESS_TEST_RESOURCES( "process-test-resources" ),
+ TEST_COMPILE( "test-compile" ),
+ PROCESS_TEST_CLASSES( "process-test-classes" ),
+ TEST( "test" ),
+ PREPARE_PACKAGE( "prepare-package" ),
+ PACKAGE( "package" ),
+ PRE_INTEGRATION_TEST( "pre-integration-test" ),
+ INTEGRATION_TEST( "integration-test" ),
+ POST_INTEGRATION_TEST( "post-integration-test" ),
+ VERIFY( "verify" ),
+ INSTALL( "install" ),
+ DEPLOY( "deploy" ),
+
+ PRE_CLEAN( "pre-clean" ),
+ CLEAN( "clean" ),
+ POST_CLEAN( "post-clean" ),
+
+ PRE_SITE( "pre-site" ),
+ SITE( "site" ),
+ POST_SITE( "post-site" ),
+ SITE_DEPLOY( "site-deploy" ),
+
+ NONE( "" );
+
+ private final String id;
+
+ LifecyclePhase( String id )
+ {
+ this.id = id;
+ }
+
+ public String id()
+ {
+ return this.id;
+ }
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java
new file mode 100644
index 0000000..87eb866
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Mojo.java
@@ -0,0 +1,89 @@
+package org.apache.maven.api.plugin.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation will mark your class as a Mojo (ie. goal in a Maven plugin).
+ *
+ * @author Olivier Lamy
+ * @since 3.0
+ */
+@Documented
+@Retention( RetentionPolicy.CLASS )
+@Target( ElementType.TYPE )
+@Inherited
+public @interface Mojo
+{
+ /**
+ * goal name (required).
+ * @return the goal name
+ */
+ String name();
+
+ /**
+ * default phase to bind your mojo.
+ * @return the default phase
+ */
+ LifecyclePhase defaultPhase() default LifecyclePhase.NONE;
+
+ /**
+ * the required dependency resolution scope.
+ * @return the required dependency resolution scope
+ */
+ ResolutionScope requiresDependencyResolution() default ResolutionScope.NONE;
+
+ /**
+ * the required dependency collection scope.
+ * @return the required dependency collection scope
+ */
+ ResolutionScope requiresDependencyCollection() default ResolutionScope.NONE;
+
+ /**
+ * does your mojo requires a project to be executed?
+ * @return requires a project
+ */
+ boolean requiresProject() default true;
+
+ /**
+ * if the Mojo uses the Maven project and its child modules.
+ * @return uses the Maven project and its child modules
+ */
+ boolean aggregator() default false;
+
+ /**
+ * does this Mojo need to be online to be executed?
+ * @return need to be online
+ */
+ boolean requiresOnline() default false;
+
+ /**
+ * own configurator class.
+ * @return own configurator class
+ */
+ String configurator() default "";
+
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java
new file mode 100644
index 0000000..6923a95
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/Parameter.java
@@ -0,0 +1,92 @@
+package org.apache.maven.api.plugin.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Used to configure your Mojo parameters to be injected by
+ * <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/MavenPluginManager.html">
+ * <code>MavenPluginManager.getConfiguredMojo(...)</code></a>.
+ * <p>
+ * Beans injected into Mojo parameters are prepared by <a href="https://www.eclipse.org/sisu/">Sisu</a> JSR330-based
+ * container: this annotation is only effective on fields of the Mojo class itself, nested bean injection
+ * requires Sisu or JSR330 annotations.
+ *
+ * @author Olivier Lamy
+ * @since 3.0
+ */
+@Documented
+@Retention( RetentionPolicy.CLASS )
+@Target( { ElementType.FIELD } )
+@Inherited
+public @interface Parameter
+{
+ /**
+ * name of the bean property used to get/set the field: by default, field name is used.
+ * @return the name of the bean property
+ */
+ String name() default "";
+
+ /**
+ * alias supported to get parameter value.
+ * @return the alias
+ */
+ String alias() default "";
+
+ /**
+ * Property to use to retrieve a value. Can come from <code>-D</code> execution, setting properties or pom
+ * properties.
+ * @return property name
+ */
+ String property() default "";
+
+ /**
+ * parameter default value, may contain <code>${...}</code> expressions which will be interpreted at
+ * inject time: see
+ * <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html">
+ * PluginParameterExpressionEvaluator</a>.
+ * @return the default value
+ */
+ String defaultValue() default "";
+
+ /**
+ * is the parameter required?
+ * @return <code>true</code> if the Mojo should fail when the parameter cannot be injected
+ */
+ boolean required() default false;
+
+ /**
+ * Specifies that this parameter cannot be configured directly by the user (as in the case of POM-specified
+ * configuration). This is useful when you want to force the user to use common POM elements rather than plugin
+ * configurations, as in the case where you want to use the artifact's final name as a parameter. In this case, you
+ * want the user to modify <code><build><finalName/></build></code> rather than specifying a value
+ * for finalName directly in the plugin configuration section. It is also useful to ensure that - for example - a
+ * List-typed parameter which expects items of type Artifact doesn't get a List full of Strings.
+ *
+ * @return <code>true</code> if the user should not be allowed to configure the parameter directly
+ */
+ boolean readonly() default false;
+}
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/ResolutionScope.java b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/ResolutionScope.java
new file mode 100644
index 0000000..5fe8862
--- /dev/null
+++ b/maven-core-api/src/main/java/org/apache/maven/api/plugin/annotations/ResolutionScope.java
@@ -0,0 +1,76 @@
+package org.apache.maven.api.plugin.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Dependencies resolution scopes available before
+ * <a href="/ref/current/maven-core/apidocs/org/apache/maven/lifecycle/internal/MojoExecutor.html">mojo execution</a>.
+ *
+ * Important note: The {@code id} values of this enum correspond to constants of
+ * {@code org.apache.maven.artifact.Artifact} class and MUST BE KEPT IN SYNC.
+ *
+ * @author Hervé Boutemy
+ * @since 3.0
+ */
+public enum ResolutionScope
+{
+ /**
+ * empty resolution scope
+ */
+ NONE( null ),
+ /**
+ * <code>compile</code> resolution scope
+ * = <code>compile</code> + <code>system</code> + <code>provided</code> dependencies
+ */
+ COMPILE( "compile" ),
+ /**
+ * <code>compile+runtime</code> resolution scope (Maven 3 only)
+ * = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> dependencies
+ */
+ COMPILE_PLUS_RUNTIME( "compile+runtime" ),
+ /**
+ * <code>runtime</code> resolution scope
+ * = <code>compile</code> + <code>runtime</code> dependencies
+ */
+ RUNTIME( "runtime" ),
+ /**
+ * <code>runtime+system</code> resolution scope (Maven 3 only)
+ * = <code>compile</code> + <code>system</code> + <code>runtime</code> dependencies
+ */
+ RUNTIME_PLUS_SYSTEM( "runtime+system" ),
+ /**
+ * <code>test</code> resolution scope
+ * = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> + <code>test</code>
+ * dependencies
+ */
+ TEST( "test" );
+
+ private final String id;
+
+ ResolutionScope( String id )
+ {
+ this.id = id;
+ }
+
+ public String id()
+ {
+ return this.id;
+ }
+}
diff --git a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java
index 41bd191..00ac3dc 100644
--- a/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java
+++ b/maven-core-impl/src/main/java/org/apache/maven/impl/DefaultLocalRepositoryManager.java
@@ -20,7 +20,6 @@ package org.apache.maven.impl;
*/
import java.nio.file.Path;
-import java.nio.file.Paths;
import org.apache.maven.api.Artifact;
import org.apache.maven.api.LocalRepository;
@@ -37,14 +36,16 @@ public class DefaultLocalRepositoryManager implements LocalRepositoryManager
public Path getPathForLocalArtifact( Session session, LocalRepository local, Artifact artifact )
{
DefaultSession s = (DefaultSession) session;
- return Paths.get( getManager( s, local ).getPathForLocalArtifact( s.toArtifact( artifact ) ) );
+ String path = getManager( s, local ).getPathForLocalArtifact( s.toArtifact( artifact ) );
+ return local.getPath().resolve( path );
}
@Override
public Path getPathForLocalMetadata( Session session, LocalRepository local, Metadata metadata )
{
DefaultSession s = (DefaultSession) session;
- return Paths.get( getManager( s, local ).getPathForLocalMetadata( s.toMetadata( metadata ) ) );
+ String path = getManager( s, local ).getPathForLocalMetadata( s.toMetadata( metadata ) );
+ return local.getPath().resolve( path );
}
@Override
@@ -52,8 +53,9 @@ public class DefaultLocalRepositoryManager implements LocalRepositoryManager
RemoteRepository remote, Artifact artifact )
{
DefaultSession s = (DefaultSession) session;
- return Paths.get( getManager( s, local ).getPathForRemoteArtifact(
- s.toArtifact( artifact ), s.toRepository( remote ), null ) );
+ String path = getManager( s, local ).getPathForRemoteArtifact(
+ s.toArtifact( artifact ), s.toRepository( remote ), null );
+ return local.getPath().resolve( path );
}
@Override
@@ -61,8 +63,9 @@ public class DefaultLocalRepositoryManager implements LocalRepositoryManager
RemoteRepository remote, Metadata metadata )
{
DefaultSession s = (DefaultSession) session;
- return Paths.get( getManager( s, local ).getPathForRemoteMetadata(
- s.toMetadata( metadata ), s.toRepository( remote ), null ) );
+ String path = getManager( s, local ).getPathForRemoteMetadata(
+ s.toMetadata( metadata ), s.toRepository( remote ), null );
+ return local.getPath().resolve( path );
}
private org.eclipse.aether.repository.LocalRepositoryManager getManager(
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
index 7edcb35..2d4e1ef 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
@@ -19,7 +19,8 @@ package org.apache.maven.plugin.descriptor;
* under the License.
*/
-import org.apache.maven.api.Artifact;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.lifecycle.Lifecycle;
import org.apache.maven.plugin.lifecycle.LifecycleConfiguration;
@@ -29,19 +30,18 @@ import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URL;
-import java.nio.file.Files;
-import java.nio.file.Path;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
/**
* @author Jason van Zyl
@@ -259,8 +259,7 @@ public class PluginDescriptor
{
if ( artifactMap == null )
{
- artifactMap = getArtifacts().stream()
- .collect( Collectors.toMap( a -> a.getGroupId() + ":" + a.getArtifactId(), a -> a ) );
+ artifactMap = ArtifactUtils.artifactMapByVersionlessId( getArtifacts() );
}
return artifactMap;
@@ -398,17 +397,17 @@ public class PluginDescriptor
private InputStream getDescriptorStream( String descriptor )
throws IOException
{
- Path pluginFile = ( pluginArtifact != null ) ? pluginArtifact.getPath().orElse( null ) : null;
+ File pluginFile = ( pluginArtifact != null ) ? pluginArtifact.getFile() : null;
if ( pluginFile == null )
{
throw new IllegalStateException( "plugin main artifact has not been resolved for " + getId() );
}
- if ( Files.isRegularFile( pluginFile ) )
+ if ( pluginFile.isFile() )
{
try
{
- return new URL( "jar:" + pluginFile.toUri() + "!/" + descriptor ).openStream();
+ return new URL( "jar:" + pluginFile.toURI() + "!/" + descriptor ).openStream();
}
catch ( MalformedURLException e )
{
@@ -417,7 +416,7 @@ public class PluginDescriptor
}
else
{
- return Files.newInputStream( pluginFile.resolve( descriptor ) );
+ return new FileInputStream( new File( pluginFile, descriptor ) );
}
}
[maven] 10/12: Fix m-deploy-p ITs
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvn4
in repository https://gitbox.apache.org/repos/asf/maven.git
commit bacfa84cf8b5a6eaef3d63b03f9c42dda93e486f
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Mar 9 07:54:59 2022 +0100
Fix m-deploy-p ITs
---
.../main/java/org/apache/maven/api/Project.java | 11 ++++--
.../maven/internal/impl/DefaultArtifact.java | 27 +++++++++++++++
.../apache/maven/internal/impl/DefaultProject.java | 14 +++++++-
.../maven/internal/impl/DefaultProjectManager.java | 39 +++++++++++-----------
.../apache/maven/internal/impl/DefaultSession.java | 4 +--
5 files changed, 70 insertions(+), 25 deletions(-)
diff --git a/maven-core-api/src/main/java/org/apache/maven/api/Project.java b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
index 9fa9c79..386dda4 100644
--- a/maven-core-api/src/main/java/org/apache/maven/api/Project.java
+++ b/maven-core-api/src/main/java/org/apache/maven/api/Project.java
@@ -50,12 +50,19 @@ public interface Project
@Nonnull
Model getModel();
- @Nonnull
+ /**
+ * Returns the path to the pom file for this project.
+ * A project is usually read from the file system and this will point to
+ * the file. In some cases, a transient project can be created which
+ * will not point to an actual pom file.
+ * @return the path of the pom
+ */
Path getPomPath();
default Path getBasedir()
{
- return getPomPath().getParent();
+ Path pomPath = getPomPath();
+ return pomPath != null ? pomPath.getParent() : null;
}
@Nonnull
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
index fd902fb..37b669a 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultArtifact.java
@@ -98,4 +98,31 @@ public class DefaultArtifact implements Artifact
{
return Optional.ofNullable( artifact.getFile() ).map( File::toPath );
}
+
+ @Override
+ public boolean equals( Object o )
+ {
+ if ( this == o )
+ {
+ return true;
+ }
+ if ( o == null || getClass() != o.getClass() )
+ {
+ return false;
+ }
+ DefaultArtifact that = (DefaultArtifact) o;
+ return artifact.equals( that.artifact );
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return Objects.hash( artifact );
+ }
+
+ @Override
+ public String toString()
+ {
+ return artifact.toString();
+ }
}
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
index e15386b..5677cf9 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java
@@ -22,6 +22,7 @@ package org.apache.maven.internal.impl;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import java.io.File;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
@@ -48,6 +49,16 @@ public class DefaultProject implements Project
this.project = project;
}
+ public DefaultSession getSession()
+ {
+ return session;
+ }
+
+ public MavenProject getProject()
+ {
+ return project;
+ }
+
@Nonnull
@Override
public String getGroupId()
@@ -94,7 +105,8 @@ public class DefaultProject implements Project
@Override
public Path getPomPath()
{
- return project.getFile().toPath();
+ File file = project.getFile();
+ return file != null ? file.toPath() : null;
}
@Nonnull
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
index ba27d0b..079d181 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java
@@ -25,11 +25,10 @@ import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
+import org.apache.maven.RepositoryUtils;
import org.apache.maven.api.Artifact;
import org.apache.maven.api.Node;
import org.apache.maven.api.Project;
@@ -40,10 +39,6 @@ import org.apache.maven.api.services.ProjectManager;
public class DefaultProjectManager implements ProjectManager
{
- private final Map<Project, Path> paths = new ConcurrentHashMap<>();
- private final Map<Project, Collection<Artifact>> attachedArtifacts = new ConcurrentHashMap<>();
- private final Map<Project, List<String>> compileSourceRoots = new ConcurrentHashMap<>();
- private final Map<Project, List<String>> testCompileSourceRoots = new ConcurrentHashMap<>();
private final ArtifactManager artifactManager;
public DefaultProjectManager( ArtifactManager artifactManager )
@@ -55,51 +50,55 @@ public class DefaultProjectManager implements ProjectManager
@Override
public Optional<Path> getPath( Project project )
{
- return Optional.ofNullable( paths.get( project ) );
+ throw new UnsupportedOperationException();
}
@Nonnull
@Override
public Collection<Artifact> getAttachedArtifacts( Project project )
{
- Collection<Artifact> attached = attachedArtifacts.get( project );
- return attached != null ? Collections.unmodifiableCollection( attached ) : Collections.emptyList();
+ DefaultSession session = ( (DefaultProject ) project ).getSession();
+ Collection<Artifact> attached = ( ( DefaultProject ) project ).getProject().getAttachedArtifacts().stream()
+ .map( RepositoryUtils::toArtifact )
+ .map( session::getArtifact )
+ .collect( Collectors.toList() );
+ return Collections.unmodifiableCollection( attached );
}
@Override
public void attachArtifact( Project project, Artifact artifact, Path path )
{
- attachedArtifacts.computeIfAbsent( project, p -> new CopyOnWriteArrayList<>() )
- .add( artifact );
+ ( ( DefaultProject ) project ).getProject().addAttachedArtifact(
+ RepositoryUtils.toArtifact( ( ( DefaultProject ) project ).getSession().toArtifact( artifact ) ) );
artifactManager.setPath( artifact, path );
}
@Override
public List<String> getCompileSourceRoots( Project project )
{
- List<String> roots = compileSourceRoots.get( project );
- return roots != null ? Collections.unmodifiableList( roots ) : Collections.emptyList();
+ List<String> roots = ( ( DefaultProject ) project ).getProject().getCompileSourceRoots();
+ return Collections.unmodifiableList( roots );
}
@Override
public void addCompileSourceRoot( Project project, String sourceRoot )
{
- compileSourceRoots.computeIfAbsent( project, p -> new CopyOnWriteArrayList<>() )
- .add( sourceRoot );
+ List<String> roots = ( ( DefaultProject ) project ).getProject().getCompileSourceRoots();
+ roots.add( sourceRoot );
}
@Override
public List<String> getTestCompileSourceRoots( Project project )
{
- List<String> roots = testCompileSourceRoots.get( project );
- return roots != null ? Collections.unmodifiableList( roots ) : Collections.emptyList();
+ List<String> roots = ( ( DefaultProject ) project ).getProject().getTestCompileSourceRoots();
+ return Collections.unmodifiableList( roots );
}
@Override
public void addTestCompileSourceRoot( Project project, String sourceRoot )
{
- testCompileSourceRoots.computeIfAbsent( project, p -> new CopyOnWriteArrayList<>() )
- .add( sourceRoot );
+ List<String> roots = ( ( DefaultProject ) project ).getProject().getTestCompileSourceRoots();
+ roots.add( sourceRoot );
}
@Override
diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
index 2671c3c..39a181a 100644
--- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
+++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java
@@ -91,7 +91,7 @@ public class DefaultSession implements Session
= Collections.synchronizedMap( new WeakHashMap<>() );
private final Map<org.eclipse.aether.repository.RemoteRepository, RemoteRepository> allRepositories
= Collections.synchronizedMap( new WeakHashMap<>() );
- private final Map<MavenProject, Project> allProjects
+ private final Map<String, Project> allProjects
= Collections.synchronizedMap( new WeakHashMap<>() );
private final Map<org.eclipse.aether.graph.Dependency, Dependency> allDependencies
= Collections.synchronizedMap( new WeakHashMap<>() );
@@ -310,7 +310,7 @@ public class DefaultSession implements Session
public Project getProject( MavenProject project )
{
- return allProjects.computeIfAbsent( project, p -> new DefaultProject( this, p ) );
+ return allProjects.computeIfAbsent( project.getId(), id -> new DefaultProject( this, project ) );
}
public List<org.eclipse.aether.repository.RemoteRepository> toRepositories( List<RemoteRepository> repositories )