diff options
Diffstat (limited to 'framework/src/maven/apache-maven-3.3.3/maven-core/src')
959 files changed, 85791 insertions, 0 deletions
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/AbstractMavenLifecycleParticipant.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/AbstractMavenLifecycleParticipant.java new file mode 100644 index 00000000..20f6c802 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/AbstractMavenLifecycleParticipant.java @@ -0,0 +1,77 @@ +package org.apache.maven; + +/* + * 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.execution.MavenSession; + +/** + * Allows core extensions to participate in Maven build session lifecycle. + * + * All callback methods (will) follow beforeXXX/afterXXX naming pattern to + * indicate at what lifecycle point it is being called. + * + * @see <a href="http://maven.apache.org/examples/maven-3-lifecycle-extensions.html">example</a> + * @see <a href="http://jira.codehaus.org/browse/MNG-4224">MNG-4224</a> + * @since 3.0-alpha-3 + */ +public abstract class AbstractMavenLifecycleParticipant +{ + + /** + * Invoked after all MavenProject instances have been created. + * + * This callback is intended to allow extensions to manipulate MavenProjects + * before they are sorted and actual build execution starts. + */ + public void afterProjectsRead( MavenSession session ) + throws MavenExecutionException + { + // do nothing + } + + /** + * Invoked after MavenSession instance has been created. + * + * This callback is intended to allow extensions to inject execution properties, + * activate profiles and perform similar tasks that affect MavenProject + * instance construction. + */ + // TODO: This is too early for build extensions, so maybe just remove it? + public void afterSessionStart( MavenSession session ) + throws MavenExecutionException + { + // do nothing + } + + /** + * Invoked after all projects were built. + * + * This callback is intended to allow extensions to perform cleanup of any + * allocated external resources after the build. It is invoked on best-effort + * basis and may be missed due to an Error or RuntimeException in Maven core + * code. + * @since 3.2.1, MNG-5389 + */ + public void afterSessionEnd( MavenSession session ) + throws MavenExecutionException + { + // do nothing + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ArtifactFilterManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ArtifactFilterManager.java new file mode 100644 index 00000000..2cf9f996 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ArtifactFilterManager.java @@ -0,0 +1,51 @@ +package org.apache.maven; + +/* + * 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.Set; + +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; + +public interface ArtifactFilterManager +{ + /** + * Returns a filter for core + extension artifacts. + * + * @deprecated use {@code META-INF/maven/extension.xml} to define artifacts exported by Maven core and plugin + * extensions. + */ + ArtifactFilter getArtifactFilter(); + + /** + * Returns a filter for only the core artifacts. + */ + ArtifactFilter getCoreArtifactFilter(); + + /** + * Exclude an extension artifact (doesn't affect getArtifactFilter's result, only getExtensionArtifactFilter). + * + * @deprecated use {@code META-INF/maven/extension.xml} to define artifacts exported by Maven core and plugin + * extensions. + */ + void excludeArtifact( String artifactId ); + + Set<String> getCoreArtifactExcludes(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ArtifactFilterManagerDelegate.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ArtifactFilterManagerDelegate.java new file mode 100644 index 00000000..13893254 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ArtifactFilterManagerDelegate.java @@ -0,0 +1,34 @@ +package org.apache.maven; + +/* + * 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.Set; + +/** + * @deprecated use {@code META-INF/maven/extension.xml} to define artifacts exported by Maven core extensions. + */ +public interface ArtifactFilterManagerDelegate +{ + + void addExcludes( Set<String> excludes ); + + void addCoreExcludes( Set<String> excludes ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/BuildAbort.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/BuildAbort.java new file mode 100644 index 00000000..3255e32b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/BuildAbort.java @@ -0,0 +1,39 @@ +package org.apache.maven; + +/* + * 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 special throwable used to signal a graceful abort of the build. + */ +public class BuildAbort + extends Error +{ + + public BuildAbort( String message ) + { + super( message ); + } + + public BuildAbort( String message, Throwable cause ) + { + super( message, cause ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/BuildFailureException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/BuildFailureException.java new file mode 100644 index 00000000..d35b0d2a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/BuildFailureException.java @@ -0,0 +1,39 @@ +package org.apache.maven; + +/* + * 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. + */ + +/** + * One or more builds failed. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class BuildFailureException + extends Exception +{ + public BuildFailureException( String message ) + { + super( message ); + } + + public BuildFailureException( String message, Throwable cause ) + { + super( message, cause ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java new file mode 100644 index 00000000..1962f917 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultArtifactFilterManager.java @@ -0,0 +1,112 @@ +package org.apache.maven; + +/* + * 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.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; + +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter; +import org.apache.maven.extension.internal.CoreExportsProvider; + +/** + * @author Jason van Zyl + */ +@Named +@Singleton +@SuppressWarnings( "deprecation" ) +public class DefaultArtifactFilterManager + implements ArtifactFilterManager +{ + + // this is a live injected collection + protected final List<ArtifactFilterManagerDelegate> delegates; + + protected Set<String> excludedArtifacts; + + private final Set<String> coreArtifacts; + + @Inject + public DefaultArtifactFilterManager( List<ArtifactFilterManagerDelegate> delegates, + CoreExportsProvider coreExports ) + { + this.delegates = delegates; + this.coreArtifacts = coreExports.get().getExportedArtifacts(); + } + + private synchronized Set<String> getExcludedArtifacts() + { + if ( excludedArtifacts == null ) + { + excludedArtifacts = new LinkedHashSet<String>( coreArtifacts ); + } + return excludedArtifacts; + } + + /** + * Returns the artifact filter for the core + extension artifacts. + * + * @see org.apache.maven.ArtifactFilterManager#getArtifactFilter() + */ + public ArtifactFilter getArtifactFilter() + { + Set<String> excludes = new LinkedHashSet<String>( getExcludedArtifacts() ); + + for ( ArtifactFilterManagerDelegate delegate : delegates ) + { + delegate.addExcludes( excludes ); + } + + return new ExclusionSetFilter( excludes ); + } + + /** + * Returns the artifact filter for the standard core artifacts. + * + * @see org.apache.maven.ArtifactFilterManager#getExtensionDependencyFilter() + */ + public ArtifactFilter getCoreArtifactFilter() + { + return new ExclusionSetFilter( getCoreArtifactExcludes() ); + } + + public void excludeArtifact( String artifactId ) + { + getExcludedArtifacts().add( artifactId ); + } + + public Set<String> getCoreArtifactExcludes() + { + Set<String> excludes = new LinkedHashSet<String>( coreArtifacts ); + + for ( ArtifactFilterManagerDelegate delegate : delegates ) + { + delegate.addCoreExcludes( excludes ); + } + + return excludes; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultMaven.java new file mode 100644 index 00000000..94e75e02 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -0,0 +1,521 @@ +package org.apache.maven; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; + +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.execution.DefaultMavenExecutionResult; +import org.apache.maven.execution.ExecutionEvent; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionResult; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.graph.GraphBuilder; +import org.apache.maven.internal.aether.DefaultRepositorySystemSessionFactory; +import org.apache.maven.lifecycle.internal.ExecutionEventCatapult; +import org.apache.maven.lifecycle.internal.LifecycleStarter; +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.model.building.Result; +import org.apache.maven.plugin.LegacySupport; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuilder; +import org.apache.maven.repository.LocalRepositoryNotAccessibleException; +import org.apache.maven.session.scope.internal.SessionScope; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.util.repository.ChainedWorkspaceReader; + +import com.google.common.collect.Iterables; + +/** + * @author Jason van Zyl + */ +@Component( role = Maven.class ) +public class DefaultMaven + implements Maven +{ + + @Requirement + private Logger logger; + + @Requirement + protected ProjectBuilder projectBuilder; + + @Requirement + private LifecycleStarter lifecycleStarter; + + @Requirement + protected PlexusContainer container; + + @Requirement + private ExecutionEventCatapult eventCatapult; + + @Requirement + private LegacySupport legacySupport; + + @Requirement + private SessionScope sessionScope; + + @Requirement + private DefaultRepositorySystemSessionFactory repositorySessionFactory; + + @Requirement( hint = GraphBuilder.HINT ) + private GraphBuilder graphBuilder; + + @Override + public MavenExecutionResult execute( MavenExecutionRequest request ) + { + MavenExecutionResult result; + + try + { + result = doExecute( request ); + } + catch ( OutOfMemoryError e ) + { + result = addExceptionToResult( new DefaultMavenExecutionResult(), e ); + } + catch ( RuntimeException e ) + { + //TODO Hack to make the cycle detection the same for the new graph builder + if ( e.getCause() instanceof ProjectCycleException ) + { + result = addExceptionToResult( new DefaultMavenExecutionResult(), e.getCause() ); + } + else + { + result = addExceptionToResult( new DefaultMavenExecutionResult(), + new InternalErrorException( "Internal error: " + e, e ) ); + } + } + finally + { + legacySupport.setSession( null ); + } + + return result; + } + + // + // 1) Setup initial properties. + // + // 2) Validate local repository directory is accessible. + // + // 3) Create RepositorySystemSession. + // + // 4) Create MavenSession. + // + // 5) Execute AbstractLifecycleParticipant.afterSessionStart(session) + // + // 6) Get reactor projects looking for general POM errors + // + // 7) Create ProjectDependencyGraph using trimming which takes into account --projects and reactor mode. + // This ensures that the projects passed into the ReactorReader are only those specified. + // + // 8) Create ReactorReader with the getProjectMap( projects ). NOTE that getProjectMap(projects) is the code that + // checks for duplicate projects definitions in the build. Ideally this type of duplicate checking should be + // part of getting the reactor projects in 6). The duplicate checking is conflated with getProjectMap(projects). + // + // 9) Execute AbstractLifecycleParticipant.afterProjectsRead(session) + // + // 10) Create ProjectDependencyGraph without trimming (as trimming was done in 7). A new topological sort is + // required after the execution of 9) as the AbstractLifecycleParticipants are free to mutate the MavenProject + // instances, which may change dependencies which can, in turn, affect the build order. + // + // 11) Execute LifecycleStarter.start() + // + @SuppressWarnings( "checkstyle:methodlength" ) + private MavenExecutionResult doExecute( MavenExecutionRequest request ) + { + request.setStartTime( new Date() ); + + MavenExecutionResult result = new DefaultMavenExecutionResult(); + + try + { + validateLocalRepository( request ); + } + catch ( LocalRepositoryNotAccessibleException e ) + { + return addExceptionToResult( result, e ); + } + + // + // We enter the session scope right after the MavenSession creation and before any of the + // AbstractLifecycleParticipant lookups + // so that @SessionScoped components can be @Injected into AbstractLifecycleParticipants. + // + sessionScope.enter(); + try + { + DefaultRepositorySystemSession repoSession = + (DefaultRepositorySystemSession) newRepositorySession( request ); + MavenSession session = new MavenSession( container, repoSession, request, result ); + + sessionScope.seed( MavenSession.class, session ); + + legacySupport.setSession( session ); + + return doExecute( request, session, result, repoSession ); + } + finally + { + sessionScope.exit(); + } + } + + private MavenExecutionResult doExecute( MavenExecutionRequest request, MavenSession session, + MavenExecutionResult result, DefaultRepositorySystemSession repoSession ) + { + try + { + for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections + .<MavenProject>emptyList() ) ) + { + listener.afterSessionStart( session ); + } + } + catch ( MavenExecutionException e ) + { + return addExceptionToResult( result, e ); + } + + eventCatapult.fire( ExecutionEvent.Type.ProjectDiscoveryStarted, session, null ); + + Result<? extends ProjectDependencyGraph> graphResult = buildGraph( session, result ); + + if ( graphResult.hasErrors() ) + { + return addExceptionToResult( result, + Iterables.toArray( graphResult.getProblems(), ModelProblem.class )[0] + .getException() ); + } + + try + { + session.setProjectMap( getProjectMap( session.getProjects() ) ); + } + catch ( DuplicateProjectException e ) + { + return addExceptionToResult( result, e ); + } + + WorkspaceReader reactorWorkspace; + try + { + reactorWorkspace = container.lookup( WorkspaceReader.class, ReactorReader.HINT ); + } + catch ( ComponentLookupException e ) + { + return addExceptionToResult( result, e ); + } + + // + // Desired order of precedence for local artifact repositories + // + // Reactor + // Workspace + // User Local Repository + // + repoSession.setWorkspaceReader( ChainedWorkspaceReader.newInstance( reactorWorkspace, + repoSession.getWorkspaceReader() ) ); + + repoSession.setReadOnly(); + + ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); + try + { + for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( session.getProjects() ) ) + { + Thread.currentThread().setContextClassLoader( listener.getClass().getClassLoader() ); + + listener.afterProjectsRead( session ); + } + } + catch ( MavenExecutionException e ) + { + return addExceptionToResult( result, e ); + } + finally + { + Thread.currentThread().setContextClassLoader( originalClassLoader ); + } + + // + // The projects need to be topologically after the participants have run their afterProjectsRead(session) + // because the participant is free to change the dependencies of a project which can potentially change the + // topological order of the projects, and therefore can potentially change the build order. + // + // Note that participants may affect the topological order of the projects but it is + // not expected that a participant will add or remove projects from the session. + // + + graphResult = buildGraph( session, result ); + + if ( graphResult.hasErrors() ) + { + return addExceptionToResult( result, + Iterables.toArray( graphResult.getProblems(), ModelProblem.class )[0] + .getException() ); + } + + try + { + if ( result.hasExceptions() ) + { + return result; + } + + result.setTopologicallySortedProjects( session.getProjects() ); + + result.setProject( session.getTopLevelProject() ); + + lifecycleStarter.execute( session ); + + validateActivatedProfiles( session.getProjects(), request.getActiveProfiles() ); + + if ( session.getResult().hasExceptions() ) + { + return addExceptionToResult( result, session.getResult().getExceptions().get( 0 ) ); + } + } + finally + { + try + { + afterSessionEnd( session.getProjects(), session ); + } + catch ( MavenExecutionException e ) + { + return addExceptionToResult( result, e ); + } + } + + return result; + } + + private void afterSessionEnd( Collection<MavenProject> projects, MavenSession session ) + throws MavenExecutionException + { + ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); + try + { + for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( projects ) ) + { + Thread.currentThread().setContextClassLoader( listener.getClass().getClassLoader() ); + + listener.afterSessionEnd( session ); + } + } + finally + { + Thread.currentThread().setContextClassLoader( originalClassLoader ); + } + } + + public RepositorySystemSession newRepositorySession( MavenExecutionRequest request ) + { + return repositorySessionFactory.newRepositorySession( request ); + } + + private void validateLocalRepository( MavenExecutionRequest request ) + throws LocalRepositoryNotAccessibleException + { + File localRepoDir = request.getLocalRepositoryPath(); + + logger.debug( "Using local repository at " + localRepoDir ); + + localRepoDir.mkdirs(); + + if ( !localRepoDir.isDirectory() ) + { + throw new LocalRepositoryNotAccessibleException( "Could not create local repository at " + localRepoDir ); + } + } + + private Collection<AbstractMavenLifecycleParticipant> getLifecycleParticipants( Collection<MavenProject> projects ) + { + Collection<AbstractMavenLifecycleParticipant> lifecycleListeners = + new LinkedHashSet<AbstractMavenLifecycleParticipant>(); + + ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); + try + { + try + { + lifecycleListeners.addAll( container.lookupList( AbstractMavenLifecycleParticipant.class ) ); + } + catch ( ComponentLookupException e ) + { + // this is just silly, lookupList should return an empty list! + logger.warn( "Failed to lookup lifecycle participants: " + e.getMessage() ); + } + + Collection<ClassLoader> scannedRealms = new HashSet<ClassLoader>(); + + for ( MavenProject project : projects ) + { + ClassLoader projectRealm = project.getClassRealm(); + + if ( projectRealm != null && scannedRealms.add( projectRealm ) ) + { + Thread.currentThread().setContextClassLoader( projectRealm ); + + try + { + lifecycleListeners.addAll( container.lookupList( AbstractMavenLifecycleParticipant.class ) ); + } + catch ( ComponentLookupException e ) + { + // this is just silly, lookupList should return an empty list! + logger.warn( "Failed to lookup lifecycle participants: " + e.getMessage() ); + } + } + } + } + finally + { + Thread.currentThread().setContextClassLoader( originalClassLoader ); + } + + return lifecycleListeners; + } + + private MavenExecutionResult addExceptionToResult( MavenExecutionResult result, Throwable e ) + { + if ( !result.getExceptions().contains( e ) ) + { + result.addException( e ); + } + + return result; + } + + private void validateActivatedProfiles( List<MavenProject> projects, List<String> activeProfileIds ) + { + Collection<String> notActivatedProfileIds = new LinkedHashSet<String>( activeProfileIds ); + + for ( MavenProject project : projects ) + { + for ( List<String> profileIds : project.getInjectedProfileIds().values() ) + { + notActivatedProfileIds.removeAll( profileIds ); + } + } + + for ( String notActivatedProfileId : notActivatedProfileIds ) + { + logger.warn( "The requested profile \"" + notActivatedProfileId + + "\" could not be activated because it does not exist." ); + } + } + + private Map<String, MavenProject> getProjectMap( Collection<MavenProject> projects ) + throws DuplicateProjectException + { + Map<String, MavenProject> index = new LinkedHashMap<String, MavenProject>(); + Map<String, List<File>> collisions = new LinkedHashMap<String, List<File>>(); + + for ( MavenProject project : projects ) + { + String projectId = ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + + MavenProject collision = index.get( projectId ); + + if ( collision == null ) + { + index.put( projectId, project ); + } + else + { + List<File> pomFiles = collisions.get( projectId ); + + if ( pomFiles == null ) + { + pomFiles = new ArrayList<File>( Arrays.asList( collision.getFile(), project.getFile() ) ); + collisions.put( projectId, pomFiles ); + } + else + { + pomFiles.add( project.getFile() ); + } + } + } + + if ( !collisions.isEmpty() ) + { + throw new DuplicateProjectException( "Two or more projects in the reactor" + + " have the same identifier, please make sure that <groupId>:<artifactId>:<version>" + + " is unique for each project: " + collisions, collisions ); + } + + return index; + } + + private Result<? extends ProjectDependencyGraph> buildGraph( MavenSession session, MavenExecutionResult result ) + { + Result<? extends ProjectDependencyGraph> graphResult = graphBuilder.build( session ); + for ( ModelProblem problem : graphResult.getProblems() ) + { + if ( problem.getSeverity() == ModelProblem.Severity.WARNING ) + { + logger.warn( problem.toString() ); + } + else + { + logger.error( problem.toString() ); + } + } + + if ( !graphResult.hasErrors() ) + { + ProjectDependencyGraph projectDependencyGraph = graphResult.get(); + session.setProjects( projectDependencyGraph.getSortedProjects() ); + session.setAllProjects( projectDependencyGraph.getSortedProjects() ); + session.setProjectDependencyGraph( projectDependencyGraph ); + } + + return graphResult; + } + + @Deprecated + // 5 January 2014 + protected Logger getLogger() + { + return logger; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java new file mode 100644 index 00000000..fa8be382 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DefaultProjectDependenciesResolver.java @@ -0,0 +1,217 @@ +package org.apache.maven; + +/* + * 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 java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; +import org.apache.maven.artifact.resolver.ArtifactResolutionResult; +import org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException; +import org.apache.maven.artifact.resolver.ResolutionErrorHandler; +import org.apache.maven.artifact.resolver.filter.CumulativeScopeArtifactFilter; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.artifact.ProjectArtifact; +import org.apache.maven.repository.RepositorySystem; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +@Deprecated +@Component( role = ProjectDependenciesResolver.class ) +public class DefaultProjectDependenciesResolver + implements ProjectDependenciesResolver +{ + + @Requirement + private RepositorySystem repositorySystem; + + @Requirement + private ResolutionErrorHandler resolutionErrorHandler; + + public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToResolve, MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolve( Collections.singleton( project ), scopesToResolve, session ); + } + + public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + Set<MavenProject> mavenProjects = Collections.singleton( project ); + return resolveImpl( mavenProjects, scopesToCollect, scopesToResolve, session, + getIgnorableArtifacts( mavenProjects ) ); + } + + public Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopesToResolve, + MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveImpl( projects, null, scopesToResolve, session, getIgnorableArtifacts( projects ) ); + } + + public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session, + Set<Artifact> ignoreableArtifacts ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return resolveImpl( Collections.singleton( project ), scopesToCollect, scopesToResolve, session, + getIgnorableArtifacts( ignoreableArtifacts ) ); + } + + + private Set<Artifact> resolveImpl( Collection<? extends MavenProject> projects, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session, + Set<String> projectIds ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + Set<Artifact> resolved = new LinkedHashSet<Artifact>(); + + if ( projects == null || projects.isEmpty() ) + { + return resolved; + } + + if ( ( scopesToCollect == null || scopesToCollect.isEmpty() ) + && ( scopesToResolve == null || scopesToResolve.isEmpty() ) ) + { + return resolved; + } + + /* + + Logic for transitive global exclusions + + List<String> exclusions = new ArrayList<String>(); + + for ( Dependency d : project.getDependencies() ) + { + if ( d.getExclusions() != null ) + { + for ( Exclusion e : d.getExclusions() ) + { + exclusions.add( e.getGroupId() + ":" + e.getArtifactId() ); + } + } + } + + ArtifactFilter scopeFilter = new ScopeArtifactFilter( scope ); + + ArtifactFilter filter; + + if ( ! exclusions.isEmpty() ) + { + filter = new AndArtifactFilter( Arrays.asList( new ArtifactFilter[]{ + new ExcludesArtifactFilter( exclusions ), scopeFilter } ) ); + } + else + { + filter = scopeFilter; + } + */ + + CumulativeScopeArtifactFilter resolutionScopeFilter = new CumulativeScopeArtifactFilter( scopesToResolve ); + + CumulativeScopeArtifactFilter collectionScopeFilter = new CumulativeScopeArtifactFilter( scopesToCollect ); + collectionScopeFilter = new CumulativeScopeArtifactFilter( collectionScopeFilter, resolutionScopeFilter ); + + ArtifactResolutionRequest request = + new ArtifactResolutionRequest().setResolveRoot( false ).setResolveTransitively( true ).setCollectionFilter( + collectionScopeFilter ).setResolutionFilter( resolutionScopeFilter ).setLocalRepository( + session.getLocalRepository() ).setOffline( session.isOffline() ).setForceUpdate( + session.getRequest().isUpdateSnapshots() ); + request.setServers( session.getRequest().getServers() ); + request.setMirrors( session.getRequest().getMirrors() ); + request.setProxies( session.getRequest().getProxies() ); + + for ( MavenProject project : projects ) + { + request.setArtifact( new ProjectArtifact( project ) ); + request.setArtifactDependencies( project.getDependencyArtifacts() ); + request.setManagedVersionMap( project.getManagedVersionMap() ); + request.setRemoteRepositories( project.getRemoteArtifactRepositories() ); + + ArtifactResolutionResult result = repositorySystem.resolve( request ); + + try + { + resolutionErrorHandler.throwErrors( request, result ); + } + catch ( MultipleArtifactsNotFoundException e ) + { + + Collection<Artifact> missing = new HashSet<Artifact>( e.getMissingArtifacts() ); + + for ( Iterator<Artifact> it = missing.iterator(); it.hasNext(); ) + { + String key = ArtifactUtils.key( it.next() ); + if ( projectIds.contains( key ) ) + { + it.remove(); + } + } + + if ( !missing.isEmpty() ) + { + throw e; + } + } + + resolved.addAll( result.getArtifacts() ); + } + + return resolved; + } + + + private Set<String> getIgnorableArtifacts( Collection<? extends MavenProject> projects ) + { + Set<String> projectIds = new HashSet<String>( projects.size() * 2 ); + + for ( MavenProject p : projects ) + { + String key = ArtifactUtils.key( p.getGroupId(), p.getArtifactId(), p.getVersion() ); + projectIds.add( key ); + } + return projectIds; + } + + private Set<String> getIgnorableArtifacts( Iterable<Artifact> artifactIterable ) + { + Set<String> projectIds = new HashSet<String>(); + + for ( Artifact artifact : artifactIterable ) + { + String key = ArtifactUtils.key( artifact ); + projectIds.add( key ); + } + return projectIds; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DuplicateProjectException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DuplicateProjectException.java new file mode 100644 index 00000000..b1398729 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/DuplicateProjectException.java @@ -0,0 +1,61 @@ +package org.apache.maven; + +/* + * 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.File; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Signals a collision of two or more projects with the same g:a:v during a reactor build. + * + * @author Benjamin Bentmann + */ +public class DuplicateProjectException + extends MavenExecutionException +{ + + private Map<String, List<File>> collisions; + + /** + * Creates a new exception with specified details. + * + * @param message The message text, may be {@code null}. + * @param collisions The POM files of the projects that collided, indexed by their g:a:v, may be {@code null}. + */ + public DuplicateProjectException( String message, Map<String, List<File>> collisions ) + { + super( message, (File) null ); + + this.collisions = ( collisions != null ) ? collisions : new LinkedHashMap<String, List<File>>(); + } + + /** + * Gets the POM files of the projects that collided. + * + * @return The POM files of the projects that collided, indexed by their g:a:v, never {@code null}. + */ + public Map<String, List<File>> getCollisions() + { + return collisions; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/InternalErrorException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/InternalErrorException.java new file mode 100644 index 00000000..afe92c1b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/InternalErrorException.java @@ -0,0 +1,36 @@ +package org.apache.maven; + +/* + * 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. + */ + +/** + * Signals an internal error in Maven itself, e.g. a programming bug. + * + * @author Benjamin Bentmann + */ +public class InternalErrorException + extends MavenExecutionException +{ + + public InternalErrorException( String message, Throwable cause ) + { + super( message, cause ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/Maven.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/Maven.java new file mode 100644 index 00000000..85638476 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/Maven.java @@ -0,0 +1,34 @@ +package org.apache.maven; + +/* + * 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.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionResult; + +/** + * @author Jason van Zyl + */ +public interface Maven +{ + @Deprecated + String POMv4 = "pom.xml"; + + MavenExecutionResult execute( MavenExecutionRequest request ); +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/MavenExecutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/MavenExecutionException.java new file mode 100644 index 00000000..5708e525 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/MavenExecutionException.java @@ -0,0 +1,55 @@ +package org.apache.maven; + +/* + * 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.File; + +import org.apache.maven.project.ProjectBuildingException; + +/** + * @author Jason van Zyl + */ +public class MavenExecutionException + extends Exception +{ + private File pomFile; + + public MavenExecutionException( String message, File pomFile ) + { + super( message ); + this.pomFile = pomFile; + } + + public MavenExecutionException( String message, File pomFile, ProjectBuildingException cause ) + { + super( message, cause ); + this.pomFile = pomFile; + } + + public MavenExecutionException( String message, Throwable cause ) + { + super( message, cause ); + } + + public File getPomFile() + { + return pomFile; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/MissingModuleException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/MissingModuleException.java new file mode 100644 index 00000000..c920a6ea --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/MissingModuleException.java @@ -0,0 +1,48 @@ +package org.apache.maven; + +/* + * 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.File; + +public class MissingModuleException + extends MavenExecutionException +{ + + private File moduleFile; + private final String moduleName; + + public MissingModuleException( String moduleName, File moduleFile, File pomFile ) + { + super( "The module: " + moduleName + " cannot be found in file: " + moduleFile, pomFile ); + this.moduleName = moduleName; + this.moduleFile = moduleFile; + } + + public File getModuleFile() + { + return moduleFile; + } + + public String getModuleName() + { + return moduleName; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectBuildFailureException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectBuildFailureException.java new file mode 100644 index 00000000..66ed3a08 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectBuildFailureException.java @@ -0,0 +1,55 @@ +package org.apache.maven; + +/* + * 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.plugin.MojoFailureException; + +/** + * Exception which occurs when a normal (i.e. non-aggregator) mojo fails to + * execute. In this case, the mojo failed while executing against a particular + * project instance, so we can wrap the {@link MojoFailureException} with context + * information including projectId that caused the failure. + * + * @author jdcasey + * + */ +public class ProjectBuildFailureException + extends BuildFailureException +{ + + private final String projectId; + + public ProjectBuildFailureException( String projectId, MojoFailureException cause ) + { + super( "Build for project: " + projectId + " failed during execution of mojo.", cause ); + + this.projectId = projectId; + } + + public MojoFailureException getMojoFailureException() + { + return (MojoFailureException) getCause(); + } + + public String getProjectId() + { + return projectId; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectCycleException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectCycleException.java new file mode 100644 index 00000000..ecd8ecac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectCycleException.java @@ -0,0 +1,39 @@ +package org.apache.maven; + +/* + * 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.codehaus.plexus.util.dag.CycleDetectedException; + +/** + * @author jdcasey + */ +public class ProjectCycleException + extends BuildFailureException +{ + public ProjectCycleException( String message ) + { + super( message ); + } + + public ProjectCycleException( String message, CycleDetectedException cause ) + { + super( message, cause ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectDependenciesResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectDependenciesResolver.java new file mode 100644 index 00000000..01e62278 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ProjectDependenciesResolver.java @@ -0,0 +1,95 @@ +package org.apache.maven; + +/* + * 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.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.project.MavenProject; + +@Deprecated +/** + * @deprecated As of 3.2.2, and there is no direct replacement. This is an internal class which was not marked as such, + * but should have been. + * @author jvanzyl + * + */ +public interface ProjectDependenciesResolver +{ + + /** + * Resolves the transitive dependencies of the specified project. + * + * @param project The project whose dependencies should be resolved, must not be {@code null}. + * @param scopesToResolve The dependency scopes that should be resolved, may be {@code null}. + * @param session The current build session, must not be {@code null}. + * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}. + */ + Set<Artifact> resolve( MavenProject project, Collection<String> scopesToResolve, MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + /** + * Resolves the transitive dependencies of the specified project. + * + * @param project The project whose dependencies should be resolved, must not be {@code null}. + * @param scopesToCollect The dependency scopes that should be collected, may be {@code null}. + * @param scopesToResolve The dependency scopes that should be collected and also resolved, may be {@code null}. + * @param session The current build session, must not be {@code null}. + * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}. + */ + Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + /** + * Resolves the transitive dependencies of the specified project. + * + * @param project The project whose dependencies should be resolved, must not be {@code null}. + * @param scopesToCollect The dependency scopes that should be collected, may be {@code null}. + * @param scopesToResolve The dependency scopes that should be collected and also resolved, may be {@code null}. + * @param session The current build session, must not be {@code null}. + * @param ignoreableArtifacts Artifacts that need not be resolved + * @return The transitive dependencies of the specified project that match the requested scopes, never {@code null}. + */ + Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session, Set<Artifact> ignoreableArtifacts ) + throws ArtifactResolutionException, ArtifactNotFoundException; + + /** + * Resolves the transitive dependencies of the specified projects. Note that dependencies which can't be resolved + * from any repository but are present among the set of specified projects will not cause an exception. Instead, + * those unresolved artifacts will be returned in the result set, allowing the caller to take special care of + * artifacts that haven't been build yet. + * + * @param projects The projects whose dependencies should be resolved, may be {@code null}. + * @param scopes The dependency scopes that should be resolved, may be {@code null}. + * @param session The current build session, must not be {@code null}. + * @return The transitive dependencies of the specified projects that match the requested scopes, never + * {@code null}. + */ + Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes, + MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ReactorReader.java new file mode 100644 index 00000000..252bdd09 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -0,0 +1,255 @@ +package org.apache.maven; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Model; +import org.apache.maven.project.MavenProject; +import org.apache.maven.repository.internal.MavenWorkspaceReader; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.repository.WorkspaceRepository; +import org.eclipse.aether.util.artifact.ArtifactIdUtils; + +/** + * An implementation of a workspace reader that knows how to search the Maven reactor for artifacts, either + * as packaged jar if it has been built, or only compile output directory if packaging hasn't happened yet. + * + * @author Jason van Zyl + */ +@Named( ReactorReader.HINT ) +@SessionScoped +class ReactorReader + implements MavenWorkspaceReader +{ + public static final String HINT = "reactor"; + + private static final Collection<String> COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" ); + + private Map<String, MavenProject> projectsByGAV; + + private Map<String, List<MavenProject>> projectsByGA; + + private WorkspaceRepository repository; + + @Inject + public ReactorReader( MavenSession session ) + { + projectsByGAV = session.getProjectMap(); + + projectsByGA = new HashMap<String, List<MavenProject>>( projectsByGAV.size() * 2 ); + for ( MavenProject project : projectsByGAV.values() ) + { + String key = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ); + + List<MavenProject> projects = projectsByGA.get( key ); + + if ( projects == null ) + { + projects = new ArrayList<MavenProject>( 1 ); + projectsByGA.put( key, projects ); + } + + projects.add( project ); + } + + repository = new WorkspaceRepository( "reactor", new HashSet<String>( projectsByGAV.keySet() ) ); + } + + // + // Public API + // + + public WorkspaceRepository getRepository() + { + return repository; + } + + public File findArtifact( Artifact artifact ) + { + String projectKey = ArtifactUtils.key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); + + MavenProject project = projectsByGAV.get( projectKey ); + + if ( project != null ) + { + File file = find( project, artifact ); + if ( file == null && project != project.getExecutionProject() ) + { + file = find( project.getExecutionProject(), artifact ); + } + return file; + } + + return null; + } + + public List<String> findVersions( Artifact artifact ) + { + String key = ArtifactUtils.versionlessKey( artifact.getGroupId(), artifact.getArtifactId() ); + + List<MavenProject> projects = projectsByGA.get( key ); + if ( projects == null || projects.isEmpty() ) + { + return Collections.emptyList(); + } + + List<String> versions = new ArrayList<String>(); + + for ( MavenProject project : projects ) + { + if ( find( project, artifact ) != null ) + { + versions.add( project.getVersion() ); + } + } + + return Collections.unmodifiableList( versions ); + } + + @Override + public Model findModel( Artifact artifact ) + { + String projectKey = ArtifactUtils.key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); + MavenProject project = projectsByGAV.get( projectKey ); + return project == null ? null : project.getModel(); + } + + // + // Implementation + // + + private File find( MavenProject project, Artifact artifact ) + { + if ( "pom".equals( artifact.getExtension() ) ) + { + return project.getFile(); + } + + Artifact projectArtifact = findMatchingArtifact( project, artifact ); + + if ( hasArtifactFileFromPackagePhase( projectArtifact ) ) + { + return projectArtifact.getFile(); + } + else if ( !hasBeenPackaged( project ) ) + { + // fallback to loose class files only if artifacts haven't been packaged yet + // and only for plain old jars. Not war files, not ear files, not anything else. + + if ( isTestArtifact( artifact ) ) + { + if ( project.hasLifecyclePhase( "test-compile" ) ) + { + return new File( project.getBuild().getTestOutputDirectory() ); + } + } + else + { + String type = artifact.getProperty( "type", "" ); + if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) ) + { + return new File( project.getBuild().getOutputDirectory() ); + } + } + } + + // The fall-through indicates that the artifact cannot be found; + // for instance if package produced nothing or classifier problems. + return null; + } + + private boolean hasArtifactFileFromPackagePhase( Artifact projectArtifact ) + { + return projectArtifact != null && projectArtifact.getFile() != null && projectArtifact.getFile().exists(); + } + + private boolean hasBeenPackaged( MavenProject project ) + { + return project.hasLifecyclePhase( "package" ) || project.hasLifecyclePhase( "install" ) + || project.hasLifecyclePhase( "deploy" ); + } + + /** + * Tries to resolve the specified artifact from the artifacts of the given project. + * + * @param project The project to try to resolve the artifact from, must not be <code>null</code>. + * @param requestedArtifact The artifact to resolve, must not be <code>null</code>. + * @return The matching artifact from the project or <code>null</code> if not found. Note that this + */ + private Artifact findMatchingArtifact( MavenProject project, Artifact requestedArtifact ) + { + String requestedRepositoryConflictId = ArtifactIdUtils.toVersionlessId( requestedArtifact ); + + Artifact mainArtifact = RepositoryUtils.toArtifact( project.getArtifact() ); + if ( requestedRepositoryConflictId.equals( ArtifactIdUtils.toVersionlessId( mainArtifact ) ) ) + { + return mainArtifact; + } + + for ( Artifact attachedArtifact : RepositoryUtils.toArtifacts( project.getAttachedArtifacts() ) ) + { + if ( attachedArtifactComparison( requestedArtifact, attachedArtifact ) ) + { + return attachedArtifact; + } + } + + return null; + } + + private boolean attachedArtifactComparison( Artifact requested, Artifact attached ) + { + // + // We are taking as much as we can from the DefaultArtifact.equals(). The requested artifact has no file so + // we want to remove that from the comparison. + // + return requested.getArtifactId().equals( attached.getArtifactId() ) + && requested.getGroupId().equals( attached.getGroupId() ) + && requested.getVersion().equals( attached.getVersion() ) + && requested.getExtension().equals( attached.getExtension() ) + && requested.getClassifier().equals( attached.getClassifier() ); + } + + /** + * Determines whether the specified artifact refers to test classes. + * + * @param artifact The artifact to check, must not be {@code null}. + * @return {@code true} if the artifact refers to test classes, {@code false} otherwise. + */ + private static boolean isTestArtifact( Artifact artifact ) + { + return ( "test-jar".equals( artifact.getProperty( "type", "" ) ) ) + || ( "jar".equals( artifact.getExtension() ) && "tests".equals( artifact.getClassifier() ) ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java new file mode 100644 index 00000000..d7fd88e2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java @@ -0,0 +1,362 @@ +package org.apache.maven; + +/* + * 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.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.handler.DefaultArtifactHandler; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.artifact.ArtifactType; +import org.eclipse.aether.artifact.ArtifactTypeRegistry; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.artifact.DefaultArtifactType; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.graph.Exclusion; +import org.eclipse.aether.repository.Authentication; +import org.eclipse.aether.repository.Proxy; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.util.repository.AuthenticationBuilder; + +/** + * <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part + * of the public API. In particular, this class can be changed or deleted without prior notice. + * + * @author Benjamin Bentmann + */ +public class RepositoryUtils +{ + + private static String nullify( String string ) + { + return ( string == null || string.length() <= 0 ) ? null : string; + } + + private static org.apache.maven.artifact.Artifact toArtifact( Dependency dependency ) + { + if ( dependency == null ) + { + return null; + } + + org.apache.maven.artifact.Artifact result = toArtifact( dependency.getArtifact() ); + result.setScope( dependency.getScope() ); + result.setOptional( dependency.isOptional() ); + + return result; + } + + public static org.apache.maven.artifact.Artifact toArtifact( Artifact artifact ) + { + if ( artifact == null ) + { + return null; + } + + ArtifactHandler handler = newHandler( artifact ); + + /* + * NOTE: From Artifact.hasClassifier(), an empty string and a null both denote "no classifier". However, some + * plugins only check for null, so be sure to nullify an empty classifier. + */ + org.apache.maven.artifact.Artifact result = + new org.apache.maven.artifact.DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), + artifact.getVersion(), null, + artifact.getProperty( ArtifactProperties.TYPE, + artifact.getExtension() ), + nullify( artifact.getClassifier() ), handler ); + + result.setFile( artifact.getFile() ); + result.setResolved( artifact.getFile() != null ); + + List<String> trail = new ArrayList<String>( 1 ); + trail.add( result.getId() ); + result.setDependencyTrail( trail ); + + return result; + } + + public static void toArtifacts( Collection<org.apache.maven.artifact.Artifact> artifacts, + Collection<? extends DependencyNode> nodes, List<String> trail, + DependencyFilter filter ) + { + for ( DependencyNode node : nodes ) + { + org.apache.maven.artifact.Artifact artifact = toArtifact( node.getDependency() ); + + List<String> nodeTrail = new ArrayList<String>( trail.size() + 1 ); + nodeTrail.addAll( trail ); + nodeTrail.add( artifact.getId() ); + + if ( filter == null || filter.accept( node, Collections.<DependencyNode>emptyList() ) ) + { + artifact.setDependencyTrail( nodeTrail ); + artifacts.add( artifact ); + } + + toArtifacts( artifacts, node.getChildren(), nodeTrail, filter ); + } + } + + public static Artifact toArtifact( org.apache.maven.artifact.Artifact artifact ) + { + if ( artifact == null ) + { + return null; + } + + String version = artifact.getVersion(); + if ( version == null && artifact.getVersionRange() != null ) + { + version = artifact.getVersionRange().toString(); + } + + Map<String, String> props = null; + if ( org.apache.maven.artifact.Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) + { + String localPath = ( artifact.getFile() != null ) ? artifact.getFile().getPath() : ""; + props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, localPath ); + } + + Artifact result = + new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(), + artifact.getArtifactHandler().getExtension(), version, props, + newArtifactType( artifact.getType(), artifact.getArtifactHandler() ) ); + result = result.setFile( artifact.getFile() ); + + return result; + } + + public static Dependency toDependency( org.apache.maven.artifact.Artifact artifact, + Collection<org.apache.maven.model.Exclusion> exclusions ) + { + if ( artifact == null ) + { + return null; + } + + Artifact result = toArtifact( artifact ); + + List<Exclusion> excl = null; + if ( exclusions != null ) + { + excl = new ArrayList<Exclusion>( exclusions.size() ); + for ( org.apache.maven.model.Exclusion exclusion : exclusions ) + { + excl.add( toExclusion( exclusion ) ); + } + } + + return new Dependency( result, artifact.getScope(), artifact.isOptional(), excl ); + } + + public static List<RemoteRepository> toRepos( List<ArtifactRepository> repos ) + { + if ( repos == null ) + { + return null; + } + + List<RemoteRepository> results = new ArrayList<RemoteRepository>( repos.size() ); + for ( ArtifactRepository repo : repos ) + { + results.add( toRepo( repo ) ); + } + return results; + } + + public static RemoteRepository toRepo( ArtifactRepository repo ) + { + RemoteRepository result = null; + if ( repo != null ) + { + RemoteRepository.Builder builder = + new RemoteRepository.Builder( repo.getId(), getLayout( repo ), repo.getUrl() ); + builder.setSnapshotPolicy( toPolicy( repo.getSnapshots() ) ); + builder.setReleasePolicy( toPolicy( repo.getReleases() ) ); + builder.setAuthentication( toAuthentication( repo.getAuthentication() ) ); + builder.setProxy( toProxy( repo.getProxy() ) ); + builder.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) ); + result = builder.build(); + } + return result; + } + + public static String getLayout( ArtifactRepository repo ) + { + try + { + return repo.getLayout().getId(); + } + catch ( LinkageError e ) + { + /* + * NOTE: getId() was added in 3.x and is as such not implemented by plugins compiled against 2.x APIs. + */ + String className = repo.getLayout().getClass().getSimpleName(); + if ( className.endsWith( "RepositoryLayout" ) ) + { + String layout = className.substring( 0, className.length() - "RepositoryLayout".length() ); + if ( layout.length() > 0 ) + { + layout = Character.toLowerCase( layout.charAt( 0 ) ) + layout.substring( 1 ); + return layout; + } + } + return ""; + } + } + + private static RepositoryPolicy toPolicy( ArtifactRepositoryPolicy policy ) + { + RepositoryPolicy result = null; + if ( policy != null ) + { + result = new RepositoryPolicy( policy.isEnabled(), policy.getUpdatePolicy(), policy.getChecksumPolicy() ); + } + return result; + } + + private static Authentication toAuthentication( org.apache.maven.artifact.repository.Authentication auth ) + { + Authentication result = null; + if ( auth != null ) + { + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.addUsername( auth.getUsername() ).addPassword( auth.getPassword() ); + authBuilder.addPrivateKey( auth.getPrivateKey(), auth.getPassphrase() ); + result = authBuilder.build(); + } + return result; + } + + private static Proxy toProxy( org.apache.maven.repository.Proxy proxy ) + { + Proxy result = null; + if ( proxy != null ) + { + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.addUsername( proxy.getUserName() ).addPassword( proxy.getPassword() ); + result = new Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authBuilder.build() ); + } + return result; + } + + public static ArtifactHandler newHandler( Artifact artifact ) + { + String type = artifact.getProperty( ArtifactProperties.TYPE, artifact.getExtension() ); + DefaultArtifactHandler handler = new DefaultArtifactHandler( type ); + handler.setExtension( artifact.getExtension() ); + handler.setLanguage( artifact.getProperty( ArtifactProperties.LANGUAGE, null ) ); + String addedToClasspath = artifact.getProperty( ArtifactProperties.CONSTITUTES_BUILD_PATH, "" ); + handler.setAddedToClasspath( Boolean.parseBoolean( addedToClasspath ) ); + String includesDependencies = artifact.getProperty( ArtifactProperties.INCLUDES_DEPENDENCIES, "" ); + handler.setIncludesDependencies( Boolean.parseBoolean( includesDependencies ) ); + return handler; + } + + public static ArtifactType newArtifactType( String id, ArtifactHandler handler ) + { + return new DefaultArtifactType( id, handler.getExtension(), handler.getClassifier(), handler.getLanguage(), + handler.isAddedToClasspath(), handler.isIncludesDependencies() ); + } + + public static Dependency toDependency( org.apache.maven.model.Dependency dependency, + ArtifactTypeRegistry stereotypes ) + { + ArtifactType stereotype = stereotypes.get( dependency.getType() ); + if ( stereotype == null ) + { + stereotype = new DefaultArtifactType( dependency.getType() ); + } + + boolean system = dependency.getSystemPath() != null && dependency.getSystemPath().length() > 0; + + Map<String, String> props = null; + if ( system ) + { + props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, dependency.getSystemPath() ); + } + + Artifact artifact = + new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), null, + dependency.getVersion(), props, stereotype ); + + List<Exclusion> exclusions = new ArrayList<Exclusion>( dependency.getExclusions().size() ); + for ( org.apache.maven.model.Exclusion exclusion : dependency.getExclusions() ) + { + exclusions.add( toExclusion( exclusion ) ); + } + + Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(), exclusions ); + + return result; + } + + private static Exclusion toExclusion( org.apache.maven.model.Exclusion exclusion ) + { + return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); + } + + public static ArtifactTypeRegistry newArtifactTypeRegistry( ArtifactHandlerManager handlerManager ) + { + return new MavenArtifactTypeRegistry( handlerManager ); + } + + static class MavenArtifactTypeRegistry + implements ArtifactTypeRegistry + { + + private final ArtifactHandlerManager handlerManager; + + public MavenArtifactTypeRegistry( ArtifactHandlerManager handlerManager ) + { + this.handlerManager = handlerManager; + } + + public ArtifactType get( String stereotypeId ) + { + ArtifactHandler handler = handlerManager.getArtifactHandler( stereotypeId ); + return newArtifactType( stereotypeId, handler ); + } + + } + + public static Collection<Artifact> toArtifacts( Collection<org.apache.maven.artifact.Artifact> artifactsToConvert ) + { + List<Artifact> artifacts = new ArrayList<Artifact>(); + for ( org.apache.maven.artifact.Artifact a : artifactsToConvert ) + { + artifacts.add( toArtifact( a ) ); + } + return artifacts; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/SessionScoped.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/SessionScoped.java new file mode 100644 index 00000000..63b1eb77 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/SessionScoped.java @@ -0,0 +1,42 @@ +package org.apache.maven; + +/* + * 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 static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import com.google.inject.ScopeAnnotation; + +/** + * Indicates that annotated component should be instantiated before session starts and discarded after session execution + * completes. + * + * @author Jason van Zyl + * @since 3.2.0 + */ +@Target( { TYPE } ) +@Retention( RUNTIME ) +@ScopeAnnotation +public @interface SessionScoped +{ +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/DependencyResolutionRequiredException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/DependencyResolutionRequiredException.java new file mode 100644 index 00000000..b54ba070 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/DependencyResolutionRequiredException.java @@ -0,0 +1,35 @@ +package org.apache.maven.artifact; + +/* + * 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. + */ + +/** + * Exception that occurs when an artifact file is used, but has not been resolved. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + * @todo it may be better for artifact.getFile() to throw it - perhaps it is a runtime exception? + */ +public class DependencyResolutionRequiredException + extends Exception +{ + public DependencyResolutionRequiredException( Artifact artifact ) + { + super( "Attempted to access the artifact " + artifact + "; which has not yet been resolved" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/InvalidRepositoryException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/InvalidRepositoryException.java new file mode 100644 index 00000000..62991f11 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/InvalidRepositoryException.java @@ -0,0 +1,65 @@ +package org.apache.maven.artifact; + +/* + * 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.net.MalformedURLException; + +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +/** + * Error constructing an artifact repository. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class InvalidRepositoryException + extends Exception +{ + private final String repositoryId; + + public InvalidRepositoryException( String message, String repositoryId, MalformedURLException cause ) + { + super( message, cause ); + this.repositoryId = repositoryId; + } + + protected InvalidRepositoryException( String message, String repositoryId, ComponentLookupException cause ) + { + super( message, cause ); + this.repositoryId = repositoryId; + } + + @Deprecated + public InvalidRepositoryException( String message, Throwable t ) + { + super( message, t ); + this.repositoryId = null; + } + + public InvalidRepositoryException( String message, String repositoryId ) + { + super( message ); + this.repositoryId = repositoryId; + } + + public String getRepositoryId() + { + return repositoryId; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java new file mode 100644 index 00000000..a16f64f6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java @@ -0,0 +1,59 @@ +package org.apache.maven.artifact.factory; + +/* + * 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.Artifact; +import org.apache.maven.artifact.versioning.VersionRange; + +@Deprecated +public interface ArtifactFactory +{ + @Deprecated + String ROLE = ArtifactFactory.class.getName(); + + Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ); + + Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, + String classifier ); + + Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope ); + + Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope, boolean optional ); + + Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope, String inheritedScope ); + + Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope, String inheritedScope, boolean optional ); + + Artifact createBuildArtifact( String groupId, String artifactId, String version, String packaging ); + + Artifact createProjectArtifact( String groupId, String artifactId, String version ); + + Artifact createParentArtifact( String groupId, String artifactId, String version ); + + Artifact createPluginArtifact( String groupId, String artifactId, VersionRange versionRange ); + + Artifact createProjectArtifact( String groupId, String artifactId, String version, String scope ); + + Artifact createExtensionArtifact( String groupId, String artifactId, VersionRange versionRange ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java new file mode 100644 index 00000000..dfcac019 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java @@ -0,0 +1,160 @@ +package org.apache.maven.artifact.factory; + +/* + * 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.Artifact; +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.artifact.versioning.VersionRange; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +@Component( role = ArtifactFactory.class ) +public class DefaultArtifactFactory + implements ArtifactFactory +{ + @Requirement + private ArtifactHandlerManager artifactHandlerManager; + + public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ) + { + return createArtifact( groupId, artifactId, version, scope, type, null, null ); + } + + public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, + String classifier ) + { + return createArtifact( groupId, artifactId, version, null, type, classifier, null ); + } + + public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, + String type, String classifier, String scope ) + { + return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, null ); + } + + public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, + String type, String classifier, String scope, boolean optional ) + { + return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, null, optional ); + } + + public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, + String type, String classifier, String scope, String inheritedScope ) + { + return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope ); + } + + public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, + String type, String classifier, String scope, String inheritedScope, + boolean optional ) + { + return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope, optional ); + } + + public Artifact createBuildArtifact( String groupId, String artifactId, String version, String packaging ) + { + return createArtifact( groupId, artifactId, version, null, packaging, null, null ); + } + + public Artifact createProjectArtifact( String groupId, String artifactId, String version ) + { + return createProjectArtifact( groupId, artifactId, version, null ); + } + + public Artifact createParentArtifact( String groupId, String artifactId, String version ) + { + return createProjectArtifact( groupId, artifactId, version ); + } + + public Artifact createPluginArtifact( String groupId, String artifactId, VersionRange versionRange ) + { + return createArtifact( groupId, artifactId, versionRange, "maven-plugin", null, Artifact.SCOPE_RUNTIME, null ); + } + + public Artifact createProjectArtifact( String groupId, String artifactId, String version, String scope ) + { + return createArtifact( groupId, artifactId, version, scope, "pom" ); + } + + public Artifact createExtensionArtifact( String groupId, String artifactId, VersionRange versionRange ) + { + return createArtifact( groupId, artifactId, versionRange, "jar", null, Artifact.SCOPE_RUNTIME, null ); + } + + private Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type, + String classifier, String inheritedScope ) + { + VersionRange versionRange = null; + if ( version != null ) + { + versionRange = VersionRange.createFromVersion( version ); + } + return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope ); + } + + private Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope, String inheritedScope ) + { + return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope, false ); + } + + private Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope, String inheritedScope, boolean optional ) + { + String desiredScope = Artifact.SCOPE_RUNTIME; + + if ( inheritedScope == null ) + { + desiredScope = scope; + } + else if ( Artifact.SCOPE_TEST.equals( scope ) || Artifact.SCOPE_PROVIDED.equals( scope ) ) + { + return null; + } + else if ( Artifact.SCOPE_COMPILE.equals( scope ) && Artifact.SCOPE_COMPILE.equals( inheritedScope ) ) + { + // added to retain compile artifactScope. Remove if you want compile inherited as runtime + desiredScope = Artifact.SCOPE_COMPILE; + } + + if ( Artifact.SCOPE_TEST.equals( inheritedScope ) ) + { + desiredScope = Artifact.SCOPE_TEST; + } + + if ( Artifact.SCOPE_PROVIDED.equals( inheritedScope ) ) + { + desiredScope = Artifact.SCOPE_PROVIDED; + } + + if ( Artifact.SCOPE_SYSTEM.equals( scope ) ) + { + // system scopes come through unchanged... + desiredScope = Artifact.SCOPE_SYSTEM; + } + + ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( type ); + + return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler, + optional ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java new file mode 100644 index 00000000..628f38bc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/DefaultArtifactHandler.java @@ -0,0 +1,134 @@ +package org.apache.maven.artifact.handler; + +/* + * 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.codehaus.plexus.component.annotations.Component; + +/** + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + * @author Jason van Zyl + */ +@Component( role = ArtifactHandler.class ) +public class DefaultArtifactHandler + implements ArtifactHandler +{ + private String extension; + + private String type; + + private String classifier; + + private String directory; + + private String packaging; + + private boolean includesDependencies; + + private String language; + + private boolean addedToClasspath; + + public DefaultArtifactHandler() + { + } + + public DefaultArtifactHandler( String type ) + { + this.type = type; + } + + public String getExtension() + { + if ( extension == null ) + { + extension = type; + } + return extension; + } + + public void setExtension( String extension ) + { + this.extension = extension; + } + + public String getType() + { + return type; + } + + public String getClassifier() + { + return classifier; + } + + public String getDirectory() + { + if ( directory == null ) + { + directory = getPackaging() + "s"; + } + return directory; + } + + public String getPackaging() + { + if ( packaging == null ) + { + packaging = type; + } + return packaging; + } + + public boolean isIncludesDependencies() + { + return includesDependencies; + } + + public void setIncludesDependencies( boolean includesDependencies ) + { + this.includesDependencies = includesDependencies; + } + + public String getLanguage() + { + if ( language == null ) + { + language = "none"; + } + + return language; + } + + public void setLanguage( String language ) + { + this.language = language; + } + + public boolean isAddedToClasspath() + { + return addedToClasspath; + } + + public void setAddedToClasspath( boolean addedToClasspath ) + { + this.addedToClasspath = addedToClasspath; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java new file mode 100644 index 00000000..cada9e93 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/ArtifactHandlerManager.java @@ -0,0 +1,37 @@ +package org.apache.maven.artifact.handler.manager; + +/* + * 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.Map; + +import org.apache.maven.artifact.handler.ArtifactHandler; + +/** + * @author Jason van Zyl + */ +public interface ArtifactHandlerManager +{ + String ROLE = ArtifactHandlerManager.class.getName(); + + ArtifactHandler getArtifactHandler( String type ); + + @Deprecated + void addHandlers( Map<String, ArtifactHandler> handlers ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java new file mode 100644 index 00000000..6be636b0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/handler/manager/DefaultArtifactHandlerManager.java @@ -0,0 +1,73 @@ +package org.apache.maven.artifact.handler.manager; + +/* + * 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.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.handler.DefaultArtifactHandler; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +/** + * @author Jason van Zyl + */ +@Component( role = ArtifactHandlerManager.class ) +public class DefaultArtifactHandlerManager + implements ArtifactHandlerManager +{ + + @Requirement( role = ArtifactHandler.class ) + private Map<String, ArtifactHandler> artifactHandlers; + + private Map<String, ArtifactHandler> unmanagedHandlers = new ConcurrentHashMap<String, ArtifactHandler>(); + + public ArtifactHandler getArtifactHandler( String type ) + { + ArtifactHandler handler = unmanagedHandlers.get( type ); + + if ( handler == null ) + { + handler = artifactHandlers.get( type ); + + if ( handler == null ) + { + handler = new DefaultArtifactHandler( type ); + } + } + + return handler; + } + + public void addHandlers( Map<String, ArtifactHandler> handlers ) + { + // legacy support for maven-gpg-plugin:1.0 + unmanagedHandlers.putAll( handlers ); + } + + @Deprecated + public Set<String> getHandlerTypes() + { + return artifactHandlers.keySet(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java new file mode 100644 index 00000000..5ef3a980 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/AbstractArtifactMetadata.java @@ -0,0 +1,33 @@ +package org.apache.maven.artifact.metadata; + +/* + * 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.Artifact; + +@Deprecated +public abstract class AbstractArtifactMetadata + extends org.apache.maven.repository.legacy.metadata.AbstractArtifactMetadata + implements org.apache.maven.artifact.metadata.ArtifactMetadata +{ + protected AbstractArtifactMetadata( Artifact artifact ) + { + super( artifact ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataRetrievalException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataRetrievalException.java new file mode 100644 index 00000000..e419ef9e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataRetrievalException.java @@ -0,0 +1,55 @@ +package org.apache.maven.artifact.metadata; + +/* + * 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.Artifact; + +@Deprecated +public class ArtifactMetadataRetrievalException + extends org.apache.maven.repository.legacy.metadata.ArtifactMetadataRetrievalException +{ + + /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ + @Deprecated + public ArtifactMetadataRetrievalException( String message ) + { + super( message, null, null ); + } + + /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ + @Deprecated + public ArtifactMetadataRetrievalException( Throwable cause ) + { + super( null, cause, null ); + } + + /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ + @Deprecated + public ArtifactMetadataRetrievalException( String message, + Throwable cause ) + { + super( message, cause, null ); + } + + public ArtifactMetadataRetrievalException( String message, Throwable cause, Artifact artifact ) + { + super( message, cause, artifact ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java new file mode 100644 index 00000000..ccd58363 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java @@ -0,0 +1,52 @@ +package org.apache.maven.artifact.metadata; + +/* + * 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.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest; + +@Deprecated +public interface ArtifactMetadataSource + extends org.apache.maven.repository.legacy.metadata.ArtifactMetadataSource +{ + + ResolutionGroup retrieve( MetadataResolutionRequest request ) + throws ArtifactMetadataRetrievalException; + + ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + throws ArtifactMetadataRetrievalException; + + List<ArtifactVersion> retrieveAvailableVersions( MetadataResolutionRequest request ) + throws ArtifactMetadataRetrievalException; + + List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + throws ArtifactMetadataRetrievalException; + + List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository( Artifact artifact, + ArtifactRepository localRepository, + ArtifactRepository remoteRepository ) + throws ArtifactMetadataRetrievalException; +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ResolutionGroup.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ResolutionGroup.java new file mode 100644 index 00000000..c219b24e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/metadata/ResolutionGroup.java @@ -0,0 +1,46 @@ +package org.apache.maven.artifact.metadata; + +/* + * 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.Map; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; + +@Deprecated +public class ResolutionGroup + extends org.apache.maven.repository.legacy.metadata.ResolutionGroup +{ + + public ResolutionGroup( Artifact pomArtifact, Set<Artifact> artifacts, + List<ArtifactRepository> resolutionRepositories ) + { + super( pomArtifact, artifacts, resolutionRepositories ); + } + + public ResolutionGroup( Artifact pomArtifact, Artifact relocatedArtifact, Set<Artifact> artifacts, + Map<String, Artifact> managedVersions, List<ArtifactRepository> resolutionRepositories ) + { + super( pomArtifact, relocatedArtifact, artifacts, managedVersions, resolutionRepositories ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultRepositoryRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultRepositoryRequest.java new file mode 100644 index 00000000..6b18789d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultRepositoryRequest.java @@ -0,0 +1,134 @@ +package org.apache.maven.artifact.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.project.MavenProject; + +/** + * Collects basic settings to access the repository system. + * + * @author Benjamin Bentmann + */ +public class DefaultRepositoryRequest + implements RepositoryRequest +{ + + private boolean offline; + + private boolean forceUpdate; + + private ArtifactRepository localRepository; + + private List<ArtifactRepository> remoteRepositories; + + /** + * Creates an empty repository request. + */ + public DefaultRepositoryRequest() + { + // enables no-arg constructor + } + + /** + * Creates a shallow copy of the specified repository request. + * + * @param repositoryRequest The repository request to copy from, must not be {@code null}. + */ + public DefaultRepositoryRequest( RepositoryRequest repositoryRequest ) + { + setLocalRepository( repositoryRequest.getLocalRepository() ); + setRemoteRepositories( repositoryRequest.getRemoteRepositories() ); + setOffline( repositoryRequest.isOffline() ); + setForceUpdate( repositoryRequest.isForceUpdate() ); + } + + public static RepositoryRequest getRepositoryRequest( MavenSession session, MavenProject project ) + { + RepositoryRequest request = new DefaultRepositoryRequest(); + + request.setLocalRepository( session.getLocalRepository() ); + if ( project != null ) + { + request.setRemoteRepositories( project.getPluginArtifactRepositories() ); + } + request.setOffline( session.isOffline() ); + request.setForceUpdate( session.getRequest().isUpdateSnapshots() ); + + return request; + } + + public boolean isOffline() + { + return offline; + } + + public DefaultRepositoryRequest setOffline( boolean offline ) + { + this.offline = offline; + + return this; + } + + public boolean isForceUpdate() + { + return forceUpdate; + } + + public DefaultRepositoryRequest setForceUpdate( boolean forceUpdate ) + { + this.forceUpdate = forceUpdate; + + return this; + } + + public ArtifactRepository getLocalRepository() + { + return localRepository; + } + + public DefaultRepositoryRequest setLocalRepository( ArtifactRepository localRepository ) + { + this.localRepository = localRepository; + + return this; + } + + public List<ArtifactRepository> getRemoteRepositories() + { + if ( remoteRepositories == null ) + { + remoteRepositories = new ArrayList<ArtifactRepository>(); + } + + return remoteRepositories; + } + + public DefaultRepositoryRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) + { + this.remoteRepositories = remoteRepositories; + + return this; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java new file mode 100644 index 00000000..f56fb459 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/LegacyLocalRepositoryManager.java @@ -0,0 +1,435 @@ +package org.apache.maven.artifact.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.File; +import java.util.Collections; +import java.util.List; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; +import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException; +import org.apache.maven.repository.Proxy; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.repository.LocalArtifactRegistration; +import org.eclipse.aether.repository.LocalArtifactRequest; +import org.eclipse.aether.repository.LocalArtifactResult; +import org.eclipse.aether.repository.LocalMetadataRegistration; +import org.eclipse.aether.repository.LocalMetadataRequest; +import org.eclipse.aether.repository.LocalMetadataResult; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part + * of the public API. In particular, this class can be changed or deleted without prior notice. + * + * @author Benjamin Bentmann + */ +public class LegacyLocalRepositoryManager + implements LocalRepositoryManager +{ + + private final ArtifactRepository delegate; + + private final LocalRepository repo; + + private final boolean realLocalRepo; + + public static RepositorySystemSession overlay( ArtifactRepository repository, RepositorySystemSession session, + RepositorySystem system ) + { + if ( repository == null || repository.getBasedir() == null ) + { + return session; + } + + if ( session != null ) + { + LocalRepositoryManager lrm = session.getLocalRepositoryManager(); + if ( lrm != null && lrm.getRepository().getBasedir().equals( new File( repository.getBasedir() ) ) ) + { + return session; + } + } + else + { + session = new DefaultRepositorySystemSession(); + } + + final LocalRepositoryManager llrm = new LegacyLocalRepositoryManager( repository ); + + return new DefaultRepositorySystemSession( session ).setLocalRepositoryManager( llrm ); + } + + private LegacyLocalRepositoryManager( ArtifactRepository delegate ) + { + if ( delegate == null ) + { + throw new IllegalArgumentException( "local repository delegate missing" ); + } + this.delegate = delegate; + + ArtifactRepositoryLayout layout = delegate.getLayout(); + repo = + new LocalRepository( new File( delegate.getBasedir() ), + ( layout != null ) ? layout.getClass().getSimpleName() : "legacy" ); + + /* + * NOTE: "invoker:install" vs "appassembler:assemble": Both mojos use the artifact installer to put an artifact + * into a repository. In the first case, the result needs to be a proper local repository that one can use for + * local artifact resolution. In the second case, the result needs to precisely obey the path information of the + * repository's layout to allow pointing at artifacts within the repository. Unfortunately, + * DefaultRepositoryLayout does not correctly describe the layout of a local repository which unlike a remote + * repository never uses timestamps in the filename of a snapshot artifact. The discrepancy gets notable when a + * remotely resolved snapshot artifact gets passed into pathOf(). So producing a proper local artifact path + * using DefaultRepositoryLayout requires us to enforce usage of the artifact's base version. This + * transformation however contradicts the other use case of precisely obeying the repository's layout. The below + * flag tries to detect which use case applies to make both plugins happy. + */ + realLocalRepo = ( layout instanceof DefaultRepositoryLayout ) && "local".equals( delegate.getId() ); + } + + public LocalRepository getRepository() + { + return repo; + } + + public String getPathForLocalArtifact( Artifact artifact ) + { + if ( realLocalRepo ) + { + return delegate.pathOf( RepositoryUtils.toArtifact( artifact.setVersion( artifact.getBaseVersion() ) ) ); + } + return delegate.pathOf( RepositoryUtils.toArtifact( artifact ) ); + } + + public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) + { + return delegate.pathOf( RepositoryUtils.toArtifact( artifact ) ); + } + + public String getPathForLocalMetadata( Metadata metadata ) + { + return delegate.pathOfLocalRepositoryMetadata( new ArtifactMetadataAdapter( metadata ), delegate ); + } + + public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) + { + return delegate.pathOfLocalRepositoryMetadata( new ArtifactMetadataAdapter( metadata ), + new ArtifactRepositoryAdapter( repository ) ); + } + + public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) + { + String path = getPathForLocalArtifact( request.getArtifact() ); + File file = new File( getRepository().getBasedir(), path ); + + LocalArtifactResult result = new LocalArtifactResult( request ); + if ( file.isFile() ) + { + result.setFile( file ); + result.setAvailable( true ); + } + + return result; + } + + public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) + { + Metadata metadata = request.getMetadata(); + + String path; + if ( request.getRepository() == null ) + { + path = getPathForLocalMetadata( metadata ); + } + else + { + path = getPathForRemoteMetadata( metadata, request.getRepository(), request.getContext() ); + } + + File file = new File( getRepository().getBasedir(), path ); + + LocalMetadataResult result = new LocalMetadataResult( request ); + if ( file.isFile() ) + { + result.setFile( file ); + } + + return result; + } + + public void add( RepositorySystemSession session, LocalArtifactRegistration request ) + { + // noop + } + + public void add( RepositorySystemSession session, LocalMetadataRegistration request ) + { + // noop + } + + static class ArtifactMetadataAdapter + implements ArtifactMetadata + { + + private final Metadata metadata; + + public ArtifactMetadataAdapter( Metadata metadata ) + { + this.metadata = metadata; + } + + public boolean storedInArtifactVersionDirectory() + { + return metadata.getVersion().length() > 0; + } + + public boolean storedInGroupDirectory() + { + return metadata.getArtifactId().length() <= 0; + } + + public String getGroupId() + { + return nullify( metadata.getGroupId() ); + } + + public String getArtifactId() + { + return nullify( metadata.getArtifactId() ); + } + + public String getBaseVersion() + { + return nullify( metadata.getVersion() ); + } + + private String nullify( String str ) + { + return ( str == null || str.length() <= 0 ) ? null : str; + } + + public Object getKey() + { + return metadata.toString(); + } + + public String getRemoteFilename() + { + return metadata.getType(); + } + + public String getLocalFilename( ArtifactRepository repository ) + { + return insertRepositoryKey( getRemoteFilename(), repository.getKey() ); + } + + private String insertRepositoryKey( String filename, String repositoryKey ) + { + String result; + int idx = filename.indexOf( '.' ); + if ( idx < 0 ) + { + result = filename + '-' + repositoryKey; + } + else + { + result = filename.substring( 0, idx ) + '-' + repositoryKey + filename.substring( idx ); + } + return result; + } + + public void merge( org.apache.maven.repository.legacy.metadata.ArtifactMetadata metadata ) + { + // not used + } + + public void merge( ArtifactMetadata metadata ) + { + // not used + } + + public void storeInLocalRepository( ArtifactRepository localRepository, ArtifactRepository remoteRepository ) + throws RepositoryMetadataStoreException + { + // not used + } + + public String extendedToString() + { + return metadata.toString(); + } + + } + + static class ArtifactRepositoryAdapter + implements ArtifactRepository + { + + private final RemoteRepository repository; + + public ArtifactRepositoryAdapter( RemoteRepository repository ) + { + this.repository = repository; + } + + public String pathOf( org.apache.maven.artifact.Artifact artifact ) + { + return null; + } + + public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) + { + return null; + } + + public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) + { + return null; + } + + public String getUrl() + { + return repository.getUrl(); + } + + public void setUrl( String url ) + { + } + + public String getBasedir() + { + return null; + } + + public String getProtocol() + { + return repository.getProtocol(); + } + + public String getId() + { + return repository.getId(); + } + + public void setId( String id ) + { + } + + public ArtifactRepositoryPolicy getSnapshots() + { + return null; + } + + public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy ) + { + } + + public ArtifactRepositoryPolicy getReleases() + { + return null; + } + + public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy ) + { + } + + public ArtifactRepositoryLayout getLayout() + { + return null; + } + + public void setLayout( ArtifactRepositoryLayout layout ) + { + } + + public String getKey() + { + return getId(); + } + + public boolean isUniqueVersion() + { + return true; + } + + public boolean isBlacklisted() + { + return false; + } + + public void setBlacklisted( boolean blackListed ) + { + } + + public org.apache.maven.artifact.Artifact find( org.apache.maven.artifact.Artifact artifact ) + { + return null; + } + + public List<String> findVersions( org.apache.maven.artifact.Artifact artifact ) + { + return Collections.emptyList(); + } + + public boolean isProjectAware() + { + return false; + } + + public void setAuthentication( Authentication authentication ) + { + } + + public Authentication getAuthentication() + { + return null; + } + + public void setProxy( Proxy proxy ) + { + } + + public Proxy getProxy() + { + return null; + } + + public List<ArtifactRepository> getMirroredRepositories() + { + return Collections.emptyList(); + } + + public void setMirroredRepositories( List<ArtifactRepository> mirroredRepositories ) + { + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java new file mode 100644 index 00000000..8e45b203 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java @@ -0,0 +1,412 @@ +package org.apache.maven.artifact.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.File; +import java.util.Collections; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.repository.Proxy; + +//TODO: completely separate local and remote artifact repositories +public class MavenArtifactRepository + implements ArtifactRepository +{ + private String id; + + private String url; + + private String basedir; + + private String protocol; + + private ArtifactRepositoryLayout layout; + + private ArtifactRepositoryPolicy snapshots; + + private ArtifactRepositoryPolicy releases; + + private Authentication authentication; + + private Proxy proxy; + + private List<ArtifactRepository> mirroredRepositories = Collections.emptyList(); + + public MavenArtifactRepository() + { + } + + /** + * Create a remote download repository. + * + * @param id the unique identifier of the repository + * @param url the URL of the repository + * @param layout the layout of the repository + * @param snapshots the policies to use for snapshots + * @param releases the policies to use for releases + */ + public MavenArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, + ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases ) + { + this.id = id; + this.url = url; + this.layout = layout; + this.snapshots = snapshots; + this.releases = releases; + // + // Derive these from the URL + // + this.protocol = protocol( url ); + this.basedir = basedir( url ); + } + + public String pathOf( Artifact artifact ) + { + return layout.pathOf( artifact ); + } + + public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata ) + { + return layout.pathOfRemoteRepositoryMetadata( artifactMetadata ); + } + + public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) + { + return layout.pathOfLocalRepositoryMetadata( metadata, repository ); + } + + public void setLayout( ArtifactRepositoryLayout layout ) + { + this.layout = layout; + } + + public ArtifactRepositoryLayout getLayout() + { + return layout; + } + + public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy snapshots ) + { + this.snapshots = snapshots; + } + + public ArtifactRepositoryPolicy getSnapshots() + { + return snapshots; + } + + public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy releases ) + { + this.releases = releases; + } + + public ArtifactRepositoryPolicy getReleases() + { + return releases; + } + + public String getKey() + { + return getId(); + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + sb.append( " id: " ).append( getId() ).append( "\n" ); + sb.append( " url: " ).append( getUrl() ).append( "\n" ); + sb.append( " layout: " ).append( layout != null ? layout : "none" ).append( "\n" ); + + if ( proxy != null ) + { + sb.append( " proxy: " ).append( proxy.getHost() ).append( ":" ).append( proxy.getPort() ).append( "\n" ); + } + + if ( snapshots != null ) + { + sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() ); + sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( "]\n" ); + } + + if ( releases != null ) + { + sb.append( " releases: [enabled => " ).append( releases.isEnabled() ); + sb.append( ", update => " ).append( releases.getUpdatePolicy() ).append( "]\n" ); + } + + return sb.toString(); + } + + public Artifact find( Artifact artifact ) + { + File artifactFile = new File( getBasedir(), pathOf( artifact ) ); + + // We need to set the file here or the resolver will fail with an NPE, not fully equipped to deal + // with multiple local repository implementations yet. + artifact.setFile( artifactFile ); + + return artifact; + } + + public List<String> findVersions( Artifact artifact ) + { + return Collections.emptyList(); + } + + public String getId() + { + return id; + } + + public String getUrl() + { + return url; + } + + public String getBasedir() + { + return basedir; + } + + public String getProtocol() + { + return protocol; + } + + public void setId( String id ) + { + this.id = id; + } + + public void setUrl( String url ) + { + this.url = url; + + this.protocol = protocol( url ); + this.basedir = basedir( url ); + } + + // Path Utils + + /** + * Return the protocol name. + * <br/> + * E.g: for input + * <code>http://www.codehause.org</code> this method will return <code>http</code> + * + * @param url the url + * @return the host name + */ + private static String protocol( final String url ) + { + final int pos = url.indexOf( ":" ); + + if ( pos == -1 ) + { + return ""; + } + return url.substring( 0, pos ).trim(); + } + + /** + * Derive the path portion of the given URL. + * + * @param url the repository URL + * @return the basedir of the repository + * @todo need to URL decode for spaces? + */ + private String basedir( String url ) + { + String retValue = null; + + if ( protocol.equalsIgnoreCase( "file" ) ) + { + retValue = url.substring( protocol.length() + 1 ); + retValue = decode( retValue ); + // special case: if omitted // on protocol, keep path as is + if ( retValue.startsWith( "//" ) ) + { + retValue = retValue.substring( 2 ); + + if ( retValue.length() >= 2 && ( retValue.charAt( 1 ) == '|' || retValue.charAt( 1 ) == ':' ) ) + { + // special case: if there is a windows drive letter, then keep the original return value + retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); + } + else + { + // Now we expect the host + int index = retValue.indexOf( "/" ); + if ( index >= 0 ) + { + retValue = retValue.substring( index + 1 ); + } + + // special case: if there is a windows drive letter, then keep the original return value + if ( retValue.length() >= 2 && ( retValue.charAt( 1 ) == '|' || retValue.charAt( 1 ) == ':' ) ) + { + retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); + } + else if ( index >= 0 ) + { + // leading / was previously stripped + retValue = "/" + retValue; + } + } + } + + // special case: if there is a windows drive letter using |, switch to : + if ( retValue.length() >= 2 && retValue.charAt( 1 ) == '|' ) + { + retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 ); + } + + // normalize separators + retValue = new File( retValue ).getPath(); + } + + if ( retValue == null ) + { + retValue = "/"; + } + return retValue.trim(); + } + + /** + * Decodes the specified (portion of a) URL. <strong>Note:</strong> This decoder assumes that ISO-8859-1 is used to + * convert URL-encoded bytes to characters. + * + * @param url The URL to decode, may be <code>null</code>. + * @return The decoded URL or <code>null</code> if the input was <code>null</code>. + */ + private static String decode( String url ) + { + String decoded = url; + if ( url != null ) + { + int pos = -1; + while ( ( pos = decoded.indexOf( '%', pos + 1 ) ) >= 0 ) + { + if ( pos + 2 < decoded.length() ) + { + String hexStr = decoded.substring( pos + 1, pos + 3 ); + char ch = (char) Integer.parseInt( hexStr, 16 ); + decoded = decoded.substring( 0, pos ) + ch + decoded.substring( pos + 3 ); + } + } + } + return decoded; + } + + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ( ( getId() == null ) ? 0 : getId().hashCode() ); + return result; + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + if ( obj == null ) + { + return false; + } + if ( getClass() != obj.getClass() ) + { + return false; + } + + ArtifactRepository other = (ArtifactRepository) obj; + + return eq( getId(), other.getId() ); + } + + protected static <T> boolean eq( T s1, T s2 ) + { + return s1 != null ? s1.equals( s2 ) : s2 == null; + } + + public Authentication getAuthentication() + { + return authentication; + } + + public void setAuthentication( Authentication authentication ) + { + this.authentication = authentication; + } + + public Proxy getProxy() + { + return proxy; + } + + public void setProxy( Proxy proxy ) + { + this.proxy = proxy; + } + + public boolean isBlacklisted() + { + return false; + } + + public void setBlacklisted( boolean blackListed ) + { + // no op + } + + public boolean isUniqueVersion() + { + return true; + } + + public boolean isProjectAware() + { + return false; + } + + public List<ArtifactRepository> getMirroredRepositories() + { + return mirroredRepositories; + } + + public void setMirroredRepositories( List<ArtifactRepository> mirroredRepositories ) + { + if ( mirroredRepositories != null ) + { + this.mirroredRepositories = mirroredRepositories; + } + else + { + this.mirroredRepositories = Collections.emptyList(); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryCache.java new file mode 100644 index 00000000..bf79d698 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryCache.java @@ -0,0 +1,58 @@ +package org.apache.maven.artifact.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant + * for exclusive consumption by the repository system and is opaque to the cache implementation. + * + * @author Benjamin Bentmann + */ +@Deprecated +// +// Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave +// this here, possibly indefinitely. +// +public interface RepositoryCache +{ + + /** + * Puts the specified data into the cache. <strong>Warning:</strong> The cache will directly save the provided + * reference. If the cached data is mutable, i.e. could be modified after being put into the cache, the caller is + * responsible for creating a copy of the original data and store the copy in the cache. + * + * @param request The repository request from which this cache was retrieved, must not be {@code null}. + * @param key The key to use associate the data with, must not be {@code null}. + * @param data The data to store in the cache, may be {@code null}. + */ + void put( RepositoryRequest request, Object key, Object data ); + + /** + * Gets the specified data from the cache. <strong>Warning:</strong> The cache will directly return the saved + * reference. If the cached data is to be modified after its retrieval, the caller is responsible to create a copy + * of the returned data and use this instead of the cache record. + * + * @param request The repository request from which this cache was retrieved, must not be {@code null}. + * @param key The key to use for lookup of the data, must not be {@code null}. + * @return The requested data or {@code null} if none was present in the cache. + */ + Object get( RepositoryRequest request, Object key ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryRequest.java new file mode 100644 index 00000000..55f60686 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/RepositoryRequest.java @@ -0,0 +1,95 @@ +package org.apache.maven.artifact.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.List; + +/** + * Collects basic settings to access the repository system. + * + * @author Benjamin Bentmann + */ +public interface RepositoryRequest +{ + + /** + * Indicates whether network access to remote repositories has been disabled. + * + * @return {@code true} if remote access has been disabled, {@code false} otherwise. + */ + boolean isOffline(); + + /** + * Enables/disables network access to remote repositories. + * + * @param offline {@code true} to disable remote access, {@code false} to allow network access. + * @return This request, never {@code null}. + */ + RepositoryRequest setOffline( boolean offline ); + + /** + * Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their + * configured update policy. + * + * @return {@code true} if remote repositories should be re-checked for updated artifacts/metadata, {@code false} + * otherwise. + */ + boolean isForceUpdate(); + + /** + * Enables/disabled forced checks for updated artifacts/metadata on remote repositories. + * + * @param forceUpdate {@code true} to forcibly check the remote repositories for updated artifacts/metadata, {@code + * false} to use the update policy configured on each repository. + * @return This request, never {@code null}. + */ + RepositoryRequest setForceUpdate( boolean forceUpdate ); + + /** + * Gets the local repository to use. + * + * @return The local repository to use or {@code null} if not set. + */ + ArtifactRepository getLocalRepository(); + + /** + * Sets the local repository to use. + * + * @param localRepository The local repository to use. + * @return This request, never {@code null}. + */ + RepositoryRequest setLocalRepository( ArtifactRepository localRepository ); + + /** + * Gets the remote repositories to use. + * + * @return The remote repositories to use, never {@code null}. + */ + List<ArtifactRepository> getRemoteRepositories(); + + /** + * Sets the remote repositories to use. + * + * @param remoteRepositories The remote repositories to use. + * @return This request, never {@code null}. + */ + RepositoryRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java new file mode 100644 index 00000000..70c0b14c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java @@ -0,0 +1,112 @@ +package org.apache.maven.artifact.repository.layout; + +/* + * 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.Artifact; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.codehaus.plexus.component.annotations.Component; + +/** + * @author jdcasey + */ +@Component( role = ArtifactRepositoryLayout.class, hint = "default" ) +public class DefaultRepositoryLayout + implements ArtifactRepositoryLayout +{ + private static final char PATH_SEPARATOR = '/'; + + private static final char GROUP_SEPARATOR = '.'; + + private static final char ARTIFACT_SEPARATOR = '-'; + + public String getId() + { + return "default"; + } + + public String pathOf( Artifact artifact ) + { + ArtifactHandler artifactHandler = artifact.getArtifactHandler(); + + StringBuilder path = new StringBuilder( 128 ); + + path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR ); + path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR ); + path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR ); + path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() ); + + if ( artifact.hasClassifier() ) + { + path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() ); + } + + if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 ) + { + path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() ); + } + + return path.toString(); + } + + public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) + { + return pathOfRepositoryMetadata( metadata, metadata.getLocalFilename( repository ) ); + } + + private String pathOfRepositoryMetadata( ArtifactMetadata metadata, + String filename ) + { + StringBuilder path = new StringBuilder( 128 ); + + path.append( formatAsDirectory( metadata.getGroupId() ) ).append( PATH_SEPARATOR ); + if ( !metadata.storedInGroupDirectory() ) + { + path.append( metadata.getArtifactId() ).append( PATH_SEPARATOR ); + + if ( metadata.storedInArtifactVersionDirectory() ) + { + path.append( metadata.getBaseVersion() ).append( PATH_SEPARATOR ); + } + } + + path.append( filename ); + + return path.toString(); + } + + public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata ) + { + return pathOfRepositoryMetadata( metadata, metadata.getRemoteFilename() ); + } + + private String formatAsDirectory( String directory ) + { + return directory.replace( GROUP_SEPARATOR, PATH_SEPARATOR ); + } + + @Override + public String toString() + { + return getId(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java new file mode 100644 index 00000000..e1e5fe3f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java @@ -0,0 +1,255 @@ +package org.apache.maven.artifact.repository.metadata; + +/* + * 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.File; +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; +import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; +import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Writer; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.WriterFactory; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * Shared methods of the repository metadata handling. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public abstract class AbstractRepositoryMetadata + implements RepositoryMetadata +{ + private Metadata metadata; + + protected AbstractRepositoryMetadata( Metadata metadata ) + { + this.metadata = metadata; + } + + public String getRemoteFilename() + { + return "maven-metadata.xml"; + } + + public String getLocalFilename( ArtifactRepository repository ) + { + return "maven-metadata-" + repository.getKey() + ".xml"; + } + + public void storeInLocalRepository( ArtifactRepository localRepository, + ArtifactRepository remoteRepository ) + throws RepositoryMetadataStoreException + { + try + { + updateRepositoryMetadata( localRepository, remoteRepository ); + } + catch ( IOException e ) + { + throw new RepositoryMetadataStoreException( "Error updating group repository metadata", e ); + } + catch ( XmlPullParserException e ) + { + throw new RepositoryMetadataStoreException( "Error updating group repository metadata", e ); + } + } + + protected void updateRepositoryMetadata( ArtifactRepository localRepository, + ArtifactRepository remoteRepository ) + throws IOException, XmlPullParserException + { + MetadataXpp3Reader mappingReader = new MetadataXpp3Reader(); + + Metadata metadata = null; + + File metadataFile = new File( localRepository.getBasedir(), + localRepository.pathOfLocalRepositoryMetadata( this, remoteRepository ) ); + + if ( metadataFile.length() == 0 ) + { + if ( !metadataFile.delete() ) + { + // sleep for 10ms just in case this is windows holding a file lock + try + { + Thread.sleep( 10 ); + } + catch ( InterruptedException e ) + { + // ignore + } + metadataFile.delete(); // if this fails, forget about it, we'll try to overwrite it anyway so no need + // to delete on exit + } + } + else if ( metadataFile.exists() ) + { + Reader reader = null; + + try + { + reader = ReaderFactory.newXmlReader( metadataFile ); + + metadata = mappingReader.read( reader, false ); + } + finally + { + IOUtil.close( reader ); + } + } + + boolean changed; + + // If file could not be found or was not valid, start from scratch + if ( metadata == null ) + { + metadata = this.metadata; + + changed = true; + } + else + { + changed = metadata.merge( this.metadata ); + } + + // beware meta-versions! + String version = metadata.getVersion(); + if ( version != null && ( Artifact.LATEST_VERSION.equals( version ) || Artifact.RELEASE_VERSION.equals( + version ) ) ) + { + // meta-versions are not valid <version/> values...don't write them. + metadata.setVersion( null ); + } + + if ( changed || !metadataFile.exists() ) + { + Writer writer = null; + try + { + metadataFile.getParentFile().mkdirs(); + writer = WriterFactory.newXmlWriter( metadataFile ); + + MetadataXpp3Writer mappingWriter = new MetadataXpp3Writer(); + + mappingWriter.write( writer, metadata ); + } + finally + { + IOUtil.close( writer ); + } + } + else + { + metadataFile.setLastModified( System.currentTimeMillis() ); + } + } + + public String toString() + { + return "repository metadata for: \'" + getKey() + "\'"; + } + + protected static Metadata createMetadata( Artifact artifact, + Versioning versioning ) + { + Metadata metadata = new Metadata(); + metadata.setGroupId( artifact.getGroupId() ); + metadata.setArtifactId( artifact.getArtifactId() ); + metadata.setVersion( artifact.getVersion() ); + metadata.setVersioning( versioning ); + return metadata; + } + + protected static Versioning createVersioning( Snapshot snapshot ) + { + Versioning versioning = new Versioning(); + versioning.setSnapshot( snapshot ); + versioning.updateTimestamp(); + return versioning; + } + + public void setMetadata( Metadata metadata ) + { + this.metadata = metadata; + } + + public Metadata getMetadata() + { + return metadata; + } + + public void merge( org.apache.maven.repository.legacy.metadata.ArtifactMetadata metadata ) + { + // TODO: not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact replaces? + AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata; + this.metadata.merge( repoMetadata.getMetadata() ); + } + + public void merge( ArtifactMetadata metadata ) + { + // TODO: not sure that it should assume this, maybe the calls to addMetadata should pre-merge, then artifact replaces? + AbstractRepositoryMetadata repoMetadata = (AbstractRepositoryMetadata) metadata; + this.metadata.merge( repoMetadata.getMetadata() ); + } + + public String extendedToString() + { + StringBuilder buffer = new StringBuilder(); + + buffer.append( "\nRepository Metadata\n--------------------------" ); + buffer.append( "\nGroupId: " ).append( getGroupId() ); + buffer.append( "\nArtifactId: " ).append( getArtifactId() ); + buffer.append( "\nMetadata Type: " ).append( getClass().getName() ); + + return buffer.toString(); + } + + public int getNature() + { + return RELEASE; + } + + public ArtifactRepositoryPolicy getPolicy( ArtifactRepository repository ) + { + int nature = getNature(); + if ( ( nature & RepositoryMetadata.RELEASE_OR_SNAPSHOT ) == RepositoryMetadata.RELEASE_OR_SNAPSHOT ) + { + ArtifactRepositoryPolicy policy = new ArtifactRepositoryPolicy( repository.getReleases() ); + policy.merge( repository.getSnapshots() ); + return policy; + } + else if ( ( nature & RepositoryMetadata.SNAPSHOT ) != 0 ) + { + return repository.getSnapshots(); + } + else + { + return repository.getReleases(); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java new file mode 100644 index 00000000..85fc6018 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.java @@ -0,0 +1,129 @@ +package org.apache.maven.artifact.repository.metadata; + +/* + * 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.Artifact; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.Restriction; +import org.apache.maven.artifact.versioning.VersionRange; + +/** + * Metadata for the artifact directory of the repository. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class ArtifactRepositoryMetadata + extends AbstractRepositoryMetadata +{ + private Artifact artifact; + + public ArtifactRepositoryMetadata( Artifact artifact ) + { + this( artifact, null ); + } + + public ArtifactRepositoryMetadata( Artifact artifact, + Versioning versioning ) + { + super( createMetadata( artifact, versioning ) ); + this.artifact = artifact; + } + + public boolean storedInGroupDirectory() + { + return false; + } + + public boolean storedInArtifactVersionDirectory() + { + return false; + } + + public String getGroupId() + { + return artifact.getGroupId(); + } + + public String getArtifactId() + { + return artifact.getArtifactId(); + } + + public String getBaseVersion() + { + // Don't want the artifact's version in here, as this is stored in the directory above that + return null; + } + + public Object getKey() + { + return "artifact " + artifact.getGroupId() + ":" + artifact.getArtifactId(); + } + + public boolean isSnapshot() + { + // Don't consider the artifact's version in here, as this is stored in the directory above that + return false; + } + + public int getNature() + { + if ( artifact.getVersion() != null ) + { + return artifact.isSnapshot() ? SNAPSHOT : RELEASE; + } + + VersionRange range = artifact.getVersionRange(); + if ( range != null ) + { + for ( Restriction restriction : range.getRestrictions() ) + { + if ( isSnapshot( restriction.getLowerBound() ) || isSnapshot( restriction.getUpperBound() ) ) + { + return RELEASE_OR_SNAPSHOT; + } + } + } + + return RELEASE; + } + + private boolean isSnapshot( ArtifactVersion version ) + { + return version != null && ArtifactUtils.isSnapshot( version.getQualifier() ); + } + + public ArtifactRepository getRepository() + { + return null; + } + + public void setRepository( ArtifactRepository remoteRepository ) + { + /* + * NOTE: Metadata at the g:a level contains a collection of available versions. After merging, we can't tell + * which repository provides which version so the metadata manager must not restrict the artifact resolution to + * the repository with the most recent updates. + */ + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java new file mode 100644 index 00000000..22e3ade8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadata.java @@ -0,0 +1,92 @@ +package org.apache.maven.artifact.repository.metadata; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; + +/** + * Describes repository directory metadata. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + * @todo not happy about the store method - they use "this" + */ +public interface RepositoryMetadata + extends org.apache.maven.artifact.metadata.ArtifactMetadata +{ + + int RELEASE = 1; + + int SNAPSHOT = 2; + + int RELEASE_OR_SNAPSHOT = RELEASE | SNAPSHOT; + + /** + * Get the repository the metadata was located in. + * + * @return the repository + */ + ArtifactRepository getRepository(); + + /** + * Set the repository the metadata was located in. + * + * @param remoteRepository the repository + */ + void setRepository( ArtifactRepository remoteRepository ); + + /** + * Get the repository metadata associated with this marker. + * + * @return the metadata, or <code>null</code> if none loaded + */ + Metadata getMetadata(); + + /** + * Set the metadata contents. + * + * @param metadata the metadata + */ + void setMetadata( Metadata metadata ); + + /** + * Whether this represents a snapshot. + * + * @return if it is a snapshot + */ + boolean isSnapshot(); + + /** + * Gets the artifact quality this metadata refers to. One of {@link #RELEASE}, {@link #SNAPSHOT} or + * {@link #RELEASE_OR_SNAPSHOT}. + * + * @return The artifact quality this metadata refers to. + */ + int getNature(); + + /** + * Gets the policy that applies to this metadata regarding the specified repository. + * + * @param repository The repository for which to determine the policy, must not be {@code null}. + * @return The policy, never {@code null}. + */ + ArtifactRepositoryPolicy getPolicy( ArtifactRepository repository ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataDeploymentException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataDeploymentException.java new file mode 100644 index 00000000..94545650 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataDeploymentException.java @@ -0,0 +1,40 @@ +package org.apache.maven.artifact.repository.metadata; + +/* + * 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. + */ + +/** + * Error while deploying repository metadata. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class RepositoryMetadataDeploymentException + extends Throwable +{ + public RepositoryMetadataDeploymentException( String message ) + { + super( message ); + } + + public RepositoryMetadataDeploymentException( String message, + Exception e ) + { + super( message, e ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataInstallationException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataInstallationException.java new file mode 100644 index 00000000..55bb57ed --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataInstallationException.java @@ -0,0 +1,40 @@ +package org.apache.maven.artifact.repository.metadata; + +/* + * 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. + */ + +/** + * Error while installing repository metadata. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class RepositoryMetadataInstallationException + extends Throwable +{ + public RepositoryMetadataInstallationException( String message ) + { + super( message ); + } + + public RepositoryMetadataInstallationException( String message, + Exception e ) + { + super( message, e ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataManager.java new file mode 100644 index 00000000..35626e58 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataManager.java @@ -0,0 +1,61 @@ +package org.apache.maven.artifact.repository.metadata; + +/* + * 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.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.RepositoryRequest; + +public interface RepositoryMetadataManager +{ + + void resolve( RepositoryMetadata repositoryMetadata, RepositoryRequest repositoryRequest ) + throws RepositoryMetadataResolutionException; + + void resolve( RepositoryMetadata repositoryMetadata, List<ArtifactRepository> repositories, + ArtifactRepository localRepository ) + throws RepositoryMetadataResolutionException; + + void resolveAlways( RepositoryMetadata metadata, ArtifactRepository localRepository, + ArtifactRepository remoteRepository ) + throws RepositoryMetadataResolutionException; + + /** + * Deploy metadata to the remote repository. + * + * @param metadata the metadata to deploy + * @param localRepository the local repository to install to first + * @param deploymentRepository the remote repository to deploy to + */ + void deploy( ArtifactMetadata metadata, ArtifactRepository localRepository, + ArtifactRepository deploymentRepository ) + throws RepositoryMetadataDeploymentException; + + /** + * Install the metadata in the local repository. + * + * @param metadata the metadata + * @param localRepository the local repository + */ + void install( ArtifactMetadata metadata, ArtifactRepository localRepository ) + throws RepositoryMetadataInstallationException; +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataResolutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataResolutionException.java new file mode 100644 index 00000000..8a6f38d4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/RepositoryMetadataResolutionException.java @@ -0,0 +1,40 @@ +package org.apache.maven.artifact.repository.metadata; + +/* + * 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. + */ + +/** + * Error while retrieving repository metadata from the repository. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class RepositoryMetadataResolutionException + extends Exception +{ + public RepositoryMetadataResolutionException( String message ) + { + super( message ); + } + + public RepositoryMetadataResolutionException( String message, + Exception e ) + { + super( message, e ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java new file mode 100644 index 00000000..6a1578d8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/DefaultMetadataReader.java @@ -0,0 +1,110 @@ +package org.apache.maven.artifact.repository.metadata.io; + +/* + * 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.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.util.Map; + +import org.apache.maven.artifact.repository.metadata.Metadata; +import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * Handles deserialization of metadata from some kind of textual format like XML. + * + * @author Benjamin Bentmann + */ +@Component( role = MetadataReader.class ) +public class DefaultMetadataReader + implements MetadataReader +{ + + public Metadata read( File input, Map<String, ?> options ) + throws IOException + { + if ( input == null ) + { + throw new IllegalArgumentException( "input file missing" ); + } + + Metadata metadata = read( ReaderFactory.newXmlReader( input ), options ); + + return metadata; + } + + public Metadata read( Reader input, Map<String, ?> options ) + throws IOException + { + if ( input == null ) + { + throw new IllegalArgumentException( "input reader missing" ); + } + + try + { + MetadataXpp3Reader r = new MetadataXpp3Reader(); + return r.read( input, isStrict( options ) ); + } + catch ( XmlPullParserException e ) + { + throw new MetadataParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); + } + finally + { + IOUtil.close( input ); + } + } + + public Metadata read( InputStream input, Map<String, ?> options ) + throws IOException + { + if ( input == null ) + { + throw new IllegalArgumentException( "input stream missing" ); + } + + try + { + MetadataXpp3Reader r = new MetadataXpp3Reader(); + return r.read( input, isStrict( options ) ); + } + catch ( XmlPullParserException e ) + { + throw new MetadataParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); + } + finally + { + IOUtil.close( input ); + } + } + + private boolean isStrict( Map<String, ?> options ) + { + Object value = ( options != null ) ? options.get( IS_STRICT ) : null; + return value == null || Boolean.parseBoolean( value.toString() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataParseException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataParseException.java new file mode 100644 index 00000000..e3e141b1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataParseException.java @@ -0,0 +1,93 @@ +package org.apache.maven.artifact.repository.metadata.io; + +/* + * 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; + +/** + * Signals a failure to parse the metadata due to invalid syntax (e.g. non-wellformed XML or unknown elements). + * + * @author Benjamin Bentmann + */ +public class MetadataParseException + extends IOException +{ + + /** + * The one-based index of the line containing the error. + */ + private final int lineNumber; + + /** + * The one-based index of the column containing the error. + */ + private final int columnNumber; + + /** + * Creates a new parser exception with the specified details. + * + * @param message The error message, may be {@code null}. + * @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown. + * @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown. + */ + public MetadataParseException( String message, int lineNumber, int columnNumber ) + { + super( message ); + this.lineNumber = lineNumber; + this.columnNumber = columnNumber; + } + + /** + * Creates a new parser exception with the specified details. + * + * @param message The error message, may be {@code null}. + * @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown. + * @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown. + * @param cause The nested cause of this error, may be {@code null}. + */ + public MetadataParseException( String message, int lineNumber, int columnNumber, Throwable cause ) + { + super( message ); + initCause( cause ); + this.lineNumber = lineNumber; + this.columnNumber = columnNumber; + } + + /** + * Gets the one-based index of the line containing the error. + * + * @return The one-based index of the line containing the error or a non-positive value if unknown. + */ + public int getLineNumber() + { + return lineNumber; + } + + /** + * Gets the one-based index of the column containing the error. + * + * @return The one-based index of the column containing the error or non-positive value if unknown. + */ + public int getColumnNumber() + { + return columnNumber; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataReader.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataReader.java new file mode 100644 index 00000000..232246fd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/io/MetadataReader.java @@ -0,0 +1,82 @@ +package org.apache.maven.artifact.repository.metadata.io; + +/* + * 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.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.util.Map; + +import org.apache.maven.artifact.repository.metadata.Metadata; + +/** + * Handles deserialization of metadata from some kind of textual format like XML. + * + * @author Benjamin Bentmann + */ +public interface MetadataReader +{ + + /** + * The key for the option to enable strict parsing. This option is of type {@link Boolean} and defaults to {@code + * true}. If {@code false}, unknown elements will be ignored instead of causing a failure. + */ + String IS_STRICT = "org.apache.maven.artifact.repository.metadata.io.isStrict"; + + /** + * Reads the metadata from the specified file. + * + * @param input The file to deserialize the metadata from, must not be {@code null}. + * @param options The options to use for deserialization, may be {@code null} to use the default values. + * @return The deserialized metadata, never {@code null}. + * @throws IOException If the metadata could not be deserialized. + * @throws MetadataParseException If the input format could not be parsed. + */ + Metadata read( File input, Map<String, ?> options ) + throws IOException, MetadataParseException; + + /** + * Reads the metadata from the specified character reader. The reader will be automatically closed before the method + * returns. + * + * @param input The reader to deserialize the metadata from, must not be {@code null}. + * @param options The options to use for deserialization, may be {@code null} to use the default values. + * @return The deserialized metadata, never {@code null}. + * @throws IOException If the metadata could not be deserialized. + * @throws MetadataParseException If the input format could not be parsed. + */ + Metadata read( Reader input, Map<String, ?> options ) + throws IOException, MetadataParseException; + + /** + * Reads the metadata from the specified byte stream. The stream will be automatically closed before the method + * returns. + * + * @param input The stream to deserialize the metadata from, must not be {@code null}. + * @param options The options to use for deserialization, may be {@code null} to use the default values. + * @return The deserialized metadata, never {@code null}. + * @throws IOException If the metadata could not be deserialized. + * @throws MetadataParseException If the input format could not be parsed. + */ + Metadata read( InputStream input, Map<String, ?> options ) + throws IOException, MetadataParseException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java new file mode 100644 index 00000000..050ec478 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionRequest.java @@ -0,0 +1,329 @@ +package org.apache.maven.artifact.resolver; + +/* + * 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.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.RepositoryCache; +import org.apache.maven.artifact.repository.RepositoryRequest; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Server; + +/** + * A resolution request allows you to either use an existing MavenProject, or a coordinate (gid:aid:version) + * to process a POMs dependencies. + * + * @author Jason van Zyl + */ +public class ArtifactResolutionRequest + implements RepositoryRequest +{ + + private Artifact artifact; + + // Needs to go away + // These are really overrides now, projects defining dependencies for a plugin that override what is + // specified in the plugin itself. + private Set<Artifact> artifactDependencies; + + private ArtifactRepository localRepository; + + private List<ArtifactRepository> remoteRepositories; + + private ArtifactFilter collectionFilter; + + private ArtifactFilter resolutionFilter; + + // Needs to go away + private List<ResolutionListener> listeners = new ArrayList<ResolutionListener>(); + + // This is like a filter but overrides all transitive versions + private Map<String, Artifact> managedVersionMap; + + private boolean resolveRoot = true; + + private boolean resolveTransitively = false; + + private boolean offline; + + private boolean forceUpdate; + + private List<Server> servers; + + private List<Mirror> mirrors; + + private List<Proxy> proxies; + + public ArtifactResolutionRequest() + { + // nothing here + } + + public ArtifactResolutionRequest( RepositoryRequest request ) + { + setLocalRepository( request.getLocalRepository() ); + setRemoteRepositories( request.getRemoteRepositories() ); + setOffline( request.isOffline() ); + setForceUpdate( request.isForceUpdate() ); + } + + public Artifact getArtifact() + { + return artifact; + } + + public ArtifactResolutionRequest setArtifact( Artifact artifact ) + { + this.artifact = artifact; + + return this; + } + + public ArtifactResolutionRequest setArtifactDependencies( Set<Artifact> artifactDependencies ) + { + this.artifactDependencies = artifactDependencies; + + return this; + } + + public Set<Artifact> getArtifactDependencies() + { + return artifactDependencies; + } + + public ArtifactRepository getLocalRepository() + { + return localRepository; + } + + public ArtifactResolutionRequest setLocalRepository( ArtifactRepository localRepository ) + { + this.localRepository = localRepository; + + return this; + } + + public List<ArtifactRepository> getRemoteRepositories() + { + return remoteRepositories; + } + + public ArtifactResolutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) + { + this.remoteRepositories = remoteRepositories; + + return this; + } + + /** + * Gets the artifact filter that controls traversal of the dependency graph. + * + * @return The filter used to determine which of the artifacts in the dependency graph should be traversed or + * {@code null} to collect all transitive dependencies. + */ + public ArtifactFilter getCollectionFilter() + { + return collectionFilter; + } + + public ArtifactResolutionRequest setCollectionFilter( ArtifactFilter filter ) + { + this.collectionFilter = filter; + + return this; + } + + /** + * Gets the artifact filter that controls downloading of artifact files. This filter operates on those artifacts + * that have been included by the {@link #getCollectionFilter()}. + * + * @return The filter used to determine which of the artifacts should have their files resolved or {@code null} to + * resolve the files for all collected artifacts. + */ + public ArtifactFilter getResolutionFilter() + { + return resolutionFilter; + } + + public ArtifactResolutionRequest setResolutionFilter( ArtifactFilter filter ) + { + this.resolutionFilter = filter; + + return this; + } + + public List<ResolutionListener> getListeners() + { + return listeners; + } + + public ArtifactResolutionRequest setListeners( List<ResolutionListener> listeners ) + { + this.listeners = listeners; + + return this; + } + + public ArtifactResolutionRequest addListener( ResolutionListener listener ) + { + listeners.add( listener ); + + return this; + } + + public Map<String, Artifact> getManagedVersionMap() + { + return managedVersionMap; + } + + public ArtifactResolutionRequest setManagedVersionMap( Map<String, Artifact> managedVersionMap ) + { + this.managedVersionMap = managedVersionMap; + + return this; + } + + public ArtifactResolutionRequest setResolveRoot( boolean resolveRoot ) + { + this.resolveRoot = resolveRoot; + + return this; + } + + public boolean isResolveRoot() + { + return resolveRoot; + } + + public ArtifactResolutionRequest setResolveTransitively( boolean resolveDependencies ) + { + this.resolveTransitively = resolveDependencies; + + return this; + } + + public boolean isResolveTransitively() + { + return resolveTransitively; + } + + public String toString() + { + StringBuilder sb = new StringBuilder() + .append( "REQUEST: " ).append( "\n" ) + .append( "artifact: " ).append( artifact ).append( "\n" ) + .append( artifactDependencies ).append( "\n" ) + .append( "localRepository: " ).append( localRepository ).append( "\n" ) + .append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" ); + + return sb.toString(); + } + + public boolean isOffline() + { + return offline; + } + + public ArtifactResolutionRequest setOffline( boolean offline ) + { + this.offline = offline; + + return this; + } + + public boolean isForceUpdate() + { + return forceUpdate; + } + + public ArtifactResolutionRequest setForceUpdate( boolean forceUpdate ) + { + this.forceUpdate = forceUpdate; + + return this; + } + + public ArtifactResolutionRequest setServers( List<Server> servers ) + { + this.servers = servers; + + return this; + } + + public List<Server> getServers() + { + if ( servers == null ) + { + servers = new ArrayList<Server>(); + } + + return servers; + } + + public ArtifactResolutionRequest setMirrors( List<Mirror> mirrors ) + { + this.mirrors = mirrors; + + return this; + } + + public List<Mirror> getMirrors() + { + if ( mirrors == null ) + { + mirrors = new ArrayList<Mirror>(); + } + + return mirrors; + } + + public ArtifactResolutionRequest setProxies( List<Proxy> proxies ) + { + this.proxies = proxies; + + return this; + } + + public List<Proxy> getProxies() + { + if ( proxies == null ) + { + proxies = new ArrayList<Proxy>(); + } + + return proxies; + } + + // + // Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave + // this here, possibly indefinitely. + // + public ArtifactResolutionRequest setCache( RepositoryCache cache ) + { + return this; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java new file mode 100644 index 00000000..86bfdb60 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java @@ -0,0 +1,358 @@ +package org.apache.maven.artifact.resolver; + +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.versioning.OverConstrainedVersionException; + +/** + * Specific problems during resolution that we want to account for: + * <p/> + * - missing metadata - version range violations - version circular dependencies - missing artifacts + * - network/transfer errors - file system errors: permissions + * + * @author Jason van Zyl + * @TODO carlos: all these possible has*Exceptions and get*Exceptions methods make the clients too + * complex requiring a long list of checks, need to create a parent/interfact/encapsulation + * for the types of exceptions + */ +public class ArtifactResolutionResult +{ + private Artifact originatingArtifact; + + private List<Artifact> missingArtifacts; + + // Exceptions + + private List<Exception> exceptions; + + private List<Exception> versionRangeViolations; + + private List<ArtifactResolutionException> metadataResolutionExceptions; + + private List<CyclicDependencyException> circularDependencyExceptions; + + private List<ArtifactResolutionException> errorArtifactExceptions; + + // file system errors + + private List<ArtifactRepository> repositories; + + private Set<Artifact> artifacts; + + private Set<ResolutionNode> resolutionNodes; + + public Artifact getOriginatingArtifact() + { + return originatingArtifact; + } + + public ArtifactResolutionResult setOriginatingArtifact( final Artifact originatingArtifact ) + { + this.originatingArtifact = originatingArtifact; + + return this; + } + + public void addArtifact( Artifact artifact ) + { + if ( artifacts == null ) + { + artifacts = new LinkedHashSet<Artifact>(); + } + + artifacts.add( artifact ); + } + + public Set<Artifact> getArtifacts() + { + if ( artifacts == null ) + { + artifacts = new LinkedHashSet<Artifact>(); + } + + return artifacts; + } + + public void setArtifacts( Set<Artifact> artifacts ) + { + this.artifacts = artifacts; + } + + public Set<ResolutionNode> getArtifactResolutionNodes() + { + if ( resolutionNodes == null ) + { + resolutionNodes = new LinkedHashSet<ResolutionNode>(); + } + + return resolutionNodes; + } + + public void setArtifactResolutionNodes( Set<ResolutionNode> resolutionNodes ) + { + this.resolutionNodes = resolutionNodes; + } + + public boolean hasMissingArtifacts() + { + return missingArtifacts != null && !missingArtifacts.isEmpty(); + } + + public List<Artifact> getMissingArtifacts() + { + return missingArtifacts == null ? Collections.<Artifact>emptyList() : missingArtifacts; + } + + public ArtifactResolutionResult addMissingArtifact( Artifact artifact ) + { + missingArtifacts = initList( missingArtifacts ); + + missingArtifacts.add( artifact ); + + return this; + } + + public ArtifactResolutionResult setUnresolvedArtifacts( final List<Artifact> unresolvedArtifacts ) + { + this.missingArtifacts = unresolvedArtifacts; + + return this; + } + + public boolean isSuccess() + { + return !( hasMissingArtifacts() || hasExceptions() ); + } + + // ------------------------------------------------------------------------ + // Exceptions + // ------------------------------------------------------------------------ + + public boolean hasExceptions() + { + return exceptions != null && !exceptions.isEmpty(); + } + + public List<Exception> getExceptions() + { + return exceptions == null ? Collections.<Exception>emptyList() : exceptions; + } + + // ------------------------------------------------------------------------ + // Version Range Violations + // ------------------------------------------------------------------------ + + public boolean hasVersionRangeViolations() + { + return versionRangeViolations != null; + } + + /** + * @TODO this needs to accept a {@link OverConstrainedVersionException} as returned by + * {@link #getVersionRangeViolation(int)} but it's not used like that in + * {@link DefaultLegacyArtifactCollector} + */ + public ArtifactResolutionResult addVersionRangeViolation( Exception e ) + { + versionRangeViolations = initList( versionRangeViolations ); + + versionRangeViolations.add( e ); + + exceptions = initList( exceptions ); + + exceptions.add( e ); + + return this; + } + + public OverConstrainedVersionException getVersionRangeViolation( int i ) + { + return (OverConstrainedVersionException) versionRangeViolations.get( i ); + } + + public List<Exception> getVersionRangeViolations() + { + return versionRangeViolations == null ? Collections.<Exception>emptyList() : versionRangeViolations; + } + + // ------------------------------------------------------------------------ + // Metadata Resolution Exceptions: ArtifactResolutionExceptions + // ------------------------------------------------------------------------ + + public boolean hasMetadataResolutionExceptions() + { + return metadataResolutionExceptions != null; + } + + public ArtifactResolutionResult addMetadataResolutionException( ArtifactResolutionException e ) + { + metadataResolutionExceptions = initList( metadataResolutionExceptions ); + + metadataResolutionExceptions.add( e ); + + exceptions = initList( exceptions ); + + exceptions.add( e ); + + return this; + } + + public ArtifactResolutionException getMetadataResolutionException( int i ) + { + return metadataResolutionExceptions.get( i ); + } + + public List<ArtifactResolutionException> getMetadataResolutionExceptions() + { + return metadataResolutionExceptions == null ? Collections.<ArtifactResolutionException>emptyList() + : metadataResolutionExceptions; + } + + // ------------------------------------------------------------------------ + // ErrorArtifactExceptions: ArtifactResolutionExceptions + // ------------------------------------------------------------------------ + + public boolean hasErrorArtifactExceptions() + { + return errorArtifactExceptions != null; + } + + public ArtifactResolutionResult addErrorArtifactException( ArtifactResolutionException e ) + { + errorArtifactExceptions = initList( errorArtifactExceptions ); + + errorArtifactExceptions.add( e ); + + exceptions = initList( exceptions ); + + exceptions.add( e ); + + return this; + } + + public List<ArtifactResolutionException> getErrorArtifactExceptions() + { + if ( errorArtifactExceptions == null ) + { + return Collections.emptyList(); + } + + return errorArtifactExceptions; + } + + // ------------------------------------------------------------------------ + // Circular Dependency Exceptions + // ------------------------------------------------------------------------ + + public boolean hasCircularDependencyExceptions() + { + return circularDependencyExceptions != null; + } + + public ArtifactResolutionResult addCircularDependencyException( CyclicDependencyException e ) + { + circularDependencyExceptions = initList( circularDependencyExceptions ); + + circularDependencyExceptions.add( e ); + + exceptions = initList( exceptions ); + + exceptions.add( e ); + + return this; + } + + public CyclicDependencyException getCircularDependencyException( int i ) + { + return circularDependencyExceptions.get( i ); + } + + public List<CyclicDependencyException> getCircularDependencyExceptions() + { + if ( circularDependencyExceptions == null ) + { + return Collections.emptyList(); + } + + return circularDependencyExceptions; + } + + // ------------------------------------------------------------------------ + // Repositories + // ------------------------------------------------------------------------ + + public List<ArtifactRepository> getRepositories() + { + if ( repositories == null ) + { + return Collections.emptyList(); + } + + return repositories; + } + + public ArtifactResolutionResult setRepositories( final List<ArtifactRepository> repositories ) + { + this.repositories = repositories; + + return this; + } + + // + // Internal + // + + private <T> List<T> initList( final List<T> l ) + { + if ( l == null ) + { + return new ArrayList<T>(); + } + return l; + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + if ( artifacts != null ) + { + int i = 1; + sb.append( "---------" ).append( "\n" ); + sb.append( artifacts.size() ).append( "\n" ); + for ( Artifact a : artifacts ) + { + sb.append( i ).append( " " ).append( a ).append( "\n" ); + i++; + } + sb.append( "---------" ).append( "\n" ); + } + + return sb.toString(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java new file mode 100644 index 00000000..a8caa79b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/DefaultResolutionErrorHandler.java @@ -0,0 +1,89 @@ +package org.apache.maven.artifact.resolver; + +/* + * 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.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.codehaus.plexus.component.annotations.Component; + +/** + * @author Benjamin Bentmann + */ +@Component( role = ResolutionErrorHandler.class ) +public class DefaultResolutionErrorHandler + implements ResolutionErrorHandler +{ + + public void throwErrors( ArtifactResolutionRequest request, ArtifactResolutionResult result ) + throws ArtifactResolutionException + { + // Metadata cannot be found + + if ( result.hasMetadataResolutionExceptions() ) + { + throw result.getMetadataResolutionException( 0 ); + } + + // Metadata cannot be retrieved + + // Cyclic Dependency Error + + if ( result.hasCircularDependencyExceptions() ) + { + throw result.getCircularDependencyException( 0 ); + } + + // Version Range Violation + + if ( result.hasVersionRangeViolations() ) + { + throw result.getVersionRangeViolation( 0 ); + } + + // Transfer Error + + if ( result.hasErrorArtifactExceptions() ) + { + throw result.getErrorArtifactExceptions().get( 0 ); + } + + if ( result.hasMissingArtifacts() ) + { + throw new MultipleArtifactsNotFoundException( request.getArtifact(), toList( result.getArtifacts() ), + result.getMissingArtifacts(), + request.getRemoteRepositories() ); + } + + // this should never happen since we checked all possible error sources before but better be sure + if ( result.hasExceptions() ) + { + throw new ArtifactResolutionException( "Unknown error during artifact resolution, " + request + ", " + + result.getExceptions(), request.getArtifact(), request.getRemoteRepositories() ); + } + } + + private static <T> List<T> toList( Collection<T> items ) + { + return ( items != null ) ? new ArrayList<T>( items ) : null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionErrorHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionErrorHandler.java new file mode 100644 index 00000000..c54e5b6c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionErrorHandler.java @@ -0,0 +1,31 @@ +package org.apache.maven.artifact.resolver; + +/* + * 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. + */ + +/** + * @author Benjamin Bentmann + */ +public interface ResolutionErrorHandler +{ + + void throwErrors( ArtifactResolutionRequest request, ArtifactResolutionResult result ) + throws ArtifactResolutionException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java new file mode 100644 index 00000000..97687de2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java @@ -0,0 +1,109 @@ +package org.apache.maven.artifact.resolver; + +/* + * 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.Artifact; +import org.apache.maven.artifact.versioning.VersionRange; + +/** + * Listens to the resolution process and handles events. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public interface ResolutionListener +{ + String ROLE = ResolutionListener.class.getName(); + + int TEST_ARTIFACT = 1; + + int PROCESS_CHILDREN = 2; + + int FINISH_PROCESSING_CHILDREN = 3; + + int INCLUDE_ARTIFACT = 4; + + int OMIT_FOR_NEARER = 5; + + int UPDATE_SCOPE = 6; + + @Deprecated + int MANAGE_ARTIFACT = 7; + + int OMIT_FOR_CYCLE = 8; + + /** + * this event means that the artifactScope has NOT been updated to a farther node artifactScope because current + * node is in the first level pom + */ + int UPDATE_SCOPE_CURRENT_POM = 9; + + int SELECT_VERSION_FROM_RANGE = 10; + + int RESTRICT_RANGE = 11; + + int MANAGE_ARTIFACT_VERSION = 12; + + int MANAGE_ARTIFACT_SCOPE = 13; + + int MANAGE_ARTIFACT_SYSTEM_PATH = 14; + + void testArtifact( Artifact node ); + + void startProcessChildren( Artifact artifact ); + + void endProcessChildren( Artifact artifact ); + + void includeArtifact( Artifact artifact ); + + void omitForNearer( Artifact omitted, + Artifact kept ); + + void updateScope( Artifact artifact, + String scope ); + + @Deprecated + void manageArtifact( Artifact artifact, + Artifact replacement ); + + // TODO Use the following two instead of manageArtifact + // TODO Remove ResolutionListenerDM interface + + //void manageArtifactVersion( Artifact artifact, Artifact replacement ); + + //void manageArtifactScope( Artifact artifact, Artifact replacement ); + + void omitForCycle( Artifact artifact ); + + /** + * This event means that the artifactScope has NOT been updated to a farther node artifactScope because current + * node is in the first level pom + * + * @param artifact current node artifact, the one in the first level pom + * @param ignoredScope artifactScope that was ignored because artifact was in first level pom + */ + void updateScopeCurrentPom( Artifact artifact, + String ignoredScope ); + + void selectVersionFromRange( Artifact artifact ); + + void restrictRange( Artifact artifact, + Artifact replacement, + VersionRange newRange ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionNode.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionNode.java new file mode 100644 index 00000000..ae6c9214 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/ResolutionNode.java @@ -0,0 +1,251 @@ +package org.apache.maven.artifact.resolver; + +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.OverConstrainedVersionException; + +public class ResolutionNode +{ + private Artifact artifact; + + private List<ResolutionNode> children; + + private final List<Object> parents; + + private final int depth; + + private final ResolutionNode parent; + + private final List<ArtifactRepository> remoteRepositories; + + private boolean active = true; + + private List<Artifact> trail; + + public ResolutionNode( Artifact artifact, List<ArtifactRepository> remoteRepositories ) + { + this.artifact = artifact; + this.remoteRepositories = remoteRepositories; + depth = 0; + parents = Collections.emptyList(); + parent = null; + } + + public ResolutionNode( Artifact artifact, List<ArtifactRepository> remoteRepositories, ResolutionNode parent ) + { + this.artifact = artifact; + this.remoteRepositories = remoteRepositories; + depth = parent.depth + 1; + parents = new ArrayList<Object>(); + parents.addAll( parent.parents ); + parents.add( parent.getKey() ); + this.parent = parent; + } + + public Artifact getArtifact() + { + return artifact; + } + + public Object getKey() + { + return artifact.getDependencyConflictId(); + } + + public void addDependencies( Set<Artifact> artifacts, List<ArtifactRepository> remoteRepositories, + ArtifactFilter filter ) + throws CyclicDependencyException, OverConstrainedVersionException + { + if ( artifacts != null && !artifacts.isEmpty() ) + { + children = new ArrayList<ResolutionNode>( artifacts.size() ); + + for ( Artifact a : artifacts ) + { + if ( parents.contains( a.getDependencyConflictId() ) ) + { + a.setDependencyTrail( getDependencyTrail() ); + + throw new CyclicDependencyException( "A dependency has introduced a cycle", a ); + } + + children.add( new ResolutionNode( a, remoteRepositories, this ) ); + } + } + else + { + children = Collections.emptyList(); + } + trail = null; + } + + /** + * @return {@link List} < {@link String} > with artifact ids + * @throws OverConstrainedVersionException + */ + public List<String> getDependencyTrail() + throws OverConstrainedVersionException + { + List<Artifact> trial = getTrail(); + + List<String> ret = new ArrayList<String>( trial.size() ); + + for ( Artifact artifact : trial ) + { + ret.add( artifact.getId() ); + } + + return ret; + } + + private List<Artifact> getTrail() + throws OverConstrainedVersionException + { + if ( trail == null ) + { + List<Artifact> ids = new LinkedList<Artifact>(); + ResolutionNode node = this; + while ( node != null ) + { + Artifact artifact = node.getArtifact(); + if ( artifact.getVersion() == null ) + { + // set the recommended version + ArtifactVersion selected = artifact.getSelectedVersion(); + // MNG-2123: null is a valid response to getSelectedVersion, don't + // assume it won't ever be. + if ( selected != null ) + { + artifact.selectVersion( selected.toString() ); + } + else + { + throw new OverConstrainedVersionException( "Unable to get a selected Version for " + + artifact.getArtifactId(), artifact ); + } + } + + ids.add( 0, artifact ); + node = node.parent; + } + trail = ids; + } + return trail; + } + + public boolean isResolved() + { + return children != null; + } + + /** + * Test whether the node is direct or transitive dependency. + */ + public boolean isChildOfRootNode() + { + return parent != null && parent.parent == null; + } + + public Iterator<ResolutionNode> getChildrenIterator() + { + return children.iterator(); + } + + public int getDepth() + { + return depth; + } + + public List<ArtifactRepository> getRemoteRepositories() + { + return remoteRepositories; + } + + public boolean isActive() + { + return active; + } + + public void enable() + { + active = true; + + // TODO: if it was null, we really need to go find them now... or is this taken care of by the ordering? + if ( children != null ) + { + for ( ResolutionNode node : children ) + { + node.enable(); + } + } + } + + public void disable() + { + active = false; + if ( children != null ) + { + for ( ResolutionNode node : children ) + { + node.disable(); + } + } + } + + public boolean filterTrail( ArtifactFilter filter ) + throws OverConstrainedVersionException + { + boolean success = true; + if ( filter != null ) + { + for ( Artifact artifact : getTrail() ) + { + if ( !filter.include( artifact ) ) + { + success = false; + } + } + } + return success; + } + + @Override + public String toString() + { + return artifact.toString() + " (" + depth + "; " + ( active ? "enabled" : "disabled" ) + ")"; + } + + public void setArtifact( Artifact artifact ) + { + this.artifact = artifact; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java new file mode 100644 index 00000000..95872dbb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java @@ -0,0 +1,107 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * 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.Artifact; + +/** + * Filter to only retain objects in the given artifactScope or better. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +abstract class AbstractScopeArtifactFilter + implements ArtifactFilter +{ + + private boolean compileScope; + + private boolean runtimeScope; + + private boolean testScope; + + private boolean providedScope; + + private boolean systemScope; + + void addScopeInternal( String scope ) + { + if ( Artifact.SCOPE_COMPILE.equals( scope ) ) + { + systemScope = true; + providedScope = true; + compileScope = true; + } + else if ( Artifact.SCOPE_RUNTIME.equals( scope ) ) + { + compileScope = true; + runtimeScope = true; + } + else if ( Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals( scope ) ) + { + systemScope = true; + providedScope = true; + compileScope = true; + runtimeScope = true; + } + else if ( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM.equals( scope ) ) + { + systemScope = true; + compileScope = true; + runtimeScope = true; + } + else if ( Artifact.SCOPE_TEST.equals( scope ) ) + { + systemScope = true; + providedScope = true; + compileScope = true; + runtimeScope = true; + testScope = true; + } + } + + public boolean include( Artifact artifact ) + { + if ( Artifact.SCOPE_COMPILE.equals( artifact.getScope() ) ) + { + return compileScope; + } + else if ( Artifact.SCOPE_RUNTIME.equals( artifact.getScope() ) ) + { + return runtimeScope; + } + else if ( Artifact.SCOPE_TEST.equals( artifact.getScope() ) ) + { + return testScope; + } + else if ( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) ) + { + return providedScope; + } + else if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) + { + return systemScope; + } + else + { + return true; + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java new file mode 100644 index 00000000..5c6689de --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java @@ -0,0 +1,99 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * 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.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; + +/** + * Apply multiple filters. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class AndArtifactFilter + implements ArtifactFilter +{ + private Set<ArtifactFilter> filters; + + public AndArtifactFilter() + { + this.filters = new LinkedHashSet<ArtifactFilter>(); + } + + public AndArtifactFilter( List<ArtifactFilter> filters ) + { + this.filters = new LinkedHashSet<ArtifactFilter>( filters ); + } + + public boolean include( Artifact artifact ) + { + boolean include = true; + for ( Iterator<ArtifactFilter> i = filters.iterator(); i.hasNext() && include; ) + { + ArtifactFilter filter = i.next(); + if ( !filter.include( artifact ) ) + { + include = false; + } + } + return include; + } + + public void add( ArtifactFilter artifactFilter ) + { + filters.add( artifactFilter ); + } + + public List<ArtifactFilter> getFilters() + { + return new ArrayList<ArtifactFilter>( filters ); + } + + @Override + public int hashCode() + { + int hash = 17; + hash = hash * 31 + filters.hashCode(); + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof AndArtifactFilter ) ) + { + return false; + } + + AndArtifactFilter other = (AndArtifactFilter) obj; + + return filters.equals( other.filters ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java new file mode 100644 index 00000000..fb0afcfb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java @@ -0,0 +1,122 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * 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.HashSet; +import java.util.Set; + +/** + * Filter to only retain objects in the given scope or better. This implementation allows the accumulation of multiple + * scopes and their associated implied scopes, so that the user can filter apply a series of implication rules in a + * single step. This should be a more efficient implementation of multiple standard {@link ScopeArtifactFilter} + * instances ORed together. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + * @author jdcasey + */ +public class CumulativeScopeArtifactFilter + extends AbstractScopeArtifactFilter +{ + + private Set<String> scopes; + + /** + * Create a new filter with the specified scopes and their implied scopes enabled. + * + * @param scopes The scopes to enable, along with all implied scopes, may be {@code null}. + */ + public CumulativeScopeArtifactFilter( Collection<String> scopes ) + { + this.scopes = new HashSet<String>(); + + addScopes( scopes ); + } + + /** + * Creates a new filter that combines the specified filters. + * + * @param filters The filters to combine, may be {@code null}. + */ + public CumulativeScopeArtifactFilter( CumulativeScopeArtifactFilter... filters ) + { + this.scopes = new HashSet<String>(); + + if ( filters != null ) + { + for ( CumulativeScopeArtifactFilter filter : filters ) + { + addScopes( filter.getScopes() ); + } + } + } + + private void addScopes( Collection<String> scopes ) + { + if ( scopes != null ) + { + for ( String scope : scopes ) + { + addScope( scope ); + } + } + } + + private void addScope( String scope ) + { + this.scopes.add( scope ); + + addScopeInternal( scope ); + } + + public Set<String> getScopes() + { + return scopes; + } + + @Override + public int hashCode() + { + int hash = 17; + + hash = hash * 31 + scopes.hashCode(); + + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof CumulativeScopeArtifactFilter ) ) + { + return false; + } + + CumulativeScopeArtifactFilter that = (CumulativeScopeArtifactFilter) obj; + + return scopes.equals( that.scopes ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java new file mode 100644 index 00000000..b6ef02e5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java @@ -0,0 +1,44 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * 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.artifact.Artifact; + +/** + * Filter to exclude from a list of artifact patterns. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + * @todo I think this is equiv. to exclusion set filter in maven-core + */ +public class ExcludesArtifactFilter + extends IncludesArtifactFilter +{ + public ExcludesArtifactFilter( List<String> patterns ) + { + super( patterns ); + } + + public boolean include( Artifact artifact ) + { + return !super.include( artifact ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java new file mode 100644 index 00000000..c3dc9812 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java @@ -0,0 +1,86 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * 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.LinkedHashSet; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; + +/** + * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> + */ +public class ExclusionSetFilter + implements ArtifactFilter +{ + private Set<String> excludes; + + public ExclusionSetFilter( String[] excludes ) + { + this.excludes = new LinkedHashSet<String>( Arrays.asList( excludes ) ); + } + + public ExclusionSetFilter( Set<String> excludes ) + { + this.excludes = excludes; + } + + public boolean include( Artifact artifact ) + { + String id = artifact.getArtifactId(); + + if ( excludes.contains( id ) ) + { + return false; + } + + id = artifact.getGroupId() + ':' + id; + + return !excludes.contains( id ); + + } + + @Override + public int hashCode() + { + int hash = 17; + hash = hash * 31 + excludes.hashCode(); + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof ExclusionSetFilter ) ) + { + return false; + } + + ExclusionSetFilter other = (ExclusionSetFilter) obj; + + return excludes.equals( other.excludes ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java new file mode 100644 index 00000000..403e1251 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java @@ -0,0 +1,93 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * 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.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; + +/** + * Filter to include from a list of artifact patterns. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class IncludesArtifactFilter + implements ArtifactFilter +{ + private final Set<String> patterns; + + public IncludesArtifactFilter( List<String> patterns ) + { + this.patterns = new LinkedHashSet<String>( patterns ); + } + + public boolean include( Artifact artifact ) + { + String id = artifact.getGroupId() + ":" + artifact.getArtifactId(); + + boolean matched = false; + for ( Iterator<String> i = patterns.iterator(); i.hasNext() & !matched; ) + { + // TODO: what about wildcards? Just specifying groups? versions? + if ( id.equals( i.next() ) ) + { + matched = true; + } + } + return matched; + } + + public List<String> getPatterns() + { + return new ArrayList<String>( patterns ); + } + + @Override + public int hashCode() + { + int hash = 17; + hash = hash * 31 + patterns.hashCode(); + + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + // make sure IncludesArtifactFilter is not equal ExcludesArtifactFilter! + if ( obj == null || getClass() != obj.getClass() ) + { + return false; + } + + IncludesArtifactFilter other = (IncludesArtifactFilter) obj; + + return patterns.equals( other.patterns ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java new file mode 100644 index 00000000..1d131b71 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java @@ -0,0 +1,78 @@ +package org.apache.maven.artifact.resolver.filter; + +/* + * 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. + */ + +/** + * Filter to only retain objects in the given artifactScope or better. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class ScopeArtifactFilter + extends AbstractScopeArtifactFilter +{ + + private final String scope; + + public ScopeArtifactFilter( String scope ) + { + this.scope = scope; + + addScopeInternal( scope ); + } + + public String getScope() + { + return scope; + } + + @Override + public int hashCode() + { + int hash = 17; + + hash = hash * 31 + ( scope != null ? scope.hashCode() : 0 ); + + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof ScopeArtifactFilter ) ) + { + return false; + } + + ScopeArtifactFilter other = (ScopeArtifactFilter) obj; + + return equals( scope, other.scope ); + } + + private static <T> boolean equals( T str1, T str2 ) + { + return str1 != null ? str1.equals( str2 ) : str2 == null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java new file mode 100644 index 00000000..f33bc328 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java @@ -0,0 +1,785 @@ +package org.apache.maven.bridge; + +/* + * 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.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; +import org.apache.maven.artifact.repository.Authentication; +import org.apache.maven.artifact.repository.MavenArtifactRepository; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout2; +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; +import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.artifact.versioning.VersionRange; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Exclusion; +import org.apache.maven.model.Plugin; +import org.apache.maven.repository.Proxy; +import org.apache.maven.repository.RepositorySystem; +import org.apache.maven.settings.Mirror; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.AuthenticationContext; +import org.eclipse.aether.repository.AuthenticationSelector; +import org.eclipse.aether.repository.ProxySelector; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * @author Jason van Zyl + */ +@Component( role = MavenRepositorySystem.class, hint = "default" ) +public class MavenRepositorySystem +{ + @Requirement + private ArtifactHandlerManager artifactHandlerManager; + + @Requirement( role = ArtifactRepositoryLayout.class ) + private Map<String, ArtifactRepositoryLayout> layouts; + + // DefaultProjectBuilder + public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ) + { + return XcreateArtifact( groupId, artifactId, version, scope, type ); + } + + // DefaultProjectBuilder + public Artifact createProjectArtifact( String groupId, String artifactId, String metaVersionId ) + { + return XcreateProjectArtifact( groupId, artifactId, metaVersionId ); + } + + // DefaultProjectBuilder + public Artifact createDependencyArtifact( Dependency d ) + { + if ( d.getVersion() == null ) + { + return null; + } + + VersionRange versionRange; + try + { + versionRange = VersionRange.createFromVersionSpec( d.getVersion() ); + } + catch ( InvalidVersionSpecificationException e ) + { + return null; + } + + Artifact artifact = + XcreateDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange, d.getType(), + d.getClassifier(), d.getScope(), d.isOptional() ); + + if ( Artifact.SCOPE_SYSTEM.equals( d.getScope() ) && d.getSystemPath() != null ) + { + artifact.setFile( new File( d.getSystemPath() ) ); + } + + if ( !d.getExclusions().isEmpty() ) + { + List<String> exclusions = new ArrayList<String>(); + + for ( Exclusion exclusion : d.getExclusions() ) + { + exclusions.add( exclusion.getGroupId() + ':' + exclusion.getArtifactId() ); + } + + artifact.setDependencyFilter( new ExcludesArtifactFilter( exclusions ) ); + } + + return artifact; + } + + // DefaultProjectBuilder + public Artifact createExtensionArtifact( String groupId, String artifactId, String version ) + { + VersionRange versionRange; + try + { + versionRange = VersionRange.createFromVersionSpec( version ); + } + catch ( InvalidVersionSpecificationException e ) + { + return null; + } + + return XcreateExtensionArtifact( groupId, artifactId, versionRange ); + } + + // DefaultProjectBuilder + public Artifact createParentArtifact( String groupId, String artifactId, String version ) + { + return XcreateParentArtifact( groupId, artifactId, version ); + } + + // DefaultProjectBuilder + 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 XcreatePluginArtifact( plugin.getGroupId(), plugin.getArtifactId(), versionRange ); + } + + public void injectMirror( List<ArtifactRepository> repositories, List<Mirror> mirrors ) + { + if ( repositories != null && mirrors != null ) + { + for ( ArtifactRepository repository : repositories ) + { + Mirror mirror = getMirror( repository, mirrors ); + injectMirror( repository, mirror ); + } + } + } + + private Mirror getMirror( RepositorySystemSession session, ArtifactRepository repository ) + { + if ( session != null ) + { + org.eclipse.aether.repository.MirrorSelector selector = session.getMirrorSelector(); + if ( selector != null ) + { + RemoteRepository repo = selector.getMirror( RepositoryUtils.toRepo( repository ) ); + if ( repo != null ) + { + Mirror mirror = new Mirror(); + mirror.setId( repo.getId() ); + mirror.setUrl( repo.getUrl() ); + mirror.setLayout( repo.getContentType() ); + return mirror; + } + } + } + return null; + } + + public void injectMirror( RepositorySystemSession session, List<ArtifactRepository> repositories ) + { + if ( repositories != null && session != null ) + { + for ( ArtifactRepository repository : repositories ) + { + Mirror mirror = getMirror( session, repository ); + injectMirror( repository, mirror ); + } + } + } + + private void injectMirror( ArtifactRepository repository, Mirror mirror ) + { + if ( mirror != null ) + { + ArtifactRepository original = + createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(), + repository.getSnapshots(), repository.getReleases() ); + + repository.setMirroredRepositories( Collections.singletonList( original ) ); + + repository.setId( mirror.getId() ); + repository.setUrl( mirror.getUrl() ); + + if ( StringUtils.isNotEmpty( mirror.getLayout() ) ) + { + repository.setLayout( getLayout( mirror.getLayout() ) ); + } + } + } + + private Authentication getAuthentication( RepositorySystemSession session, ArtifactRepository repository ) + { + if ( session != null ) + { + AuthenticationSelector selector = session.getAuthenticationSelector(); + if ( selector != null ) + { + RemoteRepository repo = RepositoryUtils.toRepo( repository ); + org.eclipse.aether.repository.Authentication auth = selector.getAuthentication( repo ); + if ( auth != null ) + { + repo = new RemoteRepository.Builder( repo ).setAuthentication( auth ).build(); + AuthenticationContext authCtx = AuthenticationContext.forRepository( session, repo ); + Authentication result = + new Authentication( authCtx.get( AuthenticationContext.USERNAME ), + authCtx.get( AuthenticationContext.PASSWORD ) ); + result.setPrivateKey( authCtx.get( AuthenticationContext.PRIVATE_KEY_PATH ) ); + result.setPassphrase( authCtx.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE ) ); + authCtx.close(); + return result; + } + } + } + return null; + } + + public void injectAuthentication( RepositorySystemSession session, List<ArtifactRepository> repositories ) + { + if ( repositories != null && session != null ) + { + for ( ArtifactRepository repository : repositories ) + { + repository.setAuthentication( getAuthentication( session, repository ) ); + } + } + } + + private Proxy getProxy( RepositorySystemSession session, ArtifactRepository repository ) + { + if ( session != null ) + { + ProxySelector selector = session.getProxySelector(); + if ( selector != null ) + { + RemoteRepository repo = RepositoryUtils.toRepo( repository ); + org.eclipse.aether.repository.Proxy proxy = selector.getProxy( repo ); + if ( proxy != null ) + { + Proxy p = new Proxy(); + p.setHost( proxy.getHost() ); + p.setProtocol( proxy.getType() ); + p.setPort( proxy.getPort() ); + if ( proxy.getAuthentication() != null ) + { + repo = new RemoteRepository.Builder( repo ).setProxy( proxy ).build(); + AuthenticationContext authCtx = AuthenticationContext.forProxy( session, repo ); + p.setUserName( authCtx.get( AuthenticationContext.USERNAME ) ); + p.setPassword( authCtx.get( AuthenticationContext.PASSWORD ) ); + p.setNtlmDomain( authCtx.get( AuthenticationContext.NTLM_DOMAIN ) ); + p.setNtlmHost( authCtx.get( AuthenticationContext.NTLM_WORKSTATION ) ); + authCtx.close(); + } + return p; + } + } + } + return null; + } + + public void injectProxy( RepositorySystemSession session, List<ArtifactRepository> repositories ) + { + if ( repositories != null && session != null ) + { + for ( ArtifactRepository repository : repositories ) + { + repository.setProxy( getProxy( session, repository ) ); + } + } + } + + private ArtifactRepositoryLayout getLayout( String id ) + { + ArtifactRepositoryLayout layout = layouts.get( id ); + + return layout; + } + + + // + // Taken from LegacyRepositorySystem + // + + public static org.apache.maven.model.Repository fromSettingsRepository( org.apache.maven.settings.Repository + settingsRepository ) + { + org.apache.maven.model.Repository modelRepository = new org.apache.maven.model.Repository(); + modelRepository.setId( settingsRepository.getId() ); + modelRepository.setLayout( settingsRepository.getLayout() ); + modelRepository.setName( settingsRepository.getName() ); + modelRepository.setUrl( settingsRepository.getUrl() ); + modelRepository.setReleases( fromSettingsRepositoryPolicy( settingsRepository.getReleases() ) ); + modelRepository.setSnapshots( fromSettingsRepositoryPolicy( settingsRepository.getSnapshots() ) ); + return modelRepository; + } + + public static org.apache.maven.model.RepositoryPolicy fromSettingsRepositoryPolicy( + org.apache.maven.settings.RepositoryPolicy settingsRepositoryPolicy ) + { + org.apache.maven.model.RepositoryPolicy modelRepositoryPolicy = new org.apache.maven.model.RepositoryPolicy(); + if ( settingsRepositoryPolicy != null ) + { + modelRepositoryPolicy.setEnabled( settingsRepositoryPolicy.isEnabled() ); + modelRepositoryPolicy.setUpdatePolicy( settingsRepositoryPolicy.getUpdatePolicy() ); + modelRepositoryPolicy.setChecksumPolicy( settingsRepositoryPolicy.getChecksumPolicy() ); + } + return modelRepositoryPolicy; + } + + public static ArtifactRepository buildArtifactRepository( org.apache.maven.settings.Repository repo ) + throws InvalidRepositoryException + { + return buildArtifactRepository( fromSettingsRepository( repo ) ); + } + + public static ArtifactRepository buildArtifactRepository( org.apache.maven.model.Repository repo ) + throws InvalidRepositoryException + { + if ( repo != null ) + { + String id = repo.getId(); + + if ( StringUtils.isEmpty( id ) ) + { + throw new InvalidRepositoryException( "Repository identifier missing", "" ); + } + + String url = repo.getUrl(); + + if ( StringUtils.isEmpty( url ) ) + { + throw new InvalidRepositoryException( "URL missing for repository " + id, id ); + } + + ArtifactRepositoryPolicy snapshots = buildArtifactRepositoryPolicy( repo.getSnapshots() ); + + ArtifactRepositoryPolicy releases = buildArtifactRepositoryPolicy( repo.getReleases() ); + + ArtifactRepositoryLayout layout = new DefaultRepositoryLayout(); + + return createArtifactRepository( id, url, layout, snapshots, releases ); + } + else + { + return null; + } + } + + public static ArtifactRepositoryPolicy buildArtifactRepositoryPolicy( 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 ArtifactRepositoryPolicy( enabled, updatePolicy, checksumPolicy ); + } + + public ArtifactRepository createArtifactRepository( String id, String url, String layoutId, + ArtifactRepositoryPolicy snapshots, + ArtifactRepositoryPolicy releases ) + throws Exception + { + ArtifactRepositoryLayout layout = layouts.get( layoutId ); + + checkLayout( id, layoutId, layout ); + + return createArtifactRepository( id, url, layout, snapshots, releases ); + } + + private void checkLayout( String repositoryId, String layoutId, ArtifactRepositoryLayout layout ) + throws Exception + { + if ( layout == null ) + { + throw new Exception( String.format( "Cannot find ArtifactRepositoryLayout instance for: %s %s", layoutId, + repositoryId ) ); + } + } + + public static ArtifactRepository createArtifactRepository( String id, String url, + ArtifactRepositoryLayout repositoryLayout, + ArtifactRepositoryPolicy snapshots, + ArtifactRepositoryPolicy releases ) + { + if ( snapshots == null ) + { + snapshots = new ArtifactRepositoryPolicy(); + } + + if ( releases == null ) + { + releases = new ArtifactRepositoryPolicy(); + } + + ArtifactRepository repository; + if ( repositoryLayout instanceof ArtifactRepositoryLayout2 ) + { + repository = + ( (ArtifactRepositoryLayout2) repositoryLayout ).newMavenArtifactRepository( id, url, snapshots, + releases ); + } + else + { + repository = new MavenArtifactRepository( id, url, repositoryLayout, snapshots, releases ); + } + + return repository; + } + + // ArtifactFactory + private Artifact XcreateArtifact( String groupId, String artifactId, String version, String scope, String type ) + { + return XcreateArtifact( groupId, artifactId, version, scope, type, null, null ); + } + + private Artifact XcreateDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, + String type, String classifier, String scope, boolean optional ) + { + return XcreateArtifact( groupId, artifactId, versionRange, type, classifier, scope, null, optional ); + } + + private Artifact XcreateProjectArtifact( String groupId, String artifactId, String version ) + { + return XcreateProjectArtifact( groupId, artifactId, version, null ); + } + + private Artifact XcreateParentArtifact( String groupId, String artifactId, String version ) + { + return XcreateProjectArtifact( groupId, artifactId, version ); + } + + private Artifact XcreatePluginArtifact( String groupId, String artifactId, VersionRange versionRange ) + { + return XcreateArtifact( groupId, artifactId, versionRange, "maven-plugin", null, Artifact.SCOPE_RUNTIME, null ); + } + + private Artifact XcreateProjectArtifact( String groupId, String artifactId, String version, String scope ) + { + return XcreateArtifact( groupId, artifactId, version, scope, "pom" ); + } + + private Artifact XcreateExtensionArtifact( String groupId, String artifactId, VersionRange versionRange ) + { + return XcreateArtifact( groupId, artifactId, versionRange, "jar", null, Artifact.SCOPE_RUNTIME, null ); + } + + private Artifact XcreateArtifact( String groupId, String artifactId, String version, String scope, String type, + String classifier, String inheritedScope ) + { + VersionRange versionRange = null; + if ( version != null ) + { + versionRange = VersionRange.createFromVersion( version ); + } + return XcreateArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope ); + } + + private Artifact XcreateArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope, String inheritedScope ) + { + return XcreateArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope, false ); + } + + private Artifact XcreateArtifact( String groupId, String artifactId, VersionRange versionRange, String type, + String classifier, String scope, String inheritedScope, boolean optional ) + { + String desiredScope = Artifact.SCOPE_RUNTIME; + + if ( inheritedScope == null ) + { + desiredScope = scope; + } + else if ( Artifact.SCOPE_TEST.equals( scope ) || Artifact.SCOPE_PROVIDED.equals( scope ) ) + { + return null; + } + else if ( Artifact.SCOPE_COMPILE.equals( scope ) && Artifact.SCOPE_COMPILE.equals( inheritedScope ) ) + { + // added to retain compile artifactScope. Remove if you want compile inherited as runtime + desiredScope = Artifact.SCOPE_COMPILE; + } + + if ( Artifact.SCOPE_TEST.equals( inheritedScope ) ) + { + desiredScope = Artifact.SCOPE_TEST; + } + + if ( Artifact.SCOPE_PROVIDED.equals( inheritedScope ) ) + { + desiredScope = Artifact.SCOPE_PROVIDED; + } + + if ( Artifact.SCOPE_SYSTEM.equals( scope ) ) + { + // system scopes come through unchanged... + desiredScope = Artifact.SCOPE_SYSTEM; + } + + ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( type ); + + return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler, + optional ); + } + + // + // Code taken from LegacyRepositorySystem + // + + public ArtifactRepository createDefaultRemoteRepository( MavenExecutionRequest request ) + throws Exception + { + return createRepository( RepositorySystem.DEFAULT_REMOTE_REPO_URL, RepositorySystem.DEFAULT_REMOTE_REPO_ID, + true, ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY, false, + ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY, + ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN ); + } + + public ArtifactRepository createRepository( String url, String repositoryId, boolean releases, + String releaseUpdates, boolean snapshots, String snapshotUpdates, + String checksumPolicy ) throws Exception + { + ArtifactRepositoryPolicy snapshotsPolicy = + new ArtifactRepositoryPolicy( snapshots, snapshotUpdates, checksumPolicy ); + + ArtifactRepositoryPolicy releasesPolicy = + new ArtifactRepositoryPolicy( releases, releaseUpdates, checksumPolicy ); + + return createArtifactRepository( repositoryId, url, "default", snapshotsPolicy, releasesPolicy ); + } + + public Set<String> getRepoIds( List<ArtifactRepository> repositories ) + { + Set<String> repoIds = new HashSet<String>(); + + if ( repositories != null ) + { + for ( ArtifactRepository repository : repositories ) + { + repoIds.add( repository.getId() ); + } + } + + return repoIds; + } + + + public ArtifactRepository createLocalRepository( MavenExecutionRequest request, File localRepository ) + throws Exception + { + return createRepository( "file://" + localRepository.toURI().getRawPath(), + RepositorySystem.DEFAULT_LOCAL_REPO_ID, true, + ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true, + ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, + ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE ); + } + + private static final String WILDCARD = "*"; + + private static final String EXTERNAL_WILDCARD = "external:*"; + + public static Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors ) + { + String repoId = repository.getId(); + + if ( repoId != null && mirrors != null ) + { + for ( Mirror mirror : mirrors ) + { + if ( repoId.equals( mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) ) + { + return mirror; + } + } + + for ( Mirror mirror : mirrors ) + { + if ( matchPattern( repository, mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) ) + { + return mirror; + } + } + } + + return null; + } + + /** + * This method checks if the pattern matches the originalRepository. Valid patterns: * = everything external:* = + * everything not on the localhost and not file based. repo,repo1 = repo or repo1 *,!repo1 = everything except repo1 + * + * @param originalRepository to compare for a match. + * @param pattern used for match. Currently only '*' is supported. + * @return true if the repository is a match to this pattern. + */ + static boolean matchPattern( ArtifactRepository originalRepository, String pattern ) + { + boolean result = false; + String originalId = originalRepository.getId(); + + // simple checks first to short circuit processing below. + if ( WILDCARD.equals( pattern ) || pattern.equals( originalId ) ) + { + result = true; + } + else + { + // process the list + String[] repos = pattern.split( "," ); + for ( String repo : repos ) + { + // see if this is a negative match + if ( repo.length() > 1 && repo.startsWith( "!" ) ) + { + if ( repo.substring( 1 ).equals( originalId ) ) + { + // explicitly exclude. Set result and stop processing. + result = false; + break; + } + } + // check for exact match + else if ( repo.equals( originalId ) ) + { + result = true; + break; + } + // check for external:* + else if ( EXTERNAL_WILDCARD.equals( repo ) && isExternalRepo( originalRepository ) ) + { + result = true; + // don't stop processing in case a future segment explicitly excludes this repo + } + else if ( WILDCARD.equals( repo ) ) + { + result = true; + // don't stop processing in case a future segment explicitly excludes this repo + } + } + } + return result; + } + + /** + * Checks the URL to see if this repository refers to an external repository + * + * @param originalRepository + * @return true if external. + */ + static boolean isExternalRepo( ArtifactRepository originalRepository ) + { + try + { + URL url = new URL( originalRepository.getUrl() ); + return !( url.getHost().equals( "localhost" ) || url.getHost().equals( "127.0.0.1" ) + || url.getProtocol().equals( "file" ) ); + } + catch ( MalformedURLException e ) + { + // bad url just skip it here. It should have been validated already, but the wagon lookup will deal with it + return false; + } + } + + static boolean matchesLayout( ArtifactRepository repository, Mirror mirror ) + { + return matchesLayout( RepositoryUtils.getLayout( repository ), mirror.getMirrorOfLayouts() ); + } + + /** + * Checks whether the layouts configured for a mirror match with the layout of the repository. + * + * @param repoLayout The layout of the repository, may be {@code null}. + * @param mirrorLayout The layouts supported by the mirror, may be {@code null}. + * @return {@code true} if the layouts associated with the mirror match the layout of the original repository, + * {@code false} otherwise. + */ + static boolean matchesLayout( String repoLayout, String mirrorLayout ) + { + boolean result = false; + + // simple checks first to short circuit processing below. + if ( StringUtils.isEmpty( mirrorLayout ) || WILDCARD.equals( mirrorLayout ) ) + { + result = true; + } + else if ( mirrorLayout.equals( repoLayout ) ) + { + result = true; + } + else + { + // process the list + String[] layouts = mirrorLayout.split( "," ); + for ( String layout : layouts ) + { + // see if this is a negative match + if ( layout.length() > 1 && layout.startsWith( "!" ) ) + { + if ( layout.substring( 1 ).equals( repoLayout ) ) + { + // explicitly exclude. Set result and stop processing. + result = false; + break; + } + } + // check for exact match + else if ( layout.equals( repoLayout ) ) + { + result = true; + break; + } + else if ( WILDCARD.equals( layout ) ) + { + result = true; + // don't stop processing in case a future segment explicitly excludes this repo + } + } + } + + return result; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ArtifactClassRealmConstituent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ArtifactClassRealmConstituent.java new file mode 100644 index 00000000..562d6f47 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ArtifactClassRealmConstituent.java @@ -0,0 +1,76 @@ +package org.apache.maven.classrealm; + +/* + * 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.File; + +import org.eclipse.aether.artifact.Artifact; + +/** + * @author Benjamin Bentmann + */ +class ArtifactClassRealmConstituent + implements ClassRealmConstituent +{ + + private final Artifact artifact; + + public ArtifactClassRealmConstituent( Artifact artifact ) + { + this.artifact = artifact; + } + + public String getGroupId() + { + return artifact.getGroupId(); + } + + public String getArtifactId() + { + return artifact.getArtifactId(); + } + + public String getType() + { + return artifact.getExtension(); + } + + public String getClassifier() + { + return artifact.getClassifier(); + } + + public String getVersion() + { + return artifact.getBaseVersion(); + } + + public File getFile() + { + return artifact.getFile(); + } + + @Override + public String toString() + { + return artifact.toString(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmConstituent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmConstituent.java new file mode 100644 index 00000000..f658eb43 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmConstituent.java @@ -0,0 +1,74 @@ +package org.apache.maven.classrealm; + +/* + * 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.File; + +/** + * Describes a constituent of a class realm. + * + * @author Benjamin Bentmann + */ +public interface ClassRealmConstituent +{ + + /** + * Gets the group id of the constituent's artifact. + * + * @return The group id, never {@code null}. + */ + String getGroupId(); + + /** + * Gets the artifact id of the constituent's artifact. + * + * @return The artifact id, never {@code null}. + */ + String getArtifactId(); + + /** + * Gets the type of the constituent's artifact. + * + * @return The type, never {@code null}. + */ + String getType(); + + /** + * Gets the classifier of the constituent's artifact. + * + * @return The classifier or an empty string, never {@code null}. + */ + String getClassifier(); + + /** + * Gets the version of the constituent's artifact. + * + * @return The version, never {@code null}. + */ + String getVersion(); + + /** + * Gets the file of the constituent's artifact. + * + * @return The file, never {@code null}. + */ + File getFile(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManager.java new file mode 100644 index 00000000..e5d15143 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManager.java @@ -0,0 +1,88 @@ +package org.apache.maven.classrealm; + +/* + * 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.Map; + +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.eclipse.aether.artifact.Artifact; + +/** + * Manages the class realms used by Maven. <strong>Warning:</strong> This is an internal utility interface that is only + * public for technical reasons, it is not part of the public API. In particular, this interface can be changed or + * deleted without prior notice. + * + * @author Benjamin Bentmann + */ +public interface ClassRealmManager +{ + + /** + * Gets the class realm hosting the Maven core. + * + * @return The class realm hosting the Maven core, never {@code null}. + */ + ClassRealm getCoreRealm(); + + /** + * Gets the class realm exposing the Maven API. This is basically a restricted view on the Maven core realm. + * + * @return The class realm exposing the Maven API, never {@code null}. + */ + ClassRealm getMavenApiRealm(); + + /** + * Creates a new class realm for the specified project and its build extensions. + * + * @param model The model of the project for which to create a realm, must not be {@code null}. + * @param artifacts The artifacts to add to the class realm, may be {@code null}. Unresolved artifacts (i.e. with a + * missing file) will automatically be excluded from the realm. + * @return The new project realm, never {@code null}. + */ + ClassRealm createProjectRealm( Model model, List<Artifact> artifacts ); + + /** + * Creates a new class realm for the specified build extension. + * + * @param extension The extension plugin for which to create a realm, must not be {@code null}. + * @param artifacts The artifacts to add to the class realm, may be {@code null}. Unresolved artifacts (i.e. with a + * missing file) will automatically be excluded from the realm. + * @return The new extension realm, never {@code null}. + */ + ClassRealm createExtensionRealm( Plugin extension, List<Artifact> artifacts ); + + /** + * Creates a new class realm for the specified plugin. + * + * @param plugin The plugin for which to create a realm, must not be {@code null}. + * @param parent The parent realm for the new realm, may be {@code null}. + * @param parentImports The packages/types to import from the parent realm, may be {@code null}. + * @param foreignImports The packages/types to import from foreign realms, may be {@code null}. + * @param artifacts The artifacts to add to the class realm, may be {@code null}. Unresolved artifacts (i.e. with a + * missing file) will automatically be excluded from the realm. + * @return The new plugin realm, never {@code null}. + */ + ClassRealm createPluginRealm( Plugin plugin, ClassLoader parent, List<String> parentImports, + Map<String, ClassLoader> foreignImports, List<Artifact> artifacts ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManagerDelegate.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManagerDelegate.java new file mode 100644 index 00000000..b0229b97 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmManagerDelegate.java @@ -0,0 +1,36 @@ +package org.apache.maven.classrealm; + +/* + * 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.codehaus.plexus.classworlds.realm.ClassRealm; + +/** + * ClassRealmManagerDelegate is used to perform addition configuration of + * class realms created by ClassRealmManager. + * + * @author igor + */ +public interface ClassRealmManagerDelegate +{ + + void setupRealm( ClassRealm classRealm, ClassRealmRequest request ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmRequest.java new file mode 100644 index 00000000..9b62108f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/ClassRealmRequest.java @@ -0,0 +1,100 @@ +package org.apache.maven.classrealm; + +/* + * 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.Map; + +/** + * Describes the requirements for a new class realm. + * + * @author Benjamin Bentmann + */ +public interface ClassRealmRequest +{ + + /** + * The type of a class realm. + */ + enum RealmType + { + /** + * The class realm for the public API of the Maven core. + */ + Core, + + /** + * A class realm for a project to aggregates its build extensions. + */ + Project, + + /** + * A class realm for a build extension. + */ + Extension, + + /** + * A class realm for a plugin. + */ + Plugin, + } + + /** + * Gets the type of the class realm. + * + * @return The type of the class realm, never {@code null}. + */ + RealmType getType(); + + /** + * Gets the parent class realm (if any). + * + * @return The parent class realm or {@code null} if using the default parent. + */ + ClassLoader getParent(); + + /** + * @deprecated Use {@link #getParentImports()} instead. + */ + @Deprecated + List<String> getImports(); + + /** + * Gets the packages/types to import from the parent realm. + * + * @return The modifiable list of packages/types to import from the parent realm, never {@code null}. + */ + List<String> getParentImports(); + + /** + * Gets the packages/types to import from foreign realms. + * + * @return The modifiable map of packages/types to import from foreign realms, never {@code null}. + */ + Map<String, ClassLoader> getForeignImports(); + + /** + * Gets the constituents for the class realm. + * + * @return The modifiable list of constituents for the class realm, never {@code null}. + */ + List<ClassRealmConstituent> getConstituents(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java new file mode 100644 index 00000000..69ee04a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java @@ -0,0 +1,416 @@ +package org.apache.maven.classrealm; + +/* + * 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.File; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.TreeMap; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; + +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.classrealm.ClassRealmRequest.RealmType; +import org.apache.maven.extension.internal.CoreExportsProvider; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.codehaus.plexus.MutablePlexusContainer; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.classworlds.ClassWorld; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.classworlds.realm.DuplicateRealmException; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.artifact.Artifact; + +/** + * Manages the class realms used by Maven. <strong>Warning:</strong> This is an internal utility class that is only + * public for technical reasons, it is not part of the public API. In particular, this class can be changed or deleted + * without prior notice. + * + * @author Benjamin Bentmann + */ +@Named +@Singleton +public class DefaultClassRealmManager + implements ClassRealmManager +{ + public static final String API_REALMID = "maven.api"; + + /** + * During normal command line build, ClassWorld is loaded by jvm system classloader, which only includes + * plexus-classworlds jar and possibly javaagent classes, see http://jira.codehaus.org/browse/MNG-4747. + * <p> + * Using ClassWorld to determine plugin/extensions realm parent classloaders gives m2e and integration test harness + * flexibility to load multiple version of maven into dedicated classloaders without assuming state of jvm system + * classloader. + */ + private static final ClassLoader PARENT_CLASSLOADER = ClassWorld.class.getClassLoader(); + + private final Logger logger; + + private final ClassWorld world; + + private final ClassRealm containerRealm; + + // this is a live injected collection + private final List<ClassRealmManagerDelegate> delegates; + + private final ClassRealm mavenApiRealm; + + /** + * Patterns of artifacts provided by maven core and exported via maven api realm. These artifacts are filtered from + * plugin and build extensions realms to avoid presence of duplicate and possibly conflicting classes on classpath. + */ + private final Set<String> providedArtifacts; + + @Inject + public DefaultClassRealmManager( Logger logger, PlexusContainer container, + List<ClassRealmManagerDelegate> delegates, CoreExportsProvider exports ) + { + this.logger = logger; + this.world = ( (MutablePlexusContainer) container ).getClassWorld(); + this.containerRealm = container.getContainerRealm(); + this.delegates = delegates; + + Map<String, ClassLoader> foreignImports = exports.get().getExportedPackages(); + + this.mavenApiRealm = + createRealm( API_REALMID, RealmType.Core, null /* parent */, null /* parentImports */, + foreignImports, null /* artifacts */ ); + + this.providedArtifacts = exports.get().getExportedArtifacts(); + } + + private ClassRealm newRealm( String id ) + { + synchronized ( world ) + { + String realmId = id; + + Random random = new Random(); + + while ( true ) + { + try + { + ClassRealm classRealm = world.newRealm( realmId, null ); + + if ( logger.isDebugEnabled() ) + { + logger.debug( "Created new class realm " + realmId ); + } + + return classRealm; + } + catch ( DuplicateRealmException e ) + { + realmId = id + '-' + random.nextInt(); + } + } + } + } + + public ClassRealm getMavenApiRealm() + { + return mavenApiRealm; + } + + /** + * Creates a new class realm with the specified parent and imports. + * + * @param baseRealmId The base id to use for the new realm, must not be {@code null}. + * @param type The type of the class realm, must not be {@code null}. + * @param parent The parent realm for the new realm, may be {@code null}. + * @param parentImports The packages/types to import from the parent realm, may be {@code null}. + * @param foreignImports The packages/types to import from foreign realms, may be {@code null}. + * @param artifacts The artifacts to add to the realm, may be {@code null}. Unresolved artifacts (i.e. with a + * missing file) will automatically be excluded from the realm. + * @return The created class realm, never {@code null}. + */ + private ClassRealm createRealm( String baseRealmId, RealmType type, ClassLoader parent, List<String> parentImports, + Map<String, ClassLoader> foreignImports, List<Artifact> artifacts ) + { + Set<String> artifactIds = new LinkedHashSet<String>(); + + List<ClassRealmConstituent> constituents = new ArrayList<ClassRealmConstituent>(); + + if ( artifacts != null ) + { + for ( Artifact artifact : artifacts ) + { + if ( !isProvidedArtifact( artifact ) ) + { + artifactIds.add( getId( artifact ) ); + if ( artifact.getFile() != null ) + { + constituents.add( new ArtifactClassRealmConstituent( artifact ) ); + } + } + } + } + + if ( parentImports != null ) + { + parentImports = new ArrayList<String>( parentImports ); + } + else + { + parentImports = new ArrayList<String>(); + } + + if ( foreignImports != null ) + { + foreignImports = new TreeMap<String, ClassLoader>( foreignImports ); + } + else + { + foreignImports = new TreeMap<String, ClassLoader>(); + } + + ClassRealm classRealm = newRealm( baseRealmId ); + + if ( parent != null ) + { + classRealm.setParentClassLoader( parent ); + } + + callDelegates( classRealm, type, parent, parentImports, foreignImports, constituents ); + + wireRealm( classRealm, parentImports, foreignImports ); + + Set<String> includedIds = populateRealm( classRealm, constituents ); + + if ( logger.isDebugEnabled() ) + { + artifactIds.removeAll( includedIds ); + + for ( String id : artifactIds ) + { + logger.debug( " Excluded: " + id ); + } + } + + return classRealm; + } + + public ClassRealm getCoreRealm() + { + return containerRealm; + } + + public ClassRealm createProjectRealm( Model model, List<Artifact> artifacts ) + { + if ( model == null ) + { + throw new IllegalArgumentException( "model missing" ); + } + + ClassLoader parent = getMavenApiRealm(); + + return createRealm( getKey( model ), RealmType.Project, parent, null, null, artifacts ); + } + + private static String getKey( Model model ) + { + return "project>" + model.getGroupId() + ":" + model.getArtifactId() + ":" + model.getVersion(); + } + + public ClassRealm createExtensionRealm( Plugin plugin, List<Artifact> artifacts ) + { + if ( plugin == null ) + { + throw new IllegalArgumentException( "extension plugin missing" ); + } + + ClassLoader parent = PARENT_CLASSLOADER; + + Map<String, ClassLoader> foreignImports = + Collections.<String, ClassLoader>singletonMap( "", getMavenApiRealm() ); + + return createRealm( getKey( plugin, true ), RealmType.Extension, parent, null, foreignImports, artifacts ); + } + + private boolean isProvidedArtifact( Artifact artifact ) + { + return providedArtifacts.contains( artifact.getGroupId() + ":" + artifact.getArtifactId() ); + } + + public ClassRealm createPluginRealm( Plugin plugin, ClassLoader parent, List<String> parentImports, + Map<String, ClassLoader> foreignImports, List<Artifact> artifacts ) + { + if ( plugin == null ) + { + throw new IllegalArgumentException( "plugin missing" ); + } + + if ( parent == null ) + { + parent = PARENT_CLASSLOADER; + } + + return createRealm( getKey( plugin, false ), RealmType.Plugin, parent, parentImports, foreignImports, + artifacts ); + } + + private static String getKey( Plugin plugin, boolean extension ) + { + String version = ArtifactUtils.toSnapshotVersion( plugin.getVersion() ); + return ( extension ? "extension>" : "plugin>" ) + plugin.getGroupId() + ":" + plugin.getArtifactId() + ":" + + version; + } + + private static String getId( Artifact artifact ) + { + return getId( artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(), + artifact.getClassifier(), artifact.getBaseVersion() ); + } + + private static String getId( ClassRealmConstituent constituent ) + { + return getId( constituent.getGroupId(), constituent.getArtifactId(), constituent.getType(), + constituent.getClassifier(), constituent.getVersion() ); + } + + private static String getId( String gid, String aid, String type, String cls, String ver ) + { + return gid + ':' + aid + ':' + type + ( StringUtils.isNotEmpty( cls ) ? ':' + cls : "" ) + ':' + ver; + } + + private void callDelegates( ClassRealm classRealm, RealmType type, ClassLoader parent, List<String> parentImports, + Map<String, ClassLoader> foreignImports, List<ClassRealmConstituent> constituents ) + { + List<ClassRealmManagerDelegate> delegates = new ArrayList<ClassRealmManagerDelegate>( this.delegates ); + + if ( !delegates.isEmpty() ) + { + ClassRealmRequest request = + new DefaultClassRealmRequest( type, parent, parentImports, foreignImports, constituents ); + + for ( ClassRealmManagerDelegate delegate : delegates ) + { + try + { + delegate.setupRealm( classRealm, request ); + } + catch ( Exception e ) + { + logger.error( delegate.getClass().getName() + " failed to setup class realm " + classRealm + ": " + + e.getMessage(), e ); + } + } + } + } + + private Set<String> populateRealm( ClassRealm classRealm, List<ClassRealmConstituent> constituents ) + { + Set<String> includedIds = new LinkedHashSet<String>(); + + if ( logger.isDebugEnabled() ) + { + logger.debug( "Populating class realm " + classRealm.getId() ); + } + + for ( ClassRealmConstituent constituent : constituents ) + { + File file = constituent.getFile(); + + String id = getId( constituent ); + includedIds.add( id ); + + if ( logger.isDebugEnabled() ) + { + logger.debug( " Included: " + id ); + } + + try + { + classRealm.addURL( file.toURI().toURL() ); + } + catch ( MalformedURLException e ) + { + // Not going to happen + logger.error( e.getMessage(), e ); + } + } + + return includedIds; + } + + private void wireRealm( ClassRealm classRealm, List<String> parentImports, Map<String, ClassLoader> foreignImports ) + { + if ( foreignImports != null && !foreignImports.isEmpty() ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( "Importing foreign packages into class realm " + classRealm.getId() ); + } + + for ( Map.Entry<String, ClassLoader> entry : foreignImports.entrySet() ) + { + ClassLoader importedRealm = entry.getValue(); + String imp = entry.getKey(); + + if ( logger.isDebugEnabled() ) + { + logger.debug( " Imported: " + imp + " < " + getId( importedRealm ) ); + } + + classRealm.importFrom( importedRealm, imp ); + } + } + + if ( parentImports != null && !parentImports.isEmpty() ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( "Importing parent packages into class realm " + classRealm.getId() ); + } + + for ( String imp : parentImports ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( " Imported: " + imp + " < " + getId( classRealm.getParentClassLoader() ) ); + } + + classRealm.importFromParent( imp ); + } + } + } + + private String getId( ClassLoader classLoader ) + { + if ( classLoader instanceof ClassRealm ) + { + return ( (ClassRealm) classLoader ).getId(); + } + return String.valueOf( classLoader ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmRequest.java new file mode 100644 index 00000000..062b2cf3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmRequest.java @@ -0,0 +1,82 @@ +package org.apache.maven.classrealm; + +/* + * 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.Map; + +/** + * @author Benjamin Bentmann + */ +class DefaultClassRealmRequest + implements ClassRealmRequest +{ + + private final RealmType type; + + private final ClassLoader parent; + + private final List<String> parentImports; + + private final Map<String, ClassLoader> foreignImports; + + private final List<ClassRealmConstituent> constituents; + + public DefaultClassRealmRequest( RealmType type, ClassLoader parent, List<String> parentImports, + Map<String, ClassLoader> foreignImports, List<ClassRealmConstituent> constituents ) + { + this.type = type; + this.parent = parent; + this.parentImports = parentImports; + this.foreignImports = foreignImports; + this.constituents = constituents; + } + + public RealmType getType() + { + return type; + } + + public ClassLoader getParent() + { + return parent; + } + + public List<String> getImports() + { + return getParentImports(); + } + + public List<String> getParentImports() + { + return parentImports; + } + + public Map<String, ClassLoader> getForeignImports() + { + return foreignImports; + } + + public List<ClassRealmConstituent> getConstituents() + { + return constituents; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BasedirBeanConfigurationPathTranslator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BasedirBeanConfigurationPathTranslator.java new file mode 100644 index 00000000..9859f586 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BasedirBeanConfigurationPathTranslator.java @@ -0,0 +1,71 @@ +package org.apache.maven.configuration; + +/* + * 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.File; + +/** + * A path translator that resolves relative paths against a specific base directory. + * + * @author Benjamin Bentmann + */ +public class BasedirBeanConfigurationPathTranslator + implements BeanConfigurationPathTranslator +{ + + private final File basedir; + + /** + * Creates a new path translator using the specified base directory. + * + * @param basedir The base directory to resolve relative paths against, may be {@code null} to disable path + * translation. + */ + public BasedirBeanConfigurationPathTranslator( File basedir ) + { + this.basedir = basedir; + } + + public File translatePath( File path ) + { + File result = path; + + if ( path != null && basedir != null ) + { + if ( path.isAbsolute() ) + { + // path is already absolute, we're done + } + else if ( path.getPath().startsWith( File.separator ) ) + { + // drive-relative Windows path, don't align with base dir but with drive root + result = path.getAbsoluteFile(); + } + else + { + // an ordinary relative path, align with base dir + result = new File( new File( basedir, path.getPath() ).toURI().normalize() ).getAbsoluteFile(); + } + } + + return result; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationException.java new file mode 100644 index 00000000..3d10ed4a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationException.java @@ -0,0 +1,41 @@ +package org.apache.maven.configuration; + +/* + * 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 when a bean couldn't be configured. + * + * @author Benjamin Bentmann + */ +public class BeanConfigurationException + extends Exception +{ + + public BeanConfigurationException( String message ) + { + super( message ); + } + + public BeanConfigurationException( String message, Throwable cause ) + { + super( message, cause ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationPathTranslator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationPathTranslator.java new file mode 100644 index 00000000..39663391 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationPathTranslator.java @@ -0,0 +1,41 @@ +package org.apache.maven.configuration; + +/* + * 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.File; + +/** + * Postprocesses filesystem paths. For instance, a path translator might want to resolve relative paths given in the + * bean configuration against some base directory. + * + * @author Benjamin Bentmann + */ +public interface BeanConfigurationPathTranslator +{ + + /** + * Translates the specified path. + * + * @param path The path to translate, may be {@code null}. + * @return The translated path or {@code null} if none. + */ + File translatePath( File path ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationRequest.java new file mode 100644 index 00000000..d19aa204 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationRequest.java @@ -0,0 +1,130 @@ +package org.apache.maven.configuration; + +/* + * 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 request to configure a bean from some configuration in the POM or similar. + * + * @author Benjamin Bentmann + */ +public interface BeanConfigurationRequest +{ + + /** + * Gets the bean to configure. Eventually, a valid request must have a bean set. + * + * @return The bean to configure, or {@code null} if none. + */ + Object getBean(); + + /** + * Sets the bean to configure. Eventually, a valid request must have a bean set. + * + * @param bean The bean to configure, may be {@code null}. + * @return This request for chaining, never {@code null}. + */ + BeanConfigurationRequest setBean( Object bean ); + + /** + * Gets the configuration to unmarshal into the bean. + * + * @return The configuration to unmarshal into the bean or {@code null} if none. + */ + Object getConfiguration(); + + /** + * Sets the configuration to unmarshal into the bean. The configuration should be taken from + * {@link org.apache.maven.model.ConfigurationContainer#getConfiguration()} or a similar source. + * Fully equivalent to {@code setConfiguration(configuration, null)}. + * + * @param configuration The configuration to unmarshal, may be {@code null}. + * @return This request for chaining, never {@code null}. + */ + BeanConfigurationRequest setConfiguration( Object configuration ); + + /** + * Sets the configuration to unmarshal into the bean. The configuration should be taken from + * {@link org.apache.maven.model.ConfigurationContainer#getConfiguration()} or a similar source. + * If {@code element} is not {@code null}, child configuration element with the specified name will + * be unmarshaled. + * + * @param configuration The configuration to unmarshal, may be {@code null}. + * @param element Configuration element name to unmarshal or {@code null} to unmarshal entire configuration. + * @return This request for chaining, never {@code null}. + */ + BeanConfigurationRequest setConfiguration( Object configuration, String element ); + + /** + * Returns configuration element name or {@code null}. + * + * @see #setConfiguration(Object, String) + * + * @return Configuration element name or {@code null} + */ + String getConfigurationElement(); + + /** + * Gets the class loader from which to load any types referenced by the configuration. If unset, the class loader of + * the bean class will be used. + * + * @return The class loader to load referenced types from or {@code null} if unset. + */ + ClassLoader getClassLoader(); + + /** + * Sets the class loader from which to load any types referenced by the configuration. If unset, the class loader of + * the bean class will be used. + * + * @param classLoader The class loader to load referenced types from, may be {@code null}. + * @return This request for chaining, never {@code null}. + */ + BeanConfigurationRequest setClassLoader( ClassLoader classLoader ); + + /** + * Gets the optional preprocessor for configuration values. + * + * @return The preprocessor for configuration values or {@code null} if none. + */ + BeanConfigurationValuePreprocessor getValuePreprocessor(); + + /** + * Sets the optional preprocessor for configuration values. + * + * @param valuePreprocessor The preprocessor for configuration values, may be {@code null} if unneeded. + * @return This request for chaining, never {@code null}. + */ + BeanConfigurationRequest setValuePreprocessor( BeanConfigurationValuePreprocessor valuePreprocessor ); + + /** + * Gets the optional path translator for configuration values unmarshalled to files. + * + * @return The path translator for files or {@code null} if none. + */ + BeanConfigurationPathTranslator getPathTranslator(); + + /** + * Sets the optional path translator for configuration values unmarshalled to files. + * + * @param pathTranslator The path translator for files, may be {@code null} if unneeded. + * @return This request for chaining, never {@code null}. + */ + BeanConfigurationRequest setPathTranslator( BeanConfigurationPathTranslator pathTranslator ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationValuePreprocessor.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationValuePreprocessor.java new file mode 100644 index 00000000..63f85173 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurationValuePreprocessor.java @@ -0,0 +1,45 @@ +package org.apache.maven.configuration; + +/* + * 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. + */ + +/** + * Preprocesses a value from a bean configuration before the bean configurator unmarshals it into a bean property. A + * common use case for such preprocessing is the evaluation of variables within the configuration value. + * + * @author Benjamin Bentmann + */ +public interface BeanConfigurationValuePreprocessor +{ + + /** + * Preprocesses the specified bean configuration value. The optional type provided to this method is a hint (not a + * requirement) for the preprocessor to resolve the value to a compatible value or a (string) value than can be + * unmarshalled into that type. The preprocessor is not required to perform any type conversion but should rather + * filter out incompatible values from its result. + * + * @param value The configuration value to preprocess, must not be {@code null}. + * @param type The target type of the value, may be {@code null}. + * @return The processed configuration value or {@code null} if none. + * @throws BeanConfigurationException If an error occurred while preprocessing the value. + */ + Object preprocessValue( String value, Class<?> type ) + throws BeanConfigurationException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurator.java new file mode 100644 index 00000000..36d23eca --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/BeanConfigurator.java @@ -0,0 +1,44 @@ +package org.apache.maven.configuration; + +/* + * 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. + */ + +/** + * Unmarshals some textual configuration from the POM or similar into the properties of a bean. This component works + * similar to the way Maven configures plugins from the POM, i.e. some configuration like {@code <param>value</param>} + * is mapped to an equally named property of the bean and converted. The properties of the bean are supposed to either + * have a public setter or be backed by an equally named field (of any visibility). + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface BeanConfigurator +{ + + /** + * Performs the specified bean configuration. + * + * @param request The configuration request that specifies the bean and the configuration to process, must not be + * {@code null}. + * @throws BeanConfigurationException If the bean configuration could not be successfully processed. + */ + void configureBean( BeanConfigurationRequest request ) + throws BeanConfigurationException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/DefaultBeanConfigurationRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/DefaultBeanConfigurationRequest.java new file mode 100644 index 00000000..32def48f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/DefaultBeanConfigurationRequest.java @@ -0,0 +1,195 @@ +package org.apache.maven.configuration; + +/* + * 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.model.Build; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.model.PluginManagement; +import org.codehaus.plexus.util.StringUtils; + +/** + * A basic bean configuration request. + * + * @author Benjamin Bentmann + */ +public class DefaultBeanConfigurationRequest + implements BeanConfigurationRequest +{ + + private Object bean; + + private Object configuration; + + private String configurationElement; + + private ClassLoader classLoader; + + private BeanConfigurationValuePreprocessor valuePreprocessor; + + private BeanConfigurationPathTranslator pathTranslator; + + public Object getBean() + { + return bean; + } + + public DefaultBeanConfigurationRequest setBean( Object bean ) + { + this.bean = bean; + return this; + } + + public Object getConfiguration() + { + return configuration; + } + + public String getConfigurationElement() + { + return configurationElement; + } + + public DefaultBeanConfigurationRequest setConfiguration( Object configuration ) + { + return setConfiguration( configuration, null ); + } + + public DefaultBeanConfigurationRequest setConfiguration( Object configuration, String element ) + { + this.configuration = configuration; + this.configurationElement = element; + return this; + } + + /** + * Sets the configuration to the configuration taken from the specified build plugin in the POM. First, the build + * plugins will be searched for the specified plugin, if that fails, the plugin management section will be searched. + * + * @param model The POM to extract the plugin configuration from, may be {@code null}. + * @param pluginGroupId The group id of the plugin whose configuration should be used, must not be {@code null} or + * empty. + * @param pluginArtifactId The artifact id of the plugin whose configuration should be used, must not be + * {@code null} or empty. + * @param pluginExecutionId The id of a plugin execution whose configuration should be used, may be {@code null} or + * empty to use the general plugin configuration. + * @return This request for chaining, never {@code null}. + */ + public DefaultBeanConfigurationRequest setConfiguration( Model model, String pluginGroupId, + String pluginArtifactId, String pluginExecutionId ) + { + Plugin plugin = findPlugin( model, pluginGroupId, pluginArtifactId ); + if ( plugin != null ) + { + if ( StringUtils.isNotEmpty( pluginExecutionId ) ) + { + for ( PluginExecution execution : plugin.getExecutions() ) + { + if ( pluginExecutionId.equals( execution.getId() ) ) + { + setConfiguration( execution.getConfiguration() ); + break; + } + } + } + else + { + setConfiguration( plugin.getConfiguration() ); + } + } + return this; + } + + private Plugin findPlugin( Model model, String groupId, String artifactId ) + { + if ( StringUtils.isEmpty( groupId ) ) + { + throw new IllegalArgumentException( "group id for plugin has not been specified" ); + } + if ( StringUtils.isEmpty( artifactId ) ) + { + throw new IllegalArgumentException( "artifact id for plugin has not been specified" ); + } + + if ( model != null ) + { + Build build = model.getBuild(); + if ( build != null ) + { + for ( Plugin plugin : build.getPlugins() ) + { + if ( groupId.equals( plugin.getGroupId() ) && artifactId.equals( plugin.getArtifactId() ) ) + { + return plugin; + } + } + + PluginManagement mngt = build.getPluginManagement(); + if ( mngt != null ) + { + for ( Plugin plugin : mngt.getPlugins() ) + { + if ( groupId.equals( plugin.getGroupId() ) && artifactId.equals( plugin.getArtifactId() ) ) + { + return plugin; + } + } + } + } + } + + return null; + } + + public ClassLoader getClassLoader() + { + return classLoader; + } + + public DefaultBeanConfigurationRequest setClassLoader( ClassLoader classLoader ) + { + this.classLoader = classLoader; + return this; + } + + public BeanConfigurationValuePreprocessor getValuePreprocessor() + { + return valuePreprocessor; + } + + public DefaultBeanConfigurationRequest setValuePreprocessor( BeanConfigurationValuePreprocessor valuePreprocessor ) + { + this.valuePreprocessor = valuePreprocessor; + return this; + } + + public BeanConfigurationPathTranslator getPathTranslator() + { + return pathTranslator; + } + + public DefaultBeanConfigurationRequest setPathTranslator( BeanConfigurationPathTranslator pathTranslator ) + { + this.pathTranslator = pathTranslator; + return this; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java new file mode 100644 index 00000000..3d3def62 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java @@ -0,0 +1,160 @@ +package org.apache.maven.configuration.internal; + +/* + * 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.File; + +import org.apache.maven.configuration.BeanConfigurationException; +import org.apache.maven.configuration.BeanConfigurationPathTranslator; +import org.apache.maven.configuration.BeanConfigurationRequest; +import org.apache.maven.configuration.BeanConfigurationValuePreprocessor; +import org.apache.maven.configuration.BeanConfigurator; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.configurator.ComponentConfigurationException; +import org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter; +import org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup; +import org.codehaus.plexus.component.configurator.converters.lookup.DefaultConverterLookup; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; +import org.codehaus.plexus.component.configurator.expression.TypeAwareExpressionEvaluator; +import org.codehaus.plexus.configuration.PlexusConfiguration; +import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * <strong>Warning:</strong> This is an internal class that is only public for technical reasons, it is not part of the + * public API. In particular, this class can be changed or deleted without prior notice. + * + * @author Benjamin Bentmann + */ +@Component( role = BeanConfigurator.class ) +public class DefaultBeanConfigurator + implements BeanConfigurator +{ + + private final ConverterLookup converterLookup = new DefaultConverterLookup(); + + public void configureBean( BeanConfigurationRequest request ) + throws BeanConfigurationException + { + if ( request == null ) + { + throw new IllegalArgumentException( "bean configuration request not specified" ); + } + + if ( request.getBean() == null ) + { + throw new IllegalArgumentException( "bean to be configured not specified" ); + } + + Object configuration = request.getConfiguration(); + if ( configuration == null ) + { + return; + } + + PlexusConfiguration plexusConfig; + if ( configuration instanceof PlexusConfiguration ) + { + plexusConfig = (PlexusConfiguration) configuration; + } + else if ( configuration instanceof Xpp3Dom ) + { + plexusConfig = new XmlPlexusConfiguration( (Xpp3Dom) configuration ); + } + else + { + throw new BeanConfigurationException( "unsupported bean configuration source (" + + configuration.getClass().getName() + ")" ); + } + + if ( request.getConfigurationElement() != null ) + { + plexusConfig = plexusConfig.getChild( request.getConfigurationElement() ); + } + + ClassLoader classLoader = request.getClassLoader(); + if ( classLoader == null ) + { + classLoader = request.getBean().getClass().getClassLoader(); + } + + BeanExpressionEvaluator evaluator = new BeanExpressionEvaluator( request ); + + ObjectWithFieldsConverter converter = new ObjectWithFieldsConverter(); + + try + { + converter.processConfiguration( converterLookup, request.getBean(), classLoader, plexusConfig, evaluator ); + } + catch ( ComponentConfigurationException e ) + { + throw new BeanConfigurationException( e.getMessage(), e ); + } + } + + static class BeanExpressionEvaluator + implements TypeAwareExpressionEvaluator + { + + private final BeanConfigurationValuePreprocessor preprocessor; + + private final BeanConfigurationPathTranslator translator; + + public BeanExpressionEvaluator( BeanConfigurationRequest request ) + { + preprocessor = request.getValuePreprocessor(); + translator = request.getPathTranslator(); + } + + public Object evaluate( String expression, Class<?> type ) + throws ExpressionEvaluationException + { + if ( preprocessor != null ) + { + try + { + return preprocessor.preprocessValue( expression, type ); + } + catch ( BeanConfigurationException e ) + { + throw new ExpressionEvaluationException( e.getMessage(), e ); + } + } + return expression; + } + + public Object evaluate( String expression ) + throws ExpressionEvaluationException + { + return evaluate( expression, null ); + } + + public File alignToBaseDirectory( File file ) + { + if ( translator != null ) + { + return translator.translatePath( file ); + } + return file; + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/AbstractEventSpy.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/AbstractEventSpy.java new file mode 100644 index 00000000..09132275 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/AbstractEventSpy.java @@ -0,0 +1,45 @@ +package org.apache.maven.eventspy; + +/* + * 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 skeleton eventspy that does nothing other than helping implementors. + * @since 3.0.2 + */ +public abstract class AbstractEventSpy + implements EventSpy +{ + + public void init( Context context ) + throws Exception + { + } + + public void onEvent( Object event ) + throws Exception + { + } + + public void close() + throws Exception + { + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java new file mode 100644 index 00000000..4284fce9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java @@ -0,0 +1,77 @@ +package org.apache.maven.eventspy; + +/* + * 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.Map; + +/** + * A core extension to monitor Maven's execution. Typically, such an extension gets loaded into Maven by specifying the + * system property {@code maven.ext.class.path} on the command line. As soon as dependency injection is setup, Maven + * looks up all implementators of this interface and calls their {@link #init(Context)} method. <em>Note:</em> + * Implementors are strongly advised to inherit from {@link AbstractEventSpy} instead of directly implementing this + * interface. + * @since 3.0.2 + */ +public interface EventSpy +{ + + interface Context + { + + /** + * Gets key-value pairs providing information about the Maven runtime. + * + * @return The key-value pairs, never {@code null}. + */ + Map<String, Object> getData(); + + } + + /** + * Initializes the spy. + * + * @param context The event spy context, never {@code null}. + */ + void init( Context context ) + throws Exception; + + /** + * Notifies the spy of some build event/operation. + * + * @param event The event, never {@code null}. + * @see org.apache.maven.settings.building.SettingsBuildingRequest + * @see org.apache.maven.settings.building.SettingsBuildingResult + * @see org.apache.maven.execution.MavenExecutionRequest + * @see org.apache.maven.execution.MavenExecutionResult + * @see org.apache.maven.project.DependencyResolutionRequest + * @see org.apache.maven.project.DependencyResolutionResult + * @see org.apache.maven.execution.ExecutionEvent + * @see org.eclipse.aether.RepositoryEvent + */ + void onEvent( Object event ) + throws Exception; + + /** + * Notifies the spy of Maven's termination, allowing it to free any resources allocated by it. + */ + void close() + throws Exception; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java new file mode 100644 index 00000000..d44642d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java @@ -0,0 +1,158 @@ +package org.apache.maven.eventspy.internal; + +/* + * 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.ArrayList; +import java.util.List; + +import org.apache.maven.eventspy.EventSpy; +import org.apache.maven.execution.ExecutionListener; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.RepositoryListener; + +/** + * Dispatches callbacks to all registered eventspies. + * @since 3.0.2 + */ +@Component( role = EventSpyDispatcher.class ) +public class EventSpyDispatcher +{ + + @Requirement + private Logger logger; + + @Requirement( role = EventSpy.class ) + private List<EventSpy> eventSpies; + + public void setEventSpies( List<EventSpy> eventSpies ) + { + // make copy to get rid of needless overhead for dynamic lookups + this.eventSpies = new ArrayList<EventSpy>( eventSpies ); + } + + public List<EventSpy> getEventSpies() + { + return eventSpies; + } + + public ExecutionListener chainListener( ExecutionListener listener ) + { + if ( eventSpies.isEmpty() ) + { + return listener; + } + return new EventSpyExecutionListener( this, listener ); + } + + public RepositoryListener chainListener( RepositoryListener listener ) + { + if ( eventSpies.isEmpty() ) + { + return listener; + } + return new EventSpyRepositoryListener( this, listener ); + } + + public void init( EventSpy.Context context ) + { + if ( eventSpies.isEmpty() ) + { + return; + } + for ( EventSpy eventSpy : eventSpies ) + { + try + { + eventSpy.init( context ); + } + catch ( Exception e ) + { + logError( "initialize", e, eventSpy ); + } + catch ( LinkageError e ) + { + logError( "initialize", e, eventSpy ); + } + } + } + + public void onEvent( Object event ) + { + if ( eventSpies.isEmpty() ) + { + return; + } + for ( EventSpy eventSpy : eventSpies ) + { + try + { + eventSpy.onEvent( event ); + } + catch ( Exception e ) + { + logError( "notify", e, eventSpy ); + } + catch ( LinkageError e ) + { + logError( "notify", e, eventSpy ); + } + } + } + + public void close() + { + if ( eventSpies.isEmpty() ) + { + return; + } + for ( EventSpy eventSpy : eventSpies ) + { + try + { + eventSpy.close(); + } + catch ( Exception e ) + { + logError( "close", e, eventSpy ); + } + catch ( LinkageError e ) + { + logError( "close", e, eventSpy ); + } + } + } + + private void logError( String action, Throwable e, EventSpy spy ) + { + String msg = "Failed to " + action + " spy " + spy.getClass().getName() + ": " + e.getMessage(); + + if ( logger.isDebugEnabled() ) + { + logger.warn( msg, e ); + } + else + { + logger.warn( msg ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyExecutionListener.java new file mode 100644 index 00000000..6b25da58 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyExecutionListener.java @@ -0,0 +1,163 @@ +package org.apache.maven.eventspy.internal; + +/* + * 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.execution.AbstractExecutionListener; +import org.apache.maven.execution.ExecutionEvent; +import org.apache.maven.execution.ExecutionListener; + +/** + * Forwards execution events to eventspies. + * @since 3.0.2 + */ +class EventSpyExecutionListener + extends AbstractExecutionListener +{ + + private final EventSpyDispatcher dispatcher; + + private final ExecutionListener delegate; + + public EventSpyExecutionListener( EventSpyDispatcher dispatcher, ExecutionListener delegate ) + { + this.dispatcher = dispatcher; + this.delegate = delegate; + } + + @Override + public void projectDiscoveryStarted( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.projectDiscoveryStarted( event ); + } + + @Override + public void sessionStarted( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.sessionStarted( event ); + } + + @Override + public void sessionEnded( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.sessionEnded( event ); + } + + @Override + public void projectSkipped( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.projectSkipped( event ); + } + + @Override + public void projectStarted( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.projectStarted( event ); + } + + @Override + public void projectSucceeded( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.projectSucceeded( event ); + } + + @Override + public void projectFailed( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.projectFailed( event ); + } + + @Override + public void forkStarted( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.forkStarted( event ); + } + + @Override + public void forkSucceeded( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.forkSucceeded( event ); + } + + @Override + public void forkFailed( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.forkFailed( event ); + } + + @Override + public void mojoSkipped( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.mojoSkipped( event ); + } + + @Override + public void mojoStarted( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.mojoStarted( event ); + } + + @Override + public void mojoSucceeded( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.mojoSucceeded( event ); + } + + @Override + public void mojoFailed( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.mojoFailed( event ); + } + + @Override + public void forkedProjectStarted( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.forkedProjectStarted( event ); + } + + @Override + public void forkedProjectSucceeded( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.forkedProjectSucceeded( event ); + } + + @Override + public void forkedProjectFailed( ExecutionEvent event ) + { + dispatcher.onEvent( event ); + delegate.forkedProjectFailed( event ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java new file mode 100644 index 00000000..60d4cd1c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java @@ -0,0 +1,176 @@ +package org.apache.maven.eventspy.internal; + +/* + * 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.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RepositoryListener; + +/** + * Forwards repository events to eventspies. + * @since 3.0.2 + */ +class EventSpyRepositoryListener + extends AbstractRepositoryListener +{ + private final EventSpyDispatcher dispatcher; + + private final RepositoryListener delegate; + + public EventSpyRepositoryListener( EventSpyDispatcher dispatcher, RepositoryListener delegate ) + { + this.dispatcher = dispatcher; + this.delegate = delegate; + } + + @Override + public void artifactDeployed( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactDeployed( event ); + } + + @Override + public void artifactDeploying( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactDeploying( event ); + } + + @Override + public void artifactDescriptorInvalid( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactDescriptorInvalid( event ); + } + + @Override + public void artifactDescriptorMissing( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactDescriptorMissing( event ); + } + + @Override + public void artifactInstalled( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactInstalled( event ); + } + + @Override + public void artifactInstalling( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactInstalling( event ); + } + + @Override + public void artifactResolved( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactResolved( event ); + } + + @Override + public void artifactResolving( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactResolving( event ); + } + + @Override + public void metadataDeployed( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataDeployed( event ); + } + + @Override + public void metadataDeploying( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataDeploying( event ); + } + + @Override + public void metadataInstalled( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataInstalled( event ); + } + + @Override + public void metadataInstalling( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataInstalling( event ); + } + + @Override + public void metadataInvalid( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataInvalid( event ); + } + + @Override + public void metadataResolved( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataResolved( event ); + } + + @Override + public void metadataResolving( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataResolving( event ); + } + + @Override + public void artifactDownloaded( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactDownloaded( event ); + } + + @Override + public void artifactDownloading( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.artifactDownloading( event ); + } + + @Override + public void metadataDownloaded( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataDownloaded( event ); + } + + @Override + public void metadataDownloading( RepositoryEvent event ) + { + dispatcher.onEvent( event ); + delegate.metadataDownloading( event ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java new file mode 100644 index 00000000..6df72c81 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java @@ -0,0 +1,336 @@ +package org.apache.maven.exception; + +/* + * 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.net.ConnectException; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.lifecycle.LifecycleExecutionException; +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.model.building.ModelProblemUtils; +import org.apache.maven.plugin.AbstractMojoExecutionException; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.PluginContainerException; +import org.apache.maven.plugin.PluginExecutionException; +import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.project.ProjectBuildingResult; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.util.StringUtils; + +/* + +- test projects for each of these +- how to categorize the problems so that the id of the problem can be match to a page with descriptive help and the test + project +- nice little sample projects that could be run in the core as well as integration tests + +All Possible Errors +- invalid lifecycle phase (maybe same as bad CLI param, though you were talking about embedder too) +- <module> specified is not found +- malformed settings +- malformed POM +- local repository not writable +- remote repositories not available +- artifact metadata missing +- extension metadata missing +- extension artifact missing +- artifact metadata retrieval problem +- version range violation +- circular dependency +- artifact missing +- artifact retrieval exception +- md5 checksum doesn't match for local artifact, need to redownload this +- POM doesn't exist for a goal that requires one +- parent POM missing (in both the repository + relative path) +- component not found + +Plugins: +- plugin metadata missing +- plugin metadata retrieval problem +- plugin artifact missing +- plugin artifact retrieval problem +- plugin dependency metadata missing +- plugin dependency metadata retrieval problem +- plugin configuration problem +- plugin execution failure due to something that is know to possibly go wrong (like compilation failure) +- plugin execution error due to something that is not expected to go wrong (the compiler executable missing) +- asking to use a plugin for which you do not have a version defined - tools to easily select versions +- goal not found in a plugin (probably could list the ones that are) + + */ + +// PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, +// CycleDetectedInPluginGraphException; + +@Component( role = ExceptionHandler.class ) +public class DefaultExceptionHandler + implements ExceptionHandler +{ + + public ExceptionSummary handleException( Throwable exception ) + { + return handle( "", exception ); + } + + private ExceptionSummary handle( String message, Throwable exception ) + { + String reference = getReference( exception ); + + List<ExceptionSummary> children = null; + + if ( exception instanceof ProjectBuildingException ) + { + List<ProjectBuildingResult> results = ( (ProjectBuildingException) exception ).getResults(); + + children = new ArrayList<ExceptionSummary>(); + + for ( ProjectBuildingResult result : results ) + { + ExceptionSummary child = handle( result ); + if ( child != null ) + { + children.add( child ); + } + } + + message = "The build could not read " + children.size() + " project" + ( children.size() == 1 ? "" : "s" ); + } + else + { + message = getMessage( message, exception ); + } + + return new ExceptionSummary( exception, message, reference, children ); + } + + private ExceptionSummary handle( ProjectBuildingResult result ) + { + List<ExceptionSummary> children = new ArrayList<ExceptionSummary>(); + + for ( ModelProblem problem : result.getProblems() ) + { + ExceptionSummary child = handle( problem, result.getProjectId() ); + if ( child != null ) + { + children.add( child ); + } + } + + if ( children.isEmpty() ) + { + return null; + } + + String message = + "\nThe project " + result.getProjectId() + " (" + result.getPomFile() + ") has " + + children.size() + " error" + ( children.size() == 1 ? "" : "s" ); + + return new ExceptionSummary( null, message, null, children ); + } + + private ExceptionSummary handle( ModelProblem problem, String projectId ) + { + if ( ModelProblem.Severity.ERROR.compareTo( problem.getSeverity() ) >= 0 ) + { + String message = problem.getMessage(); + + String location = ModelProblemUtils.formatLocation( problem, projectId ); + + if ( StringUtils.isNotEmpty( location ) ) + { + message += " @ " + location; + } + + return handle( message, problem.getException() ); + } + else + { + return null; + } + } + + private String getReference( Throwable exception ) + { + String reference = ""; + + if ( exception != null ) + { + if ( exception instanceof MojoExecutionException ) + { + reference = MojoExecutionException.class.getSimpleName(); + + Throwable cause = exception.getCause(); + if ( cause instanceof IOException ) + { + cause = cause.getCause(); + if ( cause instanceof ConnectException ) + { + reference = ConnectException.class.getSimpleName(); + } + } + } + else if ( exception instanceof MojoFailureException ) + { + reference = MojoFailureException.class.getSimpleName(); + } + else if ( exception instanceof LinkageError ) + { + reference = LinkageError.class.getSimpleName(); + } + else if ( exception instanceof PluginExecutionException ) + { + Throwable cause = exception.getCause(); + + if ( cause instanceof PluginContainerException ) + { + Throwable cause2 = cause.getCause(); + + if ( cause2 instanceof NoClassDefFoundError + && cause2.getMessage().contains( "org/sonatype/aether/" ) ) + { + reference = "AetherClassNotFound"; + } + } + + if ( StringUtils.isEmpty( reference ) ) + { + reference = getReference( cause ); + } + + if ( StringUtils.isEmpty( reference ) ) + { + reference = exception.getClass().getSimpleName(); + } + } + else if ( exception instanceof LifecycleExecutionException ) + { + reference = getReference( exception.getCause() ); + } + else if ( isNoteworthyException( exception ) ) + { + reference = exception.getClass().getSimpleName(); + } + } + + if ( StringUtils.isNotEmpty( reference ) && !reference.startsWith( "http:" ) ) + { + reference = "http://cwiki.apache.org/confluence/display/MAVEN/" + reference; + } + + return reference; + } + + private boolean isNoteworthyException( Throwable exception ) + { + if ( exception == null ) + { + return false; + } + else if ( exception instanceof Error ) + { + return true; + } + else if ( exception instanceof RuntimeException ) + { + return false; + } + else if ( exception.getClass().getName().startsWith( "java" ) ) + { + return false; + } + return true; + } + + private String getMessage( String message, Throwable exception ) + { + String fullMessage = ( message != null ) ? message : ""; + + for ( Throwable t = exception; t != null; t = t.getCause() ) + { + String exceptionMessage = t.getMessage(); + + if ( t instanceof AbstractMojoExecutionException ) + { + String longMessage = ( (AbstractMojoExecutionException) t ).getLongMessage(); + if ( StringUtils.isNotEmpty( longMessage ) ) + { + if ( StringUtils.isEmpty( exceptionMessage ) || longMessage.contains( exceptionMessage ) ) + { + exceptionMessage = longMessage; + } + else if ( !exceptionMessage.contains( longMessage ) ) + { + exceptionMessage = join( exceptionMessage, '\n' + longMessage ); + } + } + } + + if ( StringUtils.isEmpty( exceptionMessage ) ) + { + exceptionMessage = t.getClass().getSimpleName(); + } + + if ( t instanceof UnknownHostException && !fullMessage.contains( "host" ) ) + { + fullMessage = join( fullMessage, "Unknown host " + exceptionMessage ); + } + else if ( !fullMessage.contains( exceptionMessage ) ) + { + fullMessage = join( fullMessage, exceptionMessage ); + } + } + + return fullMessage.trim(); + } + + private String join( String message1, String message2 ) + { + String message = ""; + + if ( StringUtils.isNotEmpty( message1 ) ) + { + message = message1.trim(); + } + + if ( StringUtils.isNotEmpty( message2 ) ) + { + if ( StringUtils.isNotEmpty( message ) ) + { + if ( message.endsWith( "." ) || message.endsWith( "!" ) || message.endsWith( ":" ) ) + { + message += " "; + } + else + { + message += ": "; + } + } + + message += message2; + } + + return message; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/ExceptionHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/ExceptionHandler.java new file mode 100644 index 00000000..47865f67 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/ExceptionHandler.java @@ -0,0 +1,30 @@ +package org.apache.maven.exception; + +/* + * 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. + */ + +/** + * Transform an exception into useful end-user message. + * + * @since 3.0-alpha-3 + */ +public interface ExceptionHandler +{ + ExceptionSummary handleException( Throwable e ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/ExceptionSummary.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/ExceptionSummary.java new file mode 100644 index 00000000..dcc376a4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/exception/ExceptionSummary.java @@ -0,0 +1,79 @@ +package org.apache.maven.exception; + +/* + * 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.Collections; +import java.util.List; + +/** + * Provide a summary of the exception, containing:<ul> + * <li>the exception itself,</li> + * <li>useful end-user message,</li> + * <li>useful reference to a solution, or set of solutions: this is usually a wiki page url in + * <a href="http://cwiki.apache.org/confluence/display/MAVEN/">http://cwiki.apache.org/confluence/display/MAVEN/</a>, + * </li> + * <li>child exception summaries.</li> + * </ul> + */ +public class ExceptionSummary +{ + + private Throwable exception; + + private String message; + + private String reference; + + private List<ExceptionSummary> children; + + public ExceptionSummary( Throwable exception, String message, String reference ) + { + this( exception, message, reference, null ); + } + + public ExceptionSummary( Throwable exception, String message, String reference, List<ExceptionSummary> children ) + { + this.exception = exception; + this.message = ( message != null ) ? message : ""; + this.reference = ( reference != null ) ? reference : ""; + this.children = ( children != null ) ? children : Collections.<ExceptionSummary>emptyList(); + } + + public Throwable getException() + { + return exception; + } + + public String getMessage() + { + return message; + } + + public String getReference() + { + return reference; + } + + public List<ExceptionSummary> getChildren() + { + return children; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/AbstractExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/AbstractExecutionListener.java new file mode 100644 index 00000000..89665007 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/AbstractExecutionListener.java @@ -0,0 +1,116 @@ +package org.apache.maven.execution; + +/* + * 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. + */ + +/** + * Provides a skeleton implementation for execution listeners. The methods of this class are empty. + * + * @author Benjamin Bentmann + */ +public class AbstractExecutionListener + implements ExecutionListener +{ + + public void projectDiscoveryStarted( ExecutionEvent event ) + { + // default does nothing + } + + public void sessionStarted( ExecutionEvent event ) + { + // default does nothing + } + + public void sessionEnded( ExecutionEvent event ) + { + // default does nothing + } + + public void projectSkipped( ExecutionEvent event ) + { + // default does nothing + } + + public void projectStarted( ExecutionEvent event ) + { + // default does nothing + } + + public void projectSucceeded( ExecutionEvent event ) + { + // default does nothing + } + + public void projectFailed( ExecutionEvent event ) + { + // default does nothing + } + + public void forkStarted( ExecutionEvent event ) + { + // default does nothing + } + + public void forkSucceeded( ExecutionEvent event ) + { + // default does nothing + } + + public void forkFailed( ExecutionEvent event ) + { + // default does nothing + } + + public void mojoSkipped( ExecutionEvent event ) + { + // default does nothing + } + + public void mojoStarted( ExecutionEvent event ) + { + // default does nothing + } + + public void mojoSucceeded( ExecutionEvent event ) + { + // default does nothing + } + + public void mojoFailed( ExecutionEvent event ) + { + // default does nothing + } + + public void forkedProjectStarted( ExecutionEvent event ) + { + // default does nothing + } + + public void forkedProjectSucceeded( ExecutionEvent event ) + { + // default does nothing + } + + public void forkedProjectFailed( ExecutionEvent event ) + { + // default does nothing + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildFailure.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildFailure.java new file mode 100644 index 00000000..bf8f62ba --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildFailure.java @@ -0,0 +1,61 @@ +package org.apache.maven.execution; + +/* + * 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.project.MavenProject; + +/** + * Summarizes the result of a failed project build in the reactor. + * + * @author Benjamin Bentmann + */ +public class BuildFailure + extends BuildSummary +{ + + /** + * The cause of the build failure. + */ + private final Throwable cause; + + /** + * Creates a new build summary for the specified project. + * + * @param project The project being summarized, must not be {@code null}. + * @param time The build time of the project in milliseconds. + * @param cause The cause of the build failure, may be {@code null}. + */ + public BuildFailure( MavenProject project, long time, Throwable cause ) + { + super( project, time ); + this.cause = cause; + } + + /** + * Gets the cause of the build failure. + * + * @return The cause of the build failure or {@code null} if unknown. + */ + public Throwable getCause() + { + return cause; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildSuccess.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildSuccess.java new file mode 100644 index 00000000..3d0e8bd7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildSuccess.java @@ -0,0 +1,44 @@ +package org.apache.maven.execution; + +/* + * 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.project.MavenProject; + +/** + * Summarizes the result of a successful project build in the reactor. + * + * @author Benjamin Bentmann + */ +public class BuildSuccess + extends BuildSummary +{ + + /** + * Creates a new build summary for the specified project. + * + * @param project The project being summarized, must not be {@code null}. + * @param time The build time of the project in milliseconds. + */ + public BuildSuccess( MavenProject project, long time ) + { + super( project, time ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildSummary.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildSummary.java new file mode 100644 index 00000000..ec23f721 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/BuildSummary.java @@ -0,0 +1,78 @@ +package org.apache.maven.execution; + +/* + * 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.project.MavenProject; + +/** + * Summarizes the result of a project build in the reactor. + * + * @author Benjamin Bentmann + */ +public abstract class BuildSummary +{ + + /** + * The project being summarized. + */ + private final MavenProject project; + + /** + * The build time of the project in milliseconds. + */ + private final long time; + + /** + * Creates a new build summary for the specified project. + * + * @param project The project being summarized, must not be {@code null}. + * @param time The build time of the project in milliseconds. + */ + protected BuildSummary( MavenProject project, long time ) + { + if ( project == null ) + { + throw new IllegalArgumentException( "project missing" ); + } + this.project = project; + this.time = time; + } + + /** + * Gets the project being summarized. + * + * @return The project being summarized, never {@code null}. + */ + public MavenProject getProject() + { + return project; + } + + /** + * Gets the build time of the project in milliseconds. + * + * @return The build time of the project in milliseconds. + */ + public long getTime() + { + return time; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java new file mode 100644 index 00000000..e5509dca --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java @@ -0,0 +1,1299 @@ +package org.apache.maven.execution; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.eventspy.internal.EventSpyDispatcher; +import org.apache.maven.model.Profile; +import org.apache.maven.project.DefaultProjectBuildingRequest; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Server; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.eclipse.aether.DefaultRepositoryCache; +import org.eclipse.aether.RepositoryCache; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.transfer.TransferListener; + +import com.google.common.collect.Maps; + +/** + * @author Jason van Zyl + */ +public class DefaultMavenExecutionRequest + implements MavenExecutionRequest +{ + + private RepositoryCache repositoryCache = new DefaultRepositoryCache(); + + private WorkspaceReader workspaceReader; + + private ArtifactRepository localRepository; + + private EventSpyDispatcher eventSpyDispatcher; + + private File localRepositoryPath; + + private boolean offline = false; + + private boolean interactiveMode = true; + + private boolean cacheTransferError; + + private boolean cacheNotFound; + + private List<Proxy> proxies; + + private List<Server> servers; + + private List<Mirror> mirrors; + + private List<Profile> profiles; + + private List<String> pluginGroups; + + private boolean isProjectPresent = true; + + // ---------------------------------------------------------------------------- + // We need to allow per execution user and global settings as the embedder + // might be running in a mode where its executing many threads with totally + // different settings. + // ---------------------------------------------------------------------------- + + private File userSettingsFile; + + private File globalSettingsFile; + + private File userToolchainsFile; + + private File globalToolchainsFile; + + // ---------------------------------------------------------------------------- + // Request + // ---------------------------------------------------------------------------- + + private File multiModuleProjectDirectory; + + private File basedir; + + private List<String> goals; + + private boolean useReactor = false; + + private boolean recursive = true; + + private File pom; + + private String reactorFailureBehavior = REACTOR_FAIL_FAST; + + private List<String> selectedProjects; + + private List<String> excludedProjects; + + private String resumeFrom; + + private String makeBehavior; + + private Properties systemProperties; + + private Properties userProperties; + + private Date startTime; + + private boolean showErrors = false; + + private List<String> activeProfiles; + + private List<String> inactiveProfiles; + + private TransferListener transferListener; + + private int loggingLevel = LOGGING_LEVEL_INFO; + + private String globalChecksumPolicy; + + private boolean updateSnapshots = false; + + private List<ArtifactRepository> remoteRepositories; + + private List<ArtifactRepository> pluginArtifactRepositories; + + private ExecutionListener executionListener; + + private int degreeOfConcurrency = 1; + + private String builderId = "singlethreaded"; + + private Map<String, List<ToolchainModel>> toolchains; + + /** + * Suppress SNAPSHOT updates. + * + * @issue MNG-2681 + */ + private boolean noSnapshotUpdates; + + private boolean useLegacyLocalRepositoryManager = false; + + private Map<String, Object> data; + + public DefaultMavenExecutionRequest() + { + } + + public static MavenExecutionRequest copy( MavenExecutionRequest original ) + { + DefaultMavenExecutionRequest copy = new DefaultMavenExecutionRequest(); + copy.setLocalRepository( original.getLocalRepository() ); + copy.setLocalRepositoryPath( original.getLocalRepositoryPath() ); + copy.setOffline( original.isOffline() ); + copy.setInteractiveMode( original.isInteractiveMode() ); + copy.setCacheNotFound( original.isCacheNotFound() ); + copy.setCacheTransferError( original.isCacheTransferError() ); + copy.setProxies( original.getProxies() ); + copy.setServers( original.getServers() ); + copy.setMirrors( original.getMirrors() ); + copy.setProfiles( original.getProfiles() ); + copy.setPluginGroups( original.getPluginGroups() ); + copy.setProjectPresent( original.isProjectPresent() ); + copy.setUserSettingsFile( original.getUserSettingsFile() ); + copy.setGlobalSettingsFile( original.getGlobalSettingsFile() ); + copy.setUserToolchainsFile( original.getUserToolchainsFile() ); + copy.setGlobalToolchainsFile( original.getGlobalToolchainsFile() ); + copy.setBaseDirectory( ( original.getBaseDirectory() != null ) ? new File( original.getBaseDirectory() ) + : null ); + copy.setGoals( original.getGoals() ); + copy.setRecursive( original.isRecursive() ); + copy.setPom( original.getPom() ); + copy.setSystemProperties( original.getSystemProperties() ); + copy.setUserProperties( original.getUserProperties() ); + copy.setShowErrors( original.isShowErrors() ); + copy.setActiveProfiles( original.getActiveProfiles() ); + copy.setInactiveProfiles( original.getInactiveProfiles() ); + copy.setTransferListener( original.getTransferListener() ); + copy.setLoggingLevel( original.getLoggingLevel() ); + copy.setGlobalChecksumPolicy( original.getGlobalChecksumPolicy() ); + copy.setUpdateSnapshots( original.isUpdateSnapshots() ); + copy.setRemoteRepositories( original.getRemoteRepositories() ); + copy.setPluginArtifactRepositories( original.getPluginArtifactRepositories() ); + copy.setRepositoryCache( original.getRepositoryCache() ); + copy.setWorkspaceReader( original.getWorkspaceReader() ); + copy.setNoSnapshotUpdates( original.isNoSnapshotUpdates() ); + copy.setExecutionListener( original.getExecutionListener() ); + copy.setUseLegacyLocalRepository( original.isUseLegacyLocalRepository() ); + copy.setBuilderId( original.getBuilderId() ); + return copy; + } + + @Override + public String getBaseDirectory() + { + if ( basedir == null ) + { + return null; + } + + return basedir.getAbsolutePath(); + } + + @Override + public ArtifactRepository getLocalRepository() + { + return localRepository; + } + + @Override + public File getLocalRepositoryPath() + { + return localRepositoryPath; + } + + @Override + public List<String> getGoals() + { + if ( goals == null ) + { + goals = new ArrayList<String>(); + } + return goals; + } + + @Override + public Properties getSystemProperties() + { + if ( systemProperties == null ) + { + systemProperties = new Properties(); + } + + return systemProperties; + } + + @Override + public Properties getUserProperties() + { + if ( userProperties == null ) + { + userProperties = new Properties(); + } + + return userProperties; + } + + @Override + public File getPom() + { + return pom; + } + + @Override + public String getReactorFailureBehavior() + { + return reactorFailureBehavior; + } + + @Override + public List<String> getSelectedProjects() + { + if ( selectedProjects == null ) + { + selectedProjects = new ArrayList<String>(); + } + + return selectedProjects; + } + + @Override + public List<String> getExcludedProjects() + { + if ( excludedProjects == null ) + { + excludedProjects = new ArrayList<String>(); + } + + return excludedProjects; + } + + @Override + public String getResumeFrom() + { + return resumeFrom; + } + + @Override + public String getMakeBehavior() + { + return makeBehavior; + } + + @Override + public Date getStartTime() + { + return startTime; + } + + @Override + public boolean isShowErrors() + { + return showErrors; + } + + @Override + public boolean isInteractiveMode() + { + return interactiveMode; + } + + @Override + public MavenExecutionRequest setActiveProfiles( List<String> activeProfiles ) + { + if ( activeProfiles != null ) + { + this.activeProfiles = new ArrayList<String>( activeProfiles ); + } + else + { + this.activeProfiles = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setInactiveProfiles( List<String> inactiveProfiles ) + { + if ( inactiveProfiles != null ) + { + this.inactiveProfiles = new ArrayList<String>( inactiveProfiles ); + } + else + { + this.inactiveProfiles = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) + { + if ( remoteRepositories != null ) + { + this.remoteRepositories = new ArrayList<ArtifactRepository>( remoteRepositories ); + } + else + { + this.remoteRepositories = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setPluginArtifactRepositories( List<ArtifactRepository> pluginArtifactRepositories ) + { + if ( pluginArtifactRepositories != null ) + { + this.pluginArtifactRepositories = new ArrayList<ArtifactRepository>( pluginArtifactRepositories ); + } + else + { + this.pluginArtifactRepositories = null; + } + + return this; + } + + public void setProjectBuildingConfiguration( ProjectBuildingRequest projectBuildingConfiguration ) + { + this.projectBuildingRequest = projectBuildingConfiguration; + } + + @Override + public List<String> getActiveProfiles() + { + if ( activeProfiles == null ) + { + activeProfiles = new ArrayList<String>(); + } + return activeProfiles; + } + + @Override + public List<String> getInactiveProfiles() + { + if ( inactiveProfiles == null ) + { + inactiveProfiles = new ArrayList<String>(); + } + return inactiveProfiles; + } + + @Override + public TransferListener getTransferListener() + { + return transferListener; + } + + @Override + public int getLoggingLevel() + { + return loggingLevel; + } + + @Override + public boolean isOffline() + { + return offline; + } + + @Override + public boolean isUpdateSnapshots() + { + return updateSnapshots; + } + + @Override + public boolean isNoSnapshotUpdates() + { + return noSnapshotUpdates; + } + + @Override + public String getGlobalChecksumPolicy() + { + return globalChecksumPolicy; + } + + @Override + public boolean isRecursive() + { + return recursive; + } + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + @Override + public MavenExecutionRequest setBaseDirectory( File basedir ) + { + this.basedir = basedir; + + return this; + } + + @Override + public MavenExecutionRequest setStartTime( Date startTime ) + { + this.startTime = startTime; + + return this; + } + + @Override + public MavenExecutionRequest setShowErrors( boolean showErrors ) + { + this.showErrors = showErrors; + + return this; + } + + @Override + public MavenExecutionRequest setGoals( List<String> goals ) + { + if ( goals != null ) + { + this.goals = new ArrayList<String>( goals ); + } + else + { + this.goals = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setLocalRepository( ArtifactRepository localRepository ) + { + this.localRepository = localRepository; + + if ( localRepository != null ) + { + setLocalRepositoryPath( new File( localRepository.getBasedir() ).getAbsoluteFile() ); + } + + return this; + } + + @Override + public MavenExecutionRequest setLocalRepositoryPath( File localRepository ) + { + localRepositoryPath = localRepository; + + return this; + } + + @Override + public MavenExecutionRequest setLocalRepositoryPath( String localRepository ) + { + localRepositoryPath = ( localRepository != null ) ? new File( localRepository ) : null; + + return this; + } + + @Override + public MavenExecutionRequest setSystemProperties( Properties properties ) + { + if ( properties != null ) + { + this.systemProperties = new Properties(); + this.systemProperties.putAll( properties ); + } + else + { + this.systemProperties = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setUserProperties( Properties userProperties ) + { + if ( userProperties != null ) + { + this.userProperties = new Properties(); + this.userProperties.putAll( userProperties ); + } + else + { + this.userProperties = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setReactorFailureBehavior( String failureBehavior ) + { + reactorFailureBehavior = failureBehavior; + + return this; + } + + @Override + public MavenExecutionRequest setSelectedProjects( List<String> selectedProjects ) + { + if ( selectedProjects != null ) + { + this.selectedProjects = new ArrayList<String>( selectedProjects ); + } + else + { + this.selectedProjects = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setExcludedProjects( List<String> excludedProjects ) + { + if ( excludedProjects != null ) + { + this.excludedProjects = new ArrayList<String>( excludedProjects ); + } + else + { + this.excludedProjects = null; + } + + return this; + } + + @Override + public MavenExecutionRequest setResumeFrom( String project ) + { + this.resumeFrom = project; + + return this; + } + + @Override + public MavenExecutionRequest setMakeBehavior( String makeBehavior ) + { + this.makeBehavior = makeBehavior; + + return this; + } + + @Override + public MavenExecutionRequest addActiveProfile( String profile ) + { + if ( !getActiveProfiles().contains( profile ) ) + { + getActiveProfiles().add( profile ); + } + + return this; + } + + @Override + public MavenExecutionRequest addInactiveProfile( String profile ) + { + if ( !getInactiveProfiles().contains( profile ) ) + { + getInactiveProfiles().add( profile ); + } + + return this; + } + + @Override + public MavenExecutionRequest addActiveProfiles( List<String> profiles ) + { + for ( String profile : profiles ) + { + addActiveProfile( profile ); + } + + return this; + } + + @Override + public MavenExecutionRequest addInactiveProfiles( List<String> profiles ) + { + for ( String profile : profiles ) + { + addInactiveProfile( profile ); + } + + return this; + } + + public MavenExecutionRequest setUseReactor( boolean reactorActive ) + { + useReactor = reactorActive; + + return this; + } + + public boolean useReactor() + { + return useReactor; + } + + /** @deprecated use {@link #setPom(File)} */ + @Deprecated + public MavenExecutionRequest setPomFile( String pomFilename ) + { + if ( pomFilename != null ) + { + pom = new File( pomFilename ); + } + + return this; + } + + @Override + public MavenExecutionRequest setPom( File pom ) + { + this.pom = pom; + + return this; + } + + @Override + public MavenExecutionRequest setInteractiveMode( boolean interactive ) + { + interactiveMode = interactive; + + return this; + } + + @Override + public MavenExecutionRequest setTransferListener( TransferListener transferListener ) + { + this.transferListener = transferListener; + + return this; + } + + @Override + public MavenExecutionRequest setLoggingLevel( int loggingLevel ) + { + this.loggingLevel = loggingLevel; + + return this; + } + + @Override + public MavenExecutionRequest setOffline( boolean offline ) + { + this.offline = offline; + + return this; + } + + @Override + public MavenExecutionRequest setUpdateSnapshots( boolean updateSnapshots ) + { + this.updateSnapshots = updateSnapshots; + + return this; + } + + @Override + public MavenExecutionRequest setNoSnapshotUpdates( boolean noSnapshotUpdates ) + { + this.noSnapshotUpdates = noSnapshotUpdates; + + return this; + } + + @Override + public MavenExecutionRequest setGlobalChecksumPolicy( String globalChecksumPolicy ) + { + this.globalChecksumPolicy = globalChecksumPolicy; + + return this; + } + + // ---------------------------------------------------------------------------- + // Settings equivalents + // ---------------------------------------------------------------------------- + + @Override + public List<Proxy> getProxies() + { + if ( proxies == null ) + { + proxies = new ArrayList<Proxy>(); + } + return proxies; + } + + @Override + public MavenExecutionRequest setProxies( List<Proxy> proxies ) + { + if ( proxies != null ) + { + this.proxies = new ArrayList<Proxy>( proxies ); + } + else + { + this.proxies = null; + } + + return this; + } + + @Override + public MavenExecutionRequest addProxy( Proxy proxy ) + { + if ( proxy == null ) + { + throw new IllegalArgumentException( "proxy missing" ); + } + + for ( Proxy p : getProxies() ) + { + if ( p.getId() != null && p.getId().equals( proxy.getId() ) ) + { + return this; + } + } + + getProxies().add( proxy ); + + return this; + } + + @Override + public List<Server> getServers() + { + if ( servers == null ) + { + servers = new ArrayList<Server>(); + } + return servers; + } + + @Override + public MavenExecutionRequest setServers( List<Server> servers ) + { + if ( servers != null ) + { + this.servers = new ArrayList<Server>( servers ); + } + else + { + this.servers = null; + } + + return this; + } + + @Override + public MavenExecutionRequest addServer( Server server ) + { + if ( server == null ) + { + throw new IllegalArgumentException( "server missing" ); + } + + for ( Server p : getServers() ) + { + if ( p.getId() != null && p.getId().equals( server.getId() ) ) + { + return this; + } + } + + getServers().add( server ); + + return this; + } + + @Override + public List<Mirror> getMirrors() + { + if ( mirrors == null ) + { + mirrors = new ArrayList<Mirror>(); + } + return mirrors; + } + + @Override + public MavenExecutionRequest setMirrors( List<Mirror> mirrors ) + { + if ( mirrors != null ) + { + this.mirrors = new ArrayList<Mirror>( mirrors ); + } + else + { + this.mirrors = null; + } + + return this; + } + + @Override + public MavenExecutionRequest addMirror( Mirror mirror ) + { + if ( mirror == null ) + { + throw new IllegalArgumentException( "mirror missing" ); + } + + for ( Mirror p : getMirrors() ) + { + if ( p.getId() != null && p.getId().equals( mirror.getId() ) ) + { + return this; + } + } + + getMirrors().add( mirror ); + + return this; + } + + @Override + public List<Profile> getProfiles() + { + if ( profiles == null ) + { + profiles = new ArrayList<Profile>(); + } + return profiles; + } + + @Override + public MavenExecutionRequest setProfiles( List<Profile> profiles ) + { + if ( profiles != null ) + { + this.profiles = new ArrayList<Profile>( profiles ); + } + else + { + this.profiles = null; + } + + return this; + } + + @Override + public List<String> getPluginGroups() + { + if ( pluginGroups == null ) + { + pluginGroups = new ArrayList<String>(); + } + + return pluginGroups; + } + + @Override + public MavenExecutionRequest setPluginGroups( List<String> pluginGroups ) + { + if ( pluginGroups != null ) + { + this.pluginGroups = new ArrayList<String>( pluginGroups ); + } + else + { + this.pluginGroups = null; + } + + return this; + } + + @Override + public MavenExecutionRequest addPluginGroup( String pluginGroup ) + { + if ( !getPluginGroups().contains( pluginGroup ) ) + { + getPluginGroups().add( pluginGroup ); + } + + return this; + } + + @Override + public MavenExecutionRequest addPluginGroups( List<String> pluginGroups ) + { + for ( String pluginGroup : pluginGroups ) + { + addPluginGroup( pluginGroup ); + } + + return this; + } + + @Override + public MavenExecutionRequest setRecursive( boolean recursive ) + { + this.recursive = recursive; + + return this; + } + + // calculated from request attributes. + private ProjectBuildingRequest projectBuildingRequest; + + @Override + public boolean isProjectPresent() + { + return isProjectPresent; + } + + @Override + public MavenExecutionRequest setProjectPresent( boolean projectPresent ) + { + isProjectPresent = projectPresent; + + return this; + } + + // Settings files + + @Override + public File getUserSettingsFile() + { + return userSettingsFile; + } + + @Override + public MavenExecutionRequest setUserSettingsFile( File userSettingsFile ) + { + this.userSettingsFile = userSettingsFile; + + return this; + } + + @Override + public File getGlobalSettingsFile() + { + return globalSettingsFile; + } + + @Override + public MavenExecutionRequest setGlobalSettingsFile( File globalSettingsFile ) + { + this.globalSettingsFile = globalSettingsFile; + + return this; + } + + @Override + public File getUserToolchainsFile() + { + return userToolchainsFile; + } + + @Override + public MavenExecutionRequest setUserToolchainsFile( File userToolchainsFile ) + { + this.userToolchainsFile = userToolchainsFile; + + return this; + } + + @Override + public File getGlobalToolchainsFile() + { + return globalToolchainsFile; + } + + @Override + public MavenExecutionRequest setGlobalToolchainsFile( File globalToolchainsFile ) + { + this.globalToolchainsFile = globalToolchainsFile; + return this; + } + + @Override + public MavenExecutionRequest addRemoteRepository( ArtifactRepository repository ) + { + for ( ArtifactRepository repo : getRemoteRepositories() ) + { + if ( repo.getId() != null && repo.getId().equals( repository.getId() ) ) + { + return this; + } + } + + getRemoteRepositories().add( repository ); + + return this; + } + + @Override + public List<ArtifactRepository> getRemoteRepositories() + { + if ( remoteRepositories == null ) + { + remoteRepositories = new ArrayList<ArtifactRepository>(); + } + return remoteRepositories; + } + + @Override + public MavenExecutionRequest addPluginArtifactRepository( ArtifactRepository repository ) + { + for ( ArtifactRepository repo : getPluginArtifactRepositories() ) + { + if ( repo.getId() != null && repo.getId().equals( repository.getId() ) ) + { + return this; + } + } + + getPluginArtifactRepositories().add( repository ); + + return this; + } + + @Override + public List<ArtifactRepository> getPluginArtifactRepositories() + { + if ( pluginArtifactRepositories == null ) + { + pluginArtifactRepositories = new ArrayList<ArtifactRepository>(); + } + return pluginArtifactRepositories; + } + + // TODO: this does not belong here. + @Override + public ProjectBuildingRequest getProjectBuildingRequest() + { + if ( projectBuildingRequest == null ) + { + projectBuildingRequest = new DefaultProjectBuildingRequest(); + projectBuildingRequest.setLocalRepository( getLocalRepository() ); + projectBuildingRequest.setSystemProperties( getSystemProperties() ); + projectBuildingRequest.setUserProperties( getUserProperties() ); + projectBuildingRequest.setRemoteRepositories( getRemoteRepositories() ); + projectBuildingRequest.setPluginArtifactRepositories( getPluginArtifactRepositories() ); + projectBuildingRequest.setActiveProfileIds( getActiveProfiles() ); + projectBuildingRequest.setInactiveProfileIds( getInactiveProfiles() ); + projectBuildingRequest.setProfiles( getProfiles() ); + projectBuildingRequest.setProcessPlugins( true ); + projectBuildingRequest.setBuildStartTime( getStartTime() ); + } + + return projectBuildingRequest; + } + + @Override + public MavenExecutionRequest addProfile( Profile profile ) + { + if ( profile == null ) + { + throw new IllegalArgumentException( "profile missing" ); + } + + for ( Profile p : getProfiles() ) + { + if ( p.getId() != null && p.getId().equals( profile.getId() ) ) + { + return this; + } + } + + getProfiles().add( profile ); + + return this; + } + + @Override + public RepositoryCache getRepositoryCache() + { + return repositoryCache; + } + + @Override + public MavenExecutionRequest setRepositoryCache( RepositoryCache repositoryCache ) + { + this.repositoryCache = repositoryCache; + + return this; + } + + @Override + public ExecutionListener getExecutionListener() + { + return executionListener; + } + + @Override + public MavenExecutionRequest setExecutionListener( ExecutionListener executionListener ) + { + this.executionListener = executionListener; + + return this; + } + + @Override + public void setDegreeOfConcurrency( final int degreeOfConcurrency ) + { + this.degreeOfConcurrency = degreeOfConcurrency; + } + + @Override + public int getDegreeOfConcurrency() + { + return degreeOfConcurrency; + } + + @Override + public WorkspaceReader getWorkspaceReader() + { + return workspaceReader; + } + + @Override + public MavenExecutionRequest setWorkspaceReader( WorkspaceReader workspaceReader ) + { + this.workspaceReader = workspaceReader; + return this; + } + + @Override + public boolean isCacheTransferError() + { + return cacheTransferError; + } + + @Override + public MavenExecutionRequest setCacheTransferError( boolean cacheTransferError ) + { + this.cacheTransferError = cacheTransferError; + return this; + } + + @Override + public boolean isCacheNotFound() + { + return cacheNotFound; + } + + @Override + public MavenExecutionRequest setCacheNotFound( boolean cacheNotFound ) + { + this.cacheNotFound = cacheNotFound; + return this; + } + + @Override + public boolean isUseLegacyLocalRepository() + { + return this.useLegacyLocalRepositoryManager; + } + + @Override + public MavenExecutionRequest setUseLegacyLocalRepository( boolean useLegacyLocalRepositoryManager ) + { + this.useLegacyLocalRepositoryManager = useLegacyLocalRepositoryManager; + return this; + } + + @Override + public MavenExecutionRequest setBuilderId( String builderId ) + { + this.builderId = builderId; + return this; + } + + @Override + public String getBuilderId() + { + return builderId; + } + + @Override + public Map<String, List<ToolchainModel>> getToolchains() + { + if ( toolchains == null ) + { + toolchains = new HashMap<String, List<ToolchainModel>>(); + } + return toolchains; + } + + @Override + public MavenExecutionRequest setToolchains( Map<String, List<ToolchainModel>> toolchains ) + { + this.toolchains = toolchains; + return this; + } + + @Override + public void setMultiModuleProjectDirectory( File directory ) + { + this.multiModuleProjectDirectory = directory; + } + + @Override + public File getMultiModuleProjectDirectory() + { + return multiModuleProjectDirectory; + } + + @Override + public MavenExecutionRequest setEventSpyDispatcher( EventSpyDispatcher eventSpyDispatcher ) + { + this.eventSpyDispatcher = eventSpyDispatcher; + return this; + } + + @Override + public EventSpyDispatcher getEventSpyDispatcher() + { + return eventSpyDispatcher; + } + + @Override + public Map<String, Object> getData() + { + if ( data == null ) + { + data = Maps.newHashMap(); + } + + return data; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java new file mode 100644 index 00000000..7568fdee --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java @@ -0,0 +1,318 @@ +package org.apache.maven.execution; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.bridge.MavenRepositorySystem; +import org.apache.maven.repository.RepositorySystem; +// +// All of this needs to go away and be couched in terms of the execution request +// +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Repository; +import org.apache.maven.settings.Server; +import org.apache.maven.settings.Settings; +import org.apache.maven.settings.SettingsUtils; +// +// Settings in core +// +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.util.StringUtils; + +@Named +public class DefaultMavenExecutionRequestPopulator + implements MavenExecutionRequestPopulator +{ + + private final MavenRepositorySystem repositorySystem; + + @Inject + public DefaultMavenExecutionRequestPopulator( MavenRepositorySystem repositorySystem ) + { + this.repositorySystem = repositorySystem; + } + + + @Override + public MavenExecutionRequest populateFromToolchains( MavenExecutionRequest request, PersistedToolchains toolchains ) + throws MavenExecutionRequestPopulationException + { + if ( toolchains != null ) + { + Map<String, List<ToolchainModel>> groupedToolchains = new HashMap<String, List<ToolchainModel>>( 2 ); + + for ( ToolchainModel model : toolchains.getToolchains() ) + { + if ( !groupedToolchains.containsKey( model.getType() ) ) + { + groupedToolchains.put( model.getType(), new ArrayList<ToolchainModel>() ); + } + + groupedToolchains.get( model.getType() ).add( model ); + } + + request.setToolchains( groupedToolchains ); + } + return request; + } + + @Override + public MavenExecutionRequest populateDefaults( MavenExecutionRequest request ) + throws MavenExecutionRequestPopulationException + { + baseDirectory( request ); + + localRepository( request ); + + populateDefaultPluginGroups( request ); + + injectDefaultRepositories( request ); + + injectDefaultPluginRepositories( request ); + + return request; + } + + // + // + // + + private void populateDefaultPluginGroups( MavenExecutionRequest request ) + { + request.addPluginGroup( "org.apache.maven.plugins" ); + request.addPluginGroup( "org.codehaus.mojo" ); + } + + private void injectDefaultRepositories( MavenExecutionRequest request ) + throws MavenExecutionRequestPopulationException + { + Set<String> definedRepositories = repositorySystem.getRepoIds( request.getRemoteRepositories() ); + + if ( !definedRepositories.contains( RepositorySystem.DEFAULT_REMOTE_REPO_ID ) ) + { + try + { + request.addRemoteRepository( repositorySystem.createDefaultRemoteRepository( request ) ); + } + catch ( Exception e ) + { + throw new MavenExecutionRequestPopulationException( "Cannot create default remote repository.", e ); + } + } + } + + private void injectDefaultPluginRepositories( MavenExecutionRequest request ) + throws MavenExecutionRequestPopulationException + { + Set<String> definedRepositories = repositorySystem.getRepoIds( request.getPluginArtifactRepositories() ); + + if ( !definedRepositories.contains( RepositorySystem.DEFAULT_REMOTE_REPO_ID ) ) + { + try + { + request.addPluginArtifactRepository( repositorySystem.createDefaultRemoteRepository( request ) ); + } + catch ( Exception e ) + { + throw new MavenExecutionRequestPopulationException( "Cannot create default remote repository.", e ); + } + } + } + + private void localRepository( MavenExecutionRequest request ) + throws MavenExecutionRequestPopulationException + { + // ------------------------------------------------------------------------ + // Local Repository + // + // 1. Use a value has been passed in via the configuration + // 2. Use value in the resultant settings + // 3. Use default value + // ------------------------------------------------------------------------ + + if ( request.getLocalRepository() == null ) + { + request.setLocalRepository( createLocalRepository( request ) ); + } + + if ( request.getLocalRepositoryPath() == null ) + { + request.setLocalRepositoryPath( new File( request.getLocalRepository().getBasedir() ).getAbsoluteFile() ); + } + } + + // ------------------------------------------------------------------------ + // Artifact Transfer Mechanism + // ------------------------------------------------------------------------ + + private ArtifactRepository createLocalRepository( MavenExecutionRequest request ) + throws MavenExecutionRequestPopulationException + { + String localRepositoryPath = null; + + if ( request.getLocalRepositoryPath() != null ) + { + localRepositoryPath = request.getLocalRepositoryPath().getAbsolutePath(); + } + + if ( StringUtils.isEmpty( localRepositoryPath ) ) + { + localRepositoryPath = RepositorySystem.defaultUserLocalRepository.getAbsolutePath(); + } + + try + { + return repositorySystem.createLocalRepository( request, new File( localRepositoryPath ) ); + } + catch ( Exception e ) + { + throw new MavenExecutionRequestPopulationException( "Cannot create local repository.", e ); + } + } + + private void baseDirectory( MavenExecutionRequest request ) + { + if ( request.getBaseDirectory() == null && request.getPom() != null ) + { + request.setBaseDirectory( request.getPom().getAbsoluteFile().getParentFile() ); + } + } + + /*if_not[MAVEN4]*/ + + @Override + @Deprecated + public MavenExecutionRequest populateFromSettings( MavenExecutionRequest request, Settings settings ) + throws MavenExecutionRequestPopulationException + { + if ( settings == null ) + { + return request; + } + + request.setOffline( settings.isOffline() ); + + request.setInteractiveMode( settings.isInteractiveMode() ); + + request.setPluginGroups( settings.getPluginGroups() ); + + request.setLocalRepositoryPath( settings.getLocalRepository() ); + + for ( Server server : settings.getServers() ) + { + server = server.clone(); + + request.addServer( server ); + } + + // <proxies> + // <proxy> + // <active>true</active> + // <protocol>http</protocol> + // <host>proxy.somewhere.com</host> + // <port>8080</port> + // <username>proxyuser</username> + // <password>somepassword</password> + // <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts> + // </proxy> + // </proxies> + + for ( Proxy proxy : settings.getProxies() ) + { + if ( !proxy.isActive() ) + { + continue; + } + + proxy = proxy.clone(); + + request.addProxy( proxy ); + } + + // <mirrors> + // <mirror> + // <id>nexus</id> + // <mirrorOf>*</mirrorOf> + // <url>http://repository.sonatype.org/content/groups/public</url> + // </mirror> + // </mirrors> + + for ( Mirror mirror : settings.getMirrors() ) + { + mirror = mirror.clone(); + + request.addMirror( mirror ); + } + + request.setActiveProfiles( settings.getActiveProfiles() ); + + for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() ) + { + request.addProfile( SettingsUtils.convertFromSettingsProfile( rawProfile ) ); + + if ( settings.getActiveProfiles().contains( rawProfile.getId() ) ) + { + List<Repository> remoteRepositories = rawProfile.getRepositories(); + for ( Repository remoteRepository : remoteRepositories ) + { + try + { + request.addRemoteRepository( repositorySystem.buildArtifactRepository( remoteRepository ) ); + } + catch ( InvalidRepositoryException e ) + { + // do nothing for now + } + } + + List<Repository> pluginRepositories = rawProfile.getPluginRepositories(); + for ( Repository pluginRepo : pluginRepositories ) + { + try + { + request.addPluginArtifactRepository( repositorySystem.buildArtifactRepository( pluginRepo ) ); + } + catch ( InvalidRepositoryException e ) + { + // do nothing for now + } + } + } + } + + return request; + } + + /*end[MAVEN4]*/ + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java new file mode 100644 index 00000000..a8967eda --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java @@ -0,0 +1,109 @@ +package org.apache.maven.execution; + +/* + * 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.Collections; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; + +import org.apache.maven.project.DependencyResolutionResult; +import org.apache.maven.project.MavenProject; + +/** @author Jason van Zyl */ +public class DefaultMavenExecutionResult + implements MavenExecutionResult +{ + private MavenProject project; + + private List<MavenProject> topologicallySortedProjects = Collections.emptyList(); + + private DependencyResolutionResult dependencyResolutionResult; + + private final List<Throwable> exceptions = new CopyOnWriteArrayList<Throwable>(); + + private final Map<MavenProject, BuildSummary> buildSummaries = + Collections.synchronizedMap( new IdentityHashMap<MavenProject, BuildSummary>() ); + + public MavenExecutionResult setProject( MavenProject project ) + { + this.project = project; + + return this; + } + + public MavenProject getProject() + { + return project; + } + + public MavenExecutionResult setTopologicallySortedProjects( List<MavenProject> topologicallySortedProjects ) + { + this.topologicallySortedProjects = topologicallySortedProjects; + + return this; + } + + public List<MavenProject> getTopologicallySortedProjects() + { + return null == topologicallySortedProjects ? Collections.<MavenProject>emptyList() + : topologicallySortedProjects; + } + + public DependencyResolutionResult getDependencyResolutionResult() + { + return dependencyResolutionResult; + } + + public MavenExecutionResult setDependencyResolutionResult( DependencyResolutionResult dependencyResolutionResult ) + { + this.dependencyResolutionResult = dependencyResolutionResult; + + return this; + } + + public List<Throwable> getExceptions() + { + return exceptions; + } + + public MavenExecutionResult addException( Throwable t ) + { + exceptions.add( t ); + + return this; + } + + public boolean hasExceptions() + { + return !getExceptions().isEmpty(); + } + + public BuildSummary getBuildSummary( MavenProject project ) + { + return buildSummaries.get( project ); + } + + public void addBuildSummary( BuildSummary summary ) + { + buildSummaries.put( summary.getProject(), summary ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ExecutionEvent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ExecutionEvent.java new file mode 100644 index 00000000..0ee7f57a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ExecutionEvent.java @@ -0,0 +1,92 @@ +package org.apache.maven.execution; + +/* + * 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.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; + +/** + * Holds data relevant for an execution event. + * + * @author Benjamin Bentmann + */ +public interface ExecutionEvent +{ + + /** + * 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}. + */ + MavenSession getSession(); + + /** + * Gets the current project (if any). + * + * @return The current project or {@code null} if not applicable. + */ + MavenProject getProject(); + + /** + * Gets the current mojo execution (if any). + * + * @return The current mojo execution or {@code null} if not applicable. + */ + MojoExecution getMojoExecution(); + + /** + * Gets the exception that caused the event (if any). + * + * @return The exception or {@code null} if none. + */ + Exception getException(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ExecutionListener.java new file mode 100644 index 00000000..ad3f345a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ExecutionListener.java @@ -0,0 +1,66 @@ +package org.apache.maven.execution; + +/* + * 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 events that Maven fires during a build. <strong>Warning:</strong> This interface might be extended in future + * Maven versions to support further events. Hence it is strongly recommended to derive custom listeners from + * {@link AbstractExecutionListener} in order to avoid interoperability problems. + * + * @author Benjamin Bentmann + */ +public interface ExecutionListener +{ + + void projectDiscoveryStarted( ExecutionEvent event ); + + void sessionStarted( ExecutionEvent event ); + + void sessionEnded( ExecutionEvent event ); + + void projectSkipped( ExecutionEvent event ); + + void projectStarted( ExecutionEvent event ); + + void projectSucceeded( ExecutionEvent event ); + + void projectFailed( ExecutionEvent event ); + + void mojoSkipped( ExecutionEvent event ); + + void mojoStarted( ExecutionEvent event ); + + void mojoSucceeded( ExecutionEvent event ); + + void mojoFailed( ExecutionEvent event ); + + void forkStarted( ExecutionEvent event ); + + void forkSucceeded( ExecutionEvent event ); + + void forkFailed( ExecutionEvent event ); + + void forkedProjectStarted( ExecutionEvent event ); + + void forkedProjectSucceeded( ExecutionEvent event ); + + void forkedProjectFailed( ExecutionEvent event ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java new file mode 100644 index 00000000..53f84c50 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java @@ -0,0 +1,443 @@ +package org.apache.maven.execution; + +/* + * 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.File; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; +import org.apache.maven.eventspy.internal.EventSpyDispatcher; +import org.apache.maven.model.Profile; +import org.apache.maven.project.ProjectBuildingRequest; +// +// These settings values need to be removed and pushed down into a provider of configuration information +// +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Server; +// +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.RepositoryCache; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.transfer.TransferListener; + +/** + * @author Jason van Zyl + */ +public interface MavenExecutionRequest +{ + // ---------------------------------------------------------------------- + // Logging + // ---------------------------------------------------------------------- + + int LOGGING_LEVEL_DEBUG = Logger.LEVEL_DEBUG; + + int LOGGING_LEVEL_INFO = Logger.LEVEL_INFO; + + int LOGGING_LEVEL_WARN = Logger.LEVEL_WARN; + + int LOGGING_LEVEL_ERROR = Logger.LEVEL_ERROR; + + int LOGGING_LEVEL_FATAL = Logger.LEVEL_FATAL; + + int LOGGING_LEVEL_DISABLED = Logger.LEVEL_DISABLED; + + // ---------------------------------------------------------------------- + // Reactor Failure Mode + // ---------------------------------------------------------------------- + + String REACTOR_FAIL_FAST = "FAIL_FAST"; + + String REACTOR_FAIL_AT_END = "FAIL_AT_END"; + + String REACTOR_FAIL_NEVER = "FAIL_NEVER"; + + // ---------------------------------------------------------------------- + // Reactor Make Mode + // ---------------------------------------------------------------------- + + String REACTOR_MAKE_UPSTREAM = "make-upstream"; + + String REACTOR_MAKE_DOWNSTREAM = "make-downstream"; + + String REACTOR_MAKE_BOTH = "make-both"; + + // ---------------------------------------------------------------------- + // Artifact repository policies + // ---------------------------------------------------------------------- + + String CHECKSUM_POLICY_FAIL = ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL; + + String CHECKSUM_POLICY_WARN = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN; + + // ---------------------------------------------------------------------- + // + // ---------------------------------------------------------------------- + + // Base directory + MavenExecutionRequest setBaseDirectory( File basedir ); + + String getBaseDirectory(); + + // Timing (remove this) + MavenExecutionRequest setStartTime( Date start ); + + Date getStartTime(); + + // Goals + MavenExecutionRequest setGoals( List<String> goals ); + + List<String> getGoals(); + + // Properties + + /** + * Sets the system properties to use for interpolation and profile activation. The system properties are collected + * from the runtime environment like {@link System#getProperties()} and environment variables. + * + * @param systemProperties The system properties, may be {@code null}. + * @return This request, never {@code null}. + */ + MavenExecutionRequest setSystemProperties( Properties systemProperties ); + + /** + * Gets the system properties to use for interpolation and profile activation. The system properties are collected + * from the runtime environment like {@link System#getProperties()} and environment variables. + * + * @return The system properties, never {@code null}. + */ + Properties getSystemProperties(); + + /** + * Sets the user properties to use for interpolation and profile activation. The user properties have been + * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command + * line. + * + * @param userProperties The user properties, may be {@code null}. + * @return This request, never {@code null}. + */ + MavenExecutionRequest setUserProperties( Properties userProperties ); + + /** + * Gets the user properties to use for interpolation and profile activation. The user properties have been + * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command + * line. + * + * @return The user properties, never {@code null}. + */ + Properties getUserProperties(); + + // Reactor + MavenExecutionRequest setReactorFailureBehavior( String failureBehavior ); + + String getReactorFailureBehavior(); + + MavenExecutionRequest setSelectedProjects( List<String> projects ); + + List<String> getSelectedProjects(); + + /** + * @param projects the projects to exclude + * @return this MavenExecutionRequest + * @since 3.2 + */ + MavenExecutionRequest setExcludedProjects( List<String> projects ); + + /** + * @return the excluded projects, never {@code null} + * @since 3.2 + */ + List<String> getExcludedProjects(); + + MavenExecutionRequest setResumeFrom( String project ); + + String getResumeFrom(); + + MavenExecutionRequest setMakeBehavior( String makeBehavior ); + + String getMakeBehavior(); + + /** + * Set's the parallel degree of concurrency used by the build. + * + * @param degreeOfConcurrency + */ + void setDegreeOfConcurrency( int degreeOfConcurrency ); + + /** + * @return the degree of concurrency for the build. + */ + int getDegreeOfConcurrency(); + + // Recursive (really to just process the top-level POM) + MavenExecutionRequest setRecursive( boolean recursive ); + + boolean isRecursive(); + + MavenExecutionRequest setPom( File pom ); + + File getPom(); + + // Errors + MavenExecutionRequest setShowErrors( boolean showErrors ); + + boolean isShowErrors(); + + // Transfer listeners + MavenExecutionRequest setTransferListener( TransferListener transferListener ); + + TransferListener getTransferListener(); + + // Logging + MavenExecutionRequest setLoggingLevel( int loggingLevel ); + + int getLoggingLevel(); + + // Update snapshots + MavenExecutionRequest setUpdateSnapshots( boolean updateSnapshots ); + + boolean isUpdateSnapshots(); + + MavenExecutionRequest setNoSnapshotUpdates( boolean noSnapshotUpdates ); + + boolean isNoSnapshotUpdates(); + + // Checksum policy + MavenExecutionRequest setGlobalChecksumPolicy( String globalChecksumPolicy ); + + String getGlobalChecksumPolicy(); + + // Local repository + MavenExecutionRequest setLocalRepositoryPath( String localRepository ); + + MavenExecutionRequest setLocalRepositoryPath( File localRepository ); + + File getLocalRepositoryPath(); + + MavenExecutionRequest setLocalRepository( ArtifactRepository repository ); + + ArtifactRepository getLocalRepository(); + + // Interactive + MavenExecutionRequest setInteractiveMode( boolean interactive ); + + boolean isInteractiveMode(); + + // Offline + MavenExecutionRequest setOffline( boolean offline ); + + boolean isOffline(); + + boolean isCacheTransferError(); + + MavenExecutionRequest setCacheTransferError( boolean cacheTransferError ); + + boolean isCacheNotFound(); + + MavenExecutionRequest setCacheNotFound( boolean cacheNotFound ); + + // Profiles + List<Profile> getProfiles(); + + MavenExecutionRequest addProfile( Profile profile ); + + MavenExecutionRequest setProfiles( List<Profile> profiles ); + + MavenExecutionRequest addActiveProfile( String profile ); + + MavenExecutionRequest addActiveProfiles( List<String> profiles ); + + MavenExecutionRequest setActiveProfiles( List<String> profiles ); + + List<String> getActiveProfiles(); + + MavenExecutionRequest addInactiveProfile( String profile ); + + MavenExecutionRequest addInactiveProfiles( List<String> profiles ); + + MavenExecutionRequest setInactiveProfiles( List<String> profiles ); + + List<String> getInactiveProfiles(); + + // Proxies + List<Proxy> getProxies(); + + MavenExecutionRequest setProxies( List<Proxy> proxies ); + + MavenExecutionRequest addProxy( Proxy proxy ); + + // Servers + List<Server> getServers(); + + MavenExecutionRequest setServers( List<Server> servers ); + + MavenExecutionRequest addServer( Server server ); + + // Mirrors + List<Mirror> getMirrors(); + + MavenExecutionRequest setMirrors( List<Mirror> mirrors ); + + MavenExecutionRequest addMirror( Mirror mirror ); + + // Plugin groups + List<String> getPluginGroups(); + + MavenExecutionRequest setPluginGroups( List<String> pluginGroups ); + + MavenExecutionRequest addPluginGroup( String pluginGroup ); + + MavenExecutionRequest addPluginGroups( List<String> pluginGroups ); + + boolean isProjectPresent(); + + MavenExecutionRequest setProjectPresent( boolean isProjectPresent ); + + File getUserSettingsFile(); + + MavenExecutionRequest setUserSettingsFile( File userSettingsFile ); + + File getGlobalSettingsFile(); + + MavenExecutionRequest setGlobalSettingsFile( File globalSettingsFile ); + + MavenExecutionRequest addRemoteRepository( ArtifactRepository repository ); + + MavenExecutionRequest addPluginArtifactRepository( ArtifactRepository repository ); + + /** + * Set a new list of remote repositories to use the execution request. This is necessary if you perform + * transformations on the remote repositories being used. For example if you replace existing repositories with + * mirrors then it's easier to just replace the whole list with a new list of transformed repositories. + * + * @param repositories + * @return This request, never {@code null}. + */ + MavenExecutionRequest setRemoteRepositories( List<ArtifactRepository> repositories ); + + List<ArtifactRepository> getRemoteRepositories(); + + MavenExecutionRequest setPluginArtifactRepositories( List<ArtifactRepository> repositories ); + + List<ArtifactRepository> getPluginArtifactRepositories(); + + MavenExecutionRequest setRepositoryCache( RepositoryCache repositoryCache ); + + RepositoryCache getRepositoryCache(); + + WorkspaceReader getWorkspaceReader(); + + MavenExecutionRequest setWorkspaceReader( WorkspaceReader workspaceReader ); + + File getUserToolchainsFile(); + + MavenExecutionRequest setUserToolchainsFile( File userToolchainsFile ); + + /** + * + * + * @return the global toolchains file + * @since 3.3.0 + */ + File getGlobalToolchainsFile(); + + /** + * + * @param globalToolchainsFile the global toolchains file + * @return this request + * @since 3.3.0 + */ + MavenExecutionRequest setGlobalToolchainsFile( File globalToolchainsFile ); + + ExecutionListener getExecutionListener(); + + MavenExecutionRequest setExecutionListener( ExecutionListener executionListener ); + + ProjectBuildingRequest getProjectBuildingRequest(); + + /** + * @since 3.1 + */ + boolean isUseLegacyLocalRepository(); + + /** + * @since 3.1 + */ + MavenExecutionRequest setUseLegacyLocalRepository( boolean useLegacyLocalRepository ); + + /** + * Controls the {@link Builder} used by Maven by specification of the builder's id. + * + * @since 3.2.0 + */ + MavenExecutionRequest setBuilderId( String builderId ); + + /** + * Controls the {@link Builder} used by Maven by specification of the builders id. + * + * @since 3.2.0 + */ + String getBuilderId(); + + /** + * + * @param toolchains all toolchains grouped by type + * @return this request + * @since 3.3.0 + */ + MavenExecutionRequest setToolchains( Map<String, List<ToolchainModel>> toolchains ); + + /** + * + * @return all toolchains grouped by type, never {@code null} + * @since 3.3.0 + */ + Map<String, List<ToolchainModel>> getToolchains(); + + /** + * @since 3.3.0 + */ + void setMultiModuleProjectDirectory( File file ); + + /** + * @since 3.3.0 + */ + File getMultiModuleProjectDirectory(); + + /** + * @since 3.3.0 + */ + MavenExecutionRequest setEventSpyDispatcher( EventSpyDispatcher eventSpyDispatcher ); + + /** + * @since 3.3.0 + */ + EventSpyDispatcher getEventSpyDispatcher(); + + /** + * @since 3.3.0 + */ + Map<String, Object> getData(); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulationException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulationException.java new file mode 100644 index 00000000..ddd6ad22 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulationException.java @@ -0,0 +1,43 @@ +package org.apache.maven.execution; + +/* + * 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. + */ + +/** + * @author Jason van Zyl + */ +public class MavenExecutionRequestPopulationException + extends Exception +{ + public MavenExecutionRequestPopulationException( String message ) + { + super( message ); + } + + public MavenExecutionRequestPopulationException( Throwable cause ) + { + super( cause ); + } + + public MavenExecutionRequestPopulationException( String message, + Throwable cause ) + { + super( message, cause ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulator.java new file mode 100644 index 00000000..4f254f7a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequestPopulator.java @@ -0,0 +1,74 @@ +package org.apache.maven.execution; + +/* + * 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.settings.Settings; +import org.apache.maven.toolchain.model.PersistedToolchains; + +/** + * Assists in populating an execution request for invocation of Maven. + * + * @author Benjamin Bentmann + */ +public interface MavenExecutionRequestPopulator +{ + /** + * Copies the values from the given toolchains into the specified execution request. This method will replace any + * existing values in the execution request that are controlled by the toolchains. Hence, it is expected that this + * method is called on a new/empty execution request before the caller mutates it to fit its needs. + * + * @param request The execution request to populate, must not be {@code null}. + * @param toolchains The toolchains to copy into the execution request, may be {@code null}. + * @return The populated execution request, never {@code null}. + * @throws MavenExecutionRequestPopulationException If the execution request could not be populated. + * @since 3.3.0 + */ + MavenExecutionRequest populateFromToolchains( MavenExecutionRequest request, PersistedToolchains toolchains ) + throws MavenExecutionRequestPopulationException; + + /** + * Injects default values like plugin groups or repositories into the specified execution request. + * + * @param request The execution request to populate, must not be {@code null}. + * @return The populated execution request, never {@code null}. + * @throws MavenExecutionRequestPopulationException If the execution request could not be populated. + */ + MavenExecutionRequest populateDefaults( MavenExecutionRequest request ) + throws MavenExecutionRequestPopulationException; + + /*if_not[MAVEN4]*/ + + /** + * Copies the values from the given settings into the specified execution request. This method will replace any + * existing values in the execution request that are controlled by the settings. Hence, it is expected that this + * method is called on a new/empty execution request before the caller mutates it to fit its needs. + * + * @param request The execution request to populate, must not be {@code null}. + * @param settings The settings to copy into the execution request, may be {@code null}. + * @return The populated execution request, never {@code null}. + * @throws MavenExecutionRequestPopulationException If the execution request could not be populated. + */ + @Deprecated + MavenExecutionRequest populateFromSettings( MavenExecutionRequest request, Settings settings ) + throws MavenExecutionRequestPopulationException; + + /*end[MAVEN4]*/ + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java new file mode 100644 index 00000000..cb95fb1f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java @@ -0,0 +1,70 @@ +package org.apache.maven.execution; + +/* + * 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.project.DependencyResolutionResult; +import org.apache.maven.project.MavenProject; + +/** + * @author Jason van Zyl + */ +public interface MavenExecutionResult +{ + MavenExecutionResult setProject( MavenProject project ); + MavenProject getProject(); + + MavenExecutionResult setTopologicallySortedProjects( List<MavenProject> projects ); + + /** + * @return the sorted list, or an empty list if there are no projects. + */ + List<MavenProject> getTopologicallySortedProjects(); + + MavenExecutionResult setDependencyResolutionResult( DependencyResolutionResult result ); + DependencyResolutionResult getDependencyResolutionResult(); + + // for each exception + // - knowing what artifacts are missing + // - project building exception + // - invalid project model exception: list of markers + // - xmlpull parser exception + List<Throwable> getExceptions(); + + MavenExecutionResult addException( Throwable e ); + + boolean hasExceptions(); + + /** + * Gets the build summary for the specified project. + * + * @param project The project to get the build summary for, must not be {@code null}. + * @return The build summary for the project or {@code null} if the project has not been built (yet). + */ + BuildSummary getBuildSummary( MavenProject project ); + + /** + * Add the specified build summary. + * + * @param summary The build summary to add, must not be {@code null}. + */ + void addBuildSummary( BuildSummary summary ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java new file mode 100644 index 00000000..235691ac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java @@ -0,0 +1,438 @@ +package org.apache.maven.execution; + +/* + * 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.File; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.RepositoryCache; +import org.apache.maven.monitor.event.EventDispatcher; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.settings.Settings; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.eclipse.aether.RepositorySystemSession; + +/** + * @author Jason van Zyl + */ +public class MavenSession + implements Cloneable +{ + private MavenExecutionRequest request; + + private MavenExecutionResult result; + + private RepositorySystemSession repositorySession; + + private Properties executionProperties; + + private MavenProject currentProject; + + /** + * These projects have already been topologically sorted in the {@link org.apache.maven.Maven} component before + * being passed into the session. This is also the potentially constrained set of projects by using --projects + * on the command line. + */ + private List<MavenProject> projects; + + /** + * The full set of projects before any potential constraining by --projects. Useful in the case where you want to + * build a smaller set of projects but perform other operations in the context of your reactor. + */ + private List<MavenProject> allProjects; + + private MavenProject topLevelProject; + + private ProjectDependencyGraph projectDependencyGraph; + + private boolean parallel; + + private final Map<String, Map<String, Map<String, Object>>> pluginContextsByProjectAndPluginKey = + new ConcurrentHashMap<String, Map<String, Map<String, Object>>>(); + + + public void setProjects( List<MavenProject> projects ) + { + if ( !projects.isEmpty() ) + { + this.currentProject = projects.get( 0 ); + this.topLevelProject = currentProject; + for ( MavenProject project : projects ) + { + if ( project.isExecutionRoot() ) + { + topLevelProject = project; + break; + } + } + } + else + { + this.currentProject = null; + this.topLevelProject = null; + } + this.projects = projects; + } + + public ArtifactRepository getLocalRepository() + { + return request.getLocalRepository(); + } + + public List<String> getGoals() + { + return request.getGoals(); + } + + /** + * Gets the user properties to use for interpolation and profile activation. The user properties have been + * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command + * line. + * + * @return The user properties, never {@code null}. + */ + public Properties getUserProperties() + { + return request.getUserProperties(); + } + + /** + * Gets the system properties to use for interpolation and profile activation. The system properties are collected + * from the runtime environment like {@link System#getProperties()} and environment variables. + * + * @return The system properties, never {@code null}. + */ + public Properties getSystemProperties() + { + return request.getSystemProperties(); + } + + public Settings getSettings() + { + return settings; + } + + public List<MavenProject> getProjects() + { + return projects; + } + + public String getExecutionRootDirectory() + { + return request.getBaseDirectory(); + } + + public MavenExecutionRequest getRequest() + { + return request; + } + + public void setCurrentProject( MavenProject currentProject ) + { + this.currentProject = currentProject; + } + + public MavenProject getCurrentProject() + { + return currentProject; + } + + public ProjectBuildingRequest getProjectBuildingRequest() + { + return request.getProjectBuildingRequest().setRepositorySession( getRepositorySession() ); + } + + public List<String> getPluginGroups() + { + return request.getPluginGroups(); + } + + public boolean isOffline() + { + return request.isOffline(); + } + + public MavenProject getTopLevelProject() + { + return topLevelProject; + } + + public MavenExecutionResult getResult() + { + return result; + } + + // Backward compat + + public Map<String, Object> getPluginContext( PluginDescriptor plugin, MavenProject project ) + { + String projectKey = project.getId(); + + Map<String, Map<String, Object>> pluginContextsByKey = pluginContextsByProjectAndPluginKey.get( projectKey ); + + if ( pluginContextsByKey == null ) + { + pluginContextsByKey = new ConcurrentHashMap<String, Map<String, Object>>(); + + pluginContextsByProjectAndPluginKey.put( projectKey, pluginContextsByKey ); + } + + String pluginKey = plugin.getPluginLookupKey(); + + Map<String, Object> pluginContext = pluginContextsByKey.get( pluginKey ); + + if ( pluginContext == null ) + { + pluginContext = new ConcurrentHashMap<String, Object>(); + + pluginContextsByKey.put( pluginKey, pluginContext ); + } + + return pluginContext; + } + + public ProjectDependencyGraph getProjectDependencyGraph() + { + return projectDependencyGraph; + } + + public void setProjectDependencyGraph( ProjectDependencyGraph projectDependencyGraph ) + { + this.projectDependencyGraph = projectDependencyGraph; + } + + public String getReactorFailureBehavior() + { + return request.getReactorFailureBehavior(); + } + + @Override + public MavenSession clone() + { + try + { + return (MavenSession) super.clone(); + } + catch ( CloneNotSupportedException e ) + { + throw new RuntimeException( "Bug", e ); + } + } + + public Date getStartTime() + { + return request.getStartTime(); + } + + public boolean isParallel() + { + return parallel; + } + + public void setParallel( boolean parallel ) + { + this.parallel = parallel; + } + + public RepositorySystemSession getRepositorySession() + { + return repositorySession; + } + + private Map<String, MavenProject> projectMap; + + public void setProjectMap( Map<String, MavenProject> projectMap ) + { + this.projectMap = projectMap; + } + + /** This is a provisional method and may be removed */ + public List<MavenProject> getAllProjects() + { + return allProjects; + } + + /** This is a provisional method and may be removed */ + public void setAllProjects( List<MavenProject> allProjects ) + { + this.allProjects = allProjects; + } + + /*if_not[MAVEN4]*/ + + // + // Deprecated + // + + private PlexusContainer container; + + private final Settings settings; + + @Deprecated + /** @deprecated This appears to only be used in the ReactorReader and we can do any processing required there */ + public Map<String, MavenProject> getProjectMap() + { + return projectMap; + } + + @Deprecated + public MavenSession( PlexusContainer container, RepositorySystemSession repositorySession, + MavenExecutionRequest request, MavenExecutionResult result ) + { + this.container = container; + this.request = request; + this.result = result; + this.settings = new SettingsAdapter( request ); + this.repositorySession = repositorySession; + } + + @Deprecated + public MavenSession( PlexusContainer container, MavenExecutionRequest request, MavenExecutionResult result, + MavenProject project ) + { + this( container, request, result, Arrays.asList( new MavenProject[]{project} ) ); + } + + @Deprecated + public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository, + EventDispatcher eventDispatcher, ReactorManager unused, List<String> goals, + String executionRootDir, Properties executionProperties, Date startTime ) + { + this( container, settings, localRepository, eventDispatcher, unused, goals, executionRootDir, + executionProperties, null, startTime ); + } + + @Deprecated + public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository, + EventDispatcher eventDispatcher, ReactorManager unused, List<String> goals, + String executionRootDir, Properties executionProperties, Properties userProperties, + Date startTime ) + { + this.container = container; + this.settings = settings; + this.executionProperties = executionProperties; + this.request = new DefaultMavenExecutionRequest(); + this.request.setUserProperties( userProperties ); + this.request.setLocalRepository( localRepository ); + this.request.setGoals( goals ); + this.request.setBaseDirectory( ( executionRootDir != null ) ? new File( executionRootDir ) : null ); + this.request.setStartTime( startTime ); + } + + @Deprecated + public MavenSession( PlexusContainer container, MavenExecutionRequest request, MavenExecutionResult result, + List<MavenProject> projects ) + { + this.container = container; + this.request = request; + this.result = result; + this.settings = new SettingsAdapter( request ); + setProjects( projects ); + } + + @Deprecated + public List<MavenProject> getSortedProjects() + { + return getProjects(); + } + + @Deprecated + // + // Used by Tycho and will break users and force them to upgrade to Maven 3.1 so we should really leave + // this here, possibly indefinitely. + // + public RepositoryCache getRepositoryCache() + { + return null; + } + + @Deprecated + public EventDispatcher getEventDispatcher() + { + return null; + } + + @Deprecated + public boolean isUsingPOMsFromFilesystem() + { + return request.isProjectPresent(); + } + + /** + * @deprecated Use either {@link #getUserProperties()} or {@link #getSystemProperties()}. + */ + @Deprecated + public Properties getExecutionProperties() + { + if ( executionProperties == null ) + { + executionProperties = new Properties(); + executionProperties.putAll( request.getSystemProperties() ); + executionProperties.putAll( request.getUserProperties() ); + } + + return executionProperties; + } + + @Deprecated + public PlexusContainer getContainer() + { + return container; + } + + @Deprecated + public Object lookup( String role ) + throws ComponentLookupException + { + return container.lookup( role ); + } + + @Deprecated + public Object lookup( String role, String roleHint ) + throws ComponentLookupException + { + return container.lookup( role, roleHint ); + } + + @Deprecated + public List<Object> lookupList( String role ) + throws ComponentLookupException + { + return container.lookupList( role ); + } + + @Deprecated + public Map<String, Object> lookupMap( String role ) + throws ComponentLookupException + { + return container.lookupMap( role ); + } + + /*end[MAVEN4]*/ +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionEvent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionEvent.java new file mode 100644 index 00000000..a8d293d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionEvent.java @@ -0,0 +1,86 @@ +package org.apache.maven.execution; + +/* + * 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.plugin.Mojo; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; + +/** + * Encapsulates parameters of MojoExecutionListener callback methods and is meant to provide API evolution path should + * it become necessary to introduce new parameters in the existing callbacks in the future. + * + * @see MojoExecutionListener + * @see org.apache.maven.execution.scope.WeakMojoExecutionListener + * @since 3.1.2 + * @provisional This class is part of work in progress and can be changed or removed without notice. + */ +public class MojoExecutionEvent +{ + private final MavenSession session; + + private final MavenProject project; + + private final MojoExecution mojoExecution; + + private final Mojo mojo; + + private final Throwable cause; + + public MojoExecutionEvent( MavenSession session, MavenProject project, MojoExecution mojoExecution, Mojo mojo ) + { + this( session, project, mojoExecution, mojo, null ); + } + + public MojoExecutionEvent( MavenSession session, MavenProject project, MojoExecution mojoExecution, Mojo mojo, + Throwable cause ) + { + this.session = session; + this.project = project; + this.mojoExecution = mojoExecution; + this.mojo = mojo; + this.cause = cause; + } + + public MavenSession getSession() + { + return session; + } + + public MavenProject getProject() + { + return project; + } + + public MojoExecution getExecution() + { + return mojoExecution; + } + + public Mojo getMojo() + { + return mojo; + } + + public Throwable getCause() + { + return cause; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionListener.java new file mode 100644 index 00000000..c2fb7a18 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/MojoExecutionListener.java @@ -0,0 +1,40 @@ +package org.apache.maven.execution; + +/* + * 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.plugin.MojoExecutionException; + +/** + * Extension point that allows build extensions observe and possibly veto mojo executions. + * + * @see org.apache.maven.execution.scope.WeakMojoExecutionListener + * @since 3.1.2 + * @provisional This interface is part of work in progress and can be changed or removed without notice. + */ +public interface MojoExecutionListener +{ + void beforeMojoExecution( MojoExecutionEvent event ) + throws MojoExecutionException; + + void afterMojoExecutionSuccess( MojoExecutionEvent event ) + throws MojoExecutionException; + + void afterExecutionFailure( MojoExecutionEvent event ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectDependencyGraph.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectDependencyGraph.java new file mode 100644 index 00000000..1db277db --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectDependencyGraph.java @@ -0,0 +1,64 @@ +package org.apache.maven.execution; + +/* + * 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.project.MavenProject; + +/** + * Describes the inter-dependencies between projects in the reactor. + * + * @author Benjamin Bentmann + */ +public interface ProjectDependencyGraph +{ + + /** + * Gets all projects in their intended build order, i.e. after topologically sorting the projects according to their + * inter-dependencies. + * + * @return The projects in the build order, never {@code null}. + */ + List<MavenProject> getSortedProjects(); + + /** + * Gets the downstream projects of the specified project. A downstream project is a project that directly or + * indirectly depends on the given project. + * + * @param project The project whose downstream projects should be retrieved, must not be {@code null}. + * @param transitive A flag whether to retrieve all direct and indirect downstream projects or just the immediate + * downstream projects. + * @return The downstream projects in the build order, never {@code null}. + */ + List<MavenProject> getDownstreamProjects( MavenProject project, boolean transitive ); + + /** + * Gets the upstream projects of the specified project. An upstream project is a project that directly or indirectly + * is a prerequisite of the given project. + * + * @param project The project whose upstream projects should be retrieved, must not be {@code null}. + * @param transitive A flag whether to retrieve all direct and indirect upstream projects or just the immediate + * upstream projects. + * @return The upstream projects in the build order, never {@code null}. + */ + List<MavenProject> getUpstreamProjects( MavenProject project, boolean transitive ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectExecutionEvent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectExecutionEvent.java new file mode 100644 index 00000000..fb71078f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectExecutionEvent.java @@ -0,0 +1,90 @@ +package org.apache.maven.execution; + +/* + * 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.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; + +/** + * Encapsulates parameters of ProjectExecutionListener callback methods and is meant to provide API evolution path + * should it become necessary to introduce new parameters in the existing callbacks in the future. + * + * @see ProjectExecutionListener + * @since 3.1.2 + * @provisional This class is part of work in progress and can be changed or removed without notice. + */ +public class ProjectExecutionEvent +{ + + private final MavenSession session; + + private final MavenProject project; + + private final List<MojoExecution> executionPlan; + + private final Throwable cause; + + public ProjectExecutionEvent( MavenSession session, MavenProject project ) + { + this( session, project, null, null ); + } + + public ProjectExecutionEvent( MavenSession session, MavenProject project, List<MojoExecution> executionPlan ) + { + this( session, project, executionPlan, null ); + } + + public ProjectExecutionEvent( MavenSession session, MavenProject project, Throwable cause ) + { + this( session, project, null, cause ); + } + + public ProjectExecutionEvent( MavenSession session, MavenProject project, List<MojoExecution> executionPlan, + Throwable cause ) + { + this.session = session; + this.project = project; + this.executionPlan = executionPlan; + this.cause = cause; + } + + public MavenSession getSession() + { + return session; + } + + public MavenProject getProject() + { + return project; + } + + public List<MojoExecution> getExecutionPlan() + { + return executionPlan; + } + + public Throwable getCause() + { + return cause; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectExecutionListener.java new file mode 100644 index 00000000..d7e89183 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ProjectExecutionListener.java @@ -0,0 +1,44 @@ +package org.apache.maven.execution; + +/* + * 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.lifecycle.LifecycleExecutionException; + +/** + * Extension point that allows build extensions observe and possibly veto project build execution. + * + * @see ExecutionListener + * @see MojoExecutionListener + * @since 3.1.2 + * @provisional This interface is part of work in progress and can be changed or removed without notice. + */ +public interface ProjectExecutionListener +{ + void beforeProjectExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException; + + void beforeProjectLifecycleExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException; + + void afterProjectExecutionSuccess( ProjectExecutionEvent event ) + throws LifecycleExecutionException; + + void afterProjectExecutionFailure( ProjectExecutionEvent event ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java new file mode 100644 index 00000000..1b99a3be --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/ReactorManager.java @@ -0,0 +1,199 @@ +package org.apache.maven.execution; + +/* + * 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.ArtifactUtils; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.DuplicateProjectException; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectSorter; +import org.codehaus.plexus.util.dag.CycleDetectedException; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Deprecated +public class ReactorManager +{ + public static final String FAIL_FAST = "fail-fast"; + + public static final String FAIL_AT_END = "fail-at-end"; + + public static final String FAIL_NEVER = "fail-never"; + + public static final String MAKE_MODE = "make"; + + public static final String MAKE_DEPENDENTS_MODE = "make-dependents"; + + // make projects that depend on me, and projects that I depend on + public static final String MAKE_BOTH_MODE = "make-both"; + + private List<String> blackList = new ArrayList<String>(); + + private Map<String, BuildFailure> buildFailuresByProject = new HashMap<String, BuildFailure>(); + + private Map pluginContextsByProjectAndPluginKey = new HashMap(); + + private String failureBehavior = FAIL_FAST; + + private final ProjectSorter sorter; + + private Map<String, BuildSuccess> buildSuccessesByProject = new HashMap<String, BuildSuccess>(); + + public ReactorManager( List<MavenProject> projects ) + throws CycleDetectedException, DuplicateProjectException + { + this.sorter = new ProjectSorter( projects ); + } + + public Map getPluginContext( PluginDescriptor plugin, MavenProject project ) + { + Map pluginContextsByKey = (Map) pluginContextsByProjectAndPluginKey.get( project.getId() ); + + if ( pluginContextsByKey == null ) + { + pluginContextsByKey = new HashMap(); + pluginContextsByProjectAndPluginKey.put( project.getId(), pluginContextsByKey ); + } + + Map pluginContext = (Map) pluginContextsByKey.get( plugin.getPluginLookupKey() ); + + if ( pluginContext == null ) + { + pluginContext = new HashMap(); + pluginContextsByKey.put( plugin.getPluginLookupKey(), pluginContext ); + } + + return pluginContext; + } + + public void setFailureBehavior( String failureBehavior ) + { + if ( failureBehavior == null ) + { + this.failureBehavior = FAIL_FAST; // default + return; + } + if ( FAIL_FAST.equals( failureBehavior ) || FAIL_AT_END.equals( failureBehavior ) + || FAIL_NEVER.equals( failureBehavior ) ) + { + this.failureBehavior = failureBehavior; + } + else + { + throw new IllegalArgumentException( "Invalid failure behavior (must be one of: \'" + FAIL_FAST + "\', \'" + + FAIL_AT_END + "\', \'" + FAIL_NEVER + "\')." ); + } + } + + public String getFailureBehavior() + { + return failureBehavior; + } + + public void blackList( MavenProject project ) + { + blackList( getProjectKey( project ) ); + } + + private void blackList( String id ) + { + if ( !blackList.contains( id ) ) + { + blackList.add( id ); + + List<String> dependents = sorter.getDependents( id ); + + if ( dependents != null && !dependents.isEmpty() ) + { + for ( String dependentId : dependents ) + { + if ( !buildSuccessesByProject.containsKey( dependentId ) + && !buildFailuresByProject.containsKey( dependentId ) ) + { + blackList( dependentId ); + } + } + } + } + } + + public boolean isBlackListed( MavenProject project ) + { + return blackList.contains( getProjectKey( project ) ); + } + + private static String getProjectKey( MavenProject project ) + { + return ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ); + } + + public void registerBuildFailure( MavenProject project, Exception error, String task, long time ) + { + buildFailuresByProject.put( getProjectKey( project ), new BuildFailure( project, time, error ) ); + } + + public boolean hasBuildFailures() + { + return !buildFailuresByProject.isEmpty(); + } + + public boolean hasBuildFailure( MavenProject project ) + { + return buildFailuresByProject.containsKey( getProjectKey( project ) ); + } + + public boolean hasMultipleProjects() + { + return sorter.hasMultipleProjects(); + } + + public List<MavenProject> getSortedProjects() + { + return sorter.getSortedProjects(); + } + + public boolean hasBuildSuccess( MavenProject project ) + { + return buildSuccessesByProject.containsKey( getProjectKey( project ) ); + } + + public void registerBuildSuccess( MavenProject project, long time ) + { + buildSuccessesByProject.put( getProjectKey( project ), new BuildSuccess( project, time ) ); + } + + public BuildFailure getBuildFailure( MavenProject project ) + { + return (BuildFailure) buildFailuresByProject.get( getProjectKey( project ) ); + } + + public BuildSuccess getBuildSuccess( MavenProject project ) + { + return (BuildSuccess) buildSuccessesByProject.get( getProjectKey( project ) ); + } + + public boolean executedMultipleProjects() + { + return buildFailuresByProject.size() + buildSuccessesByProject.size() > 1; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java new file mode 100644 index 00000000..000607ff --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/SettingsAdapter.java @@ -0,0 +1,126 @@ +package org.apache.maven.execution; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Profile; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.RuntimeInfo; +import org.apache.maven.settings.Server; +import org.apache.maven.settings.Settings; +import org.apache.maven.settings.SettingsUtils; + +/** + * Adapt a {@link MavenExecutionRequest} to a {@link Settings} object for use in the Maven core. + * We want to make sure that what is ask for in the execution request overrides what is in the settings. + * The CLI feeds into an execution request so if a particular value is present in the execution request + * then we will take that over the value coming from the user settings. + * + * @author Jason van Zyl + */ +class SettingsAdapter + extends Settings +{ + + private MavenExecutionRequest request; + + private RuntimeInfo runtimeInfo; + + public SettingsAdapter( MavenExecutionRequest request ) + { + this.request = request; + + /* + * NOTE: Plugins like maven-release-plugin query the path to the settings.xml to pass it into a forked Maven and + * the CLI will fail when called with a non-existing settings, so be sure to only point at actual files. Having + * a null file should be harmless as this case matches general Maven 2.x behavior... + */ + File userSettings = request.getUserSettingsFile(); + this.runtimeInfo = new RuntimeInfo( ( userSettings != null && userSettings.isFile() ) ? userSettings : null ); + } + + @Override + public String getLocalRepository() + { + if ( request.getLocalRepositoryPath() != null ) + { + return request.getLocalRepositoryPath().getAbsolutePath(); + } + + return null; + } + + @Override + public boolean isInteractiveMode() + { + return request.isInteractiveMode(); + } + + @Override + public boolean isOffline() + { + return request.isOffline(); + } + + @Override + public List<Proxy> getProxies() + { + return request.getProxies(); + } + + @Override + public List<Server> getServers() + { + return request.getServers(); + } + + @Override + public List<Mirror> getMirrors() + { + return request.getMirrors(); + } + + @Override + public List<Profile> getProfiles() + { + List<Profile> result = new ArrayList<Profile>(); + for ( org.apache.maven.model.Profile profile : request.getProfiles() ) + { + result.add( SettingsUtils.convertToSettingsProfile( profile ) ); + } + return result; + } + + @Override + public List<String> getActiveProfiles() + { + return request.getActiveProfiles(); + } + + @Override + public List<String> getPluginGroups() + { + return request.getPluginGroups(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/MojoExecutionScoped.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/MojoExecutionScoped.java new file mode 100644 index 00000000..0dcbd16f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/MojoExecutionScoped.java @@ -0,0 +1,42 @@ +package org.apache.maven.execution.scope; + +/* + * 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 static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import com.google.inject.ScopeAnnotation; + +/** + * Indicates that annotated component should be instantiated before mojo execution starts and discarded after mojo + * execution completes. + * + * @author igor + * @since 3.1.2 + */ +@Target( { TYPE } ) +@Retention( RUNTIME ) +@ScopeAnnotation +public @interface MojoExecutionScoped +{ +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/WeakMojoExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/WeakMojoExecutionListener.java new file mode 100644 index 00000000..94e7c104 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/WeakMojoExecutionListener.java @@ -0,0 +1,44 @@ +package org.apache.maven.execution.scope; + +/* + * 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.execution.MojoExecutionEvent; +import org.apache.maven.plugin.MojoExecutionException; + +/** + * Extension point that allows build extensions observe and possibly veto mojo executions. + * <p> + * Unlike {@link MojoExecutionListener}, this extension point does not trigger instantiation of the component, hence + * "weak" class name prefix. Only applies to mojo execution scoped components. + * + * @see org.apache.maven.execution.MojoExecutionListener + * @since 3.1.2 + * @provisional This interface is part of work in progress and can be changed or removed without notice. + */ +public interface WeakMojoExecutionListener +{ + void beforeMojoExecution( MojoExecutionEvent event ) + throws MojoExecutionException; + + void afterMojoExecutionSuccess( MojoExecutionEvent event ) + throws MojoExecutionException; + + void afterExecutionFailure( MojoExecutionEvent event ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java new file mode 100644 index 00000000..8a98daf0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScope.java @@ -0,0 +1,190 @@ +package org.apache.maven.execution.scope.internal; + +/* + * 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.IdentityHashMap; +import java.util.LinkedList; +import java.util.Map; + +import org.apache.maven.execution.MojoExecutionEvent; +import org.apache.maven.execution.MojoExecutionListener; +import org.apache.maven.execution.scope.WeakMojoExecutionListener; +import org.apache.maven.plugin.MojoExecutionException; + +import com.google.common.collect.Maps; +import com.google.inject.Key; +import com.google.inject.OutOfScopeException; +import com.google.inject.Provider; +import com.google.inject.Scope; +import com.google.inject.util.Providers; + +public class MojoExecutionScope + implements Scope, MojoExecutionListener +{ + private static final Provider<Object> SEEDED_KEY_PROVIDER = new Provider<Object>() + { + public Object get() + { + throw new IllegalStateException(); + } + }; + + private static final class ScopeState + { + public final Map<Key<?>, Provider<?>> seeded = Maps.newHashMap(); + + public final Map<Key<?>, Object> provided = Maps.newHashMap(); + } + + private final ThreadLocal<LinkedList<ScopeState>> values = new ThreadLocal<LinkedList<ScopeState>>(); + + public MojoExecutionScope() + { + } + + public void enter() + { + LinkedList<ScopeState> stack = values.get(); + if ( stack == null ) + { + stack = new LinkedList<ScopeState>(); + values.set( stack ); + } + stack.addFirst( new ScopeState() ); + } + + private ScopeState getScopeState() + { + LinkedList<ScopeState> stack = values.get(); + if ( stack == null || stack.isEmpty() ) + { + throw new IllegalStateException(); + } + return stack.getFirst(); + } + + public void exit() + throws MojoExecutionException + { + final LinkedList<ScopeState> stack = values.get(); + if ( stack == null || stack.isEmpty() ) + { + throw new IllegalStateException(); + } + stack.removeFirst(); + if ( stack.isEmpty() ) + { + values.remove(); + } + } + + public <T> void seed( Class<T> clazz, Provider<T> value ) + { + getScopeState().seeded.put( Key.get( clazz ), value ); + } + + public <T> void seed( Class<T> clazz, final T value ) + { + getScopeState().seeded.put( Key.get( clazz ), Providers.of( value ) ); + } + + public <T> Provider<T> scope( final Key<T> key, final Provider<T> unscoped ) + { + return new Provider<T>() + { + @SuppressWarnings( "unchecked" ) + public T get() + { + LinkedList<ScopeState> stack = values.get(); + if ( stack == null || stack.isEmpty() ) + { + throw new OutOfScopeException( "Cannot access " + key + " outside of a scoping block" ); + } + + ScopeState state = stack.getFirst(); + + Provider<?> seeded = state.seeded.get( key ); + + if ( seeded != null ) + { + return (T) seeded.get(); + } + + T provided = (T) state.provided.get( key ); + if ( provided == null && unscoped != null ) + { + provided = unscoped.get(); + state.provided.put( key, provided ); + } + + return provided; + } + }; + } + + @SuppressWarnings( { "unchecked" } ) + public static <T> Provider<T> seededKeyProvider() + { + return (Provider<T>) SEEDED_KEY_PROVIDER; + } + + public void beforeMojoExecution( MojoExecutionEvent event ) + throws MojoExecutionException + { + for ( WeakMojoExecutionListener provided : getProvidedListeners() ) + { + provided.beforeMojoExecution( event ); + } + } + + public void afterMojoExecutionSuccess( MojoExecutionEvent event ) + throws MojoExecutionException + { + for ( WeakMojoExecutionListener provided : getProvidedListeners() ) + { + provided.afterMojoExecutionSuccess( event ); + } + } + + public void afterExecutionFailure( MojoExecutionEvent event ) + { + for ( WeakMojoExecutionListener provided : getProvidedListeners() ) + { + provided.afterExecutionFailure( event ); + } + } + + private Collection<WeakMojoExecutionListener> getProvidedListeners() + { + // the same instance can be provided multiple times under different Key's + // deduplicate instances to avoid redundant beforeXXX/afterXXX callbacks + IdentityHashMap<WeakMojoExecutionListener, Object> listeners = + new IdentityHashMap<WeakMojoExecutionListener, Object>(); + for ( Object provided : getScopeState().provided.values() ) + { + if ( provided instanceof WeakMojoExecutionListener ) + { + listeners.put( (WeakMojoExecutionListener) provided, null ); + } + } + return listeners.keySet(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeCoreModule.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeCoreModule.java new file mode 100644 index 00000000..8208c3c3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeCoreModule.java @@ -0,0 +1,45 @@ +package org.apache.maven.execution.scope.internal; + +/* + * 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 org.apache.maven.execution.MojoExecutionListener; + +@Named +public class MojoExecutionScopeCoreModule + extends MojoExecutionScopeModule +{ + + @Inject + public MojoExecutionScopeCoreModule() + { + super( new MojoExecutionScope() ); + } + + @Override + protected void configure() + { + super.configure(); + bind( MojoExecutionListener.class ).toInstance( scope ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeModule.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeModule.java new file mode 100644 index 00000000..229a3c56 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeModule.java @@ -0,0 +1,56 @@ +package org.apache.maven.execution.scope.internal; + +/* + * 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.execution.scope.MojoExecutionScoped; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +import com.google.inject.AbstractModule; + +public class MojoExecutionScopeModule + extends AbstractModule +{ + protected final MojoExecutionScope scope; + + public MojoExecutionScopeModule( PlexusContainer container ) + throws ComponentLookupException + { + this( container.lookup( MojoExecutionScope.class ) ); + } + + protected MojoExecutionScopeModule( MojoExecutionScope scope ) + { + this.scope = scope; + } + + @Override + protected void configure() + { + bindScope( MojoExecutionScoped.class, scope ); + bind( MojoExecutionScope.class ).toInstance( scope ); + + bind( MavenProject.class ).toProvider( MojoExecutionScope.<MavenProject>seededKeyProvider() ).in( scope ); + bind( MojoExecution.class ).toProvider( MojoExecutionScope.<MojoExecution>seededKeyProvider() ).in( scope ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExports.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExports.java new file mode 100644 index 00000000..c4265b31 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExports.java @@ -0,0 +1,75 @@ +package org.apache.maven.extension.internal; + +/* + * 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.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +import org.codehaus.plexus.classworlds.realm.ClassRealm; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; + +/** + * Provides information about artifacts (identified by groupId:artifactId string key) and classpath elements exported by + * Maven core itself and loaded Maven core extensions. + * + * @since 3.3.0 + */ +public class CoreExports +{ + private final Set<String> artifacts; + + private final Map<String, ClassLoader> packages; + + public CoreExports( CoreExtensionEntry entry ) + { + this( entry.getClassRealm(), entry.getExportedArtifacts(), entry.getExportedPackages() ); + } + + public CoreExports( ClassRealm realm, Set<String> exportedArtifacts, Set<String> exportedPackages ) + { + Map<String, ClassLoader> packages = new LinkedHashMap<String, ClassLoader>(); + for ( String pkg : exportedPackages ) + { + packages.put( pkg, realm ); + } + this.artifacts = ImmutableSet.copyOf( exportedArtifacts ); + this.packages = ImmutableMap.copyOf( packages ); + } + + /** + * Returns artifacts exported by Maven core and core extensions. Artifacts are identified by their + * groupId:artifactId string key. + */ + public Set<String> getExportedArtifacts() + { + return artifacts; + } + + /** + * Returns packages exported by Maven core and core extensions. + */ + public Map<String, ClassLoader> getExportedPackages() + { + return packages; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExportsProvider.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExportsProvider.java new file mode 100644 index 00000000..e7e4534c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExportsProvider.java @@ -0,0 +1,53 @@ +package org.apache.maven.extension.internal; + +/* + * 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.codehaus.plexus.PlexusContainer; +import org.eclipse.sisu.Nullable; + +@Named +@Singleton +public class CoreExportsProvider +{ + + private final CoreExports exports; + + @Inject + public CoreExportsProvider( PlexusContainer container, @Nullable CoreExports exports ) + { + if ( exports == null ) + { + this.exports = new CoreExports( CoreExtensionEntry.discoverFrom( container.getContainerRealm() ) ); + } + else + { + this.exports = exports; + } + } + + public CoreExports get() + { + return exports; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExtensionEntry.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExtensionEntry.java new file mode 100644 index 00000000..edadeb2d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/extension/internal/CoreExtensionEntry.java @@ -0,0 +1,141 @@ +package org.apache.maven.extension.internal; + +/* + * 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.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Collection; +import java.util.Enumeration; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.apache.maven.project.ExtensionDescriptor; +import org.apache.maven.project.ExtensionDescriptorBuilder; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.util.IOUtil; + +import com.google.common.collect.ImmutableSet; + +/** + * Provides information about artifacts (identified by groupId:artifactId string key) and classpath elements exported by + * Maven core itself or a Maven core extension. + * + * @since 3.3.0 + */ +public class CoreExtensionEntry +{ + private final ClassRealm realm; + + private final Set<String> artifacts; + + private final Set<String> packages; + + public CoreExtensionEntry( ClassRealm realm, Collection<String> artifacts, Collection<String> packages ) + { + this.realm = realm; + this.artifacts = ImmutableSet.copyOf( artifacts ); + this.packages = ImmutableSet.copyOf( packages ); + } + + /** + * Returns ClassLoader used to load extension classes. + */ + public ClassRealm getClassRealm() + { + return realm; + } + + /** + * Returns artifacts exported by the extension, identified by groupId:artifactId string key. + */ + public Set<String> getExportedArtifacts() + { + return artifacts; + } + + /** + * Returns classpath elements exported by the extension. + */ + public Set<String> getExportedPackages() + { + return packages; + } + + private static final ExtensionDescriptorBuilder builder = new ExtensionDescriptorBuilder(); + + public static CoreExtensionEntry discoverFrom( ClassRealm loader ) + { + Set<String> artifacts = new LinkedHashSet<String>(); + Set<String> packages = new LinkedHashSet<String>(); + + try + { + Enumeration<URL> urls = loader.getResources( builder.getExtensionDescriptorLocation() ); + while ( urls.hasMoreElements() ) + { + InputStream is = urls.nextElement().openStream(); + try + { + ExtensionDescriptor descriptor = builder.build( is ); + artifacts.addAll( descriptor.getExportedArtifacts() ); + packages.addAll( descriptor.getExportedPackages() ); + } + finally + { + IOUtil.close( is ); + } + } + } + catch ( IOException ignored ) + { + // exports descriptors are entirely optional + } + + return new CoreExtensionEntry( loader, artifacts, packages ); + } + + public static CoreExtensionEntry discoverFrom( ClassRealm loader, Collection<File> classpath ) + { + Set<String> artifacts = new LinkedHashSet<String>(); + Set<String> packages = new LinkedHashSet<String>(); + + try + { + for ( File entry : classpath ) + { + ExtensionDescriptor descriptor = builder.build( entry ); + if ( descriptor != null ) + { + artifacts.addAll( descriptor.getExportedArtifacts() ); + packages.addAll( descriptor.getExportedPackages() ); + } + } + } + catch ( IOException ignored ) + { + // exports descriptors are entirely optional + } + + return new CoreExtensionEntry( loader, artifacts, packages ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java new file mode 100644 index 00000000..c8367463 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java @@ -0,0 +1,488 @@ +package org.apache.maven.graph; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; + +import org.apache.maven.DefaultMaven; +import org.apache.maven.MavenExecutionException; +import org.apache.maven.ProjectCycleException; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionResult; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.building.DefaultModelProblem; +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.model.building.ModelProblemUtils; +import org.apache.maven.model.building.ModelSource; +import org.apache.maven.model.building.Result; +import org.apache.maven.model.building.UrlModelSource; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuilder; +import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.project.ProjectBuildingResult; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.dag.CycleDetectedException; + +import com.google.common.collect.Lists; + +@Component( role = GraphBuilder.class, hint = GraphBuilder.HINT ) +public class DefaultGraphBuilder + implements GraphBuilder +{ + @Requirement + private Logger logger; + + @Requirement + protected ProjectBuilder projectBuilder; + + @Override + public Result<ProjectDependencyGraph> build( MavenSession session ) + { + if ( session.getProjectDependencyGraph() != null ) + { + return dependencyGraph( session, session.getProjects(), false ); + } + + List<MavenProject> projects = session.getProjects(); + + if ( projects == null ) + { + try + { + projects = getProjectsForMavenReactor( session ); + } + catch ( ProjectBuildingException e ) + { + return Result.error( Lists.newArrayList( new DefaultModelProblem( null, null, null, null, 0, 0, e ) ) ); + } + + validateProjects( projects ); + + return dependencyGraph( session, projects, true ); + } + else + { + return dependencyGraph( session, projects, false ); + } + } + + private Result<ProjectDependencyGraph> dependencyGraph( MavenSession session, List<MavenProject> projects, + boolean applyMakeBehaviour ) + { + MavenExecutionRequest request = session.getRequest(); + + ProjectDependencyGraph projectDependencyGraph = null; + + try + { + projectDependencyGraph = new DefaultProjectDependencyGraph( projects ); + + if ( applyMakeBehaviour ) + { + List<MavenProject> activeProjects = projectDependencyGraph.getSortedProjects(); + + activeProjects = trimSelectedProjects( activeProjects, projectDependencyGraph, request ); + activeProjects = trimExcludedProjects( activeProjects, request ); + activeProjects = trimResumedProjects( activeProjects, request ); + + if ( activeProjects.size() != projectDependencyGraph.getSortedProjects().size() ) + { + projectDependencyGraph = + new FilteredProjectDependencyGraph( projectDependencyGraph, activeProjects ); + } + } + } + catch ( CycleDetectedException e ) + { + String message = "The projects in the reactor contain a cyclic reference: " + e.getMessage(); + ProjectCycleException error = new ProjectCycleException( message, e ); + return Result.error( Lists.newArrayList( new DefaultModelProblem( null, null, null, null, 0, 0, error ) ) ); + } + catch ( org.apache.maven.project.DuplicateProjectException e ) + { + return Result.error( Lists.newArrayList( new DefaultModelProblem( null, null, null, null, 0, 0, e ) ) ); + } + catch ( MavenExecutionException e ) + { + return Result.error( Lists.newArrayList( new DefaultModelProblem( null, null, null, null, 0, 0, e ) ) ); + } + + session.setProjects( projectDependencyGraph.getSortedProjects() ); + session.setProjectDependencyGraph( projectDependencyGraph ); + + return Result.success( projectDependencyGraph ); + } + + private List<MavenProject> trimSelectedProjects( List<MavenProject> projects, ProjectDependencyGraph graph, + MavenExecutionRequest request ) + throws MavenExecutionException + { + List<MavenProject> result = projects; + + if ( !request.getSelectedProjects().isEmpty() ) + { + File reactorDirectory = null; + if ( request.getBaseDirectory() != null ) + { + reactorDirectory = new File( request.getBaseDirectory() ); + } + + Collection<MavenProject> selectedProjects = new LinkedHashSet<MavenProject>( projects.size() ); + + for ( String selector : request.getSelectedProjects() ) + { + MavenProject selectedProject = null; + + for ( MavenProject project : projects ) + { + if ( isMatchingProject( project, selector, reactorDirectory ) ) + { + selectedProject = project; + break; + } + } + + if ( selectedProject != null ) + { + selectedProjects.add( selectedProject ); + } + else + { + throw new MavenExecutionException( "Could not find the selected project in the reactor: " + + selector, request.getPom() ); + } + } + + boolean makeUpstream = false; + boolean makeDownstream = false; + + if ( MavenExecutionRequest.REACTOR_MAKE_UPSTREAM.equals( request.getMakeBehavior() ) ) + { + makeUpstream = true; + } + else if ( MavenExecutionRequest.REACTOR_MAKE_DOWNSTREAM.equals( request.getMakeBehavior() ) ) + { + makeDownstream = true; + } + else if ( MavenExecutionRequest.REACTOR_MAKE_BOTH.equals( request.getMakeBehavior() ) ) + { + makeUpstream = true; + makeDownstream = true; + } + else if ( StringUtils.isNotEmpty( request.getMakeBehavior() ) ) + { + throw new MavenExecutionException( "Invalid reactor make behavior: " + request.getMakeBehavior(), + request.getPom() ); + } + + if ( makeUpstream || makeDownstream ) + { + for ( MavenProject selectedProject : new ArrayList<MavenProject>( selectedProjects ) ) + { + if ( makeUpstream ) + { + selectedProjects.addAll( graph.getUpstreamProjects( selectedProject, true ) ); + } + if ( makeDownstream ) + { + selectedProjects.addAll( graph.getDownstreamProjects( selectedProject, true ) ); + } + } + } + + result = new ArrayList<MavenProject>( selectedProjects.size() ); + + for ( MavenProject project : projects ) + { + if ( selectedProjects.contains( project ) ) + { + result.add( project ); + } + } + } + + return result; + } + + private List<MavenProject> trimExcludedProjects( List<MavenProject> projects, MavenExecutionRequest request ) + throws MavenExecutionException + { + List<MavenProject> result = projects; + + if ( !request.getExcludedProjects().isEmpty() ) + { + File reactorDirectory = null; + + if ( request.getBaseDirectory() != null ) + { + reactorDirectory = new File( request.getBaseDirectory() ); + } + + Collection<MavenProject> excludedProjects = new LinkedHashSet<MavenProject>( projects.size() ); + + for ( String selector : request.getExcludedProjects() ) + { + MavenProject excludedProject = null; + + for ( MavenProject project : projects ) + { + if ( isMatchingProject( project, selector, reactorDirectory ) ) + { + excludedProject = project; + break; + } + } + + if ( excludedProject != null ) + { + excludedProjects.add( excludedProject ); + } + else + { + throw new MavenExecutionException( "Could not find the selected project in the reactor: " + + selector, request.getPom() ); + } + } + + result = new ArrayList<MavenProject>( projects.size() ); + for ( MavenProject project : projects ) + { + if ( !excludedProjects.contains( project ) ) + { + result.add( project ); + } + } + } + + return result; + } + + private List<MavenProject> trimResumedProjects( List<MavenProject> projects, MavenExecutionRequest request ) + throws MavenExecutionException + { + List<MavenProject> result = projects; + + if ( StringUtils.isNotEmpty( request.getResumeFrom() ) ) + { + File reactorDirectory = null; + if ( request.getBaseDirectory() != null ) + { + reactorDirectory = new File( request.getBaseDirectory() ); + } + + String selector = request.getResumeFrom(); + + result = new ArrayList<MavenProject>( projects.size() ); + + boolean resumed = false; + + for ( MavenProject project : projects ) + { + if ( !resumed && isMatchingProject( project, selector, reactorDirectory ) ) + { + resumed = true; + } + + if ( resumed ) + { + result.add( project ); + } + } + + if ( !resumed ) + { + throw new MavenExecutionException( "Could not find project to resume reactor build from: " + selector + + " vs " + projects, request.getPom() ); + } + } + + return result; + } + + private boolean isMatchingProject( MavenProject project, String selector, File reactorDirectory ) + { + // [groupId]:artifactId + if ( selector.indexOf( ':' ) >= 0 ) + { + String id = ':' + project.getArtifactId(); + + if ( id.equals( selector ) ) + { + return true; + } + + id = project.getGroupId() + id; + + if ( id.equals( selector ) ) + { + return true; + } + } + + // relative path, e.g. "sub", "../sub" or "." + else if ( reactorDirectory != null ) + { + File selectedProject = new File( new File( reactorDirectory, selector ).toURI().normalize() ); + + if ( selectedProject.isFile() ) + { + return selectedProject.equals( project.getFile() ); + } + else if ( selectedProject.isDirectory() ) + { + return selectedProject.equals( project.getBasedir() ); + } + } + + return false; + } + + private MavenExecutionResult addExceptionToResult( MavenExecutionResult result, Throwable e ) + { + if ( !result.getExceptions().contains( e ) ) + { + result.addException( e ); + } + + return result; + } + + // //////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Project collection + // + // //////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + private List<MavenProject> getProjectsForMavenReactor( MavenSession session ) + throws ProjectBuildingException + { + MavenExecutionRequest request = session.getRequest(); + + request.getProjectBuildingRequest().setRepositorySession( session.getRepositorySession() ); + + List<MavenProject> projects = new ArrayList<MavenProject>(); + + // We have no POM file. + // + if ( request.getPom() == null ) + { + ModelSource modelSource = new UrlModelSource( DefaultMaven.class.getResource( "project/standalone.xml" ) ); + MavenProject project = projectBuilder.build( modelSource, request.getProjectBuildingRequest() ) + .getProject(); + project.setExecutionRoot( true ); + projects.add( project ); + request.setProjectPresent( false ); + return projects; + } + + List<File> files = Arrays.asList( request.getPom().getAbsoluteFile() ); + collectProjects( projects, files, request ); + return projects; + } + + private void collectProjects( List<MavenProject> projects, List<File> files, MavenExecutionRequest request ) + throws ProjectBuildingException + { + ProjectBuildingRequest projectBuildingRequest = request.getProjectBuildingRequest(); + + List<ProjectBuildingResult> results = projectBuilder.build( files, request.isRecursive(), + projectBuildingRequest ); + + boolean problems = false; + + for ( ProjectBuildingResult result : results ) + { + projects.add( result.getProject() ); + + if ( !result.getProblems().isEmpty() && logger.isWarnEnabled() ) + { + logger.warn( "" ); + logger.warn( "Some problems were encountered while building the effective model for " + + result.getProject().getId() ); + + for ( ModelProblem problem : result.getProblems() ) + { + String loc = ModelProblemUtils.formatLocation( problem, result.getProjectId() ); + logger.warn( problem.getMessage() + ( StringUtils.isNotEmpty( loc ) ? " @ " + loc : "" ) ); + } + + problems = true; + } + } + + if ( problems ) + { + logger.warn( "" ); + logger.warn( "It is highly recommended to fix these problems" + + " because they threaten the stability of your build." ); + logger.warn( "" ); + logger.warn( "For this reason, future Maven versions might no" + + " longer support building such malformed projects." ); + logger.warn( "" ); + } + } + + private void validateProjects( List<MavenProject> projects ) + { + Map<String, MavenProject> projectsMap = new HashMap<String, MavenProject>(); + + for ( MavenProject p : projects ) + { + String projectKey = ArtifactUtils.key( p.getGroupId(), p.getArtifactId(), p.getVersion() ); + + projectsMap.put( projectKey, p ); + } + + for ( MavenProject project : projects ) + { + // MNG-1911 / MNG-5572: Building plugins with extensions cannot be part of reactor + for ( Plugin plugin : project.getBuildPlugins() ) + { + if ( plugin.isExtensions() ) + { + String pluginKey = ArtifactUtils.key( plugin.getGroupId(), plugin.getArtifactId(), + plugin.getVersion() ); + + if ( projectsMap.containsKey( pluginKey ) ) + { + logger.warn( project.getName() + " uses " + plugin.getKey() + + " as extensions, which is not possible within the same reactor build. " + + "This plugin was pulled from the local repository!" ); + } + } + } + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java new file mode 100644 index 00000000..01fec339 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/DefaultProjectDependencyGraph.java @@ -0,0 +1,134 @@ +package org.apache.maven.graph; + +/* + * 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.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.project.DuplicateProjectException; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectSorter; +import org.codehaus.plexus.util.dag.CycleDetectedException; + +/** + * Describes the inter-dependencies between projects in the reactor. + * + * @author Benjamin Bentmann + */ +public class DefaultProjectDependencyGraph + implements ProjectDependencyGraph +{ + + private ProjectSorter sorter; + + /** + * Creates a new project dependency graph based on the specified projects. + * + * @param projects The projects to create the dependency graph with + * @throws DuplicateProjectException + * @throws CycleDetectedException + */ + public DefaultProjectDependencyGraph( Collection<MavenProject> projects ) + throws CycleDetectedException, DuplicateProjectException + { + this.sorter = new ProjectSorter( projects ); + } + + public List<MavenProject> getSortedProjects() + { + return new ArrayList<MavenProject>( sorter.getSortedProjects() ); + } + + public List<MavenProject> getDownstreamProjects( MavenProject project, boolean transitive ) + { + if ( project == null ) + { + throw new IllegalArgumentException( "project missing" ); + } + + Set<String> projectIds = new HashSet<String>(); + + getDownstreamProjects( ProjectSorter.getId( project ), projectIds, transitive ); + + return getSortedProjects( projectIds ); + } + + private void getDownstreamProjects( String projectId, Set<String> projectIds, boolean transitive ) + { + for ( String id : sorter.getDependents( projectId ) ) + { + if ( projectIds.add( id ) && transitive ) + { + getDownstreamProjects( id, projectIds, transitive ); + } + } + } + + public List<MavenProject> getUpstreamProjects( MavenProject project, boolean transitive ) + { + if ( project == null ) + { + throw new IllegalArgumentException( "project missing" ); + } + + Set<String> projectIds = new HashSet<String>(); + + getUpstreamProjects( ProjectSorter.getId( project ), projectIds, transitive ); + + return getSortedProjects( projectIds ); + } + + private void getUpstreamProjects( String projectId, Collection<String> projectIds, boolean transitive ) + { + for ( String id : sorter.getDependencies( projectId ) ) + { + if ( projectIds.add( id ) && transitive ) + { + getUpstreamProjects( id, projectIds, transitive ); + } + } + } + + private List<MavenProject> getSortedProjects( Set<String> projectIds ) + { + List<MavenProject> result = new ArrayList<MavenProject>( projectIds.size() ); + + for ( MavenProject mavenProject : sorter.getSortedProjects() ) + { + if ( projectIds.contains( ProjectSorter.getId( mavenProject ) ) ) + { + result.add( mavenProject ); + } + } + + return result; + } + + @Override + public String toString() + { + return sorter.getSortedProjects().toString(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java new file mode 100644 index 00000000..662bda47 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java @@ -0,0 +1,111 @@ +package org.apache.maven.graph; + +/* + * 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.ArrayList; +import java.util.Collection; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.project.MavenProject; + +/** + * Provides a sub view of another dependency graph. + * + * @author Benjamin Bentmann + */ +class FilteredProjectDependencyGraph + implements ProjectDependencyGraph +{ + + private ProjectDependencyGraph projectDependencyGraph; + + private Map<MavenProject, ?> whiteList; + + private List<MavenProject> sortedProjects; + + /** + * Creates a new project dependency graph from the specified graph. + * + * @param projectDependencyGraph The project dependency graph to create a sub view from, must not be {@code null}. + * @param whiteList The projects on which the dependency view should focus, must not be {@code null}. + */ + public FilteredProjectDependencyGraph( ProjectDependencyGraph projectDependencyGraph, + Collection<? extends MavenProject> whiteList ) + { + if ( projectDependencyGraph == null ) + { + throw new IllegalArgumentException( "project dependency graph missing" ); + } + + this.projectDependencyGraph = projectDependencyGraph; + + this.whiteList = new IdentityHashMap<MavenProject, Object>(); + + for ( MavenProject project : whiteList ) + { + this.whiteList.put( project, null ); + } + } + + public List<MavenProject> getSortedProjects() + { + if ( sortedProjects == null ) + { + sortedProjects = applyFilter( projectDependencyGraph.getSortedProjects() ); + } + + return new ArrayList<MavenProject>( sortedProjects ); + } + + public List<MavenProject> getDownstreamProjects( MavenProject project, boolean transitive ) + { + return applyFilter( projectDependencyGraph.getDownstreamProjects( project, transitive ) ); + } + + public List<MavenProject> getUpstreamProjects( MavenProject project, boolean transitive ) + { + return applyFilter( projectDependencyGraph.getUpstreamProjects( project, transitive ) ); + } + + private List<MavenProject> applyFilter( Collection<? extends MavenProject> projects ) + { + List<MavenProject> filtered = new ArrayList<MavenProject>( projects.size() ); + + for ( MavenProject project : projects ) + { + if ( whiteList.containsKey( project ) ) + { + filtered.add( project ); + } + } + + return filtered; + } + + @Override + public String toString() + { + return getSortedProjects().toString(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/GraphBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/GraphBuilder.java new file mode 100644 index 00000000..fb7c4f2a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/graph/GraphBuilder.java @@ -0,0 +1,31 @@ +package org.apache.maven.graph; + +/* + * 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.execution.MavenSession; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.model.building.Result; + +public interface GraphBuilder +{ + String HINT = "graphBuilder"; + + Result<? extends ProjectDependencyGraph> build( MavenSession session ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java new file mode 100644 index 00000000..26a8ddae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java @@ -0,0 +1,271 @@ +package org.apache.maven.internal.aether; + +/* + * 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; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Properties; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.bridge.MavenRepositorySystem; +import org.apache.maven.eventspy.internal.EventSpyDispatcher; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Server; +import org.apache.maven.settings.building.SettingsProblem; +import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest; +import org.apache.maven.settings.crypto.SettingsDecrypter; +import org.apache.maven.settings.crypto.SettingsDecryptionResult; +import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.eclipse.aether.ConfigurationProperties; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.NoLocalRepositoryManagerException; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.resolution.ResolutionErrorPolicy; +import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; +import org.eclipse.aether.util.repository.AuthenticationBuilder; +import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; +import org.eclipse.aether.util.repository.DefaultMirrorSelector; +import org.eclipse.aether.util.repository.DefaultProxySelector; +import org.eclipse.aether.util.repository.SimpleResolutionErrorPolicy; +import org.eclipse.sisu.Nullable; + +/** + * @since 3.3.0 + */ +@Named +public class DefaultRepositorySystemSessionFactory +{ + @Inject + private Logger logger; + + @Inject + private ArtifactHandlerManager artifactHandlerManager; + + @Inject + private RepositorySystem repoSystem; + + @Inject + @Nullable + @Named( "simple" ) + private LocalRepositoryManagerFactory simpleLocalRepoMgrFactory; + + @Inject + @Nullable + @Named( "ide" ) + private WorkspaceReader workspaceRepository; + + @Inject + private SettingsDecrypter settingsDecrypter; + + @Inject + private EventSpyDispatcher eventSpyDispatcher; + + @Inject + MavenRepositorySystem mavenRepositorySystem; + + public DefaultRepositorySystemSession newRepositorySession( MavenExecutionRequest request ) + { + DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); + + session.setCache( request.getRepositoryCache() ); + + Map<Object, Object> configProps = new LinkedHashMap<Object, Object>(); + configProps.put( ConfigurationProperties.USER_AGENT, getUserAgent() ); + configProps.put( ConfigurationProperties.INTERACTIVE, request.isInteractiveMode() ); + configProps.putAll( request.getSystemProperties() ); + configProps.putAll( request.getUserProperties() ); + + session.setOffline( request.isOffline() ); + session.setChecksumPolicy( request.getGlobalChecksumPolicy() ); + if ( request.isNoSnapshotUpdates() ) + { + session.setUpdatePolicy( RepositoryPolicy.UPDATE_POLICY_NEVER ); + } + else if ( request.isUpdateSnapshots() ) + { + session.setUpdatePolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); + } + else + { + session.setUpdatePolicy( null ); + } + + int errorPolicy = 0; + errorPolicy |= request.isCacheNotFound() ? ResolutionErrorPolicy.CACHE_NOT_FOUND : 0; + errorPolicy |= request.isCacheTransferError() ? ResolutionErrorPolicy.CACHE_TRANSFER_ERROR : 0; + session.setResolutionErrorPolicy( new SimpleResolutionErrorPolicy( errorPolicy, errorPolicy + | ResolutionErrorPolicy.CACHE_NOT_FOUND ) ); + + session.setArtifactTypeRegistry( RepositoryUtils.newArtifactTypeRegistry( artifactHandlerManager ) ); + + LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() ); + + if ( request.isUseLegacyLocalRepository() ) + { + logger.warn( "Disabling enhanced local repository: using legacy is strongly discouraged to ensure" + + " build reproducibility." ); + try + { + session.setLocalRepositoryManager( simpleLocalRepoMgrFactory.newInstance( session, localRepo ) ); + } + catch ( NoLocalRepositoryManagerException e ) + { + + logger.warn( "Failed to configure legacy local repository: back to default" ); + session.setLocalRepositoryManager( repoSystem.newLocalRepositoryManager( session, localRepo ) ); + } + } + else + { + session.setLocalRepositoryManager( repoSystem.newLocalRepositoryManager( session, localRepo ) ); + } + + if ( request.getWorkspaceReader() != null ) + { + session.setWorkspaceReader( request.getWorkspaceReader() ); + } + else + { + session.setWorkspaceReader( workspaceRepository ); + } + + DefaultSettingsDecryptionRequest decrypt = new DefaultSettingsDecryptionRequest(); + decrypt.setProxies( request.getProxies() ); + decrypt.setServers( request.getServers() ); + SettingsDecryptionResult decrypted = settingsDecrypter.decrypt( decrypt ); + + if ( logger.isDebugEnabled() ) + { + for ( SettingsProblem problem : decrypted.getProblems() ) + { + logger.debug( problem.getMessage(), problem.getException() ); + } + } + + DefaultMirrorSelector mirrorSelector = new DefaultMirrorSelector(); + for ( Mirror mirror : request.getMirrors() ) + { + mirrorSelector.add( mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirror.getMirrorOf(), + mirror.getMirrorOfLayouts() ); + } + session.setMirrorSelector( mirrorSelector ); + + DefaultProxySelector proxySelector = new DefaultProxySelector(); + for ( Proxy proxy : decrypted.getProxies() ) + { + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.addUsername( proxy.getUsername() ).addPassword( proxy.getPassword() ); + proxySelector.add( new org.eclipse.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), + proxy.getPort(), authBuilder.build() ), + proxy.getNonProxyHosts() ); + } + session.setProxySelector( proxySelector ); + + DefaultAuthenticationSelector authSelector = new DefaultAuthenticationSelector(); + for ( Server server : decrypted.getServers() ) + { + AuthenticationBuilder authBuilder = new AuthenticationBuilder(); + authBuilder.addUsername( server.getUsername() ).addPassword( server.getPassword() ); + authBuilder.addPrivateKey( server.getPrivateKey(), server.getPassphrase() ); + authSelector.add( server.getId(), authBuilder.build() ); + + if ( server.getConfiguration() != null ) + { + Xpp3Dom dom = (Xpp3Dom) server.getConfiguration(); + for ( int i = dom.getChildCount() - 1; i >= 0; i-- ) + { + Xpp3Dom child = dom.getChild( i ); + if ( "wagonProvider".equals( child.getName() ) ) + { + dom.removeChild( i ); + } + } + + XmlPlexusConfiguration config = new XmlPlexusConfiguration( dom ); + configProps.put( "aether.connector.wagon.config." + server.getId(), config ); + } + + configProps.put( "aether.connector.perms.fileMode." + server.getId(), server.getFilePermissions() ); + configProps.put( "aether.connector.perms.dirMode." + server.getId(), server.getDirectoryPermissions() ); + } + session.setAuthenticationSelector( authSelector ); + + session.setTransferListener( request.getTransferListener() ); + + session.setRepositoryListener( eventSpyDispatcher.chainListener( new LoggingRepositoryListener( logger ) ) ); + + session.setUserProperties( request.getUserProperties() ); + session.setSystemProperties( request.getSystemProperties() ); + session.setConfigProperties( configProps ); + + mavenRepositorySystem.injectMirror( request.getRemoteRepositories(), request.getMirrors() ); + mavenRepositorySystem.injectProxy( session, request.getRemoteRepositories() ); + mavenRepositorySystem.injectAuthentication( session, request.getRemoteRepositories() ); + + mavenRepositorySystem.injectMirror( request.getPluginArtifactRepositories(), request.getMirrors() ); + mavenRepositorySystem.injectProxy( session, request.getPluginArtifactRepositories() ); + mavenRepositorySystem.injectAuthentication( session, request.getPluginArtifactRepositories() ); + + return session; + } + + private String getUserAgent() + { + return "Apache-Maven/" + getMavenVersion() + " (Java " + System.getProperty( "java.version" ) + "; " + + System.getProperty( "os.name" ) + " " + System.getProperty( "os.version" ) + ")"; + } + + private String getMavenVersion() + { + Properties props = new Properties(); + + InputStream is = getClass().getResourceAsStream( "/META-INF/maven/org.apache.maven/maven-core/pom.properties" ); + if ( is != null ) + { + try + { + props.load( is ); + } + catch ( IOException e ) + { + logger.debug( "Failed to read Maven version", e ); + } + IOUtil.close( is ); + } + + return props.getProperty( "version", "unknown-version" ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java new file mode 100644 index 00000000..7b67c3bd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java @@ -0,0 +1,141 @@ +package org.apache.maven.internal.aether; + +/* + * 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.FileNotFoundException; + +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.transfer.MetadataNotFoundException; + +/** + * @author Benjamin Bentmann + */ +class LoggingRepositoryListener + extends AbstractRepositoryListener +{ + + private final Logger logger; + + public LoggingRepositoryListener( Logger logger ) + { + this.logger = logger; + } + + @Override + public void artifactInstalling( RepositoryEvent event ) + { + logger.info( "Installing " + event.getArtifact().getFile() + " to " + event.getFile() ); + } + + @Override + public void metadataInstalling( RepositoryEvent event ) + { + logger.debug( "Installing " + event.getMetadata() + " to " + event.getFile() ); + } + + @Override + public void metadataResolved( RepositoryEvent event ) + { + Exception e = event.getException(); + if ( e != null ) + { + if ( e instanceof MetadataNotFoundException ) + { + logger.debug( e.getMessage() ); + } + else if ( logger.isDebugEnabled() ) + { + logger.warn( e.getMessage(), e ); + } + else + { + logger.warn( e.getMessage() ); + } + } + } + + @Override + public void metadataInvalid( RepositoryEvent event ) + { + Exception exception = event.getException(); + + StringBuilder buffer = new StringBuilder( 256 ); + buffer.append( "The metadata " ); + if ( event.getMetadata().getFile() != null ) + { + buffer.append( event.getMetadata().getFile() ); + } + else + { + buffer.append( event.getMetadata() ); + } + + if ( exception instanceof FileNotFoundException ) + { + buffer.append( " is inaccessible" ); + } + else + { + buffer.append( " is invalid" ); + } + + if ( exception != null ) + { + buffer.append( ": " ); + buffer.append( exception.getMessage() ); + } + + if ( logger.isDebugEnabled() ) + { + logger.warn( buffer.toString(), exception ); + } + else + { + logger.warn( buffer.toString() ); + } + } + + @Override + public void artifactDescriptorInvalid( RepositoryEvent event ) + { + StringBuilder buffer = new StringBuilder( 256 ); + buffer.append( "The POM for " ); + buffer.append( event.getArtifact() ); + buffer.append( " is invalid, transitive dependencies (if any) will not be available" ); + + if ( logger.isDebugEnabled() ) + { + logger.warn( buffer + ": " + event.getException().getMessage() ); + } + else + { + logger.warn( buffer + ", enable debug logging for more details" ); + } + } + + @Override + public void artifactDescriptorMissing( RepositoryEvent event ) + { + logger.warn( "The POM for " + event.getArtifact() + " is missing, no dependency information available" ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java new file mode 100644 index 00000000..6f994b3d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -0,0 +1,177 @@ +package org.apache.maven.lifecycle; + +/* + * 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.execution.MavenSession; +import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator; +import org.apache.maven.lifecycle.internal.LifecycleStarter; +import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator; +import org.apache.maven.lifecycle.internal.MojoDescriptorCreator; +import org.apache.maven.lifecycle.internal.MojoExecutor; +import org.apache.maven.lifecycle.internal.ProjectIndex; +import org.apache.maven.lifecycle.internal.TaskSegment; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * A facade that provides lifecycle services to components outside maven core. + * + * Note that this component is not normally used from within core itself. + * + * @author Jason van Zyl + * @author Benjamin Bentmann + * @author Kristian Rosenvold + */ +@Component( role = LifecycleExecutor.class ) +public class DefaultLifecycleExecutor + implements LifecycleExecutor +{ + + @Requirement + private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer; + + @Requirement + private DefaultLifecycles defaultLifeCycles; + + @Requirement + private LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator; + + @Requirement + private LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator; + + @Requirement + private MojoExecutor mojoExecutor; + + @Requirement + private LifecycleStarter lifecycleStarter; + + + public void execute( MavenSession session ) + { + lifecycleStarter.execute( session ); + } + + @Requirement + private MojoDescriptorCreator mojoDescriptorCreator; + + // These methods deal with construction intact Plugin object that look like they come from a standard + // <plugin/> block in a Maven POM. We have to do some wiggling to pull the sources of information + // together and this really shows the problem of constructing a sensible default configuration but + // it's all encapsulated here so it appears normalized to the POM builder. + + // We are going to take the project packaging and find all plugin in the default lifecycle and create + // fully populated Plugin objects, including executions with goals and default configuration taken + // from the plugin.xml inside a plugin. + // + // TODO: This whole method could probably removed by injecting lifeCyclePluginAnalyzer straight into client site. + // TODO: But for some reason the whole plexus appcontext refuses to start when I try this. + + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) + { + return lifeCyclePluginAnalyzer.getPluginsBoundByDefaultToAllLifecycles( packaging ); + } + + // USED BY MAVEN HELP PLUGIN + + @Deprecated + public Map<String, Lifecycle> getPhaseToLifecycleMap() + { + return defaultLifeCycles.getPhaseToLifecycleMap(); + } + + // NOTE: Backward-compat with maven-help-plugin:2.1 + + @SuppressWarnings( { "UnusedDeclaration" } ) + MojoDescriptor getMojoDescriptor( String task, MavenSession session, MavenProject project, String invokedVia, + boolean canUsePrefix, boolean isOptionalMojo ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException + { + return mojoDescriptorCreator.getMojoDescriptor( task, session, project ); + } + + // Used by m2eclipse + + @SuppressWarnings( { "UnusedDeclaration" } ) + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, boolean setup, String... tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, + PluginVersionResolutionException + { + List<TaskSegment> taskSegments = + lifecycleTaskSegmentCalculator.calculateTaskSegments( session, Arrays.asList( tasks ) ); + + TaskSegment mergedSegment = new TaskSegment( false ); + + for ( TaskSegment taskSegment : taskSegments ) + { + mergedSegment.getTasks().addAll( taskSegment.getTasks() ); + } + + return lifecycleExecutionPlanCalculator.calculateExecutionPlan( session, session.getCurrentProject(), + mergedSegment.getTasks(), setup ); + } + + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, + PluginVersionResolutionException + { + return calculateExecutionPlan( session, true, tasks ); + } + + // Site 3.x + public void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + lifecycleExecutionPlanCalculator.calculateForkedExecutions( mojoExecution, session ); + } + + // Site 3.x + public List<MavenProject> executeForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + throws LifecycleExecutionException + { + return mojoExecutor.executeForkedExecutions( mojoExecution, session, + new ProjectIndex( session.getProjects() ) ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java new file mode 100644 index 00000000..64c9a7f9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java @@ -0,0 +1,144 @@ +package org.apache.maven.lifecycle; + +/* + * 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.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; + +import com.google.common.base.Preconditions; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @since 3.0 + * @author Jason van Zyl + * @author Kristian Rosenvold + */ +// TODO: The configuration for the lifecycle needs to be externalized so that I can use the annotations properly for the +// wiring and reference and external source for the lifecycle configuration. +@Component( role = DefaultLifecycles.class ) +public class DefaultLifecycles +{ + public static final String[] STANDARD_LIFECYCLES = { "default", "clean", "site" }; + + // @Configuration(source="org/apache/maven/lifecycle/lifecycles.xml") + + @Requirement( role = Lifecycle.class ) + private Map<String, Lifecycle> lifecycles; + + @Requirement + private Logger logger; + + public DefaultLifecycles() + { + } + + public DefaultLifecycles( Map<String, Lifecycle> lifecycles, Logger logger ) + { + this.lifecycles = new LinkedHashMap<String, Lifecycle>(); + this.logger = logger; + this.lifecycles = lifecycles; + } + + public Lifecycle get( String key ) + { + return getPhaseToLifecycleMap().get( key ); + } + + /** + * We use this to map all phases to the lifecycle that contains it. This is used so that a user can specify the + * phase they want to execute and we can easily determine what lifecycle we need to run. + * + * @return A map of lifecycles, indexed on id + */ + public Map<String, Lifecycle> getPhaseToLifecycleMap() + { + // If people are going to make their own lifecycles then we need to tell people how to namespace them correctly + // so that they don't interfere with internally defined lifecycles. + + HashMap<String, Lifecycle> phaseToLifecycleMap = new HashMap<String, Lifecycle>(); + + for ( Lifecycle lifecycle : getLifeCycles() ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( "Lifecycle " + lifecycle ); + } + + for ( String phase : lifecycle.getPhases() ) + { + // The first definition wins. + if ( !phaseToLifecycleMap.containsKey( phase ) ) + { + phaseToLifecycleMap.put( phase, lifecycle ); + } + else + { + Lifecycle original = phaseToLifecycleMap.get( phase ); + logger.warn( "Duplicated lifecycle phase " + phase + ". Defined in " + original.getId() + + " but also in " + lifecycle.getId() ); + } + } + } + + return phaseToLifecycleMap; + } + + public List<Lifecycle> getLifeCycles() + { + // ensure canonical order of standard lifecycles + Map<String, Lifecycle> lifecycles = new LinkedHashMap<String, Lifecycle>( this.lifecycles ); + + LinkedHashSet<String> lifecycleNames = new LinkedHashSet<String>( Arrays.asList( STANDARD_LIFECYCLES ) ); + lifecycleNames.addAll( lifecycles.keySet() ); + + ArrayList<Lifecycle> result = new ArrayList<Lifecycle>(); + for ( String name : lifecycleNames ) + { + Lifecycle lifecycle = lifecycles.get( name ); + Preconditions.checkNotNull( "A lifecycle must have an id.", lifecycle.getId() ); + result.add( lifecycle ); + } + + return result; + } + + public String getLifecyclePhaseList() + { + Set<String> phases = new LinkedHashSet<String>(); + + for ( Lifecycle lifecycle : getLifeCycles() ) + { + phases.addAll( lifecycle.getPhases() ); + } + + return StringUtils.join( phases.iterator(), ", " ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java new file mode 100644 index 00000000..ed07c1d5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java @@ -0,0 +1,32 @@ +package org.apache.maven.lifecycle; + +/* + * 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.Set; +import org.apache.maven.model.Plugin; + +/** + * @since 3.0 + * @author Kristian Rosenvold + */ +public interface LifeCyclePluginAnalyzer +{ + Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java new file mode 100644 index 00000000..fcfde951 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java @@ -0,0 +1,80 @@ +package org.apache.maven.lifecycle; + +/* + * 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.Map; + +/** + * Class Lifecycle. + */ +public class Lifecycle +{ + public Lifecycle() + { + } + + public Lifecycle( String id, List<String> phases, Map<String, String> defaultPhases ) + { + this.id = id; + this.phases = phases; + this.defaultPhases = defaultPhases; + } + + // <lifecycle> + // <id>clean</id> + // <phases> + // <phase>pre-clean</phase> + // <phase>clean</phase> + // <phase>post-clean</phase> + // </phases> + // <default-phases> + // <clean>org.apache.maven.plugins:maven-clean-plugin:clean</clean> + // </default-phases> + // </lifecycle> + + private String id; + + private List<String> phases; + + private Map<String, String> defaultPhases; + + public String getId() + { + return this.id; + } + + public List<String> getPhases() + { + return this.phases; + } + + public Map<String, String> getDefaultPhases() + { + return defaultPhases; + } + + @Override + public String toString() + { + return id + " -> " + phases; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java new file mode 100644 index 00000000..349576cd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java @@ -0,0 +1,111 @@ +package org.apache.maven.lifecycle; + +/* + * 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.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; + +/** + * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> + */ +public class LifecycleExecutionException + extends Exception +{ + private MavenProject project; + + public LifecycleExecutionException( String message ) + { + super( message ); + } + + public LifecycleExecutionException( Throwable cause ) + { + super( cause ); + } + + public LifecycleExecutionException( String message, Throwable cause ) + { + super( message, cause ); + } + + public LifecycleExecutionException( String message, MavenProject project ) + { + super( message ); + this.project = project; + } + + public LifecycleExecutionException( String message, MojoExecution execution, MavenProject project ) + { + super( message ); + this.project = project; + } + + public LifecycleExecutionException( String message, MojoExecution execution, MavenProject project, Throwable cause ) + { + super( message, cause ); + this.project = project; + } + + public LifecycleExecutionException( MojoExecution execution, MavenProject project, Throwable cause ) + { + this( createMessage( execution, project, cause ), execution, project, cause ); + } + + public MavenProject getProject() + { + return project; + } + + private static String createMessage( MojoExecution execution, MavenProject project, Throwable cause ) + { + StringBuilder buffer = new StringBuilder( 256 ); + + buffer.append( "Failed to execute goal" ); + + if ( execution != null ) + { + buffer.append( ' ' ); + buffer.append( execution.getGroupId() ); + buffer.append( ':' ); + buffer.append( execution.getArtifactId() ); + buffer.append( ':' ); + buffer.append( execution.getVersion() ); + buffer.append( ':' ); + buffer.append( execution.getGoal() ); + buffer.append( " (" ); + buffer.append( execution.getExecutionId() ); + buffer.append( ")" ); + } + + if ( project != null ) + { + buffer.append( " on project " ); + buffer.append( project.getArtifactId() ); + } + + if ( cause != null ) + { + buffer.append( ": " ).append( cause.getMessage() ); + } + + return buffer.toString(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java new file mode 100644 index 00000000..04c602cf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java @@ -0,0 +1,89 @@ +package org.apache.maven.lifecycle; + +/* + * 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.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; + +import java.util.List; +import java.util.Set; + +/** + * A facade that provides lifecycle services to components outside Maven core. + * + * @author Jason van Zyl + */ +public interface LifecycleExecutor +{ + + // USED BY MAVEN HELP PLUGIN + @Deprecated + String ROLE = LifecycleExecutor.class.getName(); + + // For a given project packaging find all the plugins that are bound to any registered + // lifecycles. The project builder needs to now what default plugin information needs to be + // merged into POM being built. Once the POM builder has this plugin information, versions can be assigned + // by the POM builder because they will have to be defined in plugin management. Once this is setComplete then it + // can be passed back so that the default configuration information can be populated. + // + // We need to know the specific version so that we can lookup the right version of the plugin descriptor + // which tells us what the default configuration is. + // + + /** + * @return The plugins bound to the lifecycles of the specified packaging or {@code null} if the packaging is + * unknown. + */ + Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ); + + MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, + PluginVersionResolutionException; + + MavenExecutionPlan calculateExecutionPlan( MavenSession session, boolean setup, String... tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, + PluginVersionResolutionException; + + void execute( MavenSession session ); + + // used by the site plugin 3.x + void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException; + + // used by the site plugin 3.x + List<MavenProject> executeForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + throws LifecycleExecutionException; +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleMappingDelegate.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleMappingDelegate.java new file mode 100644 index 00000000..f0701987 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleMappingDelegate.java @@ -0,0 +1,52 @@ +package org.apache.maven.lifecycle; + +/* + * 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.Map; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.project.MavenProject; + +/** + * Lifecycle mapping delegate component interface. Calculates project build execution plan given {@link Lifecycle} and + * lifecycle phase. Standard lifecycles use plugin execution {@code <phase>} or mojo default lifecycle phase to + * calculate the execution plan, but custom lifecycles can use alternative mapping strategies. + * <p> + * Implementations of this interface must be annotated with either {@code @Named("lifecycle-id")} or equivalent plexus + * {@code @Component} annotations. + * + * @since 3.2.0 + * @see org.apache.maven.lifecycle.internal.DefaultLifecycleMappingDelegate + * @author ifedorenko + */ +public interface LifecycleMappingDelegate +{ + Map<String, List<MojoExecution>> calculateLifecycleMappings( MavenSession session, MavenProject project, + Lifecycle lifecycle, String lifecyclePhase ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException; +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleNotFoundException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleNotFoundException.java new file mode 100644 index 00000000..e9ff0c20 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleNotFoundException.java @@ -0,0 +1,54 @@ +package org.apache.maven.lifecycle; + +/* + * 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. + */ + +/** + * Signals a failure to locate a lifecycle. + * + * @author Benjamin Bentmann + */ +public class LifecycleNotFoundException + extends Exception +{ + + private final String lifecycleId; + + /** + * Creates a new exception to indicate that the specified lifecycle is unknown. + * + * @param lifecycleId The identifier of the lifecycle that could not be located, may be {@code null}. + */ + public LifecycleNotFoundException( String lifecycleId ) + { + super( "Unknown lifecycle " + lifecycleId ); + this.lifecycleId = ( lifecycleId != null ) ? lifecycleId : ""; + } + + /** + * Gets the identifier of the lifecycle that was not found. + * + * @return The identifier of the lifecycle that was not found, never {@code null}. + */ + public String getLifecycleId() + { + return lifecycleId; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecyclePhaseNotFoundException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecyclePhaseNotFoundException.java new file mode 100644 index 00000000..fab1d2f2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/LifecyclePhaseNotFoundException.java @@ -0,0 +1,55 @@ +package org.apache.maven.lifecycle; + +/* + * 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. + */ + +/** + * Signals a failure to locate the lifecycle for some phase. + * + * @author Benjamin Bentmann + */ +public class LifecyclePhaseNotFoundException + extends Exception +{ + + private final String lifecyclePhase; + + /** + * Creates a new exception to indicate that the specified lifecycle phase is not defined by any known lifecycle. + * + * @param message The detail message, may be {@code null}. + * @param lifecyclePhase The name of the lifecycle phase that could not be located, may be {@code null}. + */ + public LifecyclePhaseNotFoundException( String message, String lifecyclePhase ) + { + super( message ); + this.lifecyclePhase = ( lifecyclePhase != null ) ? lifecyclePhase : ""; + } + + /** + * Gets the lifecycle phase that was not found. + * + * @return The lifecycle phase that was not found, never {@code null}. + */ + public String getLifecyclePhase() + { + return lifecyclePhase; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MavenExecutionPlan.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MavenExecutionPlan.java new file mode 100644 index 00000000..7767ea25 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MavenExecutionPlan.java @@ -0,0 +1,202 @@ +package org.apache.maven.lifecycle; + +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.lifecycle.internal.ExecutionPlanItem; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.descriptor.MojoDescriptor; + +//TODO: lifecycles being executed +//TODO: what runs in each phase +//TODO: plugins that need downloading +//TODO: project dependencies that need downloading +//TODO: unfortunately the plugins need to be downloaded in order to get the plugin.xml file. need to externalize this +// from the plugin archive. +//TODO: this will be the class that people get in IDEs to modify + +public class MavenExecutionPlan + implements Iterable<ExecutionPlanItem> +{ + + /* + At the moment, this class is totally immutable, and this is in line with thoughts about the + pre-calculated execution plan that stays the same during the execution. + + If deciding to add mutable state to this class, it should be at least considered to + separate this into a separate mutable structure. + + */ + + private final List<ExecutionPlanItem> planItem; + + private final Map<String, ExecutionPlanItem> lastMojoExecutionForAllPhases; + + final List<String> phasesInExecutionPlan; + + public MavenExecutionPlan( List<ExecutionPlanItem> planItem, DefaultLifecycles defaultLifecycles ) + { + this.planItem = planItem; + + lastMojoExecutionForAllPhases = new LinkedHashMap<String, ExecutionPlanItem>(); + + LinkedHashSet<String> totalPhaseSet = new LinkedHashSet<String>(); + if ( defaultLifecycles != null ) + { + for ( String phase : getDistinctPhasesInOrderOfExecutionPlanAppearance( planItem ) ) + { + final Lifecycle lifecycle = defaultLifecycles.get( phase ); + if ( lifecycle != null ) + { + totalPhaseSet.addAll( lifecycle.getPhases() ); + } + } + } + this.phasesInExecutionPlan = new ArrayList<String>( totalPhaseSet ); + + Map<String, ExecutionPlanItem> lastInExistingPhases = new HashMap<String, ExecutionPlanItem>(); + for ( ExecutionPlanItem executionPlanItem : getExecutionPlanItems() ) + { + lastInExistingPhases.put( executionPlanItem.getLifecyclePhase(), executionPlanItem ); + } + + ExecutionPlanItem lastSeenExecutionPlanItem = null; + + for ( String phase : totalPhaseSet ) + { + ExecutionPlanItem forThisPhase = lastInExistingPhases.get( phase ); + if ( forThisPhase != null ) + { + lastSeenExecutionPlanItem = forThisPhase; + } + + lastMojoExecutionForAllPhases.put( phase, lastSeenExecutionPlanItem ); + } + } + + public Iterator<ExecutionPlanItem> iterator() + { + return getExecutionPlanItems().iterator(); + } + + /** + * Returns the last ExecutionPlanItem in the supplied phase. If no items are in the specified phase, + * the closest executionPlanItem from an earlier phase item will be returned. + * + * @param requestedPhase the requested phase + * The execution plan item + * @return The ExecutionPlanItem or null if none can be found + */ + public ExecutionPlanItem findLastInPhase( String requestedPhase ) + { + return lastMojoExecutionForAllPhases.get( requestedPhase ); + } + + private List<ExecutionPlanItem> getExecutionPlanItems() + { + return planItem; + } + + private static Iterable<String> getDistinctPhasesInOrderOfExecutionPlanAppearance( + List<ExecutionPlanItem> planItems ) + { + LinkedHashSet<String> result = new LinkedHashSet<String>(); + for ( ExecutionPlanItem executionPlanItem : planItems ) + { + final String phase = executionPlanItem.getLifecyclePhase(); + if ( !result.contains( phase ) ) + { + result.add( phase ); + } + } + return result; + } + + public List<MojoExecution> getMojoExecutions() + { + List<MojoExecution> result = new ArrayList<MojoExecution>(); + for ( ExecutionPlanItem executionPlanItem : planItem ) + { + result.add( executionPlanItem.getMojoExecution() ); + } + return result; + } + + /** + * Get set of plugins having a goal/mojo used but not marked @threadSafe + * + * @return the set of plugins (without info on which goal is concerned) + */ + public Set<Plugin> getNonThreadSafePlugins() + { + Set<Plugin> plugins = new HashSet<Plugin>(); + for ( ExecutionPlanItem executionPlanItem : planItem ) + { + final MojoExecution mojoExecution = executionPlanItem.getMojoExecution(); + if ( !mojoExecution.getMojoDescriptor().isThreadSafe() ) + { + plugins.add( mojoExecution.getPlugin() ); + } + } + return plugins; + } + + /** + * Get set of mojos used but not marked @threadSafe + * + * @return the set of mojo descriptors + */ + public Set<MojoDescriptor> getNonThreadSafeMojos() + { + Set<MojoDescriptor> mojos = new HashSet<MojoDescriptor>(); + for ( ExecutionPlanItem executionPlanItem : planItem ) + { + final MojoExecution mojoExecution = executionPlanItem.getMojoExecution(); + if ( !mojoExecution.getMojoDescriptor().isThreadSafe() ) + { + mojos.add( mojoExecution.getMojoDescriptor() ); + } + } + return mojos; + } + + // Used by m2e but will be removed, really. + @Deprecated + public List<MojoExecution> getExecutions() + { + return getMojoExecutions(); + } + + public int size() + { + return planItem.size(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MissingProjectException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MissingProjectException.java new file mode 100644 index 00000000..571e1d2b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MissingProjectException.java @@ -0,0 +1,41 @@ +package org.apache.maven.lifecycle; + +/* + * 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. + */ + +/** + * Signals a failure to execute a lifecycle phase or mojo because a project is required but not present. + * + * @author Benjamin Bentmann + */ +public class MissingProjectException + extends Exception +{ + + /** + * Creates a new exception. + * + * @param message The detail message, may be {@code null}. + */ + public MissingProjectException( String message ) + { + super( message ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MojoExecutionConfigurator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MojoExecutionConfigurator.java new file mode 100644 index 00000000..b85bac77 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/MojoExecutionConfigurator.java @@ -0,0 +1,44 @@ +package org.apache.maven.lifecycle; + +/* + * 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.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; + +/** + * A MojoExecutionConfigurator is responsible for creating the configuration for Mojo based on configuration for a Mojo + * in the MavenProject and the default configuration for the Mojo from the containing plugin's plugin.xml descriptor. + * + * @provisional + * @author Jason van Zyl + * @since 3.3.1, MNG-5753 + */ +public interface MojoExecutionConfigurator +{ + /** + * Create the MojoExecution configuration based on configuration for a Mojo in the MavenProject and the + * default configuration for the Mojo from the containing plugin's plugin.xml descriptor. + * + * @param project + * @param mojoExecution + * @param allowPluginLevelConfig + */ + void configure( MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/NoGoalSpecifiedException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/NoGoalSpecifiedException.java new file mode 100644 index 00000000..2ac9638a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/NoGoalSpecifiedException.java @@ -0,0 +1,41 @@ +package org.apache.maven.lifecycle; + +/* + * 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. + */ + +/** + * Signals a failure to build because no goal was specified. + * + * @author Benjamin Bentmann + */ +public class NoGoalSpecifiedException + extends Exception +{ + + /** + * Creates a new exception. + * + * @param message The detail message, may be {@code null}. + */ + public NoGoalSpecifiedException( String message ) + { + super( message ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java new file mode 100644 index 00000000..771385cc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java @@ -0,0 +1,67 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @since 3.0 + * @author Kristian Rosenvold + * This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = BuildListCalculator.class ) +public class BuildListCalculator +{ + public ProjectBuildList calculateProjectBuilds( MavenSession session, List<TaskSegment> taskSegments ) + { + List<ProjectSegment> projectBuilds = new ArrayList<ProjectSegment>(); + + MavenProject rootProject = session.getTopLevelProject(); + + for ( TaskSegment taskSegment : taskSegments ) + { + List<MavenProject> projects; + + if ( taskSegment.isAggregating() ) + { + projects = Collections.singletonList( rootProject ); + } + else + { + projects = session.getProjects(); + } + for ( MavenProject project : projects ) + { + BuilderCommon.attachToThread( project ); // Not totally sure if this is needed for anything + MavenSession copiedSession = session.clone(); + copiedSession.setCurrentProject( project ); + projectBuilds.add( new ProjectSegment( project, taskSegment, copiedSession ) ); + } + } + return new ProjectBuildList( projectBuilds ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildThreadFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildThreadFactory.java new file mode 100644 index 00000000..01545078 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildThreadFactory.java @@ -0,0 +1,39 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Simple {@link ThreadFactory} implementation that ensures the corresponding threads have a meaningful name. + */ +public class BuildThreadFactory + implements ThreadFactory +{ + private final AtomicInteger id = new AtomicInteger(); + + private static final String PREFIX = "BuilderThread"; + + public Thread newThread( Runnable r ) + { + return new Thread( r, String.format( "%s %d", PREFIX, id.getAndIncrement() ) ); + } +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/CompoundProjectExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/CompoundProjectExecutionListener.java new file mode 100644 index 00000000..f2a8291a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/CompoundProjectExecutionListener.java @@ -0,0 +1,72 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.ProjectExecutionEvent; +import org.apache.maven.execution.ProjectExecutionListener; +import org.apache.maven.lifecycle.LifecycleExecutionException; + +class CompoundProjectExecutionListener + implements ProjectExecutionListener +{ + private final Collection<ProjectExecutionListener> listeners; + + public CompoundProjectExecutionListener( Collection<ProjectExecutionListener> listeners ) + { + this.listeners = listeners; // NB this is live injected collection + } + + public void beforeProjectExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.beforeProjectExecution( event ); + } + } + + public void beforeProjectLifecycleExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.beforeProjectLifecycleExecution( event ); + } + } + + public void afterProjectExecutionSuccess( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.afterProjectExecutionSuccess( event ); + } + } + + public void afterProjectExecutionFailure( ProjectExecutionEvent event ) + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.afterProjectExecutionFailure( event ); + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEvent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEvent.java new file mode 100644 index 00000000..9434a659 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEvent.java @@ -0,0 +1,77 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.ExecutionEvent; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; + +/** + * Holds data relevant for an execution event. + * + * @author Benjamin Bentmann + */ +class DefaultExecutionEvent + implements ExecutionEvent +{ + + private final Type type; + + private final MavenSession session; + + private final MojoExecution mojoExecution; + + private final Exception exception; + + public DefaultExecutionEvent( Type type, MavenSession session, MojoExecution mojoExecution, Exception exception ) + { + this.type = type; + this.session = session; + this.mojoExecution = mojoExecution; + this.exception = exception; + } + + public Type getType() + { + return type; + } + + public MavenSession getSession() + { + return session; + } + + public MavenProject getProject() + { + return session.getCurrentProject(); + } + + public MojoExecution getMojoExecution() + { + return mojoExecution; + } + + public Exception getException() + { + return exception; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult.java new file mode 100644 index 00000000..bfb98d43 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultExecutionEventCatapult.java @@ -0,0 +1,119 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.ExecutionEvent; +import org.apache.maven.execution.ExecutionListener; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecution; +import org.codehaus.plexus.component.annotations.Component; + +/** + * Assists in firing execution events. <strong>Warning:</strong> This is an internal utility class that is only public + * for technical reasons, it is not part of the public API. In particular, this class can be changed or deleted without + * prior notice. + * + * @author Benjamin Bentmann + */ +@Component( role = ExecutionEventCatapult.class ) +public class DefaultExecutionEventCatapult + implements ExecutionEventCatapult +{ + + public void fire( ExecutionEvent.Type eventType, MavenSession session, MojoExecution mojoExecution ) + { + fire( eventType, session, mojoExecution, null ); + } + + public void fire( ExecutionEvent.Type eventType, MavenSession session, MojoExecution mojoExecution, + Exception exception ) + { + ExecutionListener listener = session.getRequest().getExecutionListener(); + + if ( listener != null ) + { + ExecutionEvent event = new DefaultExecutionEvent( eventType, session, mojoExecution, exception ); + + switch ( eventType ) + { + case ProjectDiscoveryStarted: + listener.projectDiscoveryStarted( event ); + break; + + case SessionStarted: + listener.sessionStarted( event ); + break; + case SessionEnded: + listener.sessionEnded( event ); + break; + + case ProjectSkipped: + listener.projectSkipped( event ); + break; + case ProjectStarted: + listener.projectStarted( event ); + break; + case ProjectSucceeded: + listener.projectSucceeded( event ); + break; + case ProjectFailed: + listener.projectFailed( event ); + break; + + case MojoSkipped: + listener.mojoSkipped( event ); + break; + case MojoStarted: + listener.mojoStarted( event ); + break; + case MojoSucceeded: + listener.mojoSucceeded( event ); + break; + case MojoFailed: + listener.mojoFailed( event ); + break; + + case ForkStarted: + listener.forkStarted( event ); + break; + case ForkSucceeded: + listener.forkSucceeded( event ); + break; + case ForkFailed: + listener.forkFailed( event ); + break; + + case ForkedProjectStarted: + listener.forkedProjectStarted( event ); + break; + case ForkedProjectSucceeded: + listener.forkedProjectSucceeded( event ); + break; + case ForkedProjectFailed: + listener.forkedProjectFailed( event ); + break; + + default: + throw new IllegalStateException( "Unknown execution event type " + eventType ); + } + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java new file mode 100644 index 00000000..8cc47cc5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java @@ -0,0 +1,591 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.DefaultLifecycles; +import org.apache.maven.lifecycle.Lifecycle; +import org.apache.maven.lifecycle.LifecycleMappingDelegate; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.MojoExecutionConfigurator; +import org.apache.maven.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.Parameter; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.lifecycle.Execution; +import org.apache.maven.plugin.lifecycle.Phase; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolver; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +import com.google.common.collect.ImmutableMap; + +/** + * @since 3.0 + * @author Benjamin Bentmann + * @author Kristian Rosenvold (Extract class) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = LifecycleExecutionPlanCalculator.class ) +public class DefaultLifecycleExecutionPlanCalculator + implements LifecycleExecutionPlanCalculator +{ + @Requirement + private PluginVersionResolver pluginVersionResolver; + + @Requirement + private BuildPluginManager pluginManager; + + @Requirement + private DefaultLifecycles defaultLifeCycles; + + @Requirement + private MojoDescriptorCreator mojoDescriptorCreator; + + @Requirement + private LifecyclePluginResolver lifecyclePluginResolver; + + @Requirement( hint = DefaultLifecycleMappingDelegate.HINT ) + private LifecycleMappingDelegate standardDelegate; + + @Requirement + private Map<String, LifecycleMappingDelegate> delegates; + + @Requirement + private Map<String, MojoExecutionConfigurator> mojoExecutionConfigurators; + + @SuppressWarnings( { "UnusedDeclaration" } ) + public DefaultLifecycleExecutionPlanCalculator() + { + } + + // Only used for testing + public DefaultLifecycleExecutionPlanCalculator( BuildPluginManager pluginManager, + DefaultLifecycles defaultLifeCycles, + MojoDescriptorCreator mojoDescriptorCreator, + LifecyclePluginResolver lifecyclePluginResolver ) + { + this.pluginManager = pluginManager; + this.defaultLifeCycles = defaultLifeCycles; + this.mojoDescriptorCreator = mojoDescriptorCreator; + this.lifecyclePluginResolver = lifecyclePluginResolver; + this.mojoExecutionConfigurators = + ImmutableMap.of( "default", (MojoExecutionConfigurator) new DefaultMojoExecutionConfigurator() ); + } + + @Override + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks, + boolean setup ) + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException + { + lifecyclePluginResolver.resolveMissingPluginVersions( project, session ); + + final List<MojoExecution> executions = calculateMojoExecutions( session, project, tasks ); + + if ( setup ) + { + setupMojoExecutions( session, project, executions ); + } + + final List<ExecutionPlanItem> planItem = ExecutionPlanItem.createExecutionPlanItems( project, executions ); + + return new MavenExecutionPlan( planItem, defaultLifeCycles ); + } + + @Override + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks ) + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException + { + return calculateExecutionPlan( session, project, tasks, true ); + } + + private void setupMojoExecutions( MavenSession session, MavenProject project, List<MojoExecution> mojoExecutions ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + for ( MojoExecution mojoExecution : mojoExecutions ) + { + setupMojoExecution( session, project, mojoExecution ); + } + } + + @Override + public void setupMojoExecution( MavenSession session, MavenProject project, MojoExecution mojoExecution ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + if ( mojoDescriptor == null ) + { + mojoDescriptor = + pluginManager.getMojoDescriptor( mojoExecution.getPlugin(), mojoExecution.getGoal(), + project.getRemotePluginRepositories(), + session.getRepositorySession() ); + + mojoExecution.setMojoDescriptor( mojoDescriptor ); + } + + mojoExecutionConfigurator( mojoExecution ).configure( project, + mojoExecution, + MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) ); + + finalizeMojoConfiguration( mojoExecution ); + + calculateForkedExecutions( mojoExecution, session, project, new HashSet<MojoDescriptor>() ); + } + + public List<MojoExecution> calculateMojoExecutions( MavenSession session, MavenProject project, List<Object> tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException, LifecyclePhaseNotFoundException + { + final List<MojoExecution> mojoExecutions = new ArrayList<MojoExecution>(); + + for ( Object task : tasks ) + { + if ( task instanceof GoalTask ) + { + String pluginGoal = ( (GoalTask) task ).pluginGoal; + + String executionId = "default-cli"; + int executionIdx = pluginGoal.indexOf( '@' ); + if ( executionIdx > 0 ) + { + executionId = pluginGoal.substring( executionIdx + 1 ); + } + + MojoDescriptor mojoDescriptor = mojoDescriptorCreator.getMojoDescriptor( pluginGoal, session, project ); + + MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, executionId, + MojoExecution.Source.CLI ); + + mojoExecutions.add( mojoExecution ); + } + else if ( task instanceof LifecycleTask ) + { + String lifecyclePhase = ( (LifecycleTask) task ).getLifecyclePhase(); + + Map<String, List<MojoExecution>> phaseToMojoMapping = + calculateLifecycleMappings( session, project, lifecyclePhase ); + + for ( List<MojoExecution> mojoExecutionsFromLifecycle : phaseToMojoMapping.values() ) + { + mojoExecutions.addAll( mojoExecutionsFromLifecycle ); + } + } + else + { + throw new IllegalStateException( "unexpected task " + task ); + } + } + return mojoExecutions; + } + + private Map<String, List<MojoExecution>> calculateLifecycleMappings( MavenSession session, MavenProject project, + String lifecyclePhase ) + throws LifecyclePhaseNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException + { + /* + * Determine the lifecycle that corresponds to the given phase. + */ + + Lifecycle lifecycle = defaultLifeCycles.get( lifecyclePhase ); + + if ( lifecycle == null ) + { + throw new LifecyclePhaseNotFoundException( "Unknown lifecycle phase \"" + lifecyclePhase + + "\". You must specify a valid lifecycle phase" + " or a goal in the format <plugin-prefix>:<goal> or" + + " <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: " + + defaultLifeCycles.getLifecyclePhaseList() + ".", lifecyclePhase ); + } + + LifecycleMappingDelegate delegate; + if ( Arrays.binarySearch( DefaultLifecycles.STANDARD_LIFECYCLES, lifecycle.getId() ) >= 0 ) + { + delegate = standardDelegate; + } + else + { + delegate = delegates.get( lifecycle.getId() ); + if ( delegate == null ) + { + delegate = standardDelegate; + } + } + + return delegate.calculateLifecycleMappings( session, project, lifecycle, lifecyclePhase ); + } + + /** + * Post-processes the effective configuration for the specified mojo execution. This step discards all parameters + * from the configuration that are not applicable to the mojo and injects the default values for any missing + * parameters. + * + * @param mojoExecution The mojo execution whose configuration should be finalized, must not be {@code null}. + */ + private void finalizeMojoConfiguration( MojoExecution mojoExecution ) + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + Xpp3Dom executionConfiguration = mojoExecution.getConfiguration(); + if ( executionConfiguration == null ) + { + executionConfiguration = new Xpp3Dom( "configuration" ); + } + + Xpp3Dom defaultConfiguration = getMojoConfiguration( mojoDescriptor ); + + Xpp3Dom finalConfiguration = new Xpp3Dom( "configuration" ); + + if ( mojoDescriptor.getParameters() != null ) + { + for ( Parameter parameter : mojoDescriptor.getParameters() ) + { + Xpp3Dom parameterConfiguration = executionConfiguration.getChild( parameter.getName() ); + + if ( parameterConfiguration == null ) + { + parameterConfiguration = executionConfiguration.getChild( parameter.getAlias() ); + } + + Xpp3Dom parameterDefaults = defaultConfiguration.getChild( parameter.getName() ); + + parameterConfiguration = Xpp3Dom.mergeXpp3Dom( parameterConfiguration, parameterDefaults, + Boolean.TRUE ); + + if ( parameterConfiguration != null ) + { + parameterConfiguration = new Xpp3Dom( parameterConfiguration, parameter.getName() ); + + if ( StringUtils.isEmpty( parameterConfiguration.getAttribute( "implementation" ) ) + && StringUtils.isNotEmpty( parameter.getImplementation() ) ) + { + parameterConfiguration.setAttribute( "implementation", parameter.getImplementation() ); + } + + finalConfiguration.addChild( parameterConfiguration ); + } + } + } + + mojoExecution.setConfiguration( finalConfiguration ); + } + + private Xpp3Dom getMojoConfiguration( MojoDescriptor mojoDescriptor ) + { + return MojoDescriptorCreator.convert( mojoDescriptor ); + } + + @Override + public void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + calculateForkedExecutions( mojoExecution, session, session.getCurrentProject(), new HashSet<MojoDescriptor>() ); + } + + private void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session, MavenProject project, + Collection<MojoDescriptor> alreadyForkedExecutions ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + if ( !mojoDescriptor.isForking() ) + { + return; + } + + if ( !alreadyForkedExecutions.add( mojoDescriptor ) ) + { + return; + } + + List<MavenProject> forkedProjects = + LifecycleDependencyResolver.getProjects( project, session, mojoDescriptor.isAggregator() ); + + for ( MavenProject forkedProject : forkedProjects ) + { + if ( forkedProject != project ) + { + lifecyclePluginResolver.resolveMissingPluginVersions( forkedProject, session ); + } + + List<MojoExecution> forkedExecutions; + + if ( StringUtils.isNotEmpty( mojoDescriptor.getExecutePhase() ) ) + { + forkedExecutions = + calculateForkedLifecycle( mojoExecution, session, forkedProject, alreadyForkedExecutions ); + } + else + { + forkedExecutions = calculateForkedGoal( mojoExecution, session, forkedProject, + alreadyForkedExecutions ); + } + + mojoExecution.setForkedExecutions( BuilderCommon.getKey( forkedProject ), forkedExecutions ); + } + + alreadyForkedExecutions.remove( mojoDescriptor ); + } + + private List<MojoExecution> calculateForkedLifecycle( MojoExecution mojoExecution, MavenSession session, + MavenProject project, + Collection<MojoDescriptor> alreadyForkedExecutions ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + String forkedPhase = mojoDescriptor.getExecutePhase(); + + Map<String, List<MojoExecution>> lifecycleMappings = calculateLifecycleMappings( session, project, + forkedPhase ); + + for ( List<MojoExecution> forkedExecutions : lifecycleMappings.values() ) + { + for ( MojoExecution forkedExecution : forkedExecutions ) + { + if ( forkedExecution.getMojoDescriptor() == null ) + { + MojoDescriptor forkedMojoDescriptor = + pluginManager.getMojoDescriptor( forkedExecution.getPlugin(), forkedExecution.getGoal(), + project.getRemotePluginRepositories(), + session.getRepositorySession() ); + + forkedExecution.setMojoDescriptor( forkedMojoDescriptor ); + } + + mojoExecutionConfigurator( forkedExecution ).configure( project, forkedExecution, false ); + } + } + + injectLifecycleOverlay( lifecycleMappings, mojoExecution, session, project ); + + List<MojoExecution> mojoExecutions = new ArrayList<MojoExecution>(); + + for ( List<MojoExecution> forkedExecutions : lifecycleMappings.values() ) + { + for ( MojoExecution forkedExecution : forkedExecutions ) + { + if ( !alreadyForkedExecutions.contains( forkedExecution.getMojoDescriptor() ) ) + { + finalizeMojoConfiguration( forkedExecution ); + + calculateForkedExecutions( forkedExecution, session, project, alreadyForkedExecutions ); + + mojoExecutions.add( forkedExecution ); + } + } + } + + return mojoExecutions; + } + + private void injectLifecycleOverlay( Map<String, List<MojoExecution>> lifecycleMappings, + MojoExecution mojoExecution, MavenSession session, MavenProject project ) + throws PluginDescriptorParsingException, LifecycleNotFoundException, MojoNotFoundException, + PluginNotFoundException, PluginResolutionException, NoPluginFoundForPrefixException, + InvalidPluginDescriptorException, PluginVersionResolutionException + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor(); + + String forkedLifecycle = mojoDescriptor.getExecuteLifecycle(); + + if ( StringUtils.isEmpty( forkedLifecycle ) ) + { + return; + } + + org.apache.maven.plugin.lifecycle.Lifecycle lifecycleOverlay; + + try + { + lifecycleOverlay = pluginDescriptor.getLifecycleMapping( forkedLifecycle ); + } + catch ( IOException e ) + { + throw new PluginDescriptorParsingException( pluginDescriptor.getPlugin(), pluginDescriptor.getSource(), e ); + } + catch ( XmlPullParserException e ) + { + throw new PluginDescriptorParsingException( pluginDescriptor.getPlugin(), pluginDescriptor.getSource(), e ); + } + + if ( lifecycleOverlay == null ) + { + throw new LifecycleNotFoundException( forkedLifecycle ); + } + + for ( Phase phase : lifecycleOverlay.getPhases() ) + { + List<MojoExecution> forkedExecutions = lifecycleMappings.get( phase.getId() ); + + if ( forkedExecutions != null ) + { + for ( Execution execution : phase.getExecutions() ) + { + for ( String goal : execution.getGoals() ) + { + MojoDescriptor forkedMojoDescriptor; + + if ( goal.indexOf( ':' ) < 0 ) + { + forkedMojoDescriptor = pluginDescriptor.getMojo( goal ); + if ( forkedMojoDescriptor == null ) + { + throw new MojoNotFoundException( goal, pluginDescriptor ); + } + } + else + { + forkedMojoDescriptor = mojoDescriptorCreator.getMojoDescriptor( goal, session, project ); + } + + MojoExecution forkedExecution = + new MojoExecution( forkedMojoDescriptor, mojoExecution.getExecutionId() ); + + Xpp3Dom forkedConfiguration = (Xpp3Dom) execution.getConfiguration(); + + forkedExecution.setConfiguration( forkedConfiguration ); + + mojoExecutionConfigurator( forkedExecution ).configure( project, forkedExecution, true ); + + forkedExecutions.add( forkedExecution ); + } + } + + Xpp3Dom phaseConfiguration = (Xpp3Dom) phase.getConfiguration(); + + if ( phaseConfiguration != null ) + { + for ( MojoExecution forkedExecution : forkedExecutions ) + { + Xpp3Dom forkedConfiguration = forkedExecution.getConfiguration(); + + forkedConfiguration = Xpp3Dom.mergeXpp3Dom( phaseConfiguration, forkedConfiguration ); + + forkedExecution.setConfiguration( forkedConfiguration ); + } + } + } + } + } + + // org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process + // TODO: take repo mans into account as one may be aggregating prefixes of many + // TODO: collect at the root of the repository, read the one at the root, and fetch remote if something is missing + // or the user forces the issue + + private List<MojoExecution> calculateForkedGoal( MojoExecution mojoExecution, MavenSession session, + MavenProject project, + Collection<MojoDescriptor> alreadyForkedExecutions ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor(); + + String forkedGoal = mojoDescriptor.getExecuteGoal(); + + MojoDescriptor forkedMojoDescriptor = pluginDescriptor.getMojo( forkedGoal ); + if ( forkedMojoDescriptor == null ) + { + throw new MojoNotFoundException( forkedGoal, pluginDescriptor ); + } + + if ( alreadyForkedExecutions.contains( forkedMojoDescriptor ) ) + { + return Collections.emptyList(); + } + + MojoExecution forkedExecution = new MojoExecution( forkedMojoDescriptor, forkedGoal ); + + mojoExecutionConfigurator( forkedExecution ).configure( project, forkedExecution, true ); + + finalizeMojoConfiguration( forkedExecution ); + + calculateForkedExecutions( forkedExecution, session, project, alreadyForkedExecutions ); + + return Collections.singletonList( forkedExecution ); + } + + private MojoExecutionConfigurator mojoExecutionConfigurator( MojoExecution mojoExecution ) + { + String configuratorId = mojoExecution.getMojoDescriptor().getComponentConfigurator(); + if ( configuratorId == null ) + { + configuratorId = "default"; + } + + MojoExecutionConfigurator mojoExecutionConfigurator = mojoExecutionConfigurators.get( configuratorId ); + + if ( mojoExecutionConfigurator == null ) + { + // + // The plugin has a custom component configurator but does not have a custom mojo execution configurator + // so fall back to the default mojo execution configurator. + // + mojoExecutionConfigurator = mojoExecutionConfigurators.get( "default" ); + } + return mojoExecutionConfigurator; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java new file mode 100644 index 00000000..3024fe45 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java @@ -0,0 +1,158 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.Lifecycle; +import org.apache.maven.lifecycle.LifecycleMappingDelegate; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +@Component( role = LifecycleMappingDelegate.class, hint = DefaultLifecycleMappingDelegate.HINT ) +public class DefaultLifecycleMappingDelegate + implements LifecycleMappingDelegate +{ + public static final String HINT = "default"; + + @Requirement + private BuildPluginManager pluginManager; + + public Map<String, List<MojoExecution>> calculateLifecycleMappings( MavenSession session, MavenProject project, + Lifecycle lifecycle, String lifecyclePhase ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException + { + /* + * Initialize mapping from lifecycle phase to bound mojos. The key set of this map denotes the phases the caller + * is interested in, i.e. all phases up to and including the specified phase. + */ + + Map<String, Map<Integer, List<MojoExecution>>> mappings = + new LinkedHashMap<String, Map<Integer, List<MojoExecution>>>(); + + for ( String phase : lifecycle.getPhases() ) + { + Map<Integer, List<MojoExecution>> phaseBindings = new TreeMap<Integer, List<MojoExecution>>(); + + mappings.put( phase, phaseBindings ); + + if ( phase.equals( lifecyclePhase ) ) + { + break; + } + } + + /* + * Grab plugin executions that are bound to the selected lifecycle phases from project. The effective model of + * the project already contains the plugin executions induced by the project's packaging type. Remember, all + * phases of interest and only those are in the lifecyle mapping, if a phase has no value in the map, we are not + * interested in any of the executions bound to it. + */ + + for ( Plugin plugin : project.getBuild().getPlugins() ) + { + for ( PluginExecution execution : plugin.getExecutions() ) + { + // if the phase is specified then I don't have to go fetch the plugin yet and pull it down + // to examine the phase it is associated to. + if ( execution.getPhase() != null ) + { + Map<Integer, List<MojoExecution>> phaseBindings = mappings.get( execution.getPhase() ); + if ( phaseBindings != null ) + { + for ( String goal : execution.getGoals() ) + { + MojoExecution mojoExecution = new MojoExecution( plugin, goal, execution.getId() ); + mojoExecution.setLifecyclePhase( execution.getPhase() ); + addMojoExecution( phaseBindings, mojoExecution, execution.getPriority() ); + } + } + } + // if not then i need to grab the mojo descriptor and look at the phase that is specified + else + { + for ( String goal : execution.getGoals() ) + { + MojoDescriptor mojoDescriptor = + pluginManager.getMojoDescriptor( plugin, goal, project.getRemotePluginRepositories(), + session.getRepositorySession() ); + + Map<Integer, List<MojoExecution>> phaseBindings = mappings.get( mojoDescriptor.getPhase() ); + if ( phaseBindings != null ) + { + MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, execution.getId() ); + mojoExecution.setLifecyclePhase( mojoDescriptor.getPhase() ); + addMojoExecution( phaseBindings, mojoExecution, execution.getPriority() ); + } + } + } + } + } + + Map<String, List<MojoExecution>> lifecycleMappings = new LinkedHashMap<String, List<MojoExecution>>(); + + for ( Map.Entry<String, Map<Integer, List<MojoExecution>>> entry : mappings.entrySet() ) + { + List<MojoExecution> mojoExecutions = new ArrayList<MojoExecution>(); + + for ( List<MojoExecution> executions : entry.getValue().values() ) + { + mojoExecutions.addAll( executions ); + } + + lifecycleMappings.put( entry.getKey(), mojoExecutions ); + } + + return lifecycleMappings; + + } + + private void addMojoExecution( Map<Integer, List<MojoExecution>> phaseBindings, MojoExecution mojoExecution, + int priority ) + { + List<MojoExecution> mojoExecutions = phaseBindings.get( priority ); + + if ( mojoExecutions == null ) + { + mojoExecutions = new ArrayList<MojoExecution>(); + phaseBindings.put( priority, mojoExecutions ); + } + + mojoExecutions.add( mojoExecution ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java new file mode 100644 index 00000000..a5e6a34c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java @@ -0,0 +1,258 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.lifecycle.DefaultLifecycles; +import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; +import org.apache.maven.lifecycle.Lifecycle; +import org.apache.maven.lifecycle.mapping.LifecycleMapping; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @since 3.0 + * @author Benjamin Bentmann + * @author Jason van Zyl + * @author jdcasey + * @author Kristian Rosenvold (extracted class only) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = LifeCyclePluginAnalyzer.class ) +public class DefaultLifecyclePluginAnalyzer + implements LifeCyclePluginAnalyzer +{ + + @Requirement( role = LifecycleMapping.class ) + private Map<String, LifecycleMapping> lifecycleMappings; + + @Requirement + private DefaultLifecycles defaultLifeCycles; + + @Requirement + private Logger logger; + + public DefaultLifecyclePluginAnalyzer() + { + } + + // These methods deal with construction intact Plugin object that look like they come from a standard + // <plugin/> block in a Maven POM. We have to do some wiggling to pull the sources of information + // together and this really shows the problem of constructing a sensible default configuration but + // it's all encapsulated here so it appears normalized to the POM builder. + + // We are going to take the project packaging and find all plugin in the default lifecycle and create + // fully populated Plugin objects, including executions with goals and default configuration taken + // from the plugin.xml inside a plugin. + // + + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( "Looking up lifecyle mappings for packaging " + packaging + " from " + + Thread.currentThread().getContextClassLoader() ); + } + + LifecycleMapping lifecycleMappingForPackaging = lifecycleMappings.get( packaging ); + + if ( lifecycleMappingForPackaging == null ) + { + return null; + } + + Map<Plugin, Plugin> plugins = new LinkedHashMap<Plugin, Plugin>(); + + for ( Lifecycle lifecycle : getOrderedLifecycles() ) + { + org.apache.maven.lifecycle.mapping.Lifecycle lifecycleConfiguration = + lifecycleMappingForPackaging.getLifecycles().get( lifecycle.getId() ); + + Map<String, String> phaseToGoalMapping = null; + + if ( lifecycleConfiguration != null ) + { + phaseToGoalMapping = lifecycleConfiguration.getPhases(); + } + else if ( lifecycle.getDefaultPhases() != null ) + { + phaseToGoalMapping = lifecycle.getDefaultPhases(); + } + + if ( phaseToGoalMapping != null ) + { + // These are of the form: + // + // compile -> org.apache.maven.plugins:maven-compiler-plugin:compile[,gid:aid:goal,...] + // + for ( Map.Entry<String, String> goalsForLifecyclePhase : phaseToGoalMapping.entrySet() ) + { + String phase = goalsForLifecyclePhase.getKey(); + String goals = goalsForLifecyclePhase.getValue(); + if ( goals != null ) + { + parseLifecyclePhaseDefinitions( plugins, phase, goals ); + } + } + } + } + + return plugins.keySet(); + } + + private List<Lifecycle> getOrderedLifecycles() + { + // NOTE: The lifecycle order can affect implied execution ids so we better be deterministic. + + List<Lifecycle> lifecycles = new ArrayList<Lifecycle>( defaultLifeCycles.getLifeCycles() ); + + Collections.sort( lifecycles, new Comparator<Lifecycle>() + { + + public int compare( Lifecycle l1, Lifecycle l2 ) + { + return l1.getId().compareTo( l2.getId() ); + } + + } ); + + return lifecycles; + } + + private void parseLifecyclePhaseDefinitions( Map<Plugin, Plugin> plugins, String phase, String goals ) + { + String[] mojos = StringUtils.split( goals, "," ); + + for ( int i = 0; i < mojos.length; i++ ) + { + GoalSpec gs = parseGoalSpec( mojos[i].trim() ); + + if ( gs == null ) + { + logger.warn( "Ignored invalid goal specification '" + mojos[i] + "' from lifecycle mapping for phase " + + phase ); + continue; + } + + Plugin plugin = new Plugin(); + plugin.setGroupId( gs.groupId ); + plugin.setArtifactId( gs.artifactId ); + plugin.setVersion( gs.version ); + + Plugin existing = plugins.get( plugin ); + if ( existing != null ) + { + if ( existing.getVersion() == null ) + { + existing.setVersion( plugin.getVersion() ); + } + plugin = existing; + } + else + { + plugins.put( plugin, plugin ); + } + + PluginExecution execution = new PluginExecution(); + execution.setId( getExecutionId( plugin, gs.goal ) ); + execution.setPhase( phase ); + execution.setPriority( i - mojos.length ); + execution.getGoals().add( gs.goal ); + + plugin.getExecutions().add( execution ); + } + } + + private GoalSpec parseGoalSpec( String goalSpec ) + { + GoalSpec gs = new GoalSpec(); + + String[] p = StringUtils.split( goalSpec.trim(), ":" ); + + if ( p.length == 3 ) + { + // <groupId>:<artifactId>:<goal> + gs.groupId = p[0]; + gs.artifactId = p[1]; + gs.goal = p[2]; + } + else if ( p.length == 4 ) + { + // <groupId>:<artifactId>:<version>:<goal> + gs.groupId = p[0]; + gs.artifactId = p[1]; + gs.version = p[2]; + gs.goal = p[3]; + } + else + { + // invalid + gs = null; + } + + return gs; + } + + private String getExecutionId( Plugin plugin, String goal ) + { + Set<String> existingIds = new HashSet<String>(); + for ( PluginExecution execution : plugin.getExecutions() ) + { + existingIds.add( execution.getId() ); + } + + String base = "default-" + goal; + String id = base; + + for ( int index = 1; existingIds.contains( id ); index++ ) + { + id = base + '-' + index; + } + + return id; + } + + static class GoalSpec + { + + String groupId; + + String artifactId; + + String version; + + String goal; + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java new file mode 100644 index 00000000..28377f1d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java @@ -0,0 +1,155 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.util.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Calculates the task segments in the build + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Jason van Zyl + * @author jdcasey + * @author Kristian Rosenvold (extracted class) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ + +@Component( role = LifecycleTaskSegmentCalculator.class ) +public class DefaultLifecycleTaskSegmentCalculator + implements LifecycleTaskSegmentCalculator +{ + @Requirement + private MojoDescriptorCreator mojoDescriptorCreator; + + @Requirement + private LifecyclePluginResolver lifecyclePluginResolver; + + public DefaultLifecycleTaskSegmentCalculator() + { + } + + public List<TaskSegment> calculateTaskSegments( MavenSession session ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + + MavenProject rootProject = session.getTopLevelProject(); + + List<String> tasks = session.getGoals(); + + if ( ( tasks == null || tasks.isEmpty() ) && !StringUtils.isEmpty( rootProject.getDefaultGoal() ) ) + { + tasks = Arrays.asList( StringUtils.split( rootProject.getDefaultGoal() ) ); + } + + return calculateTaskSegments( session, tasks ); + } + + public List<TaskSegment> calculateTaskSegments( MavenSession session, List<String> tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException + { + List<TaskSegment> taskSegments = new ArrayList<TaskSegment>( tasks.size() ); + + TaskSegment currentSegment = null; + + for ( String task : tasks ) + { + if ( isGoalSpecification( task ) ) + { + // "pluginPrefix:goal" or "groupId:artifactId[:version]:goal" + + lifecyclePluginResolver.resolveMissingPluginVersions( session.getTopLevelProject(), session ); + + MojoDescriptor mojoDescriptor = + mojoDescriptorCreator.getMojoDescriptor( task, session, session.getTopLevelProject() ); + + boolean aggregating = mojoDescriptor.isAggregator() || !mojoDescriptor.isProjectRequired(); + + if ( currentSegment == null || currentSegment.isAggregating() != aggregating ) + { + currentSegment = new TaskSegment( aggregating ); + taskSegments.add( currentSegment ); + } + + currentSegment.getTasks().add( new GoalTask( task ) ); + } + else + { + // lifecycle phase + + if ( currentSegment == null || currentSegment.isAggregating() ) + { + currentSegment = new TaskSegment( false ); + taskSegments.add( currentSegment ); + } + + currentSegment.getTasks().add( new LifecycleTask( task ) ); + } + } + + return taskSegments; + } + + public boolean requiresProject( MavenSession session ) + { + List<String> goals = session.getGoals(); + if ( goals != null ) + { + for ( String goal : goals ) + { + if ( !isGoalSpecification( goal ) ) + { + return true; + } + } + } + return false; + } + + + private boolean isGoalSpecification( String task ) + { + return task.indexOf( ':' ) >= 0; + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java new file mode 100644 index 00000000..176ba320 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java @@ -0,0 +1,108 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.lifecycle.MojoExecutionConfigurator; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * @since 3.3.1, MNG-5753 + */ +@Component( role = MojoExecutionConfigurator.class ) +public class DefaultMojoExecutionConfigurator + implements MojoExecutionConfigurator +{ + + @Override + public void configure( MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig ) + { + String g = mojoExecution.getGroupId(); + + String a = mojoExecution.getArtifactId(); + + Plugin plugin = findPlugin( g, a, project.getBuildPlugins() ); + + if ( plugin == null && project.getPluginManagement() != null ) + { + plugin = findPlugin( g, a, project.getPluginManagement().getPlugins() ); + } + + if ( plugin != null ) + { + PluginExecution pluginExecution = + findPluginExecution( mojoExecution.getExecutionId(), plugin.getExecutions() ); + + Xpp3Dom pomConfiguration = null; + + if ( pluginExecution != null ) + { + pomConfiguration = (Xpp3Dom) pluginExecution.getConfiguration(); + } + else if ( allowPluginLevelConfig ) + { + pomConfiguration = (Xpp3Dom) plugin.getConfiguration(); + } + + Xpp3Dom mojoConfiguration = ( pomConfiguration != null ) ? new Xpp3Dom( pomConfiguration ) : null; + + mojoConfiguration = Xpp3Dom.mergeXpp3Dom( mojoExecution.getConfiguration(), mojoConfiguration ); + + mojoExecution.setConfiguration( mojoConfiguration ); + } + } + + private Plugin findPlugin( String groupId, String artifactId, Collection<Plugin> plugins ) + { + for ( Plugin plugin : plugins ) + { + if ( artifactId.equals( plugin.getArtifactId() ) && groupId.equals( plugin.getGroupId() ) ) + { + return plugin; + } + } + + return null; + } + + private PluginExecution findPluginExecution( String executionId, Collection<PluginExecution> executions ) + { + if ( StringUtils.isNotEmpty( executionId ) ) + { + for ( PluginExecution execution : executions ) + { + if ( executionId.equals( execution.getId() ) ) + { + return execution; + } + } + } + + return null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultProjectArtifactFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultProjectArtifactFactory.java new file mode 100644 index 00000000..762fc72b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultProjectArtifactFactory.java @@ -0,0 +1,53 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.Set; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; +import org.apache.maven.project.artifact.MavenMetadataSource; + +@SuppressWarnings( "deprecation" ) +@Named +public class DefaultProjectArtifactFactory + implements ProjectArtifactFactory +{ + private final ArtifactFactory artifactFactory; + + @Inject + public DefaultProjectArtifactFactory( ArtifactFactory artifactFactory ) + { + this.artifactFactory = artifactFactory; + } + + @Override + public Set<Artifact> createArtifacts( MavenProject project ) + throws InvalidDependencyVersionException + { + return MavenMetadataSource.createArtifacts( artifactFactory, project.getDependencies(), null, null, project ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java new file mode 100644 index 00000000..18fae7a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java @@ -0,0 +1,114 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.project.MavenProject; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.TreeSet; + +/** + * Context of dependency artifacts for a particular project. + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Kristian Rosenvold (class extract only) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +// TODO: From a concurrency perspective, this class is not good. The combination of mutable/immutable state is not nice +public class DependencyContext +{ + + private static final Collection<?> UNRESOLVED = Arrays.asList(); + + private final MavenProject project; + + private final Collection<String> scopesToCollectForCurrentProject; + + private final Collection<String> scopesToResolveForCurrentProject; + + private final Collection<String> scopesToCollectForAggregatedProjects; + + private final Collection<String> scopesToResolveForAggregatedProjects; + + private volatile Collection<?> lastDependencyArtifacts = UNRESOLVED; + + private volatile int lastDependencyArtifactCount = -1; + + public DependencyContext( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve ) + { + this.project = project; + scopesToCollectForCurrentProject = scopesToCollect; + scopesToResolveForCurrentProject = scopesToResolve; + scopesToCollectForAggregatedProjects = Collections.synchronizedSet( new TreeSet<String>() ); + scopesToResolveForAggregatedProjects = Collections.synchronizedSet( new TreeSet<String>() ); + } + + public MavenProject getProject() + { + return project; + } + + public Collection<String> getScopesToCollectForCurrentProject() + { + return scopesToCollectForCurrentProject; + } + + public Collection<String> getScopesToResolveForCurrentProject() + { + return scopesToResolveForCurrentProject; + } + + public Collection<String> getScopesToCollectForAggregatedProjects() + { + return scopesToCollectForAggregatedProjects; + } + + public Collection<String> getScopesToResolveForAggregatedProjects() + { + return scopesToResolveForAggregatedProjects; + } + + public boolean isResolutionRequiredForCurrentProject() + { + return lastDependencyArtifacts != project.getDependencyArtifacts() || ( lastDependencyArtifacts != null + && lastDependencyArtifactCount != lastDependencyArtifacts.size() ); + } + + public boolean isResolutionRequiredForAggregatedProjects( Collection<String> scopesToCollect, + Collection<String> scopesToResolve ) + { + boolean required = + scopesToCollectForAggregatedProjects.addAll( scopesToCollect ) + || scopesToResolveForAggregatedProjects.addAll( scopesToResolve ); + return required; + } + + public void synchronizeWithProjectState() + { + lastDependencyArtifacts = project.getDependencyArtifacts(); + lastDependencyArtifactCount = ( lastDependencyArtifacts != null ) ? lastDependencyArtifacts.size() : 0; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ExecutionEventCatapult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ExecutionEventCatapult.java new file mode 100644 index 00000000..acff5661 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ExecutionEventCatapult.java @@ -0,0 +1,40 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.ExecutionEvent; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecution; + +/** + * Assists in firing execution events. <strong>Warning:</strong> This is an internal utility interface that is only + * public for technical reasons, it is not part of the public API. In particular, this interface can be changed or + * deleted without prior notice. + * + * @author Benjamin Bentmann + */ +public interface ExecutionEventCatapult +{ + + void fire( ExecutionEvent.Type eventType, MavenSession session, MojoExecution mojoExecution ); + + void fire( ExecutionEvent.Type eventType, MavenSession session, MojoExecution mojoExecution, Exception exception ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ExecutionPlanItem.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ExecutionPlanItem.java new file mode 100644 index 00000000..cceffdf8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ExecutionPlanItem.java @@ -0,0 +1,84 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.project.MavenProject; + +import java.util.ArrayList; +import java.util.List; + +/** + * Wraps individual MojoExecutions, containing information about completion status and scheduling. + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + * + * @since 3.0 + * @author Kristian Rosenvold + */ +public class ExecutionPlanItem +{ + private final MojoExecution mojoExecution; + + public ExecutionPlanItem( MojoExecution mojoExecution ) + { + this.mojoExecution = mojoExecution; + } + + public static List<ExecutionPlanItem> createExecutionPlanItems( MavenProject mavenProject, + List<MojoExecution> executions ) + { + BuilderCommon.attachToThread( mavenProject ); + + List<ExecutionPlanItem> result = new ArrayList<ExecutionPlanItem>(); + for ( MojoExecution mojoExecution : executions ) + { + result.add( new ExecutionPlanItem( mojoExecution ) ); + } + return result; + } + + public MojoExecution getMojoExecution() + { + return mojoExecution; + } + + public String getLifecyclePhase() + { + return mojoExecution.getLifecyclePhase(); + } + + public Plugin getPlugin() + { + final MojoDescriptor mojoDescriptor = getMojoExecution().getMojoDescriptor(); + return mojoDescriptor.getPluginDescriptor().getPlugin(); + } + + @Override + public String toString() + { + return "ExecutionPlanItem{" + ", mojoExecution=" + mojoExecution + '}' + + super.toString(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/GoalTask.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/GoalTask.java new file mode 100644 index 00000000..5c43dbd4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/GoalTask.java @@ -0,0 +1,45 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 task that is a goal + * <p/> + * TODO: From a concurrecy perspective, this class is not good. The combination of mutable/immutable state is not nice + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public final class GoalTask +{ + + final String pluginGoal; + + public GoalTask( String pluginGoal ) + { + this.pluginGoal = pluginGoal; + } + + @Override + public String toString() + { + return pluginGoal; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDebugLogger.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDebugLogger.java new file mode 100644 index 00000000..2edbe754 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDebugLogger.java @@ -0,0 +1,182 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +/** + * Logs debug output from the various lifecycle phases. + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Jason van Zyl + * @author Kristian Rosenvold (extracted class only) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = LifecycleDebugLogger.class ) +public class LifecycleDebugLogger +{ + @Requirement + private Logger logger; + + + public LifecycleDebugLogger() + { + } + + public LifecycleDebugLogger( Logger logger ) + { + this.logger = logger; + } + + + public void debug( String s ) + { + logger.debug( s ); + } + + public void info( String s ) + { + logger.info( s ); + } + + public void debugReactorPlan( ProjectBuildList projectBuilds ) + { + if ( !logger.isDebugEnabled() ) + { + return; + } + + logger.debug( "=== REACTOR BUILD PLAN ================================================" ); + + for ( Iterator<ProjectSegment> it = projectBuilds.iterator(); it.hasNext(); ) + { + ProjectSegment projectBuild = it.next(); + + logger.debug( "Project: " + projectBuild.getProject().getId() ); + logger.debug( "Tasks: " + projectBuild.getTaskSegment().getTasks() ); + logger.debug( "Style: " + ( projectBuild.getTaskSegment().isAggregating() ? "Aggregating" : "Regular" ) ); + + if ( it.hasNext() ) + { + logger.debug( "-----------------------------------------------------------------------" ); + } + } + + logger.debug( "=======================================================================" ); + } + + + public void debugProjectPlan( MavenProject currentProject, MavenExecutionPlan executionPlan ) + { + if ( !logger.isDebugEnabled() ) + { + return; + } + + logger.debug( "=== PROJECT BUILD PLAN ================================================" ); + logger.debug( "Project: " + BuilderCommon.getKey( currentProject ) ); + + debugDependencyRequirements( executionPlan.getMojoExecutions() ); + + logger.debug( "Repositories (dependencies): " + currentProject.getRemoteProjectRepositories() ); + logger.debug( "Repositories (plugins) : " + currentProject.getRemotePluginRepositories() ); + + for ( ExecutionPlanItem mojoExecution : executionPlan ) + { + debugMojoExecution( mojoExecution.getMojoExecution() ); + } + + logger.debug( "=======================================================================" ); + } + + private void debugMojoExecution( MojoExecution mojoExecution ) + { + String mojoExecId = + mojoExecution.getGroupId() + ':' + mojoExecution.getArtifactId() + ':' + mojoExecution.getVersion() + ':' + + mojoExecution.getGoal() + " (" + mojoExecution.getExecutionId() + ')'; + + Map<String, List<MojoExecution>> forkedExecutions = mojoExecution.getForkedExecutions(); + if ( !forkedExecutions.isEmpty() ) + { + for ( Map.Entry<String, List<MojoExecution>> fork : forkedExecutions.entrySet() ) + { + logger.debug( "--- init fork of " + fork.getKey() + " for " + mojoExecId + " ---" ); + + debugDependencyRequirements( fork.getValue() ); + + for ( MojoExecution forkedExecution : fork.getValue() ) + { + debugMojoExecution( forkedExecution ); + } + + logger.debug( "--- exit fork of " + fork.getKey() + " for " + mojoExecId + " ---" ); + } + } + + logger.debug( "-----------------------------------------------------------------------" ); + logger.debug( "Goal: " + mojoExecId ); + logger.debug( + "Style: " + ( mojoExecution.getMojoDescriptor().isAggregator() ? "Aggregating" : "Regular" ) ); + logger.debug( "Configuration: " + mojoExecution.getConfiguration() ); + } + + private void debugDependencyRequirements( List<MojoExecution> mojoExecutions ) + { + Set<String> scopesToCollect = new TreeSet<String>(); + Set<String> scopesToResolve = new TreeSet<String>(); + + for ( MojoExecution mojoExecution : mojoExecutions ) + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + String scopeToCollect = mojoDescriptor.getDependencyCollectionRequired(); + if ( StringUtils.isNotEmpty( scopeToCollect ) ) + { + scopesToCollect.add( scopeToCollect ); + } + + String scopeToResolve = mojoDescriptor.getDependencyResolutionRequired(); + if ( StringUtils.isNotEmpty( scopeToResolve ) ) + { + scopesToResolve.add( scopeToResolve ); + } + } + + logger.debug( "Dependencies (collect): " + scopesToCollect ); + logger.debug( "Dependencies (resolve): " + scopesToResolve ); + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java new file mode 100644 index 00000000..4d73528c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java @@ -0,0 +1,334 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.eventspy.internal.EventSpyDispatcher; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleExecutionException; +import org.apache.maven.project.DefaultDependencyResolutionRequest; +import org.apache.maven.project.DependencyResolutionException; +import org.apache.maven.project.DependencyResolutionResult; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectDependenciesResolver; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.filter.ScopeDependencyFilter; + +/** + * Resolves dependencies for the artifacts in context of the lifecycle build + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Jason van Zyl + * @author Kristian Rosenvold (extracted class) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Named +public class LifecycleDependencyResolver +{ + + @Inject + private ProjectDependenciesResolver dependenciesResolver; + + @Inject + private Logger logger; + + @Inject + private ProjectArtifactFactory artifactFactory; + + @Inject + private EventSpyDispatcher eventSpyDispatcher; + + public LifecycleDependencyResolver() + { + } + + public LifecycleDependencyResolver( ProjectDependenciesResolver projectDependenciesResolver, Logger logger ) + { + this.dependenciesResolver = projectDependenciesResolver; + this.logger = logger; + } + + public static List<MavenProject> getProjects( MavenProject project, MavenSession session, boolean aggregator ) + { + if ( aggregator ) + { + return session.getProjects(); + } + else + { + return Collections.singletonList( project ); + } + } + + public void resolveProjectDependencies( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session, + boolean aggregating, Set<Artifact> projectArtifacts ) + throws LifecycleExecutionException + { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + try + { + ClassLoader projectRealm = project.getClassRealm(); + if ( projectRealm != null && projectRealm != tccl ) + { + Thread.currentThread().setContextClassLoader( projectRealm ); + } + + if ( project.getDependencyArtifacts() == null ) + { + try + { + project.setDependencyArtifacts( artifactFactory.createArtifacts( project ) ); + } + catch ( InvalidDependencyVersionException e ) + { + throw new LifecycleExecutionException( e ); + } + } + + Set<Artifact> artifacts = + getDependencies( project, scopesToCollect, scopesToResolve, session, aggregating, projectArtifacts ); + + project.setResolvedArtifacts( artifacts ); + + Map<String, Artifact> map = new HashMap<String, Artifact>(); + for ( Artifact artifact : artifacts ) + { + map.put( artifact.getDependencyConflictId(), artifact ); + } + for ( Artifact artifact : project.getDependencyArtifacts() ) + { + if ( artifact.getFile() == null ) + { + Artifact resolved = map.get( artifact.getDependencyConflictId() ); + if ( resolved != null ) + { + artifact.setFile( resolved.getFile() ); + artifact.setDependencyTrail( resolved.getDependencyTrail() ); + artifact.setResolvedVersion( resolved.getVersion() ); + artifact.setResolved( true ); + } + } + } + } + finally + { + Thread.currentThread().setContextClassLoader( tccl ); + } + } + + private Set<Artifact> getDependencies( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session, + boolean aggregating, Set<Artifact> projectArtifacts ) + throws LifecycleExecutionException + { + if ( scopesToCollect == null ) + { + scopesToCollect = Collections.emptySet(); + } + if ( scopesToResolve == null ) + { + scopesToResolve = Collections.emptySet(); + } + + if ( scopesToCollect.isEmpty() && scopesToResolve.isEmpty() ) + { + return new LinkedHashSet<Artifact>(); + } + + scopesToCollect = new HashSet<String>( scopesToCollect ); + scopesToCollect.addAll( scopesToResolve ); + + DependencyFilter collectionFilter = new ScopeDependencyFilter( null, negate( scopesToCollect ) ); + DependencyFilter resolutionFilter = new ScopeDependencyFilter( null, negate( scopesToResolve ) ); + resolutionFilter = AndDependencyFilter.newInstance( collectionFilter, resolutionFilter ); + resolutionFilter = + AndDependencyFilter.newInstance( resolutionFilter, new ReactorDependencyFilter( projectArtifacts ) ); + + DependencyResolutionResult result; + try + { + DefaultDependencyResolutionRequest request = + new DefaultDependencyResolutionRequest( project, session.getRepositorySession() ); + request.setResolutionFilter( resolutionFilter ); + + eventSpyDispatcher.onEvent( request ); + + result = dependenciesResolver.resolve( request ); + } + catch ( DependencyResolutionException e ) + { + result = e.getResult(); + + /* + * MNG-2277, the check below compensates for our bad plugin support where we ended up with aggregator + * plugins that require dependency resolution although they usually run in phases of the build where project + * artifacts haven't been assembled yet. The prime example of this is "mvn release:prepare". + */ + if ( aggregating && areAllDependenciesInReactor( session.getProjects(), + result.getUnresolvedDependencies() ) ) + { + logger.warn( "The following dependencies could not be resolved at this point of the build" + + " but seem to be part of the reactor:" ); + + for ( Dependency dependency : result.getUnresolvedDependencies() ) + { + logger.warn( "o " + dependency ); + } + + logger.warn( "Try running the build up to the lifecycle phase \"package\"" ); + } + else + { + throw new LifecycleExecutionException( null, project, e ); + } + } + + eventSpyDispatcher.onEvent( result ); + + Set<Artifact> artifacts = new LinkedHashSet<Artifact>(); + if ( result.getDependencyGraph() != null && !result.getDependencyGraph().getChildren().isEmpty() ) + { + RepositoryUtils.toArtifacts( artifacts, result.getDependencyGraph().getChildren(), + Collections.singletonList( project.getArtifact().getId() ), collectionFilter ); + } + return artifacts; + } + + private boolean areAllDependenciesInReactor( Collection<MavenProject> projects, + Collection<Dependency> dependencies ) + { + Set<String> projectKeys = getReactorProjectKeys( projects ); + + for ( Dependency dependency : dependencies ) + { + org.eclipse.aether.artifact.Artifact a = dependency.getArtifact(); + String key = ArtifactUtils.key( a.getGroupId(), a.getArtifactId(), a.getVersion() ); + if ( !projectKeys.contains( key ) ) + { + return false; + } + } + + return true; + } + + private Set<String> getReactorProjectKeys( Collection<MavenProject> projects ) + { + Set<String> projectKeys = new HashSet<String>( projects.size() * 2 ); + for ( MavenProject project : projects ) + { + String key = ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + projectKeys.add( key ); + } + return projectKeys; + } + + private Collection<String> negate( Collection<String> scopes ) + { + Collection<String> result = new HashSet<String>(); + Collections.addAll( result, "system", "compile", "provided", "runtime", "test" ); + + for ( String scope : scopes ) + { + if ( "compile".equals( scope ) ) + { + result.remove( "compile" ); + result.remove( "system" ); + result.remove( "provided" ); + } + else if ( "runtime".equals( scope ) ) + { + result.remove( "compile" ); + result.remove( "runtime" ); + } + else if ( "compile+runtime".equals( scope ) ) + { + result.remove( "compile" ); + result.remove( "system" ); + result.remove( "provided" ); + result.remove( "runtime" ); + } + else if ( "runtime+system".equals( scope ) ) + { + result.remove( "compile" ); + result.remove( "system" ); + result.remove( "runtime" ); + } + else if ( "test".equals( scope ) ) + { + result.clear(); + } + } + + return result; + } + + private static class ReactorDependencyFilter + implements DependencyFilter + { + + private Set<String> keys = new HashSet<String>(); + + public ReactorDependencyFilter( Collection<Artifact> artifacts ) + { + for ( Artifact artifact : artifacts ) + { + String key = ArtifactUtils.key( artifact ); + keys.add( key ); + } + } + + public boolean accept( DependencyNode node, List<DependencyNode> parents ) + { + Dependency dependency = node.getDependency(); + if ( dependency != null ) + { + org.eclipse.aether.artifact.Artifact a = dependency.getArtifact(); + String key = ArtifactUtils.key( a.getGroupId(), a.getArtifactId(), a.getVersion() ); + return !keys.contains( key ); + } + return false; + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculator.java new file mode 100644 index 00000000..7d35b102 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculator.java @@ -0,0 +1,67 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; + +import java.util.List; + +/** + * @since 3.0 + * @author Benjamin Bentmann + * @author Kristian Rosenvold (extract interface only) + * <p/> + */ +public interface LifecycleExecutionPlanCalculator +{ + MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks ) + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException; + + MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks, + boolean setup ) + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException; + + void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException; + + void setupMojoExecution( MavenSession session, MavenProject project, MojoExecution mojoExecution ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java new file mode 100644 index 00000000..343fbf95 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java @@ -0,0 +1,154 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.HashSet; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.execution.BuildSuccess; +import org.apache.maven.execution.ExecutionEvent; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.execution.ProjectExecutionEvent; +import org.apache.maven.execution.ProjectExecutionListener; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; +import org.apache.maven.session.scope.internal.SessionScope; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +/** + * Builds one or more lifecycles for a full module + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Jason van Zyl + * @author Kristian Rosenvold (extracted class) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = LifecycleModuleBuilder.class ) +public class LifecycleModuleBuilder +{ + + @Requirement + private MojoExecutor mojoExecutor; + + @Requirement + private BuilderCommon builderCommon; + + @Requirement + private ExecutionEventCatapult eventCatapult; + + private ProjectExecutionListener projectExecutionListener; + + // this tricks plexus-component-metadata generate required metadata + @Requirement + private List<ProjectExecutionListener> projectExecutionListeners; + + @Requirement + private SessionScope sessionScope; + + public void setProjectExecutionListeners( final List<ProjectExecutionListener> listeners ) + { + this.projectExecutionListeners = listeners; + this.projectExecutionListener = new CompoundProjectExecutionListener( listeners ); + } + + public void buildProject( MavenSession session, ReactorContext reactorContext, MavenProject currentProject, + TaskSegment taskSegment ) + { + buildProject( session, session, reactorContext, currentProject, taskSegment ); + } + + public void buildProject( MavenSession session, MavenSession rootSession, ReactorContext reactorContext, + MavenProject currentProject, TaskSegment taskSegment ) + { + session.setCurrentProject( currentProject ); + + long buildStartTime = System.currentTimeMillis(); + + // session may be different from rootSession seeded in DefaultMaven + // explicitly seed the right session here to make sure it is used by Guice + sessionScope.enter( reactorContext.getSessionScopeMemento() ); + sessionScope.seed( MavenSession.class, session ); + try + { + + if ( reactorContext.getReactorBuildStatus().isHaltedOrBlacklisted( currentProject ) ) + { + eventCatapult.fire( ExecutionEvent.Type.ProjectSkipped, session, null ); + return; + } + + BuilderCommon.attachToThread( currentProject ); + + projectExecutionListener.beforeProjectExecution( new ProjectExecutionEvent( session, currentProject ) ); + + eventCatapult.fire( ExecutionEvent.Type.ProjectStarted, session, null ); + + MavenExecutionPlan executionPlan = + builderCommon.resolveBuildPlan( session, currentProject, taskSegment, new HashSet<Artifact>() ); + List<MojoExecution> mojoExecutions = executionPlan.getMojoExecutions(); + + projectExecutionListener.beforeProjectLifecycleExecution( new ProjectExecutionEvent( session, + currentProject, + mojoExecutions ) ); + mojoExecutor.execute( session, mojoExecutions, reactorContext.getProjectIndex() ); + + long buildEndTime = System.currentTimeMillis(); + + projectExecutionListener.afterProjectExecutionSuccess( new ProjectExecutionEvent( session, currentProject, + mojoExecutions ) ); + + reactorContext.getResult().addBuildSummary( new BuildSuccess( currentProject, + buildEndTime - buildStartTime ) ); + + eventCatapult.fire( ExecutionEvent.Type.ProjectSucceeded, session, null ); + } + catch ( Throwable t ) + { + builderCommon.handleBuildError( reactorContext, rootSession, session, currentProject, t, buildStartTime ); + + projectExecutionListener.afterProjectExecutionFailure( new ProjectExecutionEvent( session, currentProject, + t ) ); + + // rethrow original errors and runtime exceptions + if ( t instanceof RuntimeException ) + { + throw (RuntimeException) t; + } + if ( t instanceof Error ) + { + throw (Error) t; + } + } + finally + { + sessionScope.exit(); + + session.setCurrentProject( null ); + + Thread.currentThread().setContextClassLoader( reactorContext.getOriginalContextClassLoader() ); + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecyclePluginResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecyclePluginResolver.java new file mode 100644 index 00000000..c615a6f6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecyclePluginResolver.java @@ -0,0 +1,95 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginManagement; +import org.apache.maven.plugin.version.DefaultPluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolver; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +import java.util.HashMap; +import java.util.Map; + +/** + * @since 3.0 + * @author Benjamin Bentmann + * @author Kristian Rosenvold (Extract class) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = LifecyclePluginResolver.class ) +public class LifecyclePluginResolver +{ + @Requirement + private PluginVersionResolver pluginVersionResolver; + + + public LifecyclePluginResolver( PluginVersionResolver pluginVersionResolver ) + { + this.pluginVersionResolver = pluginVersionResolver; + } + + public LifecyclePluginResolver() + { + } + + public void resolveMissingPluginVersions( MavenProject project, MavenSession session ) + throws PluginVersionResolutionException + { + Map<String, String> versions = new HashMap<String, String>( 64 ); + + for ( Plugin plugin : project.getBuildPlugins() ) + { + if ( plugin.getVersion() == null ) + { + PluginVersionRequest request = + new DefaultPluginVersionRequest( plugin, session.getRepositorySession(), + project.getRemotePluginRepositories() ); + plugin.setVersion( pluginVersionResolver.resolve( request ).getVersion() ); + } + versions.put( plugin.getKey(), plugin.getVersion() ); + } + + PluginManagement pluginManagement = project.getPluginManagement(); + if ( pluginManagement != null ) + { + for ( Plugin plugin : pluginManagement.getPlugins() ) + { + if ( plugin.getVersion() == null ) + { + plugin.setVersion( versions.get( plugin.getKey() ) ); + if ( plugin.getVersion() == null ) + { + PluginVersionRequest request = + new DefaultPluginVersionRequest( plugin, session.getRepositorySession(), + project.getRemotePluginRepositories() ); + plugin.setVersion( pluginVersionResolver.resolve( request ).getVersion() ); + } + } + } + } + } +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java new file mode 100644 index 00000000..cee80739 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java @@ -0,0 +1,150 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.Map; + +import org.apache.maven.execution.ExecutionEvent; +import org.apache.maven.execution.MavenExecutionResult; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.DefaultLifecycles; +import org.apache.maven.lifecycle.MissingProjectException; +import org.apache.maven.lifecycle.NoGoalSpecifiedException; +import org.apache.maven.lifecycle.internal.builder.Builder; +import org.apache.maven.lifecycle.internal.builder.BuilderNotFoundException; +import org.apache.maven.session.scope.internal.SessionScope; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; + +/** + * Starts the build life cycle + * + * @author Jason van Zyl + * @author Benjamin Bentmann + * @author Kristian Rosenvold + */ +@Component( role = LifecycleStarter.class ) +public class LifecycleStarter +{ + @Requirement + private ExecutionEventCatapult eventCatapult; + + @Requirement + private DefaultLifecycles defaultLifeCycles; + + @Requirement + private Logger logger; + + @Requirement + private BuildListCalculator buildListCalculator; + + @Requirement + private LifecycleDebugLogger lifecycleDebugLogger; + + @Requirement + private LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator; + + @Requirement + private Map<String, Builder> builders; + + @Requirement + private SessionScope sessionScope; + + public void execute( MavenSession session ) + { + eventCatapult.fire( ExecutionEvent.Type.SessionStarted, session, null ); + + ReactorContext reactorContext = null; + ProjectBuildList projectBuilds = null; + MavenExecutionResult result = session.getResult(); + + try + { + if ( buildExecutionRequiresProject( session ) && projectIsNotPresent( session ) ) + { + throw new MissingProjectException( "The goal you specified requires a project to execute" + + " but there is no POM in this directory (" + session.getExecutionRootDirectory() + ")." + + " Please verify you invoked Maven from the correct directory." ); + } + + List<TaskSegment> taskSegments = lifecycleTaskSegmentCalculator.calculateTaskSegments( session ); + projectBuilds = buildListCalculator.calculateProjectBuilds( session, taskSegments ); + + if ( projectBuilds.isEmpty() ) + { + throw new NoGoalSpecifiedException( "No goals have been specified for this build." + + " You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or" + + " <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>." + + " Available lifecycle phases are: " + defaultLifeCycles.getLifecyclePhaseList() + "." ); + } + + ProjectIndex projectIndex = new ProjectIndex( session.getProjects() ); + + if ( logger.isDebugEnabled() ) + { + lifecycleDebugLogger.debugReactorPlan( projectBuilds ); + } + + ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); + ReactorBuildStatus reactorBuildStatus = new ReactorBuildStatus( session.getProjectDependencyGraph() ); + reactorContext = + new ReactorContext( result, projectIndex, oldContextClassLoader, reactorBuildStatus, + sessionScope.memento() ); + + String builderId = session.getRequest().getBuilderId(); + Builder builder = builders.get( builderId ); + if ( builder == null ) + { + throw new BuilderNotFoundException( String.format( "The builder requested using id = %s cannot be" + + " found", builderId ) ); + } + + int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency(); + if ( degreeOfConcurrency >= 2 ) + { + logger.info( "" ); + logger.info( String.format( "Using the %s implementation with a thread count of %d", + builder.getClass().getSimpleName(), degreeOfConcurrency ) ); + } + builder.build( session, reactorContext, projectBuilds, taskSegments, reactorBuildStatus ); + + } + catch ( Exception e ) + { + result.addException( e ); + } + finally + { + eventCatapult.fire( ExecutionEvent.Type.SessionEnded, session, null ); + } + } + + private boolean buildExecutionRequiresProject( MavenSession session ) + { + return lifecycleTaskSegmentCalculator.requiresProject( session ); + } + + private boolean projectIsNotPresent( MavenSession session ) + { + return !session.getRequest().isProjectPresent(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleTask.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleTask.java new file mode 100644 index 00000000..0b5fff34 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleTask.java @@ -0,0 +1,50 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 task that is a lifecycle + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public final class LifecycleTask +{ + + private final String lifecyclePhase; + + public LifecycleTask( String lifecyclePhase ) + { + this.lifecyclePhase = lifecyclePhase; + } + + @Override + public String toString() + { + return getLifecyclePhase(); + } + + public String getLifecyclePhase() + { + return lifecyclePhase; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculator.java new file mode 100644 index 00000000..a721355b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculator.java @@ -0,0 +1,61 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; + +import java.util.List; + +/** + * Calculates the task segments in the build + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Jason van Zyl + * @author jdcasey + * @author Kristian Rosenvold (extracted interface) + * <p/> + * NOTE: This interface is not part of any public api and can be changed or deleted without prior notice. + */ + +public interface LifecycleTaskSegmentCalculator +{ + List<TaskSegment> calculateTaskSegments( MavenSession session ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException; + + List<TaskSegment> calculateTaskSegments( MavenSession session, List<String> tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException; + + boolean requiresProject( MavenSession session ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java new file mode 100644 index 00000000..36c85fdd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java @@ -0,0 +1,309 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.prefix.DefaultPluginPrefixRequest; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.prefix.PluginPrefixRequest; +import org.apache.maven.plugin.prefix.PluginPrefixResolver; +import org.apache.maven.plugin.prefix.PluginPrefixResult; +import org.apache.maven.plugin.version.DefaultPluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolver; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.configuration.PlexusConfiguration; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.StringTokenizer; + +/** + * Resolves dependencies for the artifacts in context of the lifecycle build + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Jason van Zyl + * @author jdcasey + * @author Kristian Rosenvold (extracted class only) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = MojoDescriptorCreator.class ) +public class MojoDescriptorCreator +{ + + @Requirement + private Logger logger; + + @Requirement + private PluginVersionResolver pluginVersionResolver; + + @Requirement + private BuildPluginManager pluginManager; + + @Requirement + private PluginPrefixResolver pluginPrefixResolver; + + @Requirement + private LifecyclePluginResolver lifecyclePluginResolver; + + public MojoDescriptorCreator() + { + } + + public MojoDescriptorCreator( PluginVersionResolver pluginVersionResolver, BuildPluginManager pluginManager, + PluginPrefixResolver pluginPrefixResolver, + LifecyclePluginResolver lifecyclePluginResolver ) + { + this.pluginVersionResolver = pluginVersionResolver; + this.pluginManager = pluginManager; + this.pluginPrefixResolver = pluginPrefixResolver; + this.lifecyclePluginResolver = lifecyclePluginResolver; + } + + private Plugin findPlugin( String groupId, String artifactId, Collection<Plugin> plugins ) + { + for ( Plugin plugin : plugins ) + { + if ( artifactId.equals( plugin.getArtifactId() ) && groupId.equals( plugin.getGroupId() ) ) + { + return plugin; + } + } + + return null; + } + + public static Xpp3Dom convert( MojoDescriptor mojoDescriptor ) + { + Xpp3Dom dom = new Xpp3Dom( "configuration" ); + + PlexusConfiguration c = mojoDescriptor.getMojoConfiguration(); + + PlexusConfiguration[] ces = c.getChildren(); + + if ( ces != null ) + { + for ( PlexusConfiguration ce : ces ) + { + String value = ce.getValue( null ); + String defaultValue = ce.getAttribute( "default-value", null ); + if ( value != null || defaultValue != null ) + { + Xpp3Dom e = new Xpp3Dom( ce.getName() ); + e.setValue( value ); + if ( defaultValue != null ) + { + e.setAttribute( "default-value", defaultValue ); + } + dom.addChild( e ); + } + } + } + + return dom; + } + + // org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process@executionId + + public MojoDescriptor getMojoDescriptor( String task, MavenSession session, MavenProject project ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException + { + String goal = null; + + Plugin plugin = null; + + StringTokenizer tok = new StringTokenizer( task, ":" ); + + int numTokens = tok.countTokens(); + + if ( numTokens >= 4 ) + { + // We have everything that we need + // + // org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process + // + // groupId + // artifactId + // version + // goal + // + plugin = new Plugin(); + plugin.setGroupId( tok.nextToken() ); + plugin.setArtifactId( tok.nextToken() ); + plugin.setVersion( tok.nextToken() ); + goal = tok.nextToken(); + + // This won't be valid, but it constructs something easy to read in the error message + while ( tok.hasMoreTokens() ) + { + goal += ":" + tok.nextToken(); + } + } + else if ( numTokens == 3 ) + { + // We have everything that we need except the version + // + // org.apache.maven.plugins:maven-remote-resources-plugin:???:process + // + // groupId + // artifactId + // ??? + // goal + // + plugin = new Plugin(); + plugin.setGroupId( tok.nextToken() ); + plugin.setArtifactId( tok.nextToken() ); + goal = tok.nextToken(); + } + else if ( numTokens <= 2 ) + { + // We have a prefix and goal + // + // idea:idea + // + String prefix = tok.nextToken(); + + if ( numTokens == 2 ) + { + goal = tok.nextToken(); + } + else + { + // goal was missing - pass through to MojoNotFoundException + goal = ""; + } + + // This is the case where someone has executed a single goal from the command line + // of the form: + // + // mvn remote-resources:process + // + // From the metadata stored on the server which has been created as part of a standard + // Maven plugin deployment we will find the right PluginDescriptor from the remote + // repository. + + plugin = findPluginForPrefix( prefix, session ); + } + + int executionIdx = goal.indexOf( '@' ); + if ( executionIdx > 0 ) + { + goal = goal.substring( 0, executionIdx ); + } + + injectPluginDeclarationFromProject( plugin, project ); + + // If there is no version to be found then we need to look in the repository metadata for + // this plugin and see what's specified as the latest release. + // + if ( plugin.getVersion() == null ) + { + resolvePluginVersion( plugin, session, project ); + } + + return pluginManager.getMojoDescriptor( plugin, goal, project.getRemotePluginRepositories(), + session.getRepositorySession() ); + } + + // TODO: take repo mans into account as one may be aggregating prefixes of many + // TODO: collect at the root of the repository, read the one at the root, and fetch remote if something is missing + // or the user forces the issue + + public Plugin findPluginForPrefix( String prefix, MavenSession session ) + throws NoPluginFoundForPrefixException + { + // [prefix]:[goal] + + if ( session.getCurrentProject() != null ) + { + try + { + lifecyclePluginResolver.resolveMissingPluginVersions( session.getCurrentProject(), session ); + } + catch ( PluginVersionResolutionException e ) + { + // not critical here + logger.debug( e.getMessage(), e ); + } + } + + PluginPrefixRequest prefixRequest = new DefaultPluginPrefixRequest( prefix, session ); + PluginPrefixResult prefixResult = pluginPrefixResolver.resolve( prefixRequest ); + + Plugin plugin = new Plugin(); + plugin.setGroupId( prefixResult.getGroupId() ); + plugin.setArtifactId( prefixResult.getArtifactId() ); + + return plugin; + } + + private void resolvePluginVersion( Plugin plugin, MavenSession session, MavenProject project ) + throws PluginVersionResolutionException + { + PluginVersionRequest versionRequest = + new DefaultPluginVersionRequest( plugin, session.getRepositorySession(), + project.getRemotePluginRepositories() ); + plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() ); + } + + private void injectPluginDeclarationFromProject( Plugin plugin, MavenProject project ) + { + Plugin pluginInPom = findPlugin( plugin, project.getBuildPlugins() ); + + if ( pluginInPom == null && project.getPluginManagement() != null ) + { + pluginInPom = findPlugin( plugin, project.getPluginManagement().getPlugins() ); + } + + if ( pluginInPom != null ) + { + if ( plugin.getVersion() == null ) + { + plugin.setVersion( pluginInPom.getVersion() ); + } + + plugin.setDependencies( new ArrayList<Dependency>( pluginInPom.getDependencies() ) ); + } + } + + private Plugin findPlugin( Plugin plugin, Collection<Plugin> plugins ) + { + return findPlugin( plugin.getGroupId(), plugin.getArtifactId(), plugins ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java new file mode 100644 index 00000000..a6ba752c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java @@ -0,0 +1,394 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.artifact.resolver.filter.CumulativeScopeArtifactFilter; +import org.apache.maven.execution.ExecutionEvent; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleExecutionException; +import org.apache.maven.lifecycle.MissingProjectException; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.MavenPluginManager; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.PluginConfigurationException; +import org.apache.maven.plugin.PluginIncompatibleException; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.util.StringUtils; + +/** + * Executes an individual mojo + * + * @since 3.0 + * @author Jason van Zyl + * @author Benjamin Bentmann + * @author Kristian Rosenvold + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = MojoExecutor.class ) +public class MojoExecutor +{ + + @Requirement + private BuildPluginManager pluginManager; + + @Requirement + private MavenPluginManager mavenPluginManager; + + @Requirement + private LifecycleDependencyResolver lifeCycleDependencyResolver; + + @Requirement + private ExecutionEventCatapult eventCatapult; + + public MojoExecutor() + { + } + + public DependencyContext newDependencyContext( MavenSession session, List<MojoExecution> mojoExecutions ) + { + Set<String> scopesToCollect = new TreeSet<String>(); + Set<String> scopesToResolve = new TreeSet<String>(); + + collectDependencyRequirements( scopesToResolve, scopesToCollect, mojoExecutions ); + + return new DependencyContext( session.getCurrentProject(), scopesToCollect, scopesToResolve ); + } + + private void collectDependencyRequirements( Set<String> scopesToResolve, Set<String> scopesToCollect, + Collection<MojoExecution> mojoExecutions ) + { + for ( MojoExecution mojoExecution : mojoExecutions ) + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + scopesToResolve.addAll( toScopes( mojoDescriptor.getDependencyResolutionRequired() ) ); + + scopesToCollect.addAll( toScopes( mojoDescriptor.getDependencyCollectionRequired() ) ); + } + } + + private Collection<String> toScopes( String classpath ) + { + if ( StringUtils.isNotEmpty( classpath ) ) + { + if ( Artifact.SCOPE_COMPILE.equals( classpath ) ) + { + return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED ); + } + else if ( Artifact.SCOPE_RUNTIME.equals( classpath ) ) + { + return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME ); + } + else if ( Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals( classpath ) ) + { + return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED, + Artifact.SCOPE_RUNTIME ); + } + else if ( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM.equals( classpath ) ) + { + return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_RUNTIME ); + } + else if ( Artifact.SCOPE_TEST.equals( classpath ) ) + { + return Arrays.asList( Artifact.SCOPE_COMPILE, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_PROVIDED, + Artifact.SCOPE_RUNTIME, Artifact.SCOPE_TEST ); + } + } + return Collections.emptyList(); + } + + public void execute( MavenSession session, List<MojoExecution> mojoExecutions, ProjectIndex projectIndex ) + throws LifecycleExecutionException + + { + DependencyContext dependencyContext = newDependencyContext( session, mojoExecutions ); + + PhaseRecorder phaseRecorder = new PhaseRecorder( session.getCurrentProject() ); + + for ( MojoExecution mojoExecution : mojoExecutions ) + { + execute( session, mojoExecution, projectIndex, dependencyContext, phaseRecorder ); + } + } + + public void execute( MavenSession session, MojoExecution mojoExecution, ProjectIndex projectIndex, + DependencyContext dependencyContext, PhaseRecorder phaseRecorder ) + throws LifecycleExecutionException + { + execute( session, mojoExecution, projectIndex, dependencyContext ); + phaseRecorder.observeExecution( mojoExecution ); + } + + private void execute( MavenSession session, MojoExecution mojoExecution, ProjectIndex projectIndex, + DependencyContext dependencyContext ) + throws LifecycleExecutionException + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + try + { + mavenPluginManager.checkRequiredMavenVersion( mojoDescriptor.getPluginDescriptor() ); + } + catch ( PluginIncompatibleException e ) + { + throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e ); + } + + if ( mojoDescriptor.isProjectRequired() && !session.getRequest().isProjectPresent() ) + { + Throwable cause = + new MissingProjectException( "Goal requires a project to execute" + + " but there is no POM in this directory (" + session.getExecutionRootDirectory() + ")." + + " Please verify you invoked Maven from the correct directory." ); + throw new LifecycleExecutionException( mojoExecution, null, cause ); + } + + if ( mojoDescriptor.isOnlineRequired() && session.isOffline() ) + { + if ( MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) ) + { + Throwable cause = + new IllegalStateException( "Goal requires online mode for execution" + + " but Maven is currently offline." ); + throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), cause ); + } + else + { + eventCatapult.fire( ExecutionEvent.Type.MojoSkipped, session, mojoExecution ); + + return; + } + } + + List<MavenProject> forkedProjects = executeForkedExecutions( mojoExecution, session, projectIndex ); + + ensureDependenciesAreResolved( mojoDescriptor, session, dependencyContext ); + + eventCatapult.fire( ExecutionEvent.Type.MojoStarted, session, mojoExecution ); + + try + { + try + { + pluginManager.executeMojo( session, mojoExecution ); + } + catch ( MojoFailureException e ) + { + throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e ); + } + catch ( MojoExecutionException e ) + { + throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e ); + } + catch ( PluginConfigurationException e ) + { + throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e ); + } + catch ( PluginManagerException e ) + { + throw new LifecycleExecutionException( mojoExecution, session.getCurrentProject(), e ); + } + + eventCatapult.fire( ExecutionEvent.Type.MojoSucceeded, session, mojoExecution ); + } + catch ( LifecycleExecutionException e ) + { + eventCatapult.fire( ExecutionEvent.Type.MojoFailed, session, mojoExecution, e ); + + throw e; + } + finally + { + for ( MavenProject forkedProject : forkedProjects ) + { + forkedProject.setExecutionProject( null ); + } + } + } + + public void ensureDependenciesAreResolved( MojoDescriptor mojoDescriptor, MavenSession session, + DependencyContext dependencyContext ) + throws LifecycleExecutionException + + { + MavenProject project = dependencyContext.getProject(); + boolean aggregating = mojoDescriptor.isAggregator(); + + if ( dependencyContext.isResolutionRequiredForCurrentProject() ) + { + Collection<String> scopesToCollect = dependencyContext.getScopesToCollectForCurrentProject(); + Collection<String> scopesToResolve = dependencyContext.getScopesToResolveForCurrentProject(); + + lifeCycleDependencyResolver.resolveProjectDependencies( project, scopesToCollect, scopesToResolve, session, + aggregating, Collections.<Artifact>emptySet() ); + + dependencyContext.synchronizeWithProjectState(); + } + + if ( aggregating ) + { + Collection<String> scopesToCollect = toScopes( mojoDescriptor.getDependencyCollectionRequired() ); + Collection<String> scopesToResolve = toScopes( mojoDescriptor.getDependencyResolutionRequired() ); + + if ( dependencyContext.isResolutionRequiredForAggregatedProjects( scopesToCollect, scopesToResolve ) ) + { + for ( MavenProject aggregatedProject : session.getProjects() ) + { + if ( aggregatedProject != project ) + { + lifeCycleDependencyResolver.resolveProjectDependencies( aggregatedProject, scopesToCollect, + scopesToResolve, session, aggregating, + Collections.<Artifact>emptySet() ); + } + } + } + } + + ArtifactFilter artifactFilter = getArtifactFilter( mojoDescriptor ); + List<MavenProject> projectsToResolve = + LifecycleDependencyResolver.getProjects( session.getCurrentProject(), session, + mojoDescriptor.isAggregator() ); + for ( MavenProject projectToResolve : projectsToResolve ) + { + projectToResolve.setArtifactFilter( artifactFilter ); + } + } + + private ArtifactFilter getArtifactFilter( MojoDescriptor mojoDescriptor ) + { + String scopeToResolve = mojoDescriptor.getDependencyResolutionRequired(); + String scopeToCollect = mojoDescriptor.getDependencyCollectionRequired(); + + List<String> scopes = new ArrayList<String>( 2 ); + if ( StringUtils.isNotEmpty( scopeToCollect ) ) + { + scopes.add( scopeToCollect ); + } + if ( StringUtils.isNotEmpty( scopeToResolve ) ) + { + scopes.add( scopeToResolve ); + } + + if ( scopes.isEmpty() ) + { + return null; + } + else + { + return new CumulativeScopeArtifactFilter( scopes ); + } + } + + public List<MavenProject> executeForkedExecutions( MojoExecution mojoExecution, MavenSession session, + ProjectIndex projectIndex ) + throws LifecycleExecutionException + { + List<MavenProject> forkedProjects = Collections.emptyList(); + + Map<String, List<MojoExecution>> forkedExecutions = mojoExecution.getForkedExecutions(); + + if ( !forkedExecutions.isEmpty() ) + { + eventCatapult.fire( ExecutionEvent.Type.ForkStarted, session, mojoExecution ); + + MavenProject project = session.getCurrentProject(); + + forkedProjects = new ArrayList<MavenProject>( forkedExecutions.size() ); + + try + { + for ( Map.Entry<String, List<MojoExecution>> fork : forkedExecutions.entrySet() ) + { + String projectId = fork.getKey(); + + int index = projectIndex.getIndices().get( projectId ); + + MavenProject forkedProject = projectIndex.getProjects().get( projectId ); + + forkedProjects.add( forkedProject ); + + MavenProject executedProject = forkedProject.clone(); + + forkedProject.setExecutionProject( executedProject ); + + List<MojoExecution> mojoExecutions = fork.getValue(); + + if ( mojoExecutions.isEmpty() ) + { + continue; + } + + try + { + session.setCurrentProject( executedProject ); + session.getProjects().set( index, executedProject ); + projectIndex.getProjects().put( projectId, executedProject ); + + eventCatapult.fire( ExecutionEvent.Type.ForkedProjectStarted, session, mojoExecution ); + + execute( session, mojoExecutions, projectIndex ); + + eventCatapult.fire( ExecutionEvent.Type.ForkedProjectSucceeded, session, mojoExecution ); + } + catch ( LifecycleExecutionException e ) + { + eventCatapult.fire( ExecutionEvent.Type.ForkedProjectFailed, session, mojoExecution, e ); + + throw e; + } + finally + { + projectIndex.getProjects().put( projectId, forkedProject ); + session.getProjects().set( index, forkedProject ); + session.setCurrentProject( project ); + } + } + + eventCatapult.fire( ExecutionEvent.Type.ForkSucceeded, session, mojoExecution ); + } + catch ( LifecycleExecutionException e ) + { + eventCatapult.fire( ExecutionEvent.Type.ForkFailed, session, mojoExecution, e ); + + throw e; + } + } + + return forkedProjects; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/PhaseRecorder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/PhaseRecorder.java new file mode 100644 index 00000000..a09a3cb9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/PhaseRecorder.java @@ -0,0 +1,78 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.plugin.MojoExecution; +import org.apache.maven.project.MavenProject; + +/** + * @since 3.0 + * @author Benjamin Bentmann + * @author Kristian Rosenvold + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +public class PhaseRecorder +{ + private String lastLifecyclePhase; + + private final MavenProject project; + + public PhaseRecorder( MavenProject project ) + { + this.project = project; + } + + public void observeExecution( MojoExecution mojoExecution ) + { + String lifecyclePhase = mojoExecution.getLifecyclePhase(); + + if ( lifecyclePhase != null ) + { + if ( lastLifecyclePhase == null ) + { + lastLifecyclePhase = lifecyclePhase; + } + else if ( !lifecyclePhase.equals( lastLifecyclePhase ) ) + { + project.addLifecyclePhase( lastLifecyclePhase ); + lastLifecyclePhase = lifecyclePhase; + } + } + + if ( lastLifecyclePhase != null ) + { + project.addLifecyclePhase( lastLifecyclePhase ); + } + } + + public boolean isDifferentPhase( MojoExecution nextMojoExecution ) + { + String lifecyclePhase = nextMojoExecution.getLifecyclePhase(); + if ( lifecyclePhase == null ) + { + return lastLifecyclePhase != null; + } + return !lifecyclePhase.equals( lastLifecyclePhase ); + + } + + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectArtifactFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectArtifactFactory.java new file mode 100644 index 00000000..b4a81075 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectArtifactFactory.java @@ -0,0 +1,38 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; + +/** + * Component interface responsible for creation of MavenProject#dependencyArtifacts instances. + * + * @since 3.2.4 + * @provisional This interface is part of work in progress and can be changed or removed without notice. + */ +public interface ProjectArtifactFactory +{ + Set<Artifact> createArtifacts( MavenProject project ) + throws InvalidDependencyVersionException; +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectBuildList.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectBuildList.java new file mode 100644 index 00000000..6c8fd50a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectBuildList.java @@ -0,0 +1,158 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.project.MavenProject; + +/** + * A list of project segments, ordered so that all ProjectSegments from first TaskSegment come before any + * subsequent TaskSegments. + * + * @since 3.0 + * @author Kristian Rosenvold + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +public class ProjectBuildList + implements Iterable<ProjectSegment> +{ + private final List<ProjectSegment> items; + + public ProjectBuildList( List<ProjectSegment> items ) + { + this.items = Collections.unmodifiableList( items ); + } + + // TODO: Optimize; or maybe just rewrite the whole way aggregating mojos are being run. + /** + * Returns aProjectBuildList that contains only items for the specified taskSegment + * @param taskSegment the requested tasksegment + * @return a project build list for the supplied task segment + */ + public ProjectBuildList getByTaskSegment( TaskSegment taskSegment ) + { + List<ProjectSegment> currentSegment = new ArrayList<ProjectSegment>(); + for ( ProjectSegment projectBuild : items ) + { + if ( taskSegment == projectBuild.getTaskSegment() ) + { // NOTE: There's no notion of taskSegment equality. + currentSegment.add( projectBuild ); + } + } + return new ProjectBuildList( currentSegment ); + } + + public Map<MavenProject, ProjectSegment> selectSegment( TaskSegment taskSegment ) + { + Map<MavenProject, ProjectSegment> result = new HashMap<MavenProject, ProjectSegment>(); + for ( ProjectSegment projectBuild : items ) + { + if ( taskSegment == projectBuild.getTaskSegment() ) + { // NOTE: There's no notion of taskSegment equality. + result.put( projectBuild.getProject(), projectBuild ); + } + } + return result; + } + + /** + * Finds the first ProjectSegment matching the supplied project + * @param mavenProject the requested project + * @return The projectSegment or null. + */ + public ProjectSegment findByMavenProject( MavenProject mavenProject ) + { + for ( ProjectSegment projectBuild : items ) + { + if ( mavenProject.equals( projectBuild.getProject() ) ) + { + return projectBuild; + } + } + return null; + } + + public Iterator<ProjectSegment> iterator() + { + return items.iterator(); + } + + public void closeAll() + { + for ( ProjectSegment item : items ) + { + MavenSession sessionForThisModule = item.getSession(); + sessionForThisModule.setCurrentProject( null ); + } + } + + public int size() + { + return items.size(); + } + + public ProjectSegment get( int index ) + { + return items.get( index ); + } + + public Set<String> getReactorProjectKeys() + { + Set<String> projectKeys = new HashSet<String>( items.size() * 2 ); + for ( ProjectSegment projectBuild : items ) + { + MavenProject project = projectBuild.getProject(); + String key = ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + projectKeys.add( key ); + } + return projectKeys; + } + + + public boolean isEmpty() + { + return items.isEmpty(); + } + + /** + * @return a set of all the projects managed by the build + */ + public Set<MavenProject> getProjects() + { + Set<MavenProject> projects = new HashSet<MavenProject>(); + + for ( ProjectSegment s : items ) + { + projects.add( s.getProject() ); + } + return projects; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectIndex.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectIndex.java new file mode 100644 index 00000000..b1b1d186 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectIndex.java @@ -0,0 +1,70 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.project.MavenProject; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Provides the positional index of the project + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Kristian Rosenvold (extracted class only) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +// Todo: Kristian wonders if this class really is necessary and if it overlaps other concepts. +public final class ProjectIndex +{ + + private final Map<String, MavenProject> projects; + + private final Map<String, Integer> indices; + + public ProjectIndex( List<MavenProject> projects ) + { + this.projects = new HashMap<String, MavenProject>( projects.size() * 2 ); + this.indices = new HashMap<String, Integer>( projects.size() * 2 ); + + for ( int i = 0; i < projects.size(); i++ ) + { + MavenProject project = projects.get( i ); + String key = BuilderCommon.getKey( project ); + + this.getProjects().put( key, project ); + this.getIndices().put( key, i ); + } + } + + public Map<String, MavenProject> getProjects() + { + return projects; + } + + public Map<String, Integer> getIndices() + { + return indices; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectSegment.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectSegment.java new file mode 100644 index 00000000..5ef77454 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ProjectSegment.java @@ -0,0 +1,106 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.project.MavenProject; + +import java.util.List; + +/** + * A build context that matches a mavenproject to a given tasksegment, and the session to be used. + * <p/> + * A note to the reader; + * <p/> + * There are several issues/discussions regarding how "aggregator" plugins should be handled. + * Read for instance http://docs.codehaus.org/display/MAVEN/Deterministic+Lifecycle+Planning + * <p/> + * In their current implementation they are "bolted" onto the lifecycle by separating them + * into TaskSegments. This class represents the execution context of one such task segment. + * <p/> + * Wise voices have suggested that maybe aggregators shouldn't be bound to the ordinary + * lifecycle at all, in which case we wouldn't be needing this class at all ( and + * ProjectBuildList.getByTaskSegments). Or maybe they should be introduced in the calculation + * of the execution plan instead, which seems much nicer. + * <p/> + * Additionally this class contains a clone of the MavenSession, which is *only* needed + * because it has as notion of a "current" project. + * + * @since 3.0 + * @author Jason van Zyl + * @author Benjamin Bentmann + * @author Kristian Rosenvold + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +public final class ProjectSegment +{ + private final MavenProject project; + + private final TaskSegment taskSegment; + + private final MavenSession session; + + private final List<MavenProject> nonTransitiveUpstreamProjects; + + private final List<MavenProject> transitiveUpstreamProjects; + + public ProjectSegment( MavenProject project, TaskSegment taskSegment, MavenSession copiedSession ) + { + this.project = project; + this.taskSegment = taskSegment; + this.session = copiedSession; + final ProjectDependencyGraph dependencyGraph = getSession().getProjectDependencyGraph(); + nonTransitiveUpstreamProjects = dependencyGraph.getUpstreamProjects( getProject(), false ); + transitiveUpstreamProjects = dependencyGraph.getUpstreamProjects( getProject(), true ); + } + + public MavenSession getSession() + { + return session; + } + + public MavenProject getProject() + { + return project; + } + + public TaskSegment getTaskSegment() + { + return taskSegment; + } + + public List<MavenProject> getImmediateUpstreamProjects() + { + return nonTransitiveUpstreamProjects; + } + + public List<MavenProject> getTransitiveUpstreamProjects() + { + return transitiveUpstreamProjects; + } + + @Override + public String toString() + { + return getProject().getId() + " -> " + getTaskSegment(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java new file mode 100644 index 00000000..2e2c3fd4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorBuildStatus.java @@ -0,0 +1,80 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.ProjectDependencyGraph; +import org.apache.maven.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.project.MavenProject; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; + +/** + * Contains status information that is global to an entire reactor build. + * + * @since 3.0 + * @author <a href="mailto:kristian.rosenvold@gmail.com">Kristian Rosenvold</a> + */ +public class ReactorBuildStatus +{ + private final ProjectDependencyGraph projectDependencyGraph; + + private final Collection<String> blackListedProjects = Collections.synchronizedSet( new HashSet<String>() ); + + private volatile boolean halted = false; + + public ReactorBuildStatus( ProjectDependencyGraph projectDependencyGraph ) + { + this.projectDependencyGraph = projectDependencyGraph; + } + + public boolean isBlackListed( MavenProject project ) + { + return blackListedProjects.contains( BuilderCommon.getKey( project ) ); + } + + public void blackList( MavenProject project ) + { + if ( blackListedProjects.add( BuilderCommon.getKey( project ) ) && projectDependencyGraph != null ) + { + for ( MavenProject downstreamProject : projectDependencyGraph.getDownstreamProjects( project, true ) ) + { + blackListedProjects.add( BuilderCommon.getKey( downstreamProject ) ); + } + } + } + + public void halt() + { + halted = true; + } + + public boolean isHalted() + { + return halted; + } + + public boolean isHaltedOrBlacklisted( MavenProject mavenProject ) + { + return isBlackListed( mavenProject ) || isHalted(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorContext.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorContext.java new file mode 100644 index 00000000..7df53140 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/ReactorContext.java @@ -0,0 +1,83 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenExecutionResult; +import org.apache.maven.session.scope.internal.SessionScope; + +/** + * Context that is fixed for the entire reactor build. + * + * @since 3.0 + * @author Jason van Zyl + * @author Kristian Rosenvold + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +public class ReactorContext +{ + private final MavenExecutionResult result; + + private final ProjectIndex projectIndex; + + private final ClassLoader originalContextClassLoader; + + private final ReactorBuildStatus reactorBuildStatus; + + private final SessionScope.Memento sessionScope; + + public ReactorContext( MavenExecutionResult result, ProjectIndex projectIndex, + ClassLoader originalContextClassLoader, ReactorBuildStatus reactorBuildStatus, + SessionScope.Memento sessionScope ) + { + this.result = result; + this.projectIndex = projectIndex; + this.originalContextClassLoader = originalContextClassLoader; + this.reactorBuildStatus = reactorBuildStatus; + this.sessionScope = sessionScope; + } + + public ReactorBuildStatus getReactorBuildStatus() + { + return reactorBuildStatus; + } + + public MavenExecutionResult getResult() + { + return result; + } + + public ProjectIndex getProjectIndex() + { + return projectIndex; + } + + public ClassLoader getOriginalContextClassLoader() + { + return originalContextClassLoader; + } + + /** + * @since 3.3.0 + */ + public SessionScope.Memento getSessionScopeMemento() + { + return sessionScope; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/TaskSegment.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/TaskSegment.java new file mode 100644 index 00000000..9551887c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/TaskSegment.java @@ -0,0 +1,73 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Describes the required task segment as provided on the maven command line; i.e. "clean jetty:run install" + * + * @since 3.0 + * @author Benjamin Bentmann + * @author Kristian Rosenvold (extracted class only) + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +public final class TaskSegment +{ + + // Can be both "LifeCycleTask" (clean/install) and "GoalTask" (org.mortbay.jetty:maven-jetty-plugin:6.1.19:run) + + private final List<Object> tasks; + + private final boolean aggregating; + + public TaskSegment( boolean aggregating ) + { + this.aggregating = aggregating; + tasks = new ArrayList<Object>(); + } + + public TaskSegment( boolean aggregating, Object... tasks ) + { + this.aggregating = aggregating; + this.tasks = new ArrayList<Object>( Arrays.asList( tasks ) ); + } + + @Override + public String toString() + { + return getTasks().toString(); + } + + public List<Object> getTasks() + { + return tasks; + } + + public boolean isAggregating() + { + return aggregating; + } + + // TODO: Consider throwing UnsupprtedSomething on hashCode/equals +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/Builder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/Builder.java new file mode 100644 index 00000000..155abf92 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/Builder.java @@ -0,0 +1,47 @@ +package org.apache.maven.lifecycle.internal.builder; + +/* + * 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.concurrent.ExecutionException; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ReactorBuildStatus; +import org.apache.maven.lifecycle.internal.ReactorContext; +import org.apache.maven.lifecycle.internal.TaskSegment; + +/** + * A {@link Builder} encapsulates a strategy for building a set of Maven projects. The default strategy in Maven builds + * the the projects serially, but a {@link Builder} can employ any type of concurrency model to build the projects. + * + * @author jvanzyl + * @provisional + */ +public interface Builder +{ + // + // Be nice to whittle this down to Session, maybe add task segments to the session. The session really is the + // the place to store reactor related information. + // + void build( MavenSession session, ReactorContext reactorContext, ProjectBuildList projectBuilds, + List<TaskSegment> taskSegments, ReactorBuildStatus reactorBuildStatus ) + throws ExecutionException, InterruptedException; +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java new file mode 100644 index 00000000..34fb323e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java @@ -0,0 +1,199 @@ +package org.apache.maven.lifecycle.internal.builder; + +/* + * 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.Artifact; +import org.apache.maven.execution.BuildFailure; +import org.apache.maven.execution.ExecutionEvent; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleExecutionException; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.internal.ExecutionEventCatapult; +import org.apache.maven.lifecycle.internal.LifecycleDebugLogger; +import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator; +import org.apache.maven.lifecycle.internal.ReactorContext; +import org.apache.maven.lifecycle.internal.TaskSegment; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; + +import java.util.Set; + +/** + * Common code that is shared by the LifecycleModuleBuilder and the LifeCycleWeaveBuilder + * + * @since 3.0 + * @author Kristian Rosenvold + * Builds one or more lifecycles for a full module + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = BuilderCommon.class ) +public class BuilderCommon +{ + @Requirement + private LifecycleDebugLogger lifecycleDebugLogger; + + @Requirement + private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator; + + @Requirement + private ExecutionEventCatapult eventCatapult; + + @Requirement + private Logger logger; + + + public BuilderCommon() + { + } + + public BuilderCommon( LifecycleDebugLogger lifecycleDebugLogger, + LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator, Logger logger ) + { + this.lifecycleDebugLogger = lifecycleDebugLogger; + this.lifeCycleExecutionPlanCalculator = lifeCycleExecutionPlanCalculator; + this.logger = logger; + } + + public MavenExecutionPlan resolveBuildPlan( MavenSession session, MavenProject project, TaskSegment taskSegment, + Set<Artifact> projectArtifacts ) + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException, + LifecycleExecutionException + { + MavenExecutionPlan executionPlan = + lifeCycleExecutionPlanCalculator.calculateExecutionPlan( session, project, taskSegment.getTasks() ); + + lifecycleDebugLogger.debugProjectPlan( project, executionPlan ); + + if ( session.getRequest().getDegreeOfConcurrency() > 1 ) + { + final Set<Plugin> unsafePlugins = executionPlan.getNonThreadSafePlugins(); + if ( !unsafePlugins.isEmpty() && logger.isDebugEnabled() ) + { + logger.warn( "*****************************************************************" ); + logger.warn( "* Your build is requesting parallel execution, but project *" ); + logger.warn( "* contains the following plugin(s) that have goals not marked *" ); + logger.warn( "* as @threadSafe to support parallel building. *" ); + logger.warn( "* While this /may/ work fine, please look for plugin updates *" ); + logger.warn( "* and/or request plugins be made thread-safe. *" ); + logger.warn( "* If reporting an issue, report it against the plugin in *" ); + logger.warn( "* question, not against maven-core *" ); + logger.warn( "*****************************************************************" ); + if ( logger.isDebugEnabled() ) + { + final Set<MojoDescriptor> unsafeGoals = executionPlan.getNonThreadSafeMojos(); + logger.warn( "The following goals are not marked @threadSafe in " + project.getName() + ":" ); + for ( MojoDescriptor unsafeGoal : unsafeGoals ) + { + logger.warn( unsafeGoal.getId() ); + } + } + else + { + logger.warn( "The following plugins are not marked @threadSafe in " + project.getName() + ":" ); + for ( Plugin unsafePlugin : unsafePlugins ) + { + logger.warn( unsafePlugin.getId() ); + } + logger.warn( "Enable debug to see more precisely which goals are not marked @threadSafe." ); + } + logger.warn( "*****************************************************************" ); + } + } + + return executionPlan; + } + + public void handleBuildError( final ReactorContext buildContext, final MavenSession rootSession, + final MavenSession currentSession, final MavenProject mavenProject, Throwable t, + final long buildStartTime ) + { + // record the error and mark the project as failed + long buildEndTime = System.currentTimeMillis(); + buildContext.getResult().addException( t ); + buildContext.getResult().addBuildSummary( new BuildFailure( mavenProject, buildEndTime - buildStartTime, t ) ); + + // notify listeners about "soft" project build failures only + if ( t instanceof Exception && !( t instanceof RuntimeException ) ) + { + eventCatapult.fire( ExecutionEvent.Type.ProjectFailed, currentSession, null, (Exception) t ); + } + + // reactor failure modes + if ( t instanceof RuntimeException || !( t instanceof Exception ) ) + { + // fail fast on RuntimeExceptions, Errors and "other" Throwables + // assume these are system errors and further build is meaningless + buildContext.getReactorBuildStatus().halt(); + } + else if ( MavenExecutionRequest.REACTOR_FAIL_NEVER.equals( rootSession.getReactorFailureBehavior() ) ) + { + // continue the build + } + else if ( MavenExecutionRequest.REACTOR_FAIL_AT_END.equals( rootSession.getReactorFailureBehavior() ) ) + { + // continue the build but ban all projects that depend on the failed one + buildContext.getReactorBuildStatus().blackList( mavenProject ); + } + else if ( MavenExecutionRequest.REACTOR_FAIL_FAST.equals( rootSession.getReactorFailureBehavior() ) ) + { + buildContext.getReactorBuildStatus().halt(); + } + else + { + logger.error( "invalid reactor failure behavior " + rootSession.getReactorFailureBehavior() ); + buildContext.getReactorBuildStatus().halt(); + } + } + + public static void attachToThread( MavenProject currentProject ) + { + ClassRealm projectRealm = currentProject.getClassRealm(); + if ( projectRealm != null ) + { + Thread.currentThread().setContextClassLoader( projectRealm ); + } + } + + // Todo: I'm really wondering where this method belongs; smells like it should be on MavenProject, but for some + // reason it isn't ? This localization is kind-of a code smell. + + public static String getKey( MavenProject project ) + { + return project.getGroupId() + ':' + project.getArtifactId() + ':' + project.getVersion(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderNotFoundException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderNotFoundException.java new file mode 100644 index 00000000..52c668f1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderNotFoundException.java @@ -0,0 +1,29 @@ +package org.apache.maven.lifecycle.internal.builder; + +/* + * 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 BuilderNotFoundException + extends Exception +{ + public BuilderNotFoundException( String message ) + { + super( message ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java new file mode 100644 index 00000000..de6a5a31 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java @@ -0,0 +1,153 @@ +package org.apache.maven.lifecycle.internal.builder.multithreaded; + +/* + * 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.execution.ProjectDependencyGraph; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; +import org.apache.maven.project.MavenProject; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Presents a view of the Dependency Graph that is suited for concurrent building. + * + * @since 3.0 + * @author Kristian Rosenvold + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +public class ConcurrencyDependencyGraph +{ + + private final ProjectBuildList projectBuilds; + + private final ProjectDependencyGraph projectDependencyGraph; + + private final HashSet<MavenProject> finishedProjects = new HashSet<MavenProject>(); + + public ConcurrencyDependencyGraph( ProjectBuildList projectBuilds, ProjectDependencyGraph projectDependencyGraph ) + { + this.projectDependencyGraph = projectDependencyGraph; + this.projectBuilds = projectBuilds; + } + + public int getNumberOfBuilds() + { + return projectBuilds.size(); + } + + /** + * Gets all the builds that have no reactor-dependencies + * + * @return A list of all the initial builds + */ + + public List<MavenProject> getRootSchedulableBuilds() + { + List<MavenProject> result = new ArrayList<MavenProject>(); + for ( ProjectSegment projectBuild : projectBuilds ) + { + if ( projectDependencyGraph.getUpstreamProjects( projectBuild.getProject(), false ).size() == 0 ) + { + result.add( projectBuild.getProject() ); + } + } + return result; + } + + /** + * Marks the provided project as finished. Returns a list of + * + * @param mavenProject The project + * @return The list of builds that are eligible for starting now that the provided project is done + */ + public List<MavenProject> markAsFinished( MavenProject mavenProject ) + { + finishedProjects.add( mavenProject ); + return getSchedulableNewProcesses( mavenProject ); + } + + private List<MavenProject> getSchedulableNewProcesses( MavenProject finishedProject ) + { + List<MavenProject> result = new ArrayList<MavenProject>(); + // schedule dependent projects, if all of their requirements are met + for ( MavenProject dependentProject : projectDependencyGraph.getDownstreamProjects( finishedProject, false ) ) + { + final List<MavenProject> upstreamProjects = + projectDependencyGraph.getUpstreamProjects( dependentProject, false ); + if ( finishedProjects.containsAll( upstreamProjects ) ) + { + result.add( dependentProject ); + } + } + return result; + } + + /** + * @return set of projects that have yet to be processed successfully by the build. + */ + public Set<MavenProject> getUnfinishedProjects() + { + Set<MavenProject> unfinished = new HashSet<MavenProject>( projectBuilds.getProjects() ); + unfinished.remove( finishedProjects ); + return unfinished; + } + + /** + * @return set of projects that have been successfully processed by the build. + */ + protected Set<MavenProject> getFinishedProjects() + { + return finishedProjects; + } + + protected ProjectBuildList getProjectBuilds() + { + return projectBuilds; + } + + /** + * For the given {@link MavenProject} {@code p}, return all of {@code p}'s dependencies. + * + * @param p + * @return List of prerequisite projects + */ + protected List<MavenProject> getDependencies( MavenProject p ) + { + return projectDependencyGraph.getUpstreamProjects( p, false ); + } + + /** + * For the given {@link MavenProject} {@code p} return {@code p}'s uncompleted dependencies. + * + * @param p + * @return List of uncompleted prerequisite projects + */ + public List<MavenProject> getActiveDependencies( MavenProject p ) + { + List<MavenProject> activeDependencies = projectDependencyGraph.getUpstreamProjects( p, false ); + activeDependencies.removeAll( finishedProjects ); + return activeDependencies; + } +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java new file mode 100644 index 00000000..906e5e75 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java @@ -0,0 +1,197 @@ +package org.apache.maven.lifecycle.internal.builder.multithreaded; + +/* + * 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.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionService; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorCompletionService; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.internal.BuildThreadFactory; +import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; +import org.apache.maven.lifecycle.internal.ReactorBuildStatus; +import org.apache.maven.lifecycle.internal.ReactorContext; +import org.apache.maven.lifecycle.internal.TaskSegment; +import org.apache.maven.lifecycle.internal.builder.Builder; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; + +/** + * Builds the full lifecycle in weave-mode (phase by phase as opposed to project-by-project) + * + * @since 3.0 + * @author Kristian Rosenvold + * Builds one or more lifecycles for a full module + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + */ +@Component( role = Builder.class, hint = "multithreaded" ) +public class MultiThreadedBuilder + implements Builder +{ + + @Requirement + private Logger logger; + + @Requirement + private LifecycleModuleBuilder lifecycleModuleBuilder; + + + public MultiThreadedBuilder() + { + } + + @Override + public void build( MavenSession session, ReactorContext reactorContext, ProjectBuildList projectBuilds, + List<TaskSegment> taskSegments, ReactorBuildStatus reactorBuildStatus ) + throws ExecutionException, InterruptedException + { + ExecutorService executor = + Executors.newFixedThreadPool( Math.min( session.getRequest().getDegreeOfConcurrency(), + session.getProjects().size() ), new BuildThreadFactory() ); + CompletionService<ProjectSegment> service = new ExecutorCompletionService<ProjectSegment>( executor ); + ConcurrencyDependencyGraph analyzer = + new ConcurrencyDependencyGraph( projectBuilds, session.getProjectDependencyGraph() ); + + // Currently disabled + ThreadOutputMuxer muxer = null; // new ThreadOutputMuxer( analyzer.getProjectBuilds(), System.out ); + + for ( TaskSegment taskSegment : taskSegments ) + { + Map<MavenProject, ProjectSegment> projectBuildMap = projectBuilds.selectSegment( taskSegment ); + try + { + multiThreadedProjectTaskSegmentBuild( analyzer, reactorContext, session, service, taskSegment, + projectBuildMap, muxer ); + if ( reactorContext.getReactorBuildStatus().isHalted() ) + { + break; + } + } + catch ( Exception e ) + { + session.getResult().addException( e ); + break; + } + + } + } + + private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph analyzer, + ReactorContext reactorContext, MavenSession rootSession, + CompletionService<ProjectSegment> service, + TaskSegment taskSegment, + Map<MavenProject, ProjectSegment> projectBuildList, + ThreadOutputMuxer muxer ) + { + + // schedule independent projects + for ( MavenProject mavenProject : analyzer.getRootSchedulableBuilds() ) + { + ProjectSegment projectSegment = projectBuildList.get( mavenProject ); + logger.debug( "Scheduling: " + projectSegment.getProject() ); + Callable<ProjectSegment> cb = + createBuildCallable( rootSession, projectSegment, reactorContext, taskSegment, muxer ); + service.submit( cb ); + } + + // for each finished project + for ( int i = 0; i < analyzer.getNumberOfBuilds(); i++ ) + { + try + { + ProjectSegment projectBuild = service.take().get(); + if ( reactorContext.getReactorBuildStatus().isHalted() ) + { + break; + } + final List<MavenProject> newItemsThatCanBeBuilt = + analyzer.markAsFinished( projectBuild.getProject() ); + for ( MavenProject mavenProject : newItemsThatCanBeBuilt ) + { + ProjectSegment scheduledDependent = projectBuildList.get( mavenProject ); + logger.debug( "Scheduling: " + scheduledDependent ); + Callable<ProjectSegment> cb = + createBuildCallable( rootSession, scheduledDependent, reactorContext, taskSegment, muxer ); + service.submit( cb ); + } + } + catch ( InterruptedException e ) + { + rootSession.getResult().addException( e ); + break; + } + catch ( ExecutionException e ) + { + // TODO MNG-5766 changes likely made this redundant + rootSession.getResult().addException( e ); + break; + } + } + + // cancel outstanding builds (if any) - this can happen if an exception is thrown in above block + + Future<ProjectSegment> unprocessed; + while ( ( unprocessed = service.poll() ) != null ) + { + try + { + unprocessed.get(); + } + catch ( InterruptedException e ) + { + throw new RuntimeException( e ); + } + catch ( ExecutionException e ) + { + throw new RuntimeException( e ); + } + } + } + + private Callable<ProjectSegment> createBuildCallable( final MavenSession rootSession, + final ProjectSegment projectBuild, + final ReactorContext reactorContext, + final TaskSegment taskSegment, final ThreadOutputMuxer muxer ) + { + return new Callable<ProjectSegment>() + { + public ProjectSegment call() + { + // muxer.associateThreadWithProjectSegment( projectBuild ); + lifecycleModuleBuilder.buildProject( projectBuild.getSession(), rootSession, reactorContext, + projectBuild.getProject(), taskSegment ); + // muxer.setThisModuleComplete( projectBuild ); + + return projectBuild; + } + }; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java new file mode 100644 index 00000000..8f1f4932 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxer.java @@ -0,0 +1,477 @@ +package org.apache.maven.lifecycle.internal.builder.multithreaded; + +/* + * 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.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; + +/** + * @since 3.0 + * @author Kristian Rosenvold + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + * This class in particular may spontaneusly self-combust and be replaced by a plexus-compliant thread aware + * logger implementation at any time. + */ +@SuppressWarnings( { "SynchronizationOnLocalVariableOrMethodParameter" } ) +public class ThreadOutputMuxer +{ + private final Iterator<ProjectSegment> projects; + + private final ThreadLocal<ProjectSegment> projectBuildThreadLocal = new ThreadLocal<ProjectSegment>(); + + private final Map<ProjectSegment, ByteArrayOutputStream> streams = + new HashMap<ProjectSegment, ByteArrayOutputStream>(); + + private final Map<ProjectSegment, PrintStream> printStreams = new HashMap<ProjectSegment, PrintStream>(); + + private final ByteArrayOutputStream defaultOutputStreamForUnknownData = new ByteArrayOutputStream(); + + private final PrintStream defaultPringStream = new PrintStream( defaultOutputStreamForUnknownData ); + + private final Set<ProjectSegment> completedBuilds = Collections.synchronizedSet( new HashSet<ProjectSegment>() ); + + private volatile ProjectSegment currentBuild; + + private final PrintStream originalSystemOUtStream; + + private final ConsolePrinter printer; + + /** + * A simple but safe solution for printing to the console. + */ + + class ConsolePrinter + implements Runnable + { + public volatile boolean running; + + private final ProjectBuildList projectBuildList; + + ConsolePrinter( ProjectBuildList projectBuildList ) + { + this.projectBuildList = projectBuildList; + } + + public void run() + { + running = true; + for ( ProjectSegment projectBuild : projectBuildList ) + { + final PrintStream projectStream = printStreams.get( projectBuild ); + ByteArrayOutputStream projectOs = streams.get( projectBuild ); + + do + { + synchronized ( projectStream ) + { + try + { + projectStream.wait( 100 ); + } + catch ( InterruptedException e ) + { + throw new RuntimeException( e ); + } + try + { + projectOs.writeTo( originalSystemOUtStream ); + } + catch ( IOException e ) + { + throw new RuntimeException( e ); + } + + projectOs.reset(); + } + } + while ( !completedBuilds.contains( projectBuild ) ); + } + running = false; + } + + /* + Wait until we are sure the print-stream thread is running. + */ + + public void waitUntilRunning( boolean expect ) + { + while ( !running == expect ) + { + try + { + Thread.sleep( 10 ); + } + catch ( InterruptedException e ) + { + throw new RuntimeException( e ); + } + } + } + } + + public ThreadOutputMuxer( ProjectBuildList segmentChunks, PrintStream originalSystemOut ) + { + projects = segmentChunks.iterator(); + for ( ProjectSegment segmentChunk : segmentChunks ) + { + final ByteArrayOutputStream value = new ByteArrayOutputStream(); + streams.put( segmentChunk, value ); + printStreams.put( segmentChunk, new PrintStream( value ) ); + } + setNext(); + this.originalSystemOUtStream = originalSystemOut; + System.setOut( new ThreadBoundPrintStream( this.originalSystemOUtStream ) ); + printer = new ConsolePrinter( segmentChunks ); + new Thread( printer ).start(); + printer.waitUntilRunning( true ); + } + + public void close() + { + printer.waitUntilRunning( false ); + System.setOut( this.originalSystemOUtStream ); + } + + private void setNext() + { + currentBuild = projects.hasNext() ? projects.next() : null; + } + + private boolean ownsRealOutputStream( ProjectSegment projectBuild ) + { + return projectBuild.equals( currentBuild ); + } + + private PrintStream getThreadBoundPrintStream() + { + ProjectSegment threadProject = projectBuildThreadLocal.get(); + if ( threadProject == null ) + { + return defaultPringStream; + } + if ( ownsRealOutputStream( threadProject ) ) + { + return originalSystemOUtStream; + } + return printStreams.get( threadProject ); + } + + public void associateThreadWithProjectSegment( ProjectSegment projectBuild ) + { + projectBuildThreadLocal.set( projectBuild ); + } + + public void setThisModuleComplete( ProjectSegment projectBuild ) + { + completedBuilds.add( projectBuild ); + PrintStream stream = printStreams.get( projectBuild ); + synchronized ( stream ) + { + stream.notifyAll(); + } + disconnectThreadFromProject(); + } + + private void disconnectThreadFromProject() + { + projectBuildThreadLocal.remove(); + } + + private class ThreadBoundPrintStream + extends PrintStream + { + + public ThreadBoundPrintStream( PrintStream systemOutStream ) + { + super( systemOutStream ); + } + + private PrintStream getOutputStreamForCurrentThread() + { + return getThreadBoundPrintStream(); + } + + @Override + public void println() + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.println(); + currentStream.notifyAll(); + } + } + + @Override + public void print( char c ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( c ); + currentStream.notifyAll(); + } + } + + @Override + public void println( char x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.println( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( double d ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( d ); + currentStream.notifyAll(); + } + } + + @Override + public void println( double x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.println( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( float f ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( f ); + currentStream.notifyAll(); + } + } + + @Override + public void println( float x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.println( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( int i ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( i ); + currentStream.notifyAll(); + } + } + + @Override + public void println( int x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.println( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( long l ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( l ); + currentStream.notifyAll(); + } + } + + @Override + public void println( long x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( boolean b ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( b ); + currentStream.notifyAll(); + } + } + + @Override + public void println( boolean x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( char s[] ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( s ); + currentStream.notifyAll(); + } + } + + @Override + public void println( char x[] ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( Object obj ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( obj ); + currentStream.notifyAll(); + } + } + + @Override + public void println( Object x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.println( x ); + currentStream.notifyAll(); + } + } + + @Override + public void print( String s ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.print( s ); + currentStream.notifyAll(); + } + } + + @Override + public void println( String x ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.println( x ); + currentStream.notifyAll(); + } + } + + @Override + public void write( byte b[], int off, int len ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.write( b, off, len ); + currentStream.notifyAll(); + } + } + + @Override + public void close() + { + getOutputStreamForCurrentThread().close(); + } + + @Override + public void flush() + { + getOutputStreamForCurrentThread().flush(); + } + + @Override + public void write( int b ) + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.write( b ); + currentStream.notifyAll(); + } + } + + @Override + public void write( byte b[] ) + throws IOException + { + final PrintStream currentStream = getOutputStreamForCurrentThread(); + synchronized ( currentStream ) + { + currentStream.write( b ); + currentStream.notifyAll(); + } + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.java new file mode 100644 index 00000000..464944f1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/singlethreaded/SingleThreadedBuilder.java @@ -0,0 +1,65 @@ +package org.apache.maven.lifecycle.internal.builder.singlethreaded; + +/* + * 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.execution.MavenSession; +import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; +import org.apache.maven.lifecycle.internal.ReactorBuildStatus; +import org.apache.maven.lifecycle.internal.ReactorContext; +import org.apache.maven.lifecycle.internal.TaskSegment; +import org.apache.maven.lifecycle.internal.builder.Builder; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +@Component( role = Builder.class, hint = "singlethreaded" ) +public class SingleThreadedBuilder + implements Builder +{ + @Requirement + private LifecycleModuleBuilder lifecycleModuleBuilder; + + public void build( MavenSession session, ReactorContext reactorContext, ProjectBuildList projectBuilds, + List<TaskSegment> taskSegments, ReactorBuildStatus reactorBuildStatus ) + { + for ( TaskSegment taskSegment : taskSegments ) + { + for ( ProjectSegment projectBuild : projectBuilds.getByTaskSegment( taskSegment ) ) + { + try + { + lifecycleModuleBuilder.buildProject( session, reactorContext, projectBuild.getProject(), + taskSegment ); + if ( reactorBuildStatus.isHalted() ) + { + break; + } + } + catch ( Exception e ) + { + break; // Why are we just ignoring this exception? Are exceptions are being used for flow control + } + } + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java new file mode 100644 index 00000000..9947e2fc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java @@ -0,0 +1,111 @@ +package org.apache.maven.lifecycle.mapping; + +/* + * 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.HashMap; +import java.util.List; +import java.util.Map; + +public class DefaultLifecycleMapping + implements LifecycleMapping +{ + + private List<Lifecycle> lifecycles; + + private Map<String, Lifecycle> lifecycleMap; + + /** @deprecated use lifecycles instead */ + private Map<String, String> phases; + + /** + * Populates the lifecycle map from the injected list of lifecycle mappings (if not already done). + */ + private void initLifecycleMap() + { + if ( lifecycleMap == null ) + { + lifecycleMap = new HashMap<String, Lifecycle>(); + + if ( lifecycles != null ) + { + for ( Lifecycle lifecycle : lifecycles ) + { + lifecycleMap.put( lifecycle.getId(), lifecycle ); + } + } + else + { + /* + * NOTE: This is to provide a migration path for implementors of the legacy API which did not know about + * getLifecycles(). + */ + + String[] lifecycleIds = { "default", "clean", "site" }; + + for ( String lifecycleId : lifecycleIds ) + { + Map<String, String> phases = getPhases( lifecycleId ); + if ( phases != null ) + { + Lifecycle lifecycle = new Lifecycle(); + + lifecycle.setId( lifecycleId ); + lifecycle.setPhases( phases ); + + lifecycleMap.put( lifecycleId, lifecycle ); + } + } + } + } + } + + public Map<String, Lifecycle> getLifecycles() + { + initLifecycleMap(); + + return lifecycleMap; + } + + public List<String> getOptionalMojos( String lifecycle ) + { + return null; + } + + public Map<String, String> getPhases( String lifecycle ) + { + initLifecycleMap(); + + Lifecycle lifecycleMapping = lifecycleMap.get( lifecycle ); + + if ( lifecycleMapping != null ) + { + return lifecycleMapping.getPhases(); + } + else if ( "default".equals( lifecycle ) ) + { + return phases; + } + else + { + return null; + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java new file mode 100644 index 00000000..6adf4f34 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Lifecycle.java @@ -0,0 +1,83 @@ +package org.apache.maven.lifecycle.mapping; + +/* + * 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.Map; + +/** + * Class Lifecycle. + */ +public class Lifecycle +{ + /** + * Field id + */ + private String id; + + /** + * Field phases + */ + private Map<String, String> phases; + + /* + * NOTE: This exists merely for backward-compat with legacy-style lifecycle definitions and allows configuration + * injection to work instead of failing. + */ + @SuppressWarnings( "unused" ) + private List<String> optionalMojos; + + /** + * Method getId + */ + public String getId() + { + return this.id; + } + + /** + * Method getPhases + */ + public Map<String, String> getPhases() + { + return this.phases; + } + + /** + * Method setId + * + * @param id + */ + public void setId( String id ) + { + this.id = id; + } + + /** + * Method setPhases + * + * @param phases + */ + public void setPhases( Map<String, String> phases ) + { + this.phases = phases; + } //-- void setPhases(java.util.List) + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java new file mode 100644 index 00000000..e656cc9f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java @@ -0,0 +1,39 @@ +package org.apache.maven.lifecycle.mapping; + +/* + * 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.Map; + +public interface LifecycleMapping +{ + + @Deprecated + String ROLE = LifecycleMapping.class.getName(); + + Map<String, Lifecycle> getLifecycles(); + + @Deprecated + List<String> getOptionalMojos( String lifecycle ); + + @Deprecated + Map<String, String> getPhases( String lifecycle ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java new file mode 100644 index 00000000..1702aa1e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java @@ -0,0 +1,171 @@ +package org.apache.maven.model.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 java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; +import org.apache.maven.model.Build; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginContainer; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.model.PluginManagement; +import org.apache.maven.model.building.ModelBuildingRequest; +import org.apache.maven.model.building.ModelProblemCollector; +import org.apache.maven.model.building.ModelProblem.Severity; +import org.apache.maven.model.building.ModelProblem.Version; +import org.apache.maven.model.building.ModelProblemCollectorRequest; +import org.apache.maven.model.merge.MavenModelMerger; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +/** + * Handles injection of plugin executions induced by the lifecycle bindings for a packaging. + * + * @author Benjamin Bentmann + */ +@Component( role = LifecycleBindingsInjector.class ) +public class DefaultLifecycleBindingsInjector + implements LifecycleBindingsInjector +{ + + private LifecycleBindingsMerger merger = new LifecycleBindingsMerger(); + + @Requirement + private LifeCyclePluginAnalyzer lifecycle; + + public void injectLifecycleBindings( Model model, ModelBuildingRequest request, ModelProblemCollector problems ) + { + String packaging = model.getPackaging(); + + Collection<Plugin> defaultPlugins = lifecycle.getPluginsBoundByDefaultToAllLifecycles( packaging ); + + if ( defaultPlugins == null ) + { + problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Unknown packaging: " + packaging ) + .setLocation( model.getLocation( "packaging" ) ) ); + } + else if ( !defaultPlugins.isEmpty() ) + { + Model lifecycleModel = new Model(); + lifecycleModel.setBuild( new Build() ); + lifecycleModel.getBuild().getPlugins().addAll( defaultPlugins ); + + merger.merge( model, lifecycleModel ); + } + } + + protected static class LifecycleBindingsMerger + extends MavenModelMerger + { + + private static final String PLUGIN_MANAGEMENT = "plugin-management"; + + public void merge( Model target, Model source ) + { + if ( target.getBuild() == null ) + { + target.setBuild( new Build() ); + } + + Map<Object, Object> context = + Collections.<Object, Object>singletonMap( PLUGIN_MANAGEMENT, target.getBuild().getPluginManagement() ); + + mergePluginContainer_Plugins( target.getBuild(), source.getBuild(), false, context ); + } + + @Override + protected void mergePluginContainer_Plugins( PluginContainer target, PluginContainer source, + boolean sourceDominant, Map<Object, Object> context ) + { + List<Plugin> src = source.getPlugins(); + if ( !src.isEmpty() ) + { + List<Plugin> tgt = target.getPlugins(); + + Map<Object, Plugin> merged = new LinkedHashMap<Object, Plugin>( ( src.size() + tgt.size() ) * 2 ); + + for ( Plugin element : tgt ) + { + Object key = getPluginKey( element ); + merged.put( key, element ); + } + + Map<Object, Plugin> unmanaged = new LinkedHashMap<Object, Plugin>(); + + for ( Plugin element : src ) + { + Object key = getPluginKey( element ); + Plugin existing = merged.get( key ); + if ( existing != null ) + { + mergePlugin( existing, element, sourceDominant, context ); + } + else + { + merged.put( key, element ); + unmanaged.put( key, element ); + } + } + + if ( !unmanaged.isEmpty() ) + { + PluginManagement pluginMgmt = (PluginManagement) context.get( PLUGIN_MANAGEMENT ); + if ( pluginMgmt != null ) + { + for ( Plugin managedPlugin : pluginMgmt.getPlugins() ) + { + Object key = getPluginKey( managedPlugin ); + Plugin unmanagedPlugin = unmanaged.get( key ); + if ( unmanagedPlugin != null ) + { + Plugin plugin = managedPlugin.clone(); + mergePlugin( plugin, unmanagedPlugin, sourceDominant, Collections.emptyMap() ); + merged.put( key, plugin ); + } + } + } + } + + List<Plugin> result = new ArrayList<Plugin>( merged.values() ); + + target.setPlugins( result ); + } + } + + @Override + protected void mergePluginExecution( PluginExecution target, PluginExecution source, boolean sourceDominant, + Map<Object, Object> context ) + { + super.mergePluginExecution( target, source, sourceDominant, context ); + + target.setPriority( Math.min( target.getPriority(), source.getPriority() ) ); + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/monitor/event/EventDispatcher.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/monitor/event/EventDispatcher.java new file mode 100644 index 00000000..492a2980 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/monitor/event/EventDispatcher.java @@ -0,0 +1,37 @@ +package org.apache.maven.monitor.event; + +/* + * 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. + */ + +/** + * @author jdcasey + */ +@Deprecated +public interface EventDispatcher +{ + + void addEventMonitor( EventMonitor monitor ); + + void dispatchStart( String event, String target ); + + void dispatchEnd( String event, String target ); + + void dispatchError( String event, String target, Throwable cause ); + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/monitor/event/EventMonitor.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/monitor/event/EventMonitor.java new file mode 100644 index 00000000..3e726746 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/monitor/event/EventMonitor.java @@ -0,0 +1,35 @@ +package org.apache.maven.monitor.event; + +/* + * 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. + */ + +/** + * @author jdcasey + */ +@Deprecated +public interface EventMonitor +{ + + void startEvent( String eventName, String target, long timestamp ); + + void endEvent( String eventName, String target, long timestamp ); + + void errorEvent( String eventName, String target, long timestamp, Throwable cause ); + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java new file mode 100644 index 00000000..6c1b9cbf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/BuildPluginManager.java @@ -0,0 +1,54 @@ +package org.apache.maven.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 java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * @author Jason van Zyl + */ +public interface BuildPluginManager +{ + // igorf: Way too many declared exceptions! + PluginDescriptor loadPlugin( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + InvalidPluginDescriptorException; + + // igorf: Way too many declared exceptions! + MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException; + + ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor ) + throws PluginResolutionException, PluginManagerException; + + void executeMojo( MavenSession session, MojoExecution execution ) + throws MojoFailureException, MojoExecutionException, PluginConfigurationException, PluginManagerException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CacheUtils.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CacheUtils.java new file mode 100644 index 00000000..a73e1efe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CacheUtils.java @@ -0,0 +1,211 @@ +package org.apache.maven.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 java.util.Iterator; +import java.util.List; + +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Exclusion; +import org.apache.maven.model.Plugin; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.repository.WorkspaceReader; +import org.eclipse.aether.repository.WorkspaceRepository; + +/** + * @author Benjamin Bentmann + */ +class CacheUtils +{ + + public static <T> boolean eq( T s1, T s2 ) + { + return s1 != null ? s1.equals( s2 ) : s2 == null; + } + + public static int hash( Object obj ) + { + return obj != null ? obj.hashCode() : 0; + } + + public static int repositoriesHashCode( List<RemoteRepository> repositories ) + { + int result = 17; + for ( RemoteRepository repository : repositories ) + { + result = 31 * result + repositoryHashCode( repository ); + } + return result; + } + + private static int repositoryHashCode( RemoteRepository repository ) + { + int result = 17; + result = 31 * result + hash( repository.getUrl() ); + return result; + } + + private static boolean repositoryEquals( RemoteRepository r1, RemoteRepository r2 ) + { + if ( r1 == r2 ) + { + return true; + } + + return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() ) + && policyEquals( r1.getPolicy( false ), r2.getPolicy( false ) ) + && policyEquals( r1.getPolicy( true ), r2.getPolicy( true ) ); + } + + private static boolean policyEquals( RepositoryPolicy p1, RepositoryPolicy p2 ) + { + if ( p1 == p2 ) + { + return true; + } + // update policy doesn't affect contents + return p1.isEnabled() == p2.isEnabled() && eq( p1.getChecksumPolicy(), p2.getChecksumPolicy() ); + } + + public static boolean repositoriesEquals( List<RemoteRepository> r1, List<RemoteRepository> r2 ) + { + if ( r1.size() != r2.size() ) + { + return false; + } + + for ( Iterator<RemoteRepository> it1 = r1.iterator(), it2 = r2.iterator(); it1.hasNext(); ) + { + if ( !repositoryEquals( it1.next(), it2.next() ) ) + { + return false; + } + } + + return true; + } + + public static int pluginHashCode( Plugin plugin ) + { + int hash = 17; + + hash = hash * 31 + hash( plugin.getGroupId() ); + hash = hash * 31 + hash( plugin.getArtifactId() ); + hash = hash * 31 + hash( plugin.getVersion() ); + + hash = hash * 31 + ( plugin.isExtensions() ? 1 : 0 ); + + for ( Dependency dependency : plugin.getDependencies() ) + { + hash = hash * 31 + hash( dependency.getGroupId() ); + hash = hash * 31 + hash( dependency.getArtifactId() ); + hash = hash * 31 + hash( dependency.getVersion() ); + hash = hash * 31 + hash( dependency.getType() ); + hash = hash * 31 + hash( dependency.getClassifier() ); + hash = hash * 31 + hash( dependency.getScope() ); + + for ( Exclusion exclusion : dependency.getExclusions() ) + { + hash = hash * 31 + hash( exclusion.getGroupId() ); + hash = hash * 31 + hash( exclusion.getArtifactId() ); + } + } + + return hash; + } + + public static boolean pluginEquals( Plugin a, Plugin b ) + { + return eq( a.getArtifactId(), b.getArtifactId() ) // + && eq( a.getGroupId(), b.getGroupId() ) // + && eq( a.getVersion(), b.getVersion() ) // + && a.isExtensions() == b.isExtensions() // + && dependenciesEquals( a.getDependencies(), b.getDependencies() ); + } + + private static boolean dependenciesEquals( List<Dependency> a, List<Dependency> b ) + { + if ( a.size() != b.size() ) + { + return false; + } + + Iterator<Dependency> aI = a.iterator(); + Iterator<Dependency> bI = b.iterator(); + + while ( aI.hasNext() ) + { + Dependency aD = aI.next(); + Dependency bD = bI.next(); + + boolean r = eq( aD.getGroupId(), bD.getGroupId() ) // + && eq( aD.getArtifactId(), bD.getArtifactId() ) // + && eq( aD.getVersion(), bD.getVersion() ) // + && eq( aD.getType(), bD.getType() ) // + && eq( aD.getClassifier(), bD.getClassifier() ) // + && eq( aD.getScope(), bD.getScope() ); + + r &= exclusionsEquals( aD.getExclusions(), bD.getExclusions() ); + + if ( !r ) + { + return false; + } + } + + return true; + } + + private static boolean exclusionsEquals( List<Exclusion> a, List<Exclusion> b ) + { + if ( a.size() != b.size() ) + { + return false; + } + + Iterator<Exclusion> aI = a.iterator(); + Iterator<Exclusion> bI = b.iterator(); + + while ( aI.hasNext() ) + { + Exclusion aD = aI.next(); + Exclusion bD = bI.next(); + + boolean r = eq( aD.getGroupId(), bD.getGroupId() ) // + && eq( aD.getArtifactId(), bD.getArtifactId() ); + + if ( !r ) + { + return false; + } + } + + return true; + } + + public static WorkspaceRepository getWorkspace( RepositorySystemSession session ) + { + WorkspaceReader reader = session.getWorkspaceReader(); + return ( reader != null ) ? reader.getRepository() : null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CompoundMojoExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CompoundMojoExecutionListener.java new file mode 100644 index 00000000..9fe52833 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CompoundMojoExecutionListener.java @@ -0,0 +1,64 @@ +package org.apache.maven.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 java.util.Collection; + +import org.apache.maven.execution.MojoExecutionEvent; +import org.apache.maven.execution.MojoExecutionListener; + +class CompoundMojoExecutionListener + implements MojoExecutionListener +{ + + private final Collection<MojoExecutionListener> listeners; + + public CompoundMojoExecutionListener( Collection<MojoExecutionListener> listeners ) + { + this.listeners = listeners; // NB this is live injected collection + } + + public void beforeMojoExecution( MojoExecutionEvent event ) + throws MojoExecutionException + { + for ( MojoExecutionListener listener : listeners ) + { + listener.beforeMojoExecution( event ); + } + } + + public void afterMojoExecutionSuccess( MojoExecutionEvent event ) + throws MojoExecutionException + { + for ( MojoExecutionListener listener : listeners ) + { + listener.afterMojoExecutionSuccess( event ); + } + } + + public void afterExecutionFailure( MojoExecutionEvent event ) + { + for ( MojoExecutionListener listener : listeners ) + { + listener.afterExecutionFailure( event ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CycleDetectedInPluginGraphException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CycleDetectedInPluginGraphException.java new file mode 100644 index 00000000..f77461fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/CycleDetectedInPluginGraphException.java @@ -0,0 +1,46 @@ +package org.apache.maven.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.model.Plugin; +import org.codehaus.plexus.component.composition.CycleDetectedInComponentGraphException; + +/** + * Exception occurring trying to resolve a plugin. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class CycleDetectedInPluginGraphException + extends Exception +{ + private final Plugin plugin; + + public CycleDetectedInPluginGraphException( Plugin plugin, CycleDetectedInComponentGraphException e ) + { + super( "A cycle was detected in the component graph of the plugin: " + plugin.getArtifactId() ); + + this.plugin = plugin; + } + + public Plugin getPlugin() + { + return plugin; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DebugConfigurationListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DebugConfigurationListener.java new file mode 100644 index 00000000..57084ceb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DebugConfigurationListener.java @@ -0,0 +1,91 @@ +package org.apache.maven.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 java.lang.reflect.Array; + +import org.codehaus.plexus.component.configurator.ConfigurationListener; +import org.codehaus.plexus.logging.Logger; + +/** + * Log at debug level the mojo configuration. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +@Deprecated +public class DebugConfigurationListener + implements ConfigurationListener +{ + private Logger logger; + + public DebugConfigurationListener( Logger logger ) + { + this.logger = logger; + } + + public void notifyFieldChangeUsingSetter( String fieldName, Object value, Object target ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( " (s) " + fieldName + " = " + toString( value ) ); + } + } + + public void notifyFieldChangeUsingReflection( String fieldName, Object value, Object target ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( " (f) " + fieldName + " = " + toString( value ) ); + } + } + + /** + * Creates a human-friendly string represenation of the specified object. + * + * @param obj The object to create a string representation for, may be <code>null</code>. + * @return The string representation, never <code>null</code>. + */ + private String toString( Object obj ) + { + String str; + if ( obj != null && obj.getClass().isArray() ) + { + int n = Array.getLength( obj ); + StringBuilder buf = new StringBuilder( 256 ); + buf.append( '[' ); + for ( int i = 0; i < n; i++ ) + { + if ( i > 0 ) + { + buf.append( ", " ); + } + buf.append( String.valueOf( Array.get( obj, i ) ) ); + } + buf.append( ']' ); + str = buf.toString(); + } + else + { + str = String.valueOf( obj ); + } + return str; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java new file mode 100644 index 00000000..8145bd58 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java @@ -0,0 +1,244 @@ +package org.apache.maven.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 java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.execution.MojoExecutionEvent; +import org.apache.maven.execution.MojoExecutionListener; +import org.apache.maven.execution.scope.internal.MojoExecutionScope; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +// TODO: the antrun plugin has its own configurator, the only plugin that does. might need to think about how that works +// TODO: remove the coreArtifactFilterManager + +@Component( role = BuildPluginManager.class ) +public class DefaultBuildPluginManager + implements BuildPluginManager +{ + + @Requirement + private MavenPluginManager mavenPluginManager; + + @Requirement + private LegacySupport legacySupport; + + @Requirement + private MojoExecutionScope scope; + + private MojoExecutionListener mojoExecutionListener; + + // this tricks plexus-component-metadata generate required metadata + @Requirement( role = MojoExecutionListener.class ) + private List<MojoExecutionListener> mojoExecutionListeners; + + public void setMojoExecutionListeners( final List<MojoExecutionListener> listeners ) + { + this.mojoExecutionListeners = listeners; + this.mojoExecutionListener = new CompoundMojoExecutionListener( listeners ); + } + + /** + * @param plugin + * @param repositories + * @param session + * @return PluginDescriptor The component descriptor for the Maven plugin. + * @throws PluginNotFoundException The plugin could not be found in any repositories. + * @throws PluginResolutionException The plugin could be found but could not be resolved. + * @throws InvalidPluginDescriptorException + */ + public PluginDescriptor loadPlugin( Plugin plugin, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + InvalidPluginDescriptorException + { + return mavenPluginManager.getPluginDescriptor( plugin, repositories, session ); + } + + // ---------------------------------------------------------------------- + // Mojo execution + // ---------------------------------------------------------------------- + + public void executeMojo( MavenSession session, MojoExecution mojoExecution ) + throws MojoFailureException, MojoExecutionException, PluginConfigurationException, PluginManagerException + { + MavenProject project = session.getCurrentProject(); + + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + Mojo mojo = null; + + ClassRealm pluginRealm; + try + { + pluginRealm = getPluginRealm( session, mojoDescriptor.getPluginDescriptor() ); + } + catch ( PluginResolutionException e ) + { + throw new PluginExecutionException( mojoExecution, project, e ); + } + + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader( pluginRealm ); + + MavenSession oldSession = legacySupport.getSession(); + + scope.enter(); + + try + { + scope.seed( MavenProject.class, project ); + scope.seed( MojoExecution.class, mojoExecution ); + + mojo = mavenPluginManager.getConfiguredMojo( Mojo.class, session, mojoExecution ); + + legacySupport.setSession( session ); + + // NOTE: DuplicateArtifactAttachmentException is currently unchecked, so be careful removing this try/catch! + // This is necessary to avoid creating compatibility problems for existing plugins that use + // MavenProjectHelper.attachArtifact(..). + try + { + MojoExecutionEvent mojoExecutionEvent = new MojoExecutionEvent( session, project, mojoExecution, mojo ); + + mojoExecutionListener.beforeMojoExecution( mojoExecutionEvent ); + + mojo.execute(); + + mojoExecutionListener.afterMojoExecutionSuccess( mojoExecutionEvent ); + } + catch ( ClassCastException e ) + { + // to be processed in the outer catch block + throw e; + } + catch ( RuntimeException e ) + { + throw new PluginExecutionException( mojoExecution, project, e ); + } + } + catch ( PluginContainerException 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 ) ); + + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "A required class was missing while executing " + mojoDescriptor.getId() + ": " + + e.getMessage() ); + pluginRealm.display( ps ); + + Exception wrapper = new PluginContainerException( mojoDescriptor, pluginRealm, os.toString(), e ); + + throw new PluginExecutionException( mojoExecution, project, wrapper ); + } + catch ( LinkageError e ) + { + mojoExecutionListener.afterExecutionFailure( new MojoExecutionEvent( session, project, mojoExecution, mojo, + e ) ); + + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "An API incompatibility was encountered while executing " + mojoDescriptor.getId() + ": " + + e.getClass().getName() + ": " + e.getMessage() ); + pluginRealm.display( ps ); + + Exception wrapper = new PluginContainerException( mojoDescriptor, pluginRealm, os.toString(), e ); + + throw new PluginExecutionException( mojoExecution, project, wrapper ); + } + catch ( ClassCastException e ) + { + mojoExecutionListener.afterExecutionFailure( new MojoExecutionEvent( session, project, mojoExecution, mojo, + e ) ); + + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "A type incompatibility occured while executing " + mojoDescriptor.getId() + ": " + + e.getMessage() ); + pluginRealm.display( ps ); + + throw new PluginExecutionException( mojoExecution, project, os.toString(), e ); + } + catch ( RuntimeException e ) + { + mojoExecutionListener.afterExecutionFailure( new MojoExecutionEvent( session, project, mojoExecution, mojo, + e ) ); + + throw e; + } + finally + { + mavenPluginManager.releaseMojo( mojo, mojoExecution ); + + scope.exit(); + + Thread.currentThread().setContextClassLoader( oldClassLoader ); + + legacySupport.setSession( oldSession ); + } + } + + /** + * TODO pluginDescriptor classRealm and artifacts are set as a side effect of this + * call, which is not nice. + * @throws PluginResolutionException + */ + public ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor ) + throws PluginResolutionException, PluginManagerException + { + ClassRealm pluginRealm = pluginDescriptor.getClassRealm(); + if ( pluginRealm != null ) + { + return pluginRealm; + } + + mavenPluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null ); + + return pluginDescriptor.getClassRealm(); + } + + public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException + { + return mavenPluginManager.getMojoDescriptor( plugin, goal, repositories, session ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java new file mode 100644 index 00000000..c9df92c6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultExtensionRealmCache.java @@ -0,0 +1,170 @@ +package org.apache.maven.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 java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.project.ExtensionDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.classworlds.realm.NoSuchRealmException; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; + +/** + * Default extension realm cache implementation. Assumes cached data does not change. + */ +@Component( role = ExtensionRealmCache.class ) +public class DefaultExtensionRealmCache + implements ExtensionRealmCache, Disposable +{ + + protected static class CacheKey + implements Key + { + + private final List<File> files; + + private final List<Long> timestamps; + + private final List<Long> sizes; + + private final List<String> ids; + + private final int hashCode; + + public CacheKey( List<Artifact> extensionArtifacts ) + { + this.files = new ArrayList<File>( extensionArtifacts.size() ); + this.timestamps = new ArrayList<Long>( extensionArtifacts.size() ); + this.sizes = new ArrayList<Long>( extensionArtifacts.size() ); + this.ids = new ArrayList<String>( extensionArtifacts.size() ); + + for ( Artifact artifact : extensionArtifacts ) + { + File file = artifact.getFile(); + files.add( file ); + timestamps.add( ( file != null ) ? Long.valueOf( file.lastModified() ) : Long.valueOf( 0 ) ); + sizes.add( ( file != null ) ? Long.valueOf( file.length() ) : Long.valueOf( 0 ) ); + ids.add( artifact.getVersion() ); + } + + this.hashCode = + 31 * files.hashCode() + 31 * ids.hashCode() + 31 * timestamps.hashCode() + 31 * sizes.hashCode(); + } + + @Override + public int hashCode() + { + return hashCode; + } + + @Override + public boolean equals( Object o ) + { + if ( o == this ) + { + return true; + } + + if ( !( o instanceof CacheKey ) ) + { + return false; + } + + CacheKey other = (CacheKey) o; + + return ids.equals( other.ids ) && files.equals( other.files ) && timestamps.equals( other.timestamps ) + && sizes.equals( other.sizes ); + } + + @Override + public String toString() + { + return files.toString(); + } + } + + protected final Map<Key, CacheRecord> cache = new ConcurrentHashMap<Key, CacheRecord>(); + + @Override + public Key createKey( List<Artifact> extensionArtifacts ) + { + return new CacheKey( extensionArtifacts ); + } + + public CacheRecord get( Key key ) + { + return cache.get( key ); + } + + public CacheRecord put( Key key, ClassRealm extensionRealm, ExtensionDescriptor extensionDescriptor, + List<Artifact> artifacts ) + { + if ( extensionRealm == null ) + { + throw new NullPointerException(); + } + + if ( cache.containsKey( key ) ) + { + throw new IllegalStateException( "Duplicate extension realm for extension " + key ); + } + + CacheRecord record = new CacheRecord( extensionRealm, extensionDescriptor, artifacts ); + + cache.put( key, record ); + + return record; + } + + public void flush() + { + for ( CacheRecord record : cache.values() ) + { + ClassRealm realm = record.realm; + try + { + realm.getWorld().disposeRealm( realm.getId() ); + } + catch ( NoSuchRealmException e ) + { + // ignore + } + } + cache.clear(); + } + + public void register( MavenProject project, Key key, CacheRecord record ) + { + // default cache does not track extension usage + } + + public void dispose() + { + flush(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java new file mode 100644 index 00000000..23bda64d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginArtifactsCache.java @@ -0,0 +1,218 @@ +package org.apache.maven.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 java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.Plugin; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Component; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; + +/** + * @author Igor Fedorenko + * @author Benjamin Bentmann + */ +@Component( role = PluginArtifactsCache.class ) +public class DefaultPluginArtifactsCache + implements PluginArtifactsCache +{ + + protected static class CacheKey + implements Key + { + + private final Plugin plugin; + + private final WorkspaceRepository workspace; + + private final LocalRepository localRepo; + + private final List<RemoteRepository> repositories; + + private final DependencyFilter filter; + + private final int hashCode; + + public CacheKey( Plugin plugin, DependencyFilter extensionFilter, List<RemoteRepository> repositories, + RepositorySystemSession session ) + { + this.plugin = plugin.clone(); + workspace = CacheUtils.getWorkspace( session ); + this.localRepo = session.getLocalRepository(); + this.repositories = new ArrayList<RemoteRepository>( repositories.size() ); + for ( RemoteRepository repository : repositories ) + { + if ( repository.isRepositoryManager() ) + { + this.repositories.addAll( repository.getMirroredRepositories() ); + } + else + { + this.repositories.add( repository ); + } + } + this.filter = extensionFilter; + + int hash = 17; + hash = hash * 31 + CacheUtils.pluginHashCode( plugin ); + hash = hash * 31 + hash( workspace ); + hash = hash * 31 + hash( localRepo ); + hash = hash * 31 + CacheUtils.repositoriesHashCode( repositories ); + hash = hash * 31 + hash( extensionFilter ); + this.hashCode = hash; + } + + @Override + public String toString() + { + return plugin.getId(); + } + + @Override + public int hashCode() + { + return hashCode; + } + + private static int hash( Object obj ) + { + return obj != null ? obj.hashCode() : 0; + } + + @Override + public boolean equals( Object o ) + { + if ( o == this ) + { + return true; + } + + if ( !( o instanceof CacheKey ) ) + { + return false; + } + + CacheKey that = (CacheKey) o; + + return CacheUtils.pluginEquals( plugin, that.plugin ) && eq( workspace, that.workspace ) + && eq( localRepo, that.localRepo ) && CacheUtils.repositoriesEquals( repositories, that.repositories ) + && eq( filter, that.filter ); + } + + private static <T> boolean eq( T s1, T s2 ) + { + return s1 != null ? s1.equals( s2 ) : s2 == null; + } + + } + + protected final Map<Key, CacheRecord> cache = new ConcurrentHashMap<Key, CacheRecord>(); + + public Key createKey( Plugin plugin, DependencyFilter extensionFilter, List<RemoteRepository> repositories, + RepositorySystemSession session ) + { + return new CacheKey( plugin, extensionFilter, repositories, session ); + } + + public CacheRecord get( Key key ) + throws PluginResolutionException + { + CacheRecord cacheRecord = cache.get( key ); + + if ( cacheRecord != null && cacheRecord.exception != null ) + { + throw cacheRecord.exception; + } + + return cacheRecord; + } + + public CacheRecord put( Key key, List<Artifact> pluginArtifacts ) + { + if ( pluginArtifacts == null ) + { + throw new NullPointerException(); + } + + assertUniqueKey( key ); + + CacheRecord record = + new CacheRecord( Collections.unmodifiableList( new ArrayList<Artifact>( pluginArtifacts ) ) ); + + cache.put( key, record ); + + return record; + } + + protected void assertUniqueKey( Key key ) + { + if ( cache.containsKey( key ) ) + { + throw new IllegalStateException( "Duplicate artifact resolution result for plugin " + key ); + } + } + + public CacheRecord put( Key key, PluginResolutionException exception ) + { + if ( exception == null ) + { + throw new NullPointerException(); + } + + assertUniqueKey( key ); + + CacheRecord record = new CacheRecord( exception ); + + cache.put( key, record ); + + return record; + } + + public void flush() + { + cache.clear(); + } + + protected static int pluginHashCode( Plugin plugin ) + { + return CacheUtils.pluginHashCode( plugin ); + } + + protected static boolean pluginEquals( Plugin a, Plugin b ) + { + return CacheUtils.pluginEquals( a, b ); + } + + public void register( MavenProject project, Key cacheKey, CacheRecord record ) + { + // default cache does not track record usage + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java new file mode 100644 index 00000000..4927726b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginDescriptorCache.java @@ -0,0 +1,219 @@ +package org.apache.maven.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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.repository.ComponentDescriptor; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; + +/** + * Caches raw plugin descriptors. A raw plugin descriptor is a descriptor that has just been extracted from the plugin + * artifact and does not contain any runtime specific data. The cache must not be used for descriptors that hold runtime + * data like the plugin realm. <strong>Warning:</strong> This is an internal utility interface that is only public for + * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without + * prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +@Component( role = PluginDescriptorCache.class ) +public class DefaultPluginDescriptorCache + implements PluginDescriptorCache +{ + + private Map<Key, PluginDescriptor> descriptors = new HashMap<Key, PluginDescriptor>( 128 ); + + public void flush() + { + descriptors.clear(); + } + + public Key createKey( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) + { + return new CacheKey( plugin, repositories, session ); + } + + public PluginDescriptor get( Key cacheKey ) + { + return clone( descriptors.get( cacheKey ) ); + } + + public void put( Key cacheKey, PluginDescriptor pluginDescriptor ) + { + descriptors.put( cacheKey, clone( pluginDescriptor ) ); + } + + protected static PluginDescriptor clone( PluginDescriptor original ) + { + PluginDescriptor clone = null; + + if ( original != null ) + { + clone = new PluginDescriptor(); + + clone.setGroupId( original.getGroupId() ); + clone.setArtifactId( original.getArtifactId() ); + clone.setVersion( original.getVersion() ); + clone.setGoalPrefix( original.getGoalPrefix() ); + clone.setInheritedByDefault( original.isInheritedByDefault() ); + + clone.setName( original.getName() ); + clone.setDescription( original.getDescription() ); + clone.setRequiredMavenVersion( original.getRequiredMavenVersion() ); + + clone.setPluginArtifact( ArtifactUtils.copyArtifactSafe( original.getPluginArtifact() ) ); + + clone.setComponents( clone( original.getMojos(), clone ) ); + clone.setId( original.getId() ); + clone.setIsolatedRealm( original.isIsolatedRealm() ); + clone.setSource( original.getSource() ); + + clone.setDependencies( original.getDependencies() ); + } + + return clone; + } + + private static List<ComponentDescriptor<?>> clone( List<MojoDescriptor> mojos, PluginDescriptor pluginDescriptor ) + { + List<ComponentDescriptor<?>> clones = null; + + if ( mojos != null ) + { + clones = new ArrayList<ComponentDescriptor<?>>( mojos.size() ); + + for ( MojoDescriptor mojo : mojos ) + { + MojoDescriptor clone = mojo.clone(); + clone.setPluginDescriptor( pluginDescriptor ); + clones.add( clone ); + } + } + + return clones; + } + + private static final class CacheKey + implements Key + { + + private final String groupId; + + private final String artifactId; + + private final String version; + + private final WorkspaceRepository workspace; + + private final LocalRepository localRepo; + + private final List<RemoteRepository> repositories; + + private final int hashCode; + + public CacheKey( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) + { + groupId = plugin.getGroupId(); + artifactId = plugin.getArtifactId(); + version = plugin.getVersion(); + + workspace = CacheUtils.getWorkspace( session ); + localRepo = session.getLocalRepository(); + this.repositories = new ArrayList<RemoteRepository>( repositories.size() ); + for ( RemoteRepository repository : repositories ) + { + if ( repository.isRepositoryManager() ) + { + this.repositories.addAll( repository.getMirroredRepositories() ); + } + else + { + this.repositories.add( repository ); + } + } + + int hash = 17; + hash = hash * 31 + groupId.hashCode(); + hash = hash * 31 + artifactId.hashCode(); + hash = hash * 31 + version.hashCode(); + hash = hash * 31 + hash( workspace ); + hash = hash * 31 + localRepo.hashCode(); + hash = hash * 31 + CacheUtils.repositoriesHashCode( repositories ); + this.hashCode = hash; + } + + @Override + public int hashCode() + { + return hashCode; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof CacheKey ) ) + { + return false; + } + + CacheKey that = (CacheKey) obj; + + return eq( this.artifactId, that.artifactId ) && eq( this.groupId, that.groupId ) + && eq( this.version, that.version ) && eq( this.localRepo, that.localRepo ) + && eq( this.workspace, that.workspace ) + && CacheUtils.repositoriesEquals( this.repositories, that.repositories ); + } + + @Override + public String toString() + { + return groupId + ':' + artifactId + ':' + version; + } + + private static int hash( Object obj ) + { + return obj != null ? obj.hashCode() : 0; + } + + private static <T> boolean eq( T s1, T s2 ) + { + return s1 != null ? s1.equals( s2 ) : s2 == null; + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java new file mode 100644 index 00000000..6c8288ee --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginRealmCache.java @@ -0,0 +1,219 @@ +package org.apache.maven.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 java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.Plugin; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.classworlds.realm.NoSuchRealmException; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; + +/** + * Default PluginCache implementation. Assumes cached data does not change. + */ +@Component( role = PluginRealmCache.class ) +public class DefaultPluginRealmCache + implements PluginRealmCache, Disposable +{ + + protected static class CacheKey + implements Key + { + + private final Plugin plugin; + + private final WorkspaceRepository workspace; + + private final LocalRepository localRepo; + + private final List<RemoteRepository> repositories; + + private final ClassLoader parentRealm; + + private final Map<String, ClassLoader> foreignImports; + + private final DependencyFilter filter; + + private final int hashCode; + + public CacheKey( Plugin plugin, ClassLoader parentRealm, Map<String, ClassLoader> foreignImports, + DependencyFilter dependencyFilter, List<RemoteRepository> repositories, + RepositorySystemSession session ) + { + this.plugin = plugin.clone(); + this.workspace = CacheUtils.getWorkspace( session ); + this.localRepo = session.getLocalRepository(); + this.repositories = new ArrayList<RemoteRepository>( repositories.size() ); + for ( RemoteRepository repository : repositories ) + { + if ( repository.isRepositoryManager() ) + { + this.repositories.addAll( repository.getMirroredRepositories() ); + } + else + { + this.repositories.add( repository ); + } + } + this.parentRealm = parentRealm; + this.foreignImports = + ( foreignImports != null ) ? foreignImports : Collections.<String, ClassLoader>emptyMap(); + this.filter = dependencyFilter; + + int hash = 17; + hash = hash * 31 + CacheUtils.pluginHashCode( plugin ); + hash = hash * 31 + hash( workspace ); + hash = hash * 31 + hash( localRepo ); + hash = hash * 31 + CacheUtils.repositoriesHashCode( repositories ); + hash = hash * 31 + hash( parentRealm ); + hash = hash * 31 + this.foreignImports.hashCode(); + hash = hash * 31 + hash( dependencyFilter ); + this.hashCode = hash; + } + + @Override + public String toString() + { + return plugin.getId(); + } + + @Override + public int hashCode() + { + return hashCode; + } + + private static int hash( Object obj ) + { + return obj != null ? obj.hashCode() : 0; + } + + @Override + public boolean equals( Object o ) + { + if ( o == this ) + { + return true; + } + + if ( !( o instanceof CacheKey ) ) + { + return false; + } + + CacheKey that = (CacheKey) o; + + return parentRealm == that.parentRealm && CacheUtils.pluginEquals( plugin, that.plugin ) + && eq( workspace, that.workspace ) && eq( localRepo, that.localRepo ) + && CacheUtils.repositoriesEquals( this.repositories, that.repositories ) && eq( filter, that.filter ) + && eq( foreignImports, that.foreignImports ); + } + + private static <T> boolean eq( T s1, T s2 ) + { + return s1 != null ? s1.equals( s2 ) : s2 == null; + } + + } + + protected final Map<Key, CacheRecord> cache = new ConcurrentHashMap<Key, CacheRecord>(); + + public Key createKey( Plugin plugin, ClassLoader parentRealm, Map<String, ClassLoader> foreignImports, + DependencyFilter dependencyFilter, List<RemoteRepository> repositories, + RepositorySystemSession session ) + { + return new CacheKey( plugin, parentRealm, foreignImports, dependencyFilter, repositories, session ); + } + + public CacheRecord get( Key key ) + { + return cache.get( key ); + } + + public CacheRecord put( Key key, ClassRealm pluginRealm, List<Artifact> pluginArtifacts ) + { + if ( pluginRealm == null || pluginArtifacts == null ) + { + throw new IllegalArgumentException(); + } + + if ( cache.containsKey( key ) ) + { + throw new IllegalStateException( "Duplicate plugin realm for plugin " + key ); + } + + CacheRecord record = new CacheRecord( pluginRealm, pluginArtifacts ); + + cache.put( key, record ); + + return record; + } + + public void flush() + { + for ( CacheRecord record : cache.values() ) + { + ClassRealm realm = record.realm; + try + { + realm.getWorld().disposeRealm( realm.getId() ); + } + catch ( NoSuchRealmException e ) + { + // ignore + } + } + cache.clear(); + } + + protected static int pluginHashCode( Plugin plugin ) + { + return CacheUtils.pluginHashCode( plugin ); + } + + protected static boolean pluginEquals( Plugin a, Plugin b ) + { + return CacheUtils.pluginEquals( a, b ); + } + + public void register( MavenProject project, Key key, CacheRecord record ) + { + // default cache does not track plugin usage + } + + public void dispose() + { + flush(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/ExtensionRealmCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/ExtensionRealmCache.java new file mode 100644 index 00000000..d50df0e9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/ExtensionRealmCache.java @@ -0,0 +1,84 @@ +package org.apache.maven.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 java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.project.ExtensionDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.realm.ClassRealm; + +/** + * Caches extension class realms. <strong>Warning:</strong> This is an internal utility interface that is only public + * for technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted + * without prior notice. + * + * @author Igor Fedorenko + * @author Benjamin Bentmann + */ +public interface ExtensionRealmCache +{ + /** + * A cache key. + */ + interface Key + { + // marker interface for cache keys + } + + static class CacheRecord + { + + public final ClassRealm realm; + + public final ExtensionDescriptor desciptor; + + public final List<Artifact> artifacts; + + public CacheRecord( ClassRealm realm, ExtensionDescriptor descriptor, List<Artifact> artifacts ) + { + this.realm = realm; + this.desciptor = descriptor; + this.artifacts = artifacts; + } + + } + + Key createKey( List<Artifact> extensionArtifacts ); + + CacheRecord get( Key key ); + + CacheRecord put( Key key, ClassRealm extensionRealm, ExtensionDescriptor extensionDescriptor, + List<Artifact> artifacts ); + + void flush(); + + /** + * Registers the specified cache record for usage with the given project. Integrators can use the information + * collected from this method in combination with a custom cache implementation to dispose unused records from the + * cache. + * + * @param project The project that employs the plugin realm, must not be {@code null}. + * @param record The cache record being used for the project, must not be {@code null}. + */ + void register( MavenProject project, Key key, CacheRecord record ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginDescriptorException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginDescriptorException.java new file mode 100644 index 00000000..223ccd81 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginDescriptorException.java @@ -0,0 +1,44 @@ +package org.apache.maven.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 java.util.List; + +public class InvalidPluginDescriptorException + extends Exception +{ + + public InvalidPluginDescriptorException( String message, List<String> errors ) + { + super( toMessage( message, errors ) ); + } + + private static String toMessage( String message, List<String> errors ) + { + StringBuilder buffer = new StringBuilder( 256 ); + buffer.append( message ); + for ( String error : errors ) + { + buffer.append( ", " ).append( error ); + } + return buffer.toString(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java new file mode 100644 index 00000000..b89fc869 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/InvalidPluginException.java @@ -0,0 +1,48 @@ +package org.apache.maven.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.project.ProjectBuildingException; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; + +/** + * Thrown when a plugin is not internally consistent. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class InvalidPluginException + extends Exception +{ + public InvalidPluginException( String message, ProjectBuildingException e ) + { + super( message, e ); + } + + public InvalidPluginException( String message, InvalidDependencyVersionException e ) + { + super( message, e ); + } + + public InvalidPluginException( String message ) + { + super( message ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java new file mode 100644 index 00000000..b246ed18 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java @@ -0,0 +1,59 @@ +package org.apache.maven.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.execution.MavenSession; +import org.eclipse.aether.RepositorySystemSession; + +/** + * Helps to provide backward-compatibility with plugins that use legacy components. <strong>Warning:</strong> This is an + * internal utility interface that is only public for technical reasons, it is not part of the public API. In + * particular, this interface can be changed or deleted without prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface LegacySupport +{ + + /** + * Sets the currently active session. Some legacy components are basically stateful and their API is missing + * parameters that would be required to delegate to a stateless component. Saving the session (in a thread-local + * variable) is our best effort to record any state that is required to enable proper delegation. + * + * @param session The currently active session, may be {@code null}. + */ + void setSession( MavenSession session ); + + /** + * Gets the currently active session. + * + * @return The currently active session or {@code null} if none. + */ + MavenSession getSession(); + + /** + * Gets the currently active repository session. + * + * @return The currently active repository session or {@code null} if none. + */ + RepositorySystemSession getRepositorySession(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java new file mode 100644 index 00000000..b228a1b4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginManager.java @@ -0,0 +1,128 @@ +package org.apache.maven.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 java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.MavenProject; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such + * that the plugins/mojos can be used in arbitrary contexts. In particular, the mojos can be used for ordinary build + * plugins as well as special purpose plugins like reports. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface MavenPluginManager +{ + + /** + * Retrieves the descriptor for the specified plugin from its main artifact. + * + * @param plugin The plugin whose descriptor should be retrieved, must not be {@code null}. + * @param repositories The plugin repositories to use for resolving the plugin's main artifact, must not be {@code + * null}. + * @param session The repository session to use for resolving the plugin's main artifact, must not be {@code null}. + * @return The plugin descriptor, never {@code null}. + */ + PluginDescriptor getPluginDescriptor( Plugin plugin, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws PluginResolutionException, PluginDescriptorParsingException, InvalidPluginDescriptorException; + + /** + * Retrieves the descriptor for the specified plugin goal from the plugin's main artifact. + * + * @param plugin The plugin whose mojo descriptor should be retrieved, must not be {@code null}. + * @param goal The simple name of the mojo whose descriptor should be retrieved, must not be {@code null}. + * @param repositories The plugin repositories to use for resolving the plugin's main artifact, must not be {@code + * null}. + * @param session The repository session to use for resolving the plugin's main artifact, must not be {@code null}. + * @return The mojo descriptor, never {@code null}. + */ + MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws MojoNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + InvalidPluginDescriptorException; + + /** + * Verifies the specified plugin is compatible with the current Maven runtime. + * + * @param pluginDescriptor The descriptor of the plugin to check, must not be {@code null}. + */ + void checkRequiredMavenVersion( PluginDescriptor pluginDescriptor ) + throws PluginIncompatibleException; + + /** + * Sets up the class realm for the specified plugin. Both the class realm and the plugin artifacts that constitute + * it will be stored in the plugin descriptor. + * + * @param pluginDescriptor The plugin descriptor in which to save the class realm and the plugin artifacts, must not + * be {@code null}. + * @param session The build session from which to pick the current project and repository settings, must not be + * {@code null}. + * @param parent The parent class realm for the plugin, may be {@code null} to use the Maven core realm. + * @param imports The packages/types to import from the parent realm, may be {@code null}. + * @param filter The filter used to exclude certain plugin dependencies, may be {@code null}. + */ + void setupPluginRealm( PluginDescriptor pluginDescriptor, MavenSession session, ClassLoader parent, + List<String> imports, DependencyFilter filter ) + throws PluginResolutionException, PluginContainerException; + + /** + * Sets up class realm for the specified build extensions plugin. + * + * @since 3.3.0 + */ + ExtensionRealmCache.CacheRecord setupExtensionsRealm( MavenProject project, Plugin plugin, + RepositorySystemSession session ) + throws PluginManagerException; + + /** + * Looks up the mojo for the specified mojo execution and populates its parameters from the configuration given by + * the mojo execution. The mojo/plugin descriptor associated with the mojo execution provides the class realm to + * lookup the mojo from. <strong>Warning:</strong> The returned mojo instance must be released via + * {@link #releaseMojo(Object, MojoExecution)} when the mojo is no longer needed to free any resources allocated for + * it. + * + * @param mojoInterface The component role of the mojo, must not be {@code null}. + * @param session The build session in whose context the mojo will be used, must not be {@code null}. + * @param mojoExecution The mojo execution to retrieve the mojo for, must not be {@code null}. + * @return The ready-to-execute mojo, never {@code null}. + */ + <T> T getConfiguredMojo( Class<T> mojoInterface, MavenSession session, MojoExecution mojoExecution ) + throws PluginConfigurationException, PluginContainerException; + + /** + * Releases the specified mojo back to the container. + * + * @param mojo The mojo to release, may be {@code null}. + * @param mojoExecution The mojo execution the mojo was originally retrieved for, must not be {@code null}. + */ + void releaseMojo( Object mojo, MojoExecution mojoExecution ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java new file mode 100644 index 00000000..2eb2738b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java @@ -0,0 +1,78 @@ +package org.apache.maven.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 java.util.ArrayList; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.plugin.descriptor.PluginDescriptor; + +public class MavenPluginValidator +{ + private final Artifact pluginArtifact; + + private List<String> errors = new ArrayList<String>(); + + private boolean firstDescriptor = true; + + public MavenPluginValidator( Artifact pluginArtifact ) + { + this.pluginArtifact = pluginArtifact; + } + + public void validate( PluginDescriptor pluginDescriptor ) + { + /* + * NOTE: For plugins that depend on other plugin artifacts the plugin realm contains more than one plugin + * descriptor. However, only the first descriptor is of interest. + */ + if ( !firstDescriptor ) + { + return; + } + firstDescriptor = false; + + if ( !pluginArtifact.getGroupId().equals( pluginDescriptor.getGroupId() ) ) + { + errors.add( "Plugin's descriptor contains the wrong group ID: " + pluginDescriptor.getGroupId() ); + } + + if ( !pluginArtifact.getArtifactId().equals( pluginDescriptor.getArtifactId() ) ) + { + errors.add( "Plugin's descriptor contains the wrong artifact ID: " + pluginDescriptor.getArtifactId() ); + } + + if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() ) ) + { + errors.add( "Plugin's descriptor contains the wrong version: " + pluginDescriptor.getVersion() ); + } + } + + public boolean hasErrors() + { + return !errors.isEmpty(); + } + + public List<String> getErrors() + { + return errors; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java new file mode 100644 index 00000000..a417219e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java @@ -0,0 +1,237 @@ +package org.apache.maven.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 java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +public class MojoExecution +{ + + private Plugin plugin; + + private String goal; + + private String executionId; + + private MojoDescriptor mojoDescriptor; + + private Xpp3Dom configuration; + + /** + * Describes the source of an execution. + */ + public enum Source + { + + /** + * An execution that originates from the direct invocation of a goal from the CLI. + */ + CLI, + + /** + * An execution that originates from a goal bound to a lifecycle phase. + */ + LIFECYCLE, + } + + private Source source = Source.LIFECYCLE; + + /** + * The phase may or may not have been bound to a phase but once the plan has been calculated we know what phase + * this mojo execution is going to run in. + */ + private String lifecyclePhase; + + /** + * The executions to fork before this execution, indexed by the groupId:artifactId:version of the project on which + * the forked execution are to be run and in reactor build order. + */ + private Map<String, List<MojoExecution>> forkedExecutions = new LinkedHashMap<String, List<MojoExecution>>(); + + public MojoExecution( Plugin plugin, String goal, String executionId ) + { + this.plugin = plugin; + this.goal = goal; + this.executionId = executionId; + } + + public MojoExecution( MojoDescriptor mojoDescriptor ) + { + this.mojoDescriptor = mojoDescriptor; + this.executionId = null; + this.configuration = null; + } + + public MojoExecution( MojoDescriptor mojoDescriptor, String executionId, Source source ) + { + this.mojoDescriptor = mojoDescriptor; + this.executionId = executionId; + this.configuration = null; + this.source = source; + } + + public MojoExecution( MojoDescriptor mojoDescriptor, String executionId ) + { + this.mojoDescriptor = mojoDescriptor; + this.executionId = executionId; + this.configuration = null; + } + + public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration ) + { + this.mojoDescriptor = mojoDescriptor; + this.configuration = configuration; + this.executionId = null; + } + + /** + * Gets the source of this execution. + * + * @return The source of this execution or {@code null} if unknown. + */ + public Source getSource() + { + return source; + } + + public String getExecutionId() + { + return executionId; + } + + public Plugin getPlugin() + { + if ( mojoDescriptor != null ) + { + return mojoDescriptor.getPluginDescriptor().getPlugin(); + } + + return plugin; + } + + public MojoDescriptor getMojoDescriptor() + { + return mojoDescriptor; + } + + public Xpp3Dom getConfiguration() + { + return configuration; + } + + public void setConfiguration( Xpp3Dom configuration ) + { + this.configuration = configuration; + } + + public String identify() + { + StringBuilder sb = new StringBuilder( 256 ); + + sb.append( executionId ); + sb.append( configuration.toString() ); + + return sb.toString(); + } + + public String getLifecyclePhase() + { + return lifecyclePhase; + } + + public void setLifecyclePhase( String lifecyclePhase ) + { + this.lifecyclePhase = lifecyclePhase; + } + + @Override + public String toString() + { + StringBuilder buffer = new StringBuilder( 128 ); + if ( mojoDescriptor != null ) + { + buffer.append( mojoDescriptor.getId() ); + } + buffer.append( " {execution: " ).append( executionId ).append( "}" ); + return buffer.toString(); + } + + public String getGroupId() + { + if ( mojoDescriptor != null ) + { + return mojoDescriptor.getPluginDescriptor().getGroupId(); + } + + return plugin.getGroupId(); + } + + public String getArtifactId() + { + if ( mojoDescriptor != null ) + { + return mojoDescriptor.getPluginDescriptor().getArtifactId(); + } + + return plugin.getArtifactId(); + } + + public String getVersion() + { + if ( mojoDescriptor != null ) + { + return mojoDescriptor.getPluginDescriptor().getVersion(); + } + + return plugin.getVersion(); + } + + public String getGoal() + { + if ( mojoDescriptor != null ) + { + return mojoDescriptor.getGoal(); + } + + return goal; + } + + public void setMojoDescriptor( MojoDescriptor mojoDescriptor ) + { + this.mojoDescriptor = mojoDescriptor; + } + + public Map<String, List<MojoExecution>> getForkedExecutions() + { + return forkedExecutions; + } + + public void setForkedExecutions( String projectKey, List<MojoExecution> forkedExecutions ) + { + this.forkedExecutions.put( projectKey, forkedExecutions ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginArtifactsCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginArtifactsCache.java new file mode 100644 index 00000000..17537a29 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginArtifactsCache.java @@ -0,0 +1,91 @@ +package org.apache.maven.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 java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.Plugin; +import org.apache.maven.project.MavenProject; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Caches plugin artifacts. <strong>Warning:</strong> This is an internal utility interface that is only public for + * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without + * prior notice. + * + * @author Igor Fedorenko + * @author Benjamin Bentmann + */ +public interface PluginArtifactsCache +{ + + /** + * A cache key. + */ + interface Key + { + // marker interface for cache keys + } + + static class CacheRecord + { + + public final List<Artifact> artifacts; + + public final PluginResolutionException exception; + + public CacheRecord( List<Artifact> artifacts ) + { + this.artifacts = artifacts; + this.exception = null; + } + + public CacheRecord( PluginResolutionException exception ) + { + this.artifacts = null; + this.exception = exception; + } + } + + Key createKey( Plugin plugin, DependencyFilter extensionFilter, List<RemoteRepository> repositories, + RepositorySystemSession session ); + + CacheRecord get( Key key ) throws PluginResolutionException; + + CacheRecord put( Key key, List<Artifact> pluginArtifacts ); + + CacheRecord put( Key key, PluginResolutionException e ); + + void flush(); + + /** + * Registers the specified cache record for usage with the given project. Integrators can use the information + * collected from this method in combination with a custom cache implementation to dispose unused records from the + * cache. + * + * @param project The project that employs the plugin realm, must not be {@code null}. + * @param record The cache record being used for the project, must not be {@code null}. + */ + void register( MavenProject project, Key cacheKey, CacheRecord record ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java new file mode 100644 index 00000000..f4dcffcd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginConfigurationException.java @@ -0,0 +1,74 @@ +package org.apache.maven.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.plugin.descriptor.PluginDescriptor; +import org.codehaus.plexus.component.configurator.ComponentConfigurationException; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +/** + * @author Jason van Zyl + */ +public class PluginConfigurationException + extends Exception +{ + private PluginDescriptor pluginDescriptor; + + private String originalMessage; + + public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage ) + { + super( originalMessage ); + this.pluginDescriptor = pluginDescriptor; + this.originalMessage = originalMessage; + } + + public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage, Throwable cause ) + { + super( originalMessage, cause ); + this.pluginDescriptor = pluginDescriptor; + this.originalMessage = originalMessage; + } + + public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage, + ExpressionEvaluationException cause ) + { + super( originalMessage, cause ); + this.pluginDescriptor = pluginDescriptor; + this.originalMessage = originalMessage; + } + + public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage, + ComponentConfigurationException cause ) + { + super( originalMessage, cause ); + this.pluginDescriptor = pluginDescriptor; + this.originalMessage = originalMessage; + } + + public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage, + ComponentLookupException cause ) + { + super( originalMessage, cause ); + this.pluginDescriptor = pluginDescriptor; + this.originalMessage = originalMessage; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginContainerException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginContainerException.java new file mode 100644 index 00000000..d35ac6c3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginContainerException.java @@ -0,0 +1,88 @@ +package org.apache.maven.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.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.component.repository.exception.ComponentRepositoryException; +import org.codehaus.plexus.configuration.PlexusConfigurationException; + +/** + * Exception which occurs to indicate that the plugin cannot be initialized due + * to some deeper problem with Plexus. Context information includes the groupId, + * artifactId, and version for the plugin; at times, the goal name for which + * execution failed; a message detailing the problem; the ClassRealm used to + * lookup the plugin; and the Plexus exception that caused this error. + * + * @author jdcasey + * + */ +public class PluginContainerException + extends PluginManagerException +{ + + private ClassRealm pluginRealm; + + public PluginContainerException( MojoDescriptor mojoDescriptor, ClassRealm pluginRealm, String message, + Throwable e ) + { + super( mojoDescriptor, message, e ); + + this.pluginRealm = pluginRealm; + } + + public PluginContainerException( MojoDescriptor mojoDescriptor, ClassRealm pluginRealm, String message, + ComponentLookupException e ) + { + super( mojoDescriptor, message, e ); + + this.pluginRealm = pluginRealm; + } + + public PluginContainerException( Plugin plugin, ClassRealm pluginRealm, String message, Throwable e ) + { + super( plugin, message, e ); + + this.pluginRealm = pluginRealm; + } + + public PluginContainerException( Plugin plugin, ClassRealm pluginRealm, String message, + PlexusConfigurationException e ) + { + super( plugin, message, e ); + + this.pluginRealm = pluginRealm; + } + + public PluginContainerException( Plugin plugin, ClassRealm pluginRealm, String message, + ComponentRepositoryException e ) + { + super( plugin, message, e ); + + this.pluginRealm = pluginRealm; + } + + public ClassRealm getPluginRealm() + { + return pluginRealm; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorCache.java new file mode 100644 index 00000000..08b4f1bc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorCache.java @@ -0,0 +1,58 @@ +package org.apache.maven.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 java.util.List; + +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Caches raw plugin descriptors. A raw plugin descriptor is a descriptor that has just been extracted from the plugin + * artifact and does not contain any runtime specific data. The cache must not be used for descriptors that hold runtime + * data like the plugin realm. <strong>Warning:</strong> This is an internal utility interface that is only public for + * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without + * prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginDescriptorCache +{ + + /** + * A cache key. + */ + interface Key + { + // marker interface for cache keys + } + + Key createKey( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ); + + void put( Key key, PluginDescriptor pluginDescriptor ); + + PluginDescriptor get( Key key ); + + void flush(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorParsingException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorParsingException.java new file mode 100644 index 00000000..7d57b363 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginDescriptorParsingException.java @@ -0,0 +1,58 @@ +package org.apache.maven.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.model.Plugin; + +/** + * @author Jason van Zyl + */ +public class PluginDescriptorParsingException + extends Exception +{ + + public PluginDescriptorParsingException( Plugin plugin, String descriptorLocation, Throwable e ) + { + super( createMessage( plugin, descriptorLocation, e ), e ); + } + + private static String createMessage( Plugin plugin, String descriptorLocation, Throwable e ) + { + String message = "Failed to parse plugin descriptor"; + + if ( plugin != null ) + { + message += " for " + plugin.getId(); + } + + if ( descriptorLocation != null ) + { + message += " (" + descriptorLocation + ")"; + } + + if ( e != null ) + { + message += ": " + e.getMessage(); + } + + return message; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginExecutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginExecutionException.java new file mode 100644 index 00000000..602d2cb4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginExecutionException.java @@ -0,0 +1,90 @@ +package org.apache.maven.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.project.DuplicateArtifactAttachmentException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.StringUtils; + +public class PluginExecutionException + extends PluginManagerException +{ + + private final MojoExecution mojoExecution; + + public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, String message ) + { + super( mojoExecution.getMojoDescriptor(), project, message ); + this.mojoExecution = mojoExecution; + } + + public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, String message, + Throwable cause ) + { + super( mojoExecution.getMojoDescriptor(), project, message, cause ); + this.mojoExecution = mojoExecution; + } + + public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, Exception cause ) + { + super( mojoExecution.getMojoDescriptor(), project, constructMessage( mojoExecution, cause ), cause ); + this.mojoExecution = mojoExecution; + } + + public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, + DuplicateArtifactAttachmentException cause ) + { + super( mojoExecution.getMojoDescriptor(), project, constructMessage( mojoExecution, cause ), cause ); + this.mojoExecution = mojoExecution; + } + + public MojoExecution getMojoExecution() + { + return mojoExecution; + } + + private static String constructMessage( MojoExecution mojoExecution, Throwable cause ) + { + String message; + + if ( mojoExecution != null ) + { + message = + "Execution " + mojoExecution.getExecutionId() + " of goal " + mojoExecution.getMojoDescriptor().getId() + + " failed"; + } + else + { + message = "Mojo execution failed"; + } + + if ( cause != null && StringUtils.isNotEmpty( cause.getMessage() ) ) + { + message += ": " + cause.getMessage(); + } + else + { + message += "."; + } + + return message; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginIncompatibleException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginIncompatibleException.java new file mode 100644 index 00000000..f7b53ebd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginIncompatibleException.java @@ -0,0 +1,36 @@ +package org.apache.maven.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.model.Plugin; + +/** + * Signals a plugin which is not compatible with the current Maven runtime. + */ +public class PluginIncompatibleException + extends PluginManagerException +{ + + public PluginIncompatibleException( Plugin plugin, String message ) + { + super( plugin, message, (Throwable) null ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginLoaderException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginLoaderException.java new file mode 100644 index 00000000..161e1c4e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginLoaderException.java @@ -0,0 +1,124 @@ +package org.apache.maven.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.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.ReportPlugin; +import org.apache.maven.plugin.version.PluginVersionNotFoundException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; + +/** + * Signifies a failure to load a plugin. This is used to abstract the specific errors which may be + * encountered at lower levels, and provide a dependable interface to the plugin-loading framework. + * + * @author jdcasey + * + */ +public class PluginLoaderException + extends Exception +{ + + private String pluginKey; + + public PluginLoaderException( Plugin plugin, String message, ArtifactResolutionException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message, ArtifactNotFoundException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message, PluginNotFoundException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message, PluginVersionResolutionException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message, InvalidVersionSpecificationException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message, InvalidPluginException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message, PluginManagerException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message, PluginVersionNotFoundException cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( Plugin plugin, String message ) + { + super( message ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( String message ) + { + super( message ); + } + + public PluginLoaderException( String message, Throwable cause ) + { + super( message, cause ); + } + + public PluginLoaderException( ReportPlugin plugin, String message, Throwable cause ) + { + super( message, cause ); + pluginKey = plugin.getKey(); + } + + public PluginLoaderException( ReportPlugin plugin, String message ) + { + super( message ); + pluginKey = plugin.getKey(); + } + + public String getPluginKey() + { + return pluginKey; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java new file mode 100644 index 00000000..1a3100e9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginManager.java @@ -0,0 +1,82 @@ +package org.apache.maven.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.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.version.PluginVersionNotFoundException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; +import org.apache.maven.settings.Settings; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +import java.util.Map; + +/** + * @author <a href="mailto:jason@maven.org">Jason van Zyl </a> + */ +@Deprecated +public interface PluginManager +{ + String ROLE = PluginManager.class.getName(); + + void executeMojo( MavenProject project, MojoExecution execution, MavenSession session ) + throws MojoExecutionException, ArtifactResolutionException, MojoFailureException, ArtifactNotFoundException, + InvalidDependencyVersionException, PluginManagerException, PluginConfigurationException; + + PluginDescriptor getPluginDescriptorForPrefix( String prefix ); + + Plugin getPluginDefinitionForPrefix( String prefix, MavenSession session, MavenProject project ); + + PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings, + ArtifactRepository localRepository ) + throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException, + InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException, + PluginVersionNotFoundException; + + Object getPluginComponent( Plugin plugin, String role, String roleHint ) + throws PluginManagerException, ComponentLookupException; + + Map getPluginComponents( Plugin plugin, String role ) + throws ComponentLookupException, PluginManagerException; + + /** + * @since 2.2.1 + */ + PluginDescriptor loadPluginDescriptor( Plugin plugin, MavenProject project, MavenSession session ) + throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException, + InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException, + PluginVersionNotFoundException; + + /** + * @since 2.2.1 + */ + PluginDescriptor loadPluginFully( Plugin plugin, MavenProject project, MavenSession session ) + throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException, + InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException, + PluginVersionNotFoundException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginManagerException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginManagerException.java new file mode 100644 index 00000000..dc8f9a20 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginManagerException.java @@ -0,0 +1,197 @@ +package org.apache.maven.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.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.PlexusContainerException; +import org.codehaus.plexus.classworlds.realm.NoSuchRealmException; +import org.codehaus.plexus.component.repository.exception.ComponentRepositoryException; +import org.codehaus.plexus.configuration.PlexusConfigurationException; + +/** + * Exception in the plugin manager. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class PluginManagerException + extends Exception +{ + + private final String pluginGroupId; + + private final String pluginArtifactId; + + private final String pluginVersion; + + private String goal; + + private MavenProject project; + + protected PluginManagerException( Plugin plugin, String message, MavenProject project, Throwable cause ) + { + super( message, cause ); + + this.project = project; + pluginGroupId = plugin.getGroupId(); + pluginArtifactId = plugin.getArtifactId(); + pluginVersion = plugin.getVersion(); + } + + public PluginManagerException( Plugin plugin, String message, Throwable cause ) + { + super( message, cause ); + + pluginGroupId = plugin.getGroupId(); + pluginArtifactId = plugin.getArtifactId(); + pluginVersion = plugin.getVersion(); + } + + protected PluginManagerException( MojoDescriptor mojoDescriptor, String message, Throwable cause ) + { + super( message, cause ); + pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); + pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); + pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); + goal = mojoDescriptor.getGoal(); + } + + protected PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message ) + { + super( message ); + this.project = project; + pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); + pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); + pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); + goal = mojoDescriptor.getGoal(); + } + + protected PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message, + Throwable cause ) + { + super( message, cause ); + this.project = project; + pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); + pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); + pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); + goal = mojoDescriptor.getGoal(); + } + + public PluginManagerException( Plugin plugin, InvalidVersionSpecificationException cause ) + { + super( cause ); + + pluginGroupId = plugin.getGroupId(); + pluginArtifactId = plugin.getArtifactId(); + pluginVersion = plugin.getVersion(); + } + + public PluginManagerException( Plugin plugin, String message, PlexusConfigurationException cause ) + { + super( message, cause ); + + pluginGroupId = plugin.getGroupId(); + pluginArtifactId = plugin.getArtifactId(); + pluginVersion = plugin.getVersion(); + } + + public PluginManagerException( Plugin plugin, String message, ComponentRepositoryException cause ) + { + super( message, cause ); + + pluginGroupId = plugin.getGroupId(); + pluginArtifactId = plugin.getArtifactId(); + pluginVersion = plugin.getVersion(); + } + + public PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message, + NoSuchRealmException cause ) + { + super( message, cause ); + + this.project = project; + pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); + pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); + pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); + goal = mojoDescriptor.getGoal(); + } + + public PluginManagerException( MojoDescriptor mojoDescriptor, String message, MavenProject project, + PlexusContainerException cause ) + { + super( message, cause ); + + this.project = project; + + PluginDescriptor pd = mojoDescriptor.getPluginDescriptor(); + pluginGroupId = pd.getGroupId(); + pluginArtifactId = pd.getArtifactId(); + pluginVersion = pd.getVersion(); + + goal = mojoDescriptor.getGoal(); + } + + public PluginManagerException( Plugin plugin, String message, PlexusContainerException cause ) + { + super( message, cause ); + + pluginGroupId = plugin.getGroupId(); + pluginArtifactId = plugin.getArtifactId(); + pluginVersion = plugin.getVersion(); + } + + public PluginManagerException( Plugin plugin, String message, MavenProject project ) + { + super( message ); + + pluginGroupId = plugin.getGroupId(); + pluginArtifactId = plugin.getArtifactId(); + pluginVersion = plugin.getVersion(); + this.project = project; + } + + public String getPluginGroupId() + { + return pluginGroupId; + } + + public String getPluginArtifactId() + { + return pluginArtifactId; + } + + public String getPluginVersion() + { + return pluginVersion; + } + + public String getGoal() + { + return goal; + } + + public MavenProject getProject() + { + return project; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginNotFoundException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginNotFoundException.java new file mode 100644 index 00000000..ef54e2d7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginNotFoundException.java @@ -0,0 +1,58 @@ +package org.apache.maven.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 java.util.List; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.model.Plugin; + +/** + * Exception occurring trying to resolve a plugin. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class PluginNotFoundException + extends AbstractArtifactResolutionException +{ + private Plugin plugin; + + public PluginNotFoundException( Plugin plugin, ArtifactNotFoundException e ) + { + super( "Plugin could not be found - check that the goal name is correct: " + e.getMessage(), e.getGroupId(), + e.getArtifactId(), e.getVersion(), "maven-plugin", null, e.getRemoteRepositories(), null, e.getCause() ); + this.plugin = plugin; + } + + public PluginNotFoundException( Plugin plugin, List<ArtifactRepository> remoteRepositories ) + { + super( "Plugin could not be found, please check its coordinates for typos and ensure the required" + + " plugin repositories are defined in the POM", plugin.getGroupId(), plugin.getArtifactId(), + plugin.getVersion(), "maven-plugin", null, remoteRepositories, null ); + this.plugin = plugin; + } + + public Plugin getPlugin() + { + return plugin; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java new file mode 100644 index 00000000..dcf459e7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java @@ -0,0 +1,192 @@ +package org.apache.maven.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 java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.Parameter; +import org.codehaus.plexus.util.StringUtils; + +public class PluginParameterException + extends PluginConfigurationException +{ + + private final List<Parameter> parameters; + + private final MojoDescriptor mojo; + + public PluginParameterException( MojoDescriptor mojo, List<Parameter> parameters ) + { + super( mojo.getPluginDescriptor(), "The parameters " + format( parameters ) + " for goal " + + mojo.getRoleHint() + " are missing or invalid" ); + + this.mojo = mojo; + + this.parameters = parameters; + } + + private static String format( List<Parameter> parameters ) + { + StringBuilder buffer = new StringBuilder( 128 ); + if ( parameters != null ) + { + for ( Parameter parameter : parameters ) + { + if ( buffer.length() > 0 ) + { + buffer.append( ", " ); + } + buffer.append( '\'' ).append( parameter.getName() ).append( '\'' ); + } + } + return buffer.toString(); + } + + public MojoDescriptor getMojoDescriptor() + { + return mojo; + } + + public List<Parameter> getParameters() + { + return parameters; + } + + private static void decomposeParameterIntoUserInstructions( MojoDescriptor mojo, Parameter param, + StringBuilder messageBuffer ) + { + String expression = param.getExpression(); + + if ( param.isEditable() ) + { + boolean isArray = param.getType().endsWith( "[]" ); + boolean isCollection = false; + boolean isMap = false; + boolean isProperties = false; + if ( !isArray ) + { + try + { + //assuming Type is available in current ClassLoader + isCollection = Collection.class.isAssignableFrom( Class.forName( param.getType() ) ); + isMap = Map.class.isAssignableFrom( Class.forName( param.getType() ) ); + isProperties = Properties.class.isAssignableFrom( Class.forName( param.getType() ) ); + } + catch ( ClassNotFoundException e ) + { + // assume it is not assignable from Collection or Map + } + } + + messageBuffer.append( "Inside the definition for plugin \'" ); + messageBuffer.append( mojo.getPluginDescriptor().getArtifactId() ); + messageBuffer.append( "\', specify the following:\n\n<configuration>\n ...\n" ); + messageBuffer.append( " <" ).append( param.getName() ).append( '>' ); + if ( isArray || isCollection ) + { + messageBuffer.append( '\n' ); + messageBuffer.append( " <item>" ); + } + else if ( isProperties ) + { + messageBuffer.append( '\n' ); + messageBuffer.append( " <property>\n" ); + messageBuffer.append( " <name>KEY</name>\n" ); + messageBuffer.append( " <value>" ); + } + else if ( isMap ) + { + messageBuffer.append( '\n' ); + messageBuffer.append( " <KEY>" ); + } + messageBuffer.append( "VALUE" ); + if ( isArray || isCollection ) + { + messageBuffer.append( "</item>\n" ); + messageBuffer.append( " " ); + } + else if ( isProperties ) + { + messageBuffer.append( "</value>\n" ); + messageBuffer.append( " </property>\n" ); + messageBuffer.append( " " ); + } + else if ( isMap ) + { + messageBuffer.append( "</KEY>\n" ); + messageBuffer.append( " " ); + } + messageBuffer.append( "</" ).append( param.getName() ).append( ">\n" ); + messageBuffer.append( "</configuration>" ); + + String alias = param.getAlias(); + if ( StringUtils.isNotEmpty( alias ) && !alias.equals( param.getName() ) ) + { + messageBuffer.append( "\n\n-OR-\n\n<configuration>\n ...\n <" ).append( alias ).append( + ">VALUE</" ).append( alias ).append( ">\n</configuration>\n" ); + } + } + + if ( StringUtils.isEmpty( expression ) ) + { + messageBuffer.append( "." ); + } + else + { + if ( param.isEditable() ) + { + messageBuffer.append( "\n\n-OR-\n\n" ); + } + + //addParameterUsageInfo( expression, messageBuffer ); + } + } + + public String buildDiagnosticMessage() + { + StringBuilder messageBuffer = new StringBuilder( 256 ); + + List<Parameter> params = getParameters(); + MojoDescriptor mojo = getMojoDescriptor(); + + messageBuffer.append( "One or more required plugin parameters are invalid/missing for \'" ) + .append( mojo.getPluginDescriptor().getGoalPrefix() ).append( ":" ).append( mojo.getGoal() ) + .append( "\'\n" ); + + int idx = 0; + for ( Iterator<Parameter> it = params.iterator(); it.hasNext(); idx++ ) + { + Parameter param = it.next(); + + messageBuffer.append( "\n[" ).append( idx ).append( "] " ); + + decomposeParameterIntoUserInstructions( mojo, param, messageBuffer ); + + messageBuffer.append( "\n" ); + } + + return messageBuffer.toString(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java new file mode 100644 index 00000000..9199ba5a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java @@ -0,0 +1,482 @@ +package org.apache.maven.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 java.io.File; +import java.util.Properties; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.path.PathTranslator; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; +import org.codehaus.plexus.component.configurator.expression.TypeAwareExpressionEvaluator; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.introspection.ReflectionValueExtractor; + +/** + * Evaluator for plugin parameters expressions. Content surrounded by <code>${</code> and <code>}</code> is evaluated. + * Recognized values are:<table border="1"> + * <tr><th>expression</th> <th></th> <th>evaluation result</th></tr> + * <tr><td><code>session</code></td> <td></td> <td>the actual {@link MavenSession}</td></tr> + * <tr><td><code>session.*</code></td> <td>(since Maven 3)</td><td></td></tr> + * <tr><td><code>localRepository</code></td> <td></td> + * <td>{@link MavenSession#getLocalRepository()}</td></tr> + * <tr><td><code>reactorProjects</code></td> <td></td> <td>{@link MavenSession#getProjects()}</td></tr> + * <tr><td><code>repositorySystemSession</code></td><td> (since Maven 3)</td> + * <td>{@link MavenSession#getRepositorySession()}</td></tr> + * <tr><td><code>project</code></td> <td></td> + * <td>{@link MavenSession#getCurrentProject()}</td></tr> + * <tr><td><code>project.*</code></td> <td></td> <td></td></tr> + * <tr><td><code>pom.*</code></td> <td>(since Maven 3)</td><td>same as <code>project.*</code></td></tr> + * <tr><td><code>executedProject</code></td> <td></td> + * <td>{@link MavenProject#getExecutionProject()}</td></tr> + * <tr><td><code>settings</code></td> <td></td> <td>{@link MavenSession#getSettings()}</td></tr> + * <tr><td><code>settings.*</code></td> <td></td> <td></td></tr> + * <tr><td><code>basedir</code></td> <td></td> + * <td>{@link MavenSession#getExecutionRootDirectory()} or + * <code>System.getProperty( "user.dir" )</code> if null</td></tr> + * <tr><td><code>mojoExecution</code></td> <td></td> <td>the actual {@link MojoExecution}</td></tr> + * <tr><td><code>mojo</code></td> <td>(since Maven 3)</td><td>same as <code>mojoExecution</code></td></tr> + * <tr><td><code>mojo.*</code></td> <td>(since Maven 3)</td><td></td></tr> + * <tr><td><code>plugin</code></td> <td>(since Maven 3)</td> + * <td>{@link MojoExecution#getMojoDescriptor()}.{@link MojoDescriptor#getPluginDescriptor() + * getPluginDescriptor()}</td></tr> + * <tr><td><code>plugin.*</code></td> <td></td> <td></td></tr> + * <tr><td><code>*</code></td> <td></td> <td>system properties</td></tr> + * <tr><td><code>*</code></td> <td></td> <td>project properties</td></tr> + * </table> + * <i>Notice:</i> <code>reports</code> was supported in Maven 2.x but was removed in Maven 3 + * + * @author Jason van Zyl + * @see MavenSession + * @see MojoExecution + */ +public class PluginParameterExpressionEvaluator + implements TypeAwareExpressionEvaluator +{ + private MavenSession session; + + private MojoExecution mojoExecution; + + private MavenProject project; + + private String basedir; + + private Properties properties; + + @Deprecated //TODO: used by the Enforcer plugin + public PluginParameterExpressionEvaluator( MavenSession session, MojoExecution mojoExecution, + PathTranslator pathTranslator, Logger logger, MavenProject project, + Properties properties ) + { + this( session, mojoExecution ); + } + + public PluginParameterExpressionEvaluator( MavenSession session ) + { + this( session, null ); + } + + public PluginParameterExpressionEvaluator( MavenSession session, MojoExecution mojoExecution ) + { + this.session = session; + this.mojoExecution = mojoExecution; + this.properties = new Properties(); + this.project = session.getCurrentProject(); + + // + // Maven4: We may want to evaluate how this is used but we add these separate as the + // getExecutionProperties is deprecated in MavenSession. + // + this.properties.putAll( session.getUserProperties() ); + this.properties.putAll( session.getSystemProperties() ); + + String basedir = null; + + if ( project != null ) + { + File projectFile = project.getBasedir(); + + // this should always be the case for non-super POM instances... + if ( projectFile != null ) + { + basedir = projectFile.getAbsolutePath(); + } + } + + if ( basedir == null ) + { + basedir = session.getExecutionRootDirectory(); + } + + if ( basedir == null ) + { + basedir = System.getProperty( "user.dir" ); + } + + this.basedir = basedir; + } + + @Override + public Object evaluate( String expr ) + throws ExpressionEvaluationException + { + return evaluate( expr, null ); + } + + @Override + public Object evaluate( String expr, Class<?> type ) + throws ExpressionEvaluationException + { + Object value = null; + + if ( expr == null ) + { + return null; + } + + String expression = stripTokens( expr ); + if ( expression.equals( expr ) ) + { + int index = expr.indexOf( "${" ); + if ( index >= 0 ) + { + int lastIndex = expr.indexOf( "}", index ); + if ( lastIndex >= 0 ) + { + String retVal = expr.substring( 0, index ); + + if ( ( index > 0 ) && ( expr.charAt( index - 1 ) == '$' ) ) + { + retVal += expr.substring( index + 1, lastIndex + 1 ); + } + else + { + Object subResult = evaluate( expr.substring( index, lastIndex + 1 ) ); + + if ( subResult != null ) + { + retVal += subResult; + } + else + { + retVal += "$" + expr.substring( index + 1, lastIndex + 1 ); + } + } + + retVal += evaluate( expr.substring( lastIndex + 1 ) ); + return retVal; + } + } + + // Was not an expression + if ( expression.contains( "$$" ) ) + { + return expression.replaceAll( "\\$\\$", "\\$" ); + } + else + { + return expression; + } + } + + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + if ( "localRepository".equals( expression ) ) + { + value = session.getLocalRepository(); + } + else if ( "session".equals( expression ) ) + { + value = session; + } + else if ( expression.startsWith( "session" ) ) + { + try + { + int pathSeparator = expression.indexOf( "/" ); + + if ( pathSeparator > 0 ) + { + String pathExpression = expression.substring( 1, pathSeparator ); + value = ReflectionValueExtractor.evaluate( pathExpression, session ); + value = value + expression.substring( pathSeparator ); + } + else + { + value = ReflectionValueExtractor.evaluate( expression.substring( 1 ), session ); + } + } + catch ( Exception e ) + { + // TODO: don't catch exception + throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression, + e ); + } + } + else if ( "reactorProjects".equals( expression ) ) + { + value = session.getProjects(); + } + else if ( "mojoExecution".equals( expression ) ) + { + value = mojoExecution; + } + else if ( "project".equals( expression ) ) + { + value = project; + } + else if ( "executedProject".equals( expression ) ) + { + value = project.getExecutionProject(); + } + else if ( expression.startsWith( "project" ) || expression.startsWith( "pom" ) ) + { + try + { + int pathSeparator = expression.indexOf( "/" ); + + if ( pathSeparator > 0 ) + { + String pathExpression = expression.substring( 0, pathSeparator ); + value = ReflectionValueExtractor.evaluate( pathExpression, project ); + value = value + expression.substring( pathSeparator ); + } + else + { + value = ReflectionValueExtractor.evaluate( expression.substring( 1 ), project ); + } + } + catch ( Exception e ) + { + // TODO: don't catch exception + throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression, + e ); + } + } + else if ( expression.equals( "repositorySystemSession" ) ) + { + value = session.getRepositorySession(); + } + else if ( expression.equals( "mojo" ) ) + { + value = mojoExecution; + } + else if ( expression.startsWith( "mojo" ) ) + { + try + { + int pathSeparator = expression.indexOf( "/" ); + + if ( pathSeparator > 0 ) + { + String pathExpression = expression.substring( 1, pathSeparator ); + value = ReflectionValueExtractor.evaluate( pathExpression, mojoExecution ); + value = value + expression.substring( pathSeparator ); + } + else + { + value = ReflectionValueExtractor.evaluate( expression.substring( 1 ), mojoExecution ); + } + } + catch ( Exception e ) + { + // TODO: don't catch exception + throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression, + e ); + } + } + else if ( expression.equals( "plugin" ) ) + { + value = mojoDescriptor.getPluginDescriptor(); + } + else if ( expression.startsWith( "plugin" ) ) + { + try + { + int pathSeparator = expression.indexOf( "/" ); + + PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor(); + + if ( pathSeparator > 0 ) + { + String pathExpression = expression.substring( 1, pathSeparator ); + value = ReflectionValueExtractor.evaluate( pathExpression, pluginDescriptor ); + value = value + expression.substring( pathSeparator ); + } + else + { + value = ReflectionValueExtractor.evaluate( expression.substring( 1 ), pluginDescriptor ); + } + } + catch ( Exception e ) + { + throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression, + e ); + } + } + else if ( "settings".equals( expression ) ) + { + value = session.getSettings(); + } + else if ( expression.startsWith( "settings" ) ) + { + try + { + int pathSeparator = expression.indexOf( "/" ); + + if ( pathSeparator > 0 ) + { + String pathExpression = expression.substring( 1, pathSeparator ); + value = ReflectionValueExtractor.evaluate( pathExpression, session.getSettings() ); + value = value + expression.substring( pathSeparator ); + } + else + { + value = ReflectionValueExtractor.evaluate( expression.substring( 1 ), session.getSettings() ); + } + } + catch ( Exception e ) + { + // TODO: don't catch exception + throw new ExpressionEvaluationException( "Error evaluating plugin parameter expression: " + expression, + e ); + } + } + else if ( "basedir".equals( expression ) ) + { + value = basedir; + } + else if ( expression.startsWith( "basedir" ) ) + { + int pathSeparator = expression.indexOf( "/" ); + + if ( pathSeparator > 0 ) + { + value = basedir + expression.substring( pathSeparator ); + } + } + + /* + * MNG-4312: We neither have reserved all of the above magic expressions nor is their set fixed/well-known (it + * gets occasionally extended by newer Maven versions). This imposes the risk for existing plugins to + * unintentionally use such a magic expression for an ordinary system property. So here we check whether we + * ended up with a magic value that is not compatible with the type of the configured mojo parameter (a string + * could still be converted by the configurator so we leave those alone). If so, back off to evaluating the + * expression from properties only. + */ + if ( value != null && type != null && !( value instanceof String ) && !isTypeCompatible( type, value ) ) + { + value = null; + } + + if ( value == null ) + { + // The CLI should win for defining properties + + if ( properties != null ) + { + // We will attempt to get nab a system property as a way to specify a + // parameter to a plugins. My particular case here is allowing the surefire + // plugin to run a single test so I want to specify that class on the cli + // as a parameter. + + value = properties.getProperty( expression ); + } + + if ( ( value == null ) && ( ( project != null ) && ( project.getProperties() != null ) ) ) + { + value = project.getProperties().getProperty( expression ); + } + + } + + if ( value instanceof String ) + { + // TODO: without #, this could just be an evaluate call... + + String val = (String) value; + + int exprStartDelimiter = val.indexOf( "${" ); + + if ( exprStartDelimiter >= 0 ) + { + if ( exprStartDelimiter > 0 ) + { + value = val.substring( 0, exprStartDelimiter ) + evaluate( val.substring( exprStartDelimiter ) ); + } + else + { + value = evaluate( val.substring( exprStartDelimiter ) ); + } + } + } + + return value; + } + + private static boolean isTypeCompatible( Class<?> type, Object value ) + { + if ( type.isInstance( value ) ) + { + return true; + } + // likely Boolean -> boolean, Short -> int etc. conversions, it's not the problem case we try to avoid + return ( ( type.isPrimitive() || type.getName().startsWith( "java.lang." ) ) + && value.getClass().getName().startsWith( "java.lang." ) ); + } + + private String stripTokens( String expr ) + { + if ( expr.startsWith( "${" ) && ( expr.indexOf( "}" ) == expr.length() - 1 ) ) + { + expr = expr.substring( 2, expr.length() - 1 ); + } + return expr; + } + + @Override + public File alignToBaseDirectory( File file ) + { + // TODO: Copied from the DefaultInterpolator. We likely want to resurrect the PathTranslator or at least a + // similar component for re-usage + if ( file != null ) + { + if ( file.isAbsolute() ) + { + // path was already absolute, just normalize file separator and we're done + } + else if ( file.getPath().startsWith( File.separator ) ) + { + // drive-relative Windows path, don't align with project directory but with drive root + file = file.getAbsoluteFile(); + } + else + { + // an ordinary relative path, align with project directory + file = new File( new File( basedir, file.getPath() ).toURI().normalize() ).getAbsoluteFile(); + } + } + return file; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java new file mode 100644 index 00000000..1ffa1575 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java @@ -0,0 +1,85 @@ +package org.apache.maven.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 java.util.List; +import java.util.Map; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.Plugin; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Caches plugin class realms. <strong>Warning:</strong> This is an internal utility interface that is only public for + * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without + * prior notice. + * + * @author Igor Fedorenko + * @author Benjamin Bentmann + */ +public interface PluginRealmCache +{ + + static class CacheRecord + { + public final ClassRealm realm; + + public final List<Artifact> artifacts; + + public CacheRecord( ClassRealm realm, List<Artifact> artifacts ) + { + this.realm = realm; + this.artifacts = artifacts; + } + } + + /** + * A cache key. + */ + interface Key + { + // marker interface for cache keys + } + + Key createKey( Plugin plugin, ClassLoader parentRealm, Map<String, ClassLoader> foreignImports, + DependencyFilter dependencyFilter, List<RemoteRepository> repositories, + RepositorySystemSession session ); + + CacheRecord get( Key key ); + + CacheRecord put( Key key, ClassRealm pluginRealm, List<Artifact> pluginArtifacts ); + + void flush(); + + /** + * Registers the specified cache record for usage with the given project. Integrators can use the information + * collected from this method in combination with a custom cache implementation to dispose unused records from the + * cache. + * + * @param project The project that employs the plugin realm, must not be {@code null}. + * @param record The cache record being used for the project, must not be {@code null}. + */ + void register( MavenProject project, Key key, CacheRecord record ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginResolutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginResolutionException.java new file mode 100644 index 00000000..ab280643 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/PluginResolutionException.java @@ -0,0 +1,47 @@ +package org.apache.maven.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.model.Plugin; + +/** + * Exception occurring trying to resolve a plugin. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class PluginResolutionException + extends Exception +{ + + private final Plugin plugin; + + public PluginResolutionException( Plugin plugin, Throwable cause ) + { + super( "Plugin " + plugin.getId() + " or one of its dependencies could not be resolved: " + cause.getMessage(), + cause ); + this.plugin = plugin; + } + + public Plugin getPlugin() + { + return plugin; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java new file mode 100644 index 00000000..f397c1e8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultLegacySupport.java @@ -0,0 +1,74 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.concurrent.atomic.AtomicReference; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.LegacySupport; +import org.codehaus.plexus.component.annotations.Component; +import org.eclipse.aether.RepositorySystemSession; + +/** + * Helps to provide backward-compatibility with plugins that use legacy components. <strong>Warning:</strong> This is an + * internal utility component that is only public for technical reasons, it is not part of the public API. In + * particular, this component can be changed or deleted without prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +@Component( role = LegacySupport.class ) +public class DefaultLegacySupport + implements LegacySupport +{ + + private static final ThreadLocal<AtomicReference<MavenSession>> SESSION = + new InheritableThreadLocal<AtomicReference<MavenSession>>(); + + public void setSession( MavenSession session ) + { + AtomicReference<MavenSession> reference = DefaultLegacySupport.SESSION.get(); + if ( reference != null ) + { + reference.set( null ); + } + + if ( session == null && reference != null ) + { + DefaultLegacySupport.SESSION.remove(); + } + else + { + DefaultLegacySupport.SESSION.set( new AtomicReference<MavenSession>( session ) ); + } + } + + public MavenSession getSession() + { + AtomicReference<MavenSession> currentSession = DefaultLegacySupport.SESSION.get(); + return currentSession != null ? currentSession.get() : null; + } + + public RepositorySystemSession getRepositorySession() + { + MavenSession session = getSession(); + return ( session != null ) ? session.getRepositorySession() : null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java new file mode 100644 index 00000000..d32e04c1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -0,0 +1,946 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.jar.JarFile; +import java.util.zip.ZipEntry; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.classrealm.ClassRealmManager; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.execution.scope.internal.MojoExecutionScopeModule; +import org.apache.maven.model.Plugin; +import org.apache.maven.monitor.logging.DefaultLog; +import org.apache.maven.plugin.ContextEnabled; +import org.apache.maven.plugin.DebugConfigurationListener; +import org.apache.maven.plugin.ExtensionRealmCache; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MavenPluginManager; +import org.apache.maven.plugin.MavenPluginValidator; +import org.apache.maven.plugin.Mojo; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginArtifactsCache; +import org.apache.maven.plugin.PluginConfigurationException; +import org.apache.maven.plugin.PluginContainerException; +import org.apache.maven.plugin.PluginDescriptorCache; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginIncompatibleException; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.PluginParameterException; +import org.apache.maven.plugin.PluginParameterExpressionEvaluator; +import org.apache.maven.plugin.PluginRealmCache; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.Parameter; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder; +import org.apache.maven.plugin.version.DefaultPluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolver; +import org.apache.maven.project.ExtensionDescriptor; +import org.apache.maven.project.ExtensionDescriptorBuilder; +import org.apache.maven.project.MavenProject; +import org.apache.maven.rtinfo.RuntimeInformation; +import org.apache.maven.session.scope.internal.SessionScopeModule; +import org.codehaus.plexus.DefaultPlexusContainer; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.component.composition.CycleDetectedInComponentGraphException; +import org.codehaus.plexus.component.configurator.ComponentConfigurationException; +import org.codehaus.plexus.component.configurator.ComponentConfigurator; +import org.codehaus.plexus.component.configurator.ConfigurationListener; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; +import org.codehaus.plexus.component.repository.ComponentDescriptor; +import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.configuration.PlexusConfiguration; +import org.codehaus.plexus.configuration.PlexusConfigurationException; +import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.logging.LoggerManager; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.graph.visitor.PreorderNodeListGenerator; + +/** + * Provides basic services to manage Maven plugins and their mojos. This component is kept general in its design such + * that the plugins/mojos can be used in arbitrary contexts. In particular, the mojos can be used for ordinary build + * plugins as well as special purpose plugins like reports. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +@Component( role = MavenPluginManager.class ) +public class DefaultMavenPluginManager + implements MavenPluginManager +{ + + /** + * PluginId=>ExtensionRealmCache.CacheRecord map MavenProject context value key. The map is used to ensure the same + * class realm is used to load build extensions and load mojos for extensions=true plugins. + * + * @noreference this is part of internal implementation and may be changed or removed without notice + * @since 3.3.0 + */ + public static final String KEY_EXTENSIONS_REALMS = DefaultMavenPluginManager.class.getName() + "/extensionsRealms"; + + @Requirement + private Logger logger; + + @Requirement + private LoggerManager loggerManager; + + @Requirement + private PlexusContainer container; + + @Requirement + private ClassRealmManager classRealmManager; + + @Requirement + private PluginDescriptorCache pluginDescriptorCache; + + @Requirement + private PluginRealmCache pluginRealmCache; + + @Requirement + private PluginDependenciesResolver pluginDependenciesResolver; + + @Requirement + private RuntimeInformation runtimeInformation; + + @Requirement + private ExtensionRealmCache extensionRealmCache; + + @Requirement + private PluginVersionResolver pluginVersionResolver; + + @Requirement + private PluginArtifactsCache pluginArtifactsCache; + + private ExtensionDescriptorBuilder extensionDescriptorBuilder = new ExtensionDescriptorBuilder(); + + private PluginDescriptorBuilder builder = new PluginDescriptorBuilder(); + + public synchronized PluginDescriptor getPluginDescriptor( Plugin plugin, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws PluginResolutionException, PluginDescriptorParsingException, InvalidPluginDescriptorException + { + PluginDescriptorCache.Key cacheKey = pluginDescriptorCache.createKey( plugin, repositories, session ); + + PluginDescriptor pluginDescriptor = pluginDescriptorCache.get( cacheKey ); + + if ( pluginDescriptor == null ) + { + org.eclipse.aether.artifact.Artifact artifact = + pluginDependenciesResolver.resolve( plugin, repositories, session ); + + Artifact pluginArtifact = RepositoryUtils.toArtifact( artifact ); + + pluginDescriptor = extractPluginDescriptor( pluginArtifact, plugin ); + + pluginDescriptor.setRequiredMavenVersion( artifact.getProperty( "requiredMavenVersion", null ) ); + + pluginDescriptorCache.put( cacheKey, pluginDescriptor ); + } + + pluginDescriptor.setPlugin( plugin ); + + return pluginDescriptor; + } + + private PluginDescriptor extractPluginDescriptor( Artifact pluginArtifact, Plugin plugin ) + throws PluginDescriptorParsingException, InvalidPluginDescriptorException + { + PluginDescriptor pluginDescriptor = null; + + File pluginFile = pluginArtifact.getFile(); + + try + { + if ( pluginFile.isFile() ) + { + JarFile pluginJar = new JarFile( pluginFile, false ); + try + { + ZipEntry pluginDescriptorEntry = pluginJar.getEntry( getPluginDescriptorLocation() ); + + if ( pluginDescriptorEntry != null ) + { + InputStream is = pluginJar.getInputStream( pluginDescriptorEntry ); + + pluginDescriptor = parsePluginDescriptor( is, plugin, pluginFile.getAbsolutePath() ); + } + } + finally + { + pluginJar.close(); + } + } + else + { + File pluginXml = new File( pluginFile, getPluginDescriptorLocation() ); + + if ( pluginXml.isFile() ) + { + InputStream is = new BufferedInputStream( new FileInputStream( pluginXml ) ); + try + { + pluginDescriptor = parsePluginDescriptor( is, plugin, pluginXml.getAbsolutePath() ); + } + finally + { + IOUtil.close( is ); + } + } + } + + if ( pluginDescriptor == null ) + { + throw new IOException( "No plugin descriptor found at " + getPluginDescriptorLocation() ); + } + } + catch ( IOException e ) + { + throw new PluginDescriptorParsingException( plugin, pluginFile.getAbsolutePath(), e ); + } + + MavenPluginValidator validator = new MavenPluginValidator( pluginArtifact ); + + validator.validate( pluginDescriptor ); + + if ( validator.hasErrors() ) + { + throw new InvalidPluginDescriptorException( "Invalid plugin descriptor for " + plugin.getId() + " (" + + pluginFile + ")", validator.getErrors() ); + } + + pluginDescriptor.setPluginArtifact( pluginArtifact ); + + return pluginDescriptor; + } + + private String getPluginDescriptorLocation() + { + return "META-INF/maven/plugin.xml"; + } + + private PluginDescriptor parsePluginDescriptor( InputStream is, Plugin plugin, String descriptorLocation ) + throws PluginDescriptorParsingException + { + try + { + Reader reader = ReaderFactory.newXmlReader( is ); + + PluginDescriptor pluginDescriptor = builder.build( reader, descriptorLocation ); + + return pluginDescriptor; + } + catch ( IOException e ) + { + throw new PluginDescriptorParsingException( plugin, descriptorLocation, e ); + } + catch ( PlexusConfigurationException e ) + { + throw new PluginDescriptorParsingException( plugin, descriptorLocation, e ); + } + } + + public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws MojoNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + InvalidPluginDescriptorException + { + PluginDescriptor pluginDescriptor = getPluginDescriptor( plugin, repositories, session ); + + MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal ); + + if ( mojoDescriptor == null ) + { + throw new MojoNotFoundException( goal, pluginDescriptor ); + } + + return mojoDescriptor; + } + + public void checkRequiredMavenVersion( PluginDescriptor pluginDescriptor ) + throws PluginIncompatibleException + { + String requiredMavenVersion = pluginDescriptor.getRequiredMavenVersion(); + if ( StringUtils.isNotBlank( requiredMavenVersion ) ) + { + try + { + if ( !runtimeInformation.isMavenVersion( requiredMavenVersion ) ) + { + throw new PluginIncompatibleException( pluginDescriptor.getPlugin(), "The plugin " + + pluginDescriptor.getId() + " requires Maven version " + requiredMavenVersion ); + } + } + catch ( RuntimeException e ) + { + logger.warn( "Could not verify plugin's Maven prerequisite: " + e.getMessage() ); + } + } + } + + public synchronized void setupPluginRealm( PluginDescriptor pluginDescriptor, MavenSession session, + ClassLoader parent, List<String> imports, DependencyFilter filter ) + throws PluginResolutionException, PluginContainerException + { + Plugin plugin = pluginDescriptor.getPlugin(); + MavenProject project = session.getCurrentProject(); + + if ( plugin.isExtensions() ) + { + ExtensionRealmCache.CacheRecord extensionRecord; + try + { + RepositorySystemSession repositorySession = session.getRepositorySession(); + extensionRecord = setupExtensionsRealm( project, plugin, repositorySession ); + } + catch ( PluginManagerException e ) + { + // extensions realm is expected to be fully setup at this point + // any exception means a problem in maven code, not a user error + throw new IllegalStateException( e ); + } + + ClassRealm pluginRealm = extensionRecord.realm; + List<Artifact> pluginArtifacts = extensionRecord.artifacts; + + for ( ComponentDescriptor<?> componentDescriptor : pluginDescriptor.getComponents() ) + { + componentDescriptor.setRealm( pluginRealm ); + } + + pluginDescriptor.setClassRealm( pluginRealm ); + pluginDescriptor.setArtifacts( pluginArtifacts ); + } + else + { + Map<String, ClassLoader> foreignImports = calcImports( project, parent, imports ); + + PluginRealmCache.Key cacheKey = + pluginRealmCache.createKey( plugin, parent, foreignImports, filter, + project.getRemotePluginRepositories(), session.getRepositorySession() ); + + PluginRealmCache.CacheRecord cacheRecord = pluginRealmCache.get( cacheKey ); + + if ( cacheRecord != null ) + { + pluginDescriptor.setClassRealm( cacheRecord.realm ); + pluginDescriptor.setArtifacts( new ArrayList<Artifact>( cacheRecord.artifacts ) ); + for ( ComponentDescriptor<?> componentDescriptor : pluginDescriptor.getComponents() ) + { + componentDescriptor.setRealm( cacheRecord.realm ); + } + } + else + { + createPluginRealm( pluginDescriptor, session, parent, foreignImports, filter ); + + cacheRecord = + pluginRealmCache.put( cacheKey, pluginDescriptor.getClassRealm(), pluginDescriptor.getArtifacts() ); + } + + pluginRealmCache.register( project, cacheKey, cacheRecord ); + } + } + + private void createPluginRealm( PluginDescriptor pluginDescriptor, MavenSession session, ClassLoader parent, + Map<String, ClassLoader> foreignImports, DependencyFilter filter ) + throws PluginResolutionException, PluginContainerException + { + Plugin plugin = pluginDescriptor.getPlugin(); + + if ( plugin == null ) + { + throw new IllegalArgumentException( "incomplete plugin descriptor, plugin missing" ); + } + + Artifact pluginArtifact = pluginDescriptor.getPluginArtifact(); + + if ( pluginArtifact == null ) + { + throw new IllegalArgumentException( "incomplete plugin descriptor, plugin artifact missing" ); + } + + MavenProject project = session.getCurrentProject(); + + final ClassRealm pluginRealm; + final List<Artifact> pluginArtifacts; + + RepositorySystemSession repositorySession = session.getRepositorySession(); + DependencyFilter dependencyFilter = project.getExtensionDependencyFilter(); + dependencyFilter = AndDependencyFilter.newInstance( dependencyFilter, filter ); + + DependencyNode root = + pluginDependenciesResolver.resolve( plugin, RepositoryUtils.toArtifact( pluginArtifact ), + dependencyFilter, project.getRemotePluginRepositories(), + repositorySession ); + + PreorderNodeListGenerator nlg = new PreorderNodeListGenerator(); + root.accept( nlg ); + + pluginArtifacts = toMavenArtifacts( root, nlg ); + + pluginRealm = + classRealmManager.createPluginRealm( plugin, parent, null, foreignImports, + toAetherArtifacts( pluginArtifacts ) ); + + discoverPluginComponents( pluginRealm, plugin, pluginDescriptor ); + + pluginDescriptor.setClassRealm( pluginRealm ); + pluginDescriptor.setArtifacts( pluginArtifacts ); + } + + private void discoverPluginComponents( final ClassRealm pluginRealm, Plugin plugin, + PluginDescriptor pluginDescriptor ) + throws PluginContainerException + { + try + { + if ( pluginDescriptor != null ) + { + for ( ComponentDescriptor<?> componentDescriptor : pluginDescriptor.getComponents() ) + { + componentDescriptor.setRealm( pluginRealm ); + container.addComponentDescriptor( componentDescriptor ); + } + } + + ( (DefaultPlexusContainer) container ).discoverComponents( pluginRealm, + new SessionScopeModule( container ), + new MojoExecutionScopeModule( container ) ); + } + catch ( ComponentLookupException e ) + { + throw new PluginContainerException( plugin, pluginRealm, "Error in component graph of plugin " + + plugin.getId() + ": " + e.getMessage(), e ); + } + catch ( CycleDetectedInComponentGraphException e ) + { + throw new PluginContainerException( plugin, pluginRealm, "Error in component graph of plugin " + + plugin.getId() + ": " + e.getMessage(), e ); + } + } + + private List<org.eclipse.aether.artifact.Artifact> toAetherArtifacts( final List<Artifact> pluginArtifacts ) + { + return new ArrayList<org.eclipse.aether.artifact.Artifact>( RepositoryUtils.toArtifacts( pluginArtifacts ) ); + } + + private List<Artifact> toMavenArtifacts( DependencyNode root, PreorderNodeListGenerator nlg ) + { + List<Artifact> artifacts = new ArrayList<Artifact>( nlg.getNodes().size() ); + RepositoryUtils.toArtifacts( artifacts, Collections.singleton( root ), Collections.<String>emptyList(), null ); + for ( Iterator<Artifact> it = artifacts.iterator(); it.hasNext(); ) + { + Artifact artifact = it.next(); + if ( artifact.getFile() == null ) + { + it.remove(); + } + } + return artifacts; + } + + private Map<String, ClassLoader> calcImports( MavenProject project, ClassLoader parent, List<String> imports ) + { + Map<String, ClassLoader> foreignImports = new HashMap<String, ClassLoader>(); + + ClassLoader projectRealm = project.getClassRealm(); + if ( projectRealm != null ) + { + foreignImports.put( "", projectRealm ); + } + else + { + foreignImports.put( "", classRealmManager.getMavenApiRealm() ); + } + + if ( parent != null && imports != null ) + { + for ( String parentImport : imports ) + { + foreignImports.put( parentImport, parent ); + } + } + + return foreignImports; + } + + public <T> T getConfiguredMojo( Class<T> mojoInterface, MavenSession session, MojoExecution mojoExecution ) + throws PluginConfigurationException, PluginContainerException + { + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor(); + + ClassRealm pluginRealm = pluginDescriptor.getClassRealm(); + + if ( logger.isDebugEnabled() ) + { + logger.debug( "Configuring mojo " + mojoDescriptor.getId() + " from plugin realm " + pluginRealm ); + } + + // We are forcing the use of the plugin realm for all lookups that might occur during + // the lifecycle that is part of the lookup. Here we are specifically trying to keep + // lookups that occur in contextualize calls in line with the right realm. + ClassRealm oldLookupRealm = container.setLookupRealm( pluginRealm ); + + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader( pluginRealm ); + + try + { + T mojo; + + try + { + mojo = container.lookup( mojoInterface, mojoDescriptor.getRoleHint() ); + } + catch ( ComponentLookupException e ) + { + Throwable cause = e.getCause(); + while ( cause != null && !( cause instanceof LinkageError ) + && !( cause instanceof ClassNotFoundException ) ) + { + cause = cause.getCause(); + } + + if ( ( cause instanceof NoClassDefFoundError ) || ( cause instanceof ClassNotFoundException ) ) + { + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "Unable to load the mojo '" + mojoDescriptor.getGoal() + "' in the plugin '" + + pluginDescriptor.getId() + "'. A required class is missing: " + cause.getMessage() ); + pluginRealm.display( ps ); + + throw new PluginContainerException( mojoDescriptor, pluginRealm, os.toString(), cause ); + } + else if ( cause instanceof LinkageError ) + { + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "Unable to load the mojo '" + mojoDescriptor.getGoal() + "' in the plugin '" + + pluginDescriptor.getId() + "' due to an API incompatibility: " + e.getClass().getName() + + ": " + cause.getMessage() ); + pluginRealm.display( ps ); + + throw new PluginContainerException( mojoDescriptor, pluginRealm, os.toString(), cause ); + } + + throw new PluginContainerException( mojoDescriptor, pluginRealm, "Unable to load the mojo '" + + mojoDescriptor.getGoal() + "' (or one of its required components) from the plugin '" + + pluginDescriptor.getId() + "'", e ); + } + + if ( mojo instanceof ContextEnabled ) + { + MavenProject project = session.getCurrentProject(); + + Map<String, Object> pluginContext = session.getPluginContext( pluginDescriptor, project ); + + if ( pluginContext != null ) + { + pluginContext.put( "project", project ); + + pluginContext.put( "pluginDescriptor", pluginDescriptor ); + + ( (ContextEnabled) mojo ).setPluginContext( pluginContext ); + } + } + + if ( mojo instanceof Mojo ) + { + Logger mojoLogger = loggerManager.getLoggerForComponent( mojoDescriptor.getImplementation() ); + ( (Mojo) mojo ).setLog( new DefaultLog( mojoLogger ) ); + } + + Xpp3Dom dom = mojoExecution.getConfiguration(); + + PlexusConfiguration pomConfiguration; + + if ( dom == null ) + { + pomConfiguration = new XmlPlexusConfiguration( "configuration" ); + } + else + { + pomConfiguration = new XmlPlexusConfiguration( dom ); + } + + ExpressionEvaluator expressionEvaluator = new PluginParameterExpressionEvaluator( session, mojoExecution ); + + populatePluginFields( mojo, mojoDescriptor, pluginRealm, pomConfiguration, expressionEvaluator ); + + return mojo; + } + finally + { + Thread.currentThread().setContextClassLoader( oldClassLoader ); + container.setLookupRealm( oldLookupRealm ); + } + } + + private void populatePluginFields( Object mojo, MojoDescriptor mojoDescriptor, ClassRealm pluginRealm, + PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator ) + throws PluginConfigurationException + { + ComponentConfigurator configurator = null; + + String configuratorId = mojoDescriptor.getComponentConfigurator(); + + if ( StringUtils.isEmpty( configuratorId ) ) + { + configuratorId = "basic"; + } + + try + { + // TODO: could the configuration be passed to lookup and the configurator known to plexus via the descriptor + // so that this method could entirely be handled by a plexus lookup? + configurator = container.lookup( ComponentConfigurator.class, configuratorId ); + + ConfigurationListener listener = new DebugConfigurationListener( logger ); + + ValidatingConfigurationListener validator = + new ValidatingConfigurationListener( mojo, mojoDescriptor, listener ); + + logger.debug( "Configuring mojo '" + mojoDescriptor.getId() + "' with " + configuratorId + + " configurator -->" ); + + configurator.configureComponent( mojo, configuration, expressionEvaluator, pluginRealm, validator ); + + logger.debug( "-- end configuration --" ); + + Collection<Parameter> missingParameters = validator.getMissingParameters(); + if ( !missingParameters.isEmpty() ) + { + if ( "basic".equals( configuratorId ) ) + { + throw new PluginParameterException( mojoDescriptor, new ArrayList<Parameter>( missingParameters ) ); + } + else + { + /* + * NOTE: Other configurators like the map-oriented one don't call into the listener, so do it the + * hard way. + */ + validateParameters( mojoDescriptor, configuration, expressionEvaluator ); + } + } + } + catch ( ComponentConfigurationException e ) + { + String message = "Unable to parse configuration of mojo " + mojoDescriptor.getId(); + if ( e.getFailedConfiguration() != null ) + { + message += " for parameter " + e.getFailedConfiguration().getName(); + } + message += ": " + e.getMessage(); + + throw new PluginConfigurationException( mojoDescriptor.getPluginDescriptor(), message, e ); + } + catch ( ComponentLookupException e ) + { + throw new PluginConfigurationException( mojoDescriptor.getPluginDescriptor(), + "Unable to retrieve component configurator " + configuratorId + + " for configuration of mojo " + mojoDescriptor.getId(), e ); + } + catch ( NoClassDefFoundError e ) + { + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "A required class was missing during configuration of mojo " + mojoDescriptor.getId() + ": " + + e.getMessage() ); + pluginRealm.display( ps ); + + throw new PluginConfigurationException( mojoDescriptor.getPluginDescriptor(), os.toString(), e ); + } + catch ( LinkageError e ) + { + ByteArrayOutputStream os = new ByteArrayOutputStream( 1024 ); + PrintStream ps = new PrintStream( os ); + ps.println( "An API incompatibility was encountered during configuration of mojo " + mojoDescriptor.getId() + + ": " + e.getClass().getName() + ": " + e.getMessage() ); + pluginRealm.display( ps ); + + throw new PluginConfigurationException( mojoDescriptor.getPluginDescriptor(), os.toString(), e ); + } + finally + { + if ( configurator != null ) + { + try + { + container.release( configurator ); + } + catch ( ComponentLifecycleException e ) + { + logger.debug( "Failed to release mojo configurator - ignoring." ); + } + } + } + } + + private void validateParameters( MojoDescriptor mojoDescriptor, PlexusConfiguration configuration, + ExpressionEvaluator expressionEvaluator ) + throws ComponentConfigurationException, PluginParameterException + { + if ( mojoDescriptor.getParameters() == null ) + { + return; + } + + List<Parameter> invalidParameters = new ArrayList<Parameter>(); + + for ( Parameter parameter : mojoDescriptor.getParameters() ) + { + if ( !parameter.isRequired() ) + { + continue; + } + + Object value = null; + + PlexusConfiguration config = configuration.getChild( parameter.getName(), false ); + if ( config != null ) + { + String expression = config.getValue( null ); + + try + { + value = expressionEvaluator.evaluate( expression ); + + if ( value == null ) + { + value = config.getAttribute( "default-value", null ); + } + } + catch ( ExpressionEvaluationException e ) + { + String msg = + "Error evaluating the expression '" + expression + "' for configuration value '" + + configuration.getName() + "'"; + throw new ComponentConfigurationException( configuration, msg, e ); + } + } + + if ( value == null && ( config == null || config.getChildCount() <= 0 ) ) + { + invalidParameters.add( parameter ); + } + } + + if ( !invalidParameters.isEmpty() ) + { + throw new PluginParameterException( mojoDescriptor, invalidParameters ); + } + } + + public void releaseMojo( Object mojo, MojoExecution mojoExecution ) + { + if ( mojo != null ) + { + try + { + container.release( mojo ); + } + catch ( ComponentLifecycleException e ) + { + String goalExecId = mojoExecution.getGoal(); + + if ( mojoExecution.getExecutionId() != null ) + { + goalExecId += " {execution: " + mojoExecution.getExecutionId() + "}"; + } + + logger.debug( "Error releasing mojo for " + goalExecId, e ); + } + } + } + + public ExtensionRealmCache.CacheRecord setupExtensionsRealm( MavenProject project, Plugin plugin, + RepositorySystemSession session ) + throws PluginManagerException + { + @SuppressWarnings( "unchecked" ) + Map<String, ExtensionRealmCache.CacheRecord> pluginRealms = + (Map<String, ExtensionRealmCache.CacheRecord>) project.getContextValue( KEY_EXTENSIONS_REALMS ); + if ( pluginRealms == null ) + { + pluginRealms = new HashMap<String, ExtensionRealmCache.CacheRecord>(); + project.setContextValue( KEY_EXTENSIONS_REALMS, pluginRealms ); + } + + final String pluginKey = plugin.getId(); + + ExtensionRealmCache.CacheRecord extensionRecord = pluginRealms.get( pluginKey ); + if ( extensionRecord != null ) + { + return extensionRecord; + } + + final List<RemoteRepository> repositories = project.getRemotePluginRepositories(); + + // resolve plugin version as necessary + if ( plugin.getVersion() == null ) + { + PluginVersionRequest versionRequest = new DefaultPluginVersionRequest( plugin, session, repositories ); + try + { + plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() ); + } + catch ( PluginVersionResolutionException e ) + { + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + } + + // resolve plugin artifacts + List<Artifact> artifacts; + PluginArtifactsCache.Key cacheKey = pluginArtifactsCache.createKey( plugin, null, repositories, session ); + PluginArtifactsCache.CacheRecord recordArtifacts; + try + { + recordArtifacts = pluginArtifactsCache.get( cacheKey ); + } + catch ( PluginResolutionException e ) + { + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + if ( recordArtifacts != null ) + { + artifacts = recordArtifacts.artifacts; + } + else + { + try + { + artifacts = resolveExtensionArtifacts( plugin, repositories, session ); + recordArtifacts = pluginArtifactsCache.put( cacheKey, artifacts ); + } + catch ( PluginResolutionException e ) + { + pluginArtifactsCache.put( cacheKey, e ); + pluginArtifactsCache.register( project, cacheKey, recordArtifacts ); + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + } + pluginArtifactsCache.register( project, cacheKey, recordArtifacts ); + + // create and cache extensions realms + final ExtensionRealmCache.Key extensionKey = extensionRealmCache.createKey( artifacts ); + extensionRecord = extensionRealmCache.get( extensionKey ); + if ( extensionRecord == null ) + { + ClassRealm extensionRealm = classRealmManager.createExtensionRealm( plugin, + toAetherArtifacts( artifacts ) ); + + // TODO figure out how to use the same PluginDescriptor when running mojos + + PluginDescriptor pluginDescriptor = null; + if ( plugin.isExtensions() && !artifacts.isEmpty() ) + { + // ignore plugin descriptor parsing errors at this point + // these errors will reported during calculation of project build execution plan + try + { + pluginDescriptor = extractPluginDescriptor( artifacts.get( 0 ), plugin ); + } + catch ( PluginDescriptorParsingException e ) + { + // ignore, see above + } + catch ( InvalidPluginDescriptorException e ) + { + // ignore, see above + } + } + + discoverPluginComponents( extensionRealm, plugin, pluginDescriptor ); + + ExtensionDescriptor extensionDescriptor = null; + Artifact extensionArtifact = artifacts.get( 0 ); + try + { + extensionDescriptor = extensionDescriptorBuilder.build( extensionArtifact.getFile() ); + } + catch ( IOException e ) + { + String message = "Invalid extension descriptor for " + plugin.getId() + ": " + e.getMessage(); + if ( logger.isDebugEnabled() ) + { + logger.error( message, e ); + } + else + { + logger.error( message ); + } + } + extensionRecord = extensionRealmCache.put( extensionKey, extensionRealm, extensionDescriptor, artifacts ); + } + extensionRealmCache.register( project, extensionKey, extensionRecord ); + pluginRealms.put( pluginKey, extensionRecord ); + + return extensionRecord; + } + + private List<Artifact> resolveExtensionArtifacts( Plugin extensionPlugin, List<RemoteRepository> repositories, + RepositorySystemSession session ) + throws PluginResolutionException + { + DependencyNode root = pluginDependenciesResolver.resolve( extensionPlugin, null, null, repositories, session ); + PreorderNodeListGenerator nlg = new PreorderNodeListGenerator(); + root.accept( nlg ); + return toMavenArtifacts( root, nlg ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java new file mode 100644 index 00000000..5b0c2712 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java @@ -0,0 +1,256 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.PluginResolutionException; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.collection.DependencyCollectionException; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.graph.DependencyVisitor; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactDescriptorException; +import org.eclipse.aether.resolution.ArtifactDescriptorRequest; +import org.eclipse.aether.resolution.ArtifactDescriptorResult; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.resolution.DependencyResolutionException; +import org.eclipse.aether.util.artifact.JavaScopes; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.filter.ScopeDependencyFilter; +import org.eclipse.aether.util.graph.selector.AndDependencySelector; +import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer; +import org.eclipse.aether.util.repository.SimpleArtifactDescriptorPolicy; + +/** + * Assists in resolving the dependencies of a plugin. <strong>Warning:</strong> This is an internal utility class that + * is only public for technical reasons, it is not part of the public API. In particular, this class can be changed or + * deleted without prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +@Component( role = PluginDependenciesResolver.class ) +public class DefaultPluginDependenciesResolver + implements PluginDependenciesResolver +{ + + private static final String REPOSITORY_CONTEXT = "plugin"; + + @Requirement + private Logger logger; + + @Requirement + private RepositorySystem repoSystem; + + private Artifact toArtifact( Plugin plugin, RepositorySystemSession session ) + { + return new DefaultArtifact( plugin.getGroupId(), plugin.getArtifactId(), null, "jar", plugin.getVersion(), + session.getArtifactTypeRegistry().get( "maven-plugin" ) ); + } + + public Artifact resolve( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) + throws PluginResolutionException + { + RequestTrace trace = RequestTrace.newChild( null, plugin ); + + Artifact pluginArtifact = toArtifact( plugin, session ); + + try + { + DefaultRepositorySystemSession pluginSession = new DefaultRepositorySystemSession( session ); + pluginSession.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, false ) ); + + ArtifactDescriptorRequest request = + new ArtifactDescriptorRequest( pluginArtifact, repositories, REPOSITORY_CONTEXT ); + request.setTrace( trace ); + ArtifactDescriptorResult result = repoSystem.readArtifactDescriptor( pluginSession, request ); + + pluginArtifact = result.getArtifact(); + + String requiredMavenVersion = (String) result.getProperties().get( "prerequisites.maven" ); + if ( requiredMavenVersion != null ) + { + Map<String, String> props = new LinkedHashMap<String, String>( pluginArtifact.getProperties() ); + props.put( "requiredMavenVersion", requiredMavenVersion ); + pluginArtifact = pluginArtifact.setProperties( props ); + } + } + catch ( ArtifactDescriptorException e ) + { + throw new PluginResolutionException( plugin, e ); + } + + try + { + ArtifactRequest request = new ArtifactRequest( pluginArtifact, repositories, REPOSITORY_CONTEXT ); + request.setTrace( trace ); + pluginArtifact = repoSystem.resolveArtifact( session, request ).getArtifact(); + } + catch ( ArtifactResolutionException e ) + { + throw new PluginResolutionException( plugin, e ); + } + + return pluginArtifact; + } + + /** + * @since 3.3.0 + */ + public DependencyNode resolveCoreExtension( Plugin plugin, DependencyFilter dependencyFilter, + List<RemoteRepository> repositories, RepositorySystemSession session ) + throws PluginResolutionException + { + return resolveInternal( plugin, null /* pluginArtifact */, dependencyFilter, null /* transformer */, + repositories, session ); + } + + public DependencyNode resolve( Plugin plugin, Artifact pluginArtifact, DependencyFilter dependencyFilter, + List<RemoteRepository> repositories, RepositorySystemSession session ) + throws PluginResolutionException + { + return resolveInternal( plugin, pluginArtifact, dependencyFilter, new PlexusUtilsInjector(), repositories, + session ); + } + + private DependencyNode resolveInternal( Plugin plugin, Artifact pluginArtifact, DependencyFilter dependencyFilter, + DependencyGraphTransformer transformer, + List<RemoteRepository> repositories, RepositorySystemSession session ) + throws PluginResolutionException + { + RequestTrace trace = RequestTrace.newChild( null, plugin ); + + if ( pluginArtifact == null ) + { + pluginArtifact = toArtifact( plugin, session ); + } + + DependencyFilter collectionFilter = new ScopeDependencyFilter( "provided", "test" ); + DependencyFilter resolutionFilter = AndDependencyFilter.newInstance( collectionFilter, dependencyFilter ); + + DependencyNode node; + + try + { + DependencySelector selector = + AndDependencySelector.newInstance( session.getDependencySelector(), new WagonExcluder() ); + + transformer = + ChainedDependencyGraphTransformer.newInstance( session.getDependencyGraphTransformer(), transformer ); + + DefaultRepositorySystemSession pluginSession = new DefaultRepositorySystemSession( session ); + pluginSession.setDependencySelector( selector ); + pluginSession.setDependencyGraphTransformer( transformer ); + + CollectRequest request = new CollectRequest(); + request.setRequestContext( REPOSITORY_CONTEXT ); + request.setRepositories( repositories ); + request.setRoot( new org.eclipse.aether.graph.Dependency( pluginArtifact, null ) ); + for ( Dependency dependency : plugin.getDependencies() ) + { + org.eclipse.aether.graph.Dependency pluginDep = + RepositoryUtils.toDependency( dependency, session.getArtifactTypeRegistry() ); + if ( !JavaScopes.SYSTEM.equals( pluginDep.getScope() ) ) + { + pluginDep = pluginDep.setScope( JavaScopes.RUNTIME ); + } + request.addDependency( pluginDep ); + } + + DependencyRequest depRequest = new DependencyRequest( request, resolutionFilter ); + depRequest.setTrace( trace ); + + request.setTrace( RequestTrace.newChild( trace, depRequest ) ); + + node = repoSystem.collectDependencies( pluginSession, request ).getRoot(); + + if ( logger.isDebugEnabled() ) + { + node.accept( new GraphLogger() ); + } + + depRequest.setRoot( node ); + repoSystem.resolveDependencies( session, depRequest ); + } + catch ( DependencyCollectionException e ) + { + throw new PluginResolutionException( plugin, e ); + } + catch ( DependencyResolutionException e ) + { + throw new PluginResolutionException( plugin, e.getCause() ); + } + + return node; + } + + class GraphLogger + implements DependencyVisitor + { + + private String indent = ""; + + public boolean visitEnter( DependencyNode node ) + { + StringBuilder buffer = new StringBuilder( 128 ); + buffer.append( indent ); + org.eclipse.aether.graph.Dependency dep = node.getDependency(); + if ( dep != null ) + { + Artifact art = dep.getArtifact(); + + buffer.append( art ); + buffer.append( ':' ).append( dep.getScope() ); + } + + logger.debug( buffer.toString() ); + indent += " "; + return true; + } + + public boolean visitLeave( DependencyNode node ) + { + indent = indent.substring( 0, indent.length() - 3 ); + return true; + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java new file mode 100644 index 00000000..015060f6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java @@ -0,0 +1,261 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.Map; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.InvalidPluginException; +import org.apache.maven.plugin.LegacySupport; +import org.apache.maven.plugin.MavenPluginManager; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.PluginConfigurationException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginManager; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.prefix.DefaultPluginPrefixRequest; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.prefix.PluginPrefixRequest; +import org.apache.maven.plugin.prefix.PluginPrefixResolver; +import org.apache.maven.plugin.prefix.PluginPrefixResult; +import org.apache.maven.plugin.version.DefaultPluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionNotFoundException; +import org.apache.maven.plugin.version.PluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolver; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; +import org.apache.maven.settings.Settings; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +/** + * @author Benjamin Bentmann + */ +@Component( role = PluginManager.class ) +public class DefaultPluginManager + implements PluginManager +{ + + @Requirement + private PlexusContainer container; + + @Requirement + private MavenPluginManager pluginManager; + + @Requirement + private PluginVersionResolver pluginVersionResolver; + + @Requirement + private PluginPrefixResolver pluginPrefixResolver; + + @Requirement + private LegacySupport legacySupport; + + public void executeMojo( MavenProject project, MojoExecution execution, MavenSession session ) + throws MojoExecutionException, ArtifactResolutionException, MojoFailureException, ArtifactNotFoundException, + InvalidDependencyVersionException, PluginManagerException, PluginConfigurationException + { + throw new UnsupportedOperationException(); + } + + public Object getPluginComponent( Plugin plugin, String role, String roleHint ) + throws PluginManagerException, ComponentLookupException + { + MavenSession session = legacySupport.getSession(); + + PluginDescriptor pluginDescriptor; + try + { + pluginDescriptor = + pluginManager.getPluginDescriptor( plugin, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + + pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null ); + } + catch ( Exception e ) + { + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + try + { + Thread.currentThread().setContextClassLoader( pluginDescriptor.getClassRealm() ); + + return container.lookup( role, roleHint ); + } + finally + { + Thread.currentThread().setContextClassLoader( oldClassLoader ); + } + } + + public Map getPluginComponents( Plugin plugin, String role ) + throws ComponentLookupException, PluginManagerException + { + MavenSession session = legacySupport.getSession(); + + PluginDescriptor pluginDescriptor; + try + { + pluginDescriptor = + pluginManager.getPluginDescriptor( plugin, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + + pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null ); + } + catch ( Exception e ) + { + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + try + { + Thread.currentThread().setContextClassLoader( pluginDescriptor.getClassRealm() ); + + return container.lookupMap( role ); + } + finally + { + Thread.currentThread().setContextClassLoader( oldClassLoader ); + } + } + + public Plugin getPluginDefinitionForPrefix( String prefix, MavenSession session, MavenProject project ) + { + PluginPrefixRequest request = new DefaultPluginPrefixRequest( prefix, session ); + request.setPom( project.getModel() ); + + try + { + PluginPrefixResult result = pluginPrefixResolver.resolve( request ); + + Plugin plugin = new Plugin(); + plugin.setGroupId( result.getGroupId() ); + plugin.setArtifactId( result.getArtifactId() ); + + return plugin; + } + catch ( NoPluginFoundForPrefixException e ) + { + return null; + } + } + + public PluginDescriptor getPluginDescriptorForPrefix( String prefix ) + { + MavenSession session = legacySupport.getSession(); + + PluginPrefixRequest request = new DefaultPluginPrefixRequest( prefix, session ); + + try + { + PluginPrefixResult result = pluginPrefixResolver.resolve( request ); + + Plugin plugin = new Plugin(); + plugin.setGroupId( result.getGroupId() ); + plugin.setArtifactId( result.getArtifactId() ); + + return loadPluginDescriptor( plugin, session.getCurrentProject(), session ); + } + catch ( Exception e ) + { + return null; + } + } + + public PluginDescriptor loadPluginDescriptor( Plugin plugin, MavenProject project, MavenSession session ) + throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException, + InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException, + PluginVersionNotFoundException + { + return verifyPlugin( plugin, project, session.getSettings(), session.getLocalRepository() ); + } + + public PluginDescriptor loadPluginFully( Plugin plugin, MavenProject project, MavenSession session ) + throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException, + InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException, + PluginVersionNotFoundException + { + PluginDescriptor pluginDescriptor = loadPluginDescriptor( plugin, project, session ); + + try + { + pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null ); + } + catch ( PluginResolutionException e ) + { + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + + return pluginDescriptor; + } + + public PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings, + ArtifactRepository localRepository ) + throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException, + InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException, + PluginVersionNotFoundException + { + MavenSession session = legacySupport.getSession(); + + if ( plugin.getVersion() == null ) + { + PluginVersionRequest versionRequest = + new DefaultPluginVersionRequest( plugin, session.getRepositorySession(), + project.getRemotePluginRepositories() ); + plugin.setVersion( pluginVersionResolver.resolve( versionRequest ).getVersion() ); + } + + try + { + return pluginManager.getPluginDescriptor( plugin, project.getRemotePluginRepositories(), + session.getRepositorySession() ); + } + catch ( PluginResolutionException e ) + { + throw new PluginNotFoundException( plugin, project.getPluginArtifactRepositories() ); + } + catch ( PluginDescriptorParsingException e ) + { + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + catch ( InvalidPluginDescriptorException e ) + { + throw new PluginManagerException( plugin, e.getMessage(), e ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java new file mode 100644 index 00000000..16a0b63c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java @@ -0,0 +1,87 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.eclipse.aether.RepositoryException; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.collection.DependencyGraphTransformationContext; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.graph.DefaultDependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.util.artifact.JavaScopes; + +/** + * Injects plexus-utils:1.1 into a plugin's class path if it doesn't already declare a dependency on plexus-utils. This + * is another legacy bit to provide backward-compat with Maven 2.x. + * + * @author Benjamin Bentmann + */ +class PlexusUtilsInjector + implements DependencyGraphTransformer +{ + + private static final String GID = "org.codehaus.plexus"; + + private static final String AID = "plexus-utils"; + + private static final String VER = "1.1"; + + private static final String EXT = "jar"; + + public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) + throws RepositoryException + { + if ( findPlexusUtils( node ) == null ) + { + Artifact pu = new DefaultArtifact( GID, AID, null, EXT, VER ); + DefaultDependencyNode child = new DefaultDependencyNode( new Dependency( pu, JavaScopes.RUNTIME ) ); + child.setRepositories( node.getRepositories() ); + child.setRequestContext( node.getRequestContext() ); + node.getChildren().add( child ); + } + + return node; + } + + private DependencyNode findPlexusUtils( DependencyNode node ) + { + Artifact artifact = node.getDependency().getArtifact(); + + if ( AID.equals( artifact.getArtifactId() ) && GID.equals( artifact.getGroupId() ) + && EXT.equals( artifact.getExtension() ) && "".equals( artifact.getClassifier() ) ) + { + return node; + } + + for ( DependencyNode child : node.getChildren() ) + { + DependencyNode result = findPlexusUtils( child ); + if ( result != null ) + { + return result; + } + } + + return null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java new file mode 100644 index 00000000..41942978 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependenciesResolver.java @@ -0,0 +1,71 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.model.Plugin; +import org.apache.maven.plugin.PluginResolutionException; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Assists in resolving the dependencies of a plugin. <strong>Warning:</strong> This is an internal utility interface + * that is only public for technical reasons, it is not part of the public API. In particular, this interface can be + * changed or deleted without prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginDependenciesResolver +{ + + /** + * Resolves the main artifact of the specified plugin. + * + * @param plugin The plugin for which to resolve the main artifact, must not be {@code null}. + * @param repositories The plugin repositories to use for resolving the plugin's main artifact, must not be {@code + * null}. + * @param session The repository session to use for resolving the plugin's main artifact, must not be {@code null}. + * @return The resolved plugin artifact, never {@code null}. + * @throws PluginResolutionException If the plugin artifact could not be resolved. + */ + Artifact resolve( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) + throws PluginResolutionException; + + /** + * Resolves the runtime dependencies of the specified plugin. + * + * @param plugin The plugin for which to resolve the dependencies, must not be {@code null}. + * @param pluginArtifact The plugin's main artifact, may be {@code null}. + * @param dependencyFilter A filter to exclude artifacts from resolution (but not collection), may be {@code null}. + * @param repositories The plugin repositories to use for resolving the plugin artifacts, must not be {@code null}. + * @param session The repository session to use for resolving the plugin artifacts, must not be {@code null}. + * @return The dependency tree denoting the resolved plugin class path, never {@code null}. + * @throws PluginResolutionException If any dependency could not be resolved. + */ + DependencyNode resolve( Plugin plugin, Artifact pluginArtifact, DependencyFilter dependencyFilter, + List<RemoteRepository> repositories, RepositorySystemSession session ) + throws PluginResolutionException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependencyResolutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependencyResolutionListener.java new file mode 100644 index 00000000..533920a8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/PluginDependencyResolutionListener.java @@ -0,0 +1,158 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.IdentityHashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.resolver.ResolutionListener; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.artifact.versioning.VersionRange; + +/** + * Assists in detecting wagon providers brought into the plugin class path via legacy Maven core artifacts (e.g. + * maven-core:2.0.6) and excluding them. A plugin should be able to explicitly declare dependencies on specific wagons + * for its use. However, the (old) wagons pulled in transitively via legacy Maven core artifacts are usually not + * intended as dependencies and more importantly screw up artifact resolution because they would get preferred over the + * core wagon versions. This is a hack to provide backward-compat with Maven 2 (MNG-4528, MNG-4561). + * + * @since 3.0 + * @author Benjamin Bentmann + */ +class PluginDependencyResolutionListener + implements ResolutionListener +{ + + private ArtifactFilter coreFilter; + + private LinkedList<Artifact> coreArtifacts = new LinkedList<Artifact>(); + + private Artifact wagonProvider; + + private Map<Artifact, Object> bannedArtifacts = new IdentityHashMap<Artifact, Object>(); + + public PluginDependencyResolutionListener( ArtifactFilter coreFilter ) + { + this.coreFilter = coreFilter; + } + + public void removeBannedDependencies( Collection<Artifact> artifacts ) + { + if ( !bannedArtifacts.isEmpty() && artifacts != null ) + { + for ( Iterator<Artifact> it = artifacts.iterator(); it.hasNext(); ) + { + Artifact artifact = it.next(); + if ( bannedArtifacts.containsKey( artifact ) ) + { + it.remove(); + } + } + } + } + + public void startProcessChildren( Artifact artifact ) + { + if ( wagonProvider == null ) + { + if ( isLegacyCoreArtifact( artifact ) ) + { + coreArtifacts.addFirst( artifact ); + } + else if ( !coreArtifacts.isEmpty() && isWagonProvider( artifact ) ) + { + wagonProvider = artifact; + bannedArtifacts.put( artifact, null ); + } + } + } + + private boolean isLegacyCoreArtifact( Artifact artifact ) + { + String version = artifact.getVersion(); + return version != null && version.startsWith( "2." ) && !coreFilter.include( artifact ); + } + + public void endProcessChildren( Artifact artifact ) + { + if ( wagonProvider == artifact ) + { + wagonProvider = null; + } + else if ( coreArtifacts.peek() == artifact ) + { + coreArtifacts.removeFirst(); + } + } + + public void includeArtifact( Artifact artifact ) + { + if ( wagonProvider != null ) + { + bannedArtifacts.put( artifact, null ); + } + } + + private boolean isWagonProvider( Artifact artifact ) + { + if ( "org.apache.maven.wagon".equals( artifact.getGroupId() ) ) + { + return artifact.getArtifactId().startsWith( "wagon-" ); + } + return false; + } + + public void manageArtifact( Artifact artifact, Artifact replacement ) + { + } + + public void omitForCycle( Artifact artifact ) + { + } + + public void omitForNearer( Artifact omitted, Artifact kept ) + { + } + + public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange ) + { + } + + public void selectVersionFromRange( Artifact artifact ) + { + } + + public void testArtifact( Artifact node ) + { + } + + public void updateScope( Artifact artifact, String scope ) + { + } + + public void updateScopeCurrentPom( Artifact artifact, String ignoredScope ) + { + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/ValidatingConfigurationListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/ValidatingConfigurationListener.java new file mode 100644 index 00000000..706694b8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/ValidatingConfigurationListener.java @@ -0,0 +1,97 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.HashMap; +import java.util.Map; + +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.Parameter; +import org.codehaus.plexus.component.configurator.ConfigurationListener; + +/** + * A configuration listener to help validate the plugin configuration. For instance, check for required but missing + * parameters. + * + * @author Benjamin Bentmann + */ +class ValidatingConfigurationListener + implements ConfigurationListener +{ + + private final Object mojo; + + private final ConfigurationListener delegate; + + private final Map<String, Parameter> missingParameters; + + public ValidatingConfigurationListener( Object mojo, MojoDescriptor mojoDescriptor, ConfigurationListener delegate ) + { + this.mojo = mojo; + this.delegate = delegate; + this.missingParameters = new HashMap<String, Parameter>(); + + if ( mojoDescriptor.getParameters() != null ) + { + for ( Parameter param : mojoDescriptor.getParameters() ) + { + if ( param.isRequired() ) + { + missingParameters.put( param.getName(), param ); + } + } + } + } + + public Collection<Parameter> getMissingParameters() + { + return missingParameters.values(); + } + + public void notifyFieldChangeUsingSetter( String fieldName, Object value, Object target ) + { + delegate.notifyFieldChangeUsingSetter( fieldName, value, target ); + + if ( mojo == target ) + { + notify( fieldName, value ); + } + } + + public void notifyFieldChangeUsingReflection( String fieldName, Object value, Object target ) + { + delegate.notifyFieldChangeUsingReflection( fieldName, value, target ); + + if ( mojo == target ) + { + notify( fieldName, value ); + } + } + + private void notify( String fieldName, Object value ) + { + if ( value != null ) + { + missingParameters.remove( fieldName ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/WagonExcluder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/WagonExcluder.java new file mode 100644 index 00000000..43e8cfc4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/internal/WagonExcluder.java @@ -0,0 +1,109 @@ +package org.apache.maven.plugin.internal; + +/* + * 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.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.DependencyCollectionContext; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.graph.Dependency; + +/** + * Assists in detecting wagon providers brought into the plugin class path via legacy Maven core artifacts (e.g. + * maven-core:2.0.6) and excluding them. A plugin should be able to explicitly declare dependencies on specific wagons + * for its use. However, the (old) wagons pulled in transitively via legacy Maven core artifacts are usually not + * intended as dependencies and more importantly screw up artifact resolution because they would get preferred over the + * core wagon versions. This is a hack to provide backward-compat with Maven 2 (MNG-4528, MNG-4561). + * + * @author Benjamin Bentmann + */ +class WagonExcluder + implements DependencySelector +{ + + private final boolean coreArtifact; + + public WagonExcluder() + { + this( false ); + } + + private WagonExcluder( boolean coreArtifact ) + { + this.coreArtifact = coreArtifact; + } + + public boolean selectDependency( Dependency dependency ) + { + return !coreArtifact || !isWagonProvider( dependency.getArtifact() ); + } + + public DependencySelector deriveChildSelector( DependencyCollectionContext context ) + { + if ( coreArtifact || !isLegacyCoreArtifact( context.getDependency().getArtifact() ) ) + { + return this; + } + else + { + return new WagonExcluder( true ); + } + } + + private boolean isLegacyCoreArtifact( Artifact artifact ) + { + String version = artifact.getVersion(); + return version != null && version.startsWith( "2." ) && artifact.getArtifactId().startsWith( "maven-" ) + && artifact.getGroupId().equals( "org.apache.maven" ); + } + + private boolean isWagonProvider( Artifact artifact ) + { + if ( "org.apache.maven.wagon".equals( artifact.getGroupId() ) ) + { + return artifact.getArtifactId().startsWith( "wagon-" ); + } + return false; + } + + @Override + public boolean equals( Object obj ) + { + if ( obj == this ) + { + return true; + } + else if ( obj == null || !getClass().equals( obj.getClass() ) ) + { + return false; + } + + WagonExcluder that = (WagonExcluder) obj; + return coreArtifact == that.coreArtifact; + } + + @Override + public int hashCode() + { + int hash = getClass().hashCode(); + hash = hash * 31 + ( coreArtifact ? 1 : 0 ); + return hash; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/DefaultPluginPrefixRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/DefaultPluginPrefixRequest.java new file mode 100644 index 00000000..7ab86cfd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/DefaultPluginPrefixRequest.java @@ -0,0 +1,156 @@ +package org.apache.maven.plugin.prefix; + +/* + * 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.Collections; +import java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Model; +import org.apache.maven.project.MavenProject; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Collects settings required to resolve a plugin prefix. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public class DefaultPluginPrefixRequest + implements PluginPrefixRequest +{ + + private String prefix; + + private List<String> pluginGroups = Collections.emptyList(); + + private Model pom; + + private List<RemoteRepository> repositories = Collections.emptyList(); + + private RepositorySystemSession session; + + /** + * Creates an empty request. + */ + public DefaultPluginPrefixRequest() + { + } + + /** + * Creates a request for the specified plugin prefix and build session. The provided build session will be used to + * configure repository settings. If the session has a current project, its plugin repositories and model will be + * used as well. + * + * @param prefix The plugin prefix to resolve, must not be {@code null}. + * @param session The build session from which to derive further settings, must not be {@code null}. + */ + public DefaultPluginPrefixRequest( String prefix, MavenSession session ) + { + setPrefix( prefix ); + + setRepositorySession( session.getRepositorySession() ); + + MavenProject project = session.getCurrentProject(); + if ( project != null ) + { + setRepositories( project.getRemotePluginRepositories() ); + setPom( project.getModel() ); + } + + setPluginGroups( session.getPluginGroups() ); + } + + public String getPrefix() + { + return prefix; + } + + public DefaultPluginPrefixRequest setPrefix( String prefix ) + { + this.prefix = prefix; + + return this; + } + + public List<String> getPluginGroups() + { + return pluginGroups; + } + + public DefaultPluginPrefixRequest setPluginGroups( List<String> pluginGroups ) + { + if ( pluginGroups != null ) + { + this.pluginGroups = pluginGroups; + } + else + { + this.pluginGroups = Collections.emptyList(); + } + + return this; + } + + public Model getPom() + { + return pom; + } + + public DefaultPluginPrefixRequest setPom( Model pom ) + { + this.pom = pom; + + return this; + } + + public List<RemoteRepository> getRepositories() + { + return repositories; + } + + public DefaultPluginPrefixRequest setRepositories( List<RemoteRepository> repositories ) + { + if ( repositories != null ) + { + this.repositories = repositories; + } + else + { + this.repositories = Collections.emptyList(); + } + + return this; + } + + public RepositorySystemSession getRepositorySession() + { + return session; + } + + public DefaultPluginPrefixRequest setRepositorySession( RepositorySystemSession session ) + { + this.session = session; + + return this; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException.java new file mode 100644 index 00000000..32870217 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/NoPluginFoundForPrefixException.java @@ -0,0 +1,65 @@ +package org.apache.maven.plugin.prefix; + +/* + * 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.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; + +public class NoPluginFoundForPrefixException + extends Exception +{ + + public NoPluginFoundForPrefixException( String prefix, List<String> pluginGroups, LocalRepository localRepository, + List<RemoteRepository> remoteRepositories ) + { + super( "No plugin found for prefix '" + prefix + "' in the current project and in the plugin groups " + + pluginGroups + " available from the repositories " + format( localRepository, remoteRepositories ) ); + } + + private static String format( LocalRepository localRepository, List<RemoteRepository> remoteRepositories ) + { + String repos = "["; + + if ( localRepository != null ) + { + repos += localRepository.getId() + " (" + localRepository.getBasedir() + ")"; + } + + if ( remoteRepositories != null && !remoteRepositories.isEmpty() ) + { + for ( RemoteRepository repository : remoteRepositories ) + { + repos += ", "; + + if ( repository != null ) + { + repos += repository.getId() + " (" + repository.getUrl() + ")"; + } + } + } + + repos += "]"; + + return repos; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixRequest.java new file mode 100644 index 00000000..23df66ee --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixRequest.java @@ -0,0 +1,115 @@ +package org.apache.maven.plugin.prefix; + +/* + * 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.model.Model; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Collects settings required to resolve a plugin prefix. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginPrefixRequest +{ + + /** + * Gets the prefix of the plugin. + * + * @return The prefix of the plugin. + */ + String getPrefix(); + + /** + * Sets the prefix of the plugin. + * + * @param prefix The prefix of the plugin. + * @return This request, never {@code null}. + */ + PluginPrefixRequest setPrefix( String prefix ); + + /** + * Gets the list of group ids to scan for the plugin prefix. + * + * @return The list of group ids to scan for the plugin prefix, never {@code null}. + */ + List<String> getPluginGroups(); + + /** + * Sets the list of group ids to scan for the plugin prefix. + * + * @param pluginGroups The list of group ids to scan for the plugin prefix, may be {@code null}. + * @return This request, never {@code null}. + */ + PluginPrefixRequest setPluginGroups( List<String> pluginGroups ); + + /** + * Gets the POM whose build plugins are to be scanned for the prefix. + * + * @return The POM whose build plugins are to be scanned for the prefix or {@code null} to only search the plugin + * repositories. + */ + Model getPom(); + + /** + * Sets the POM whose build plugins are to be scanned for the prefix. + * + * @param pom The POM whose build plugins are to be scanned for the prefix, may be {@code null} to only search the + * plugin repositories. + * @return This request, never {@code null}. + */ + PluginPrefixRequest setPom( Model pom ); + + /** + * Gets the remote repositories to use. + * + * @return The remote repositories to use, never {@code null}. + */ + List<RemoteRepository> getRepositories(); + + /** + * Sets the remote repositories to use. <em>Note:</em> When creating a request from a project, be sure to use the + * plugin repositories and not the regular project repositories. + * + * @param repositories The remote repositories to use. + * @return This request, never {@code null}. + */ + PluginPrefixRequest setRepositories( List<RemoteRepository> repositories ); + + /** + * Gets the session to use for repository access. + * + * @return The repository session or {@code null} if not set. + */ + RepositorySystemSession getRepositorySession(); + + /** + * Sets the session to use for repository access. + * + * @param repositorySession The repository session to use. + * @return This request, never {@code null}. + */ + PluginPrefixRequest setRepositorySession( RepositorySystemSession repositorySession ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResolver.java new file mode 100644 index 00000000..943e6833 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResolver.java @@ -0,0 +1,42 @@ +package org.apache.maven.plugin.prefix; + +/* + * 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. + */ + +/** + * Resolves a plugin prefix. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginPrefixResolver +{ + + /** + * Resolves the plugin prefix for the specified request. + * + * @param request The request that holds the details about the plugin and the repositories to consult, must not be + * {@code null}. + * @return The result of the prefix resolution, never {@code null}. + * @throws NoPluginFoundForPrefixException If the plugin prefix could not be resolved. + */ + PluginPrefixResult resolve( PluginPrefixRequest request ) + throws NoPluginFoundForPrefixException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java new file mode 100644 index 00000000..8fe1a71a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/PluginPrefixResult.java @@ -0,0 +1,55 @@ +package org.apache.maven.plugin.prefix; + +/* + * 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.eclipse.aether.repository.ArtifactRepository; + +/** + * Describes the result of a plugin prefix resolution request. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginPrefixResult +{ + + /** + * The resolved group id for the plugin. + * + * @return The resolved group id for the plugin, never {@code null}. + */ + String getGroupId(); + + /** + * The resolved artifact id for the plugin. + * + * @return The resolved artifact id for the plugin, never {@code null}. + */ + String getArtifactId(); + + /** + * The repository from which the plugin prefix was resolved. + * + * @return The repository from which the plugin prefix was resolved or {@code null} if the prefix was resolved from + * the supplied POM. + */ + ArtifactRepository getRepository(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java new file mode 100644 index 00000000..8d2ad0f7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java @@ -0,0 +1,294 @@ +package org.apache.maven.plugin.prefix.internal; + +/* + * 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.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.apache.maven.artifact.repository.metadata.Metadata; +import org.apache.maven.artifact.repository.metadata.io.MetadataReader; +import org.apache.maven.model.Build; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.prefix.PluginPrefixRequest; +import org.apache.maven.plugin.prefix.PluginPrefixResolver; +import org.apache.maven.plugin.prefix.PluginPrefixResult; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RepositoryListener; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.metadata.DefaultMetadata; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.resolution.MetadataRequest; +import org.eclipse.aether.resolution.MetadataResult; + +/** + * Resolves a plugin prefix. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +@Component( role = PluginPrefixResolver.class ) +public class DefaultPluginPrefixResolver + implements PluginPrefixResolver +{ + + private static final String REPOSITORY_CONTEXT = "plugin"; + + @Requirement + private Logger logger; + + @Requirement + private BuildPluginManager pluginManager; + + @Requirement + private RepositorySystem repositorySystem; + + @Requirement + private MetadataReader metadataReader; + + public PluginPrefixResult resolve( PluginPrefixRequest request ) + throws NoPluginFoundForPrefixException + { + logger.debug( "Resolving plugin prefix " + request.getPrefix() + " from " + request.getPluginGroups() ); + + PluginPrefixResult result = resolveFromProject( request ); + + if ( result == null ) + { + result = resolveFromRepository( request ); + + if ( result == null ) + { + throw new NoPluginFoundForPrefixException( request.getPrefix(), request.getPluginGroups(), + request.getRepositorySession().getLocalRepository(), + request.getRepositories() ); + } + else if ( logger.isDebugEnabled() ) + { + logger.debug( "Resolved plugin prefix " + request.getPrefix() + " to " + result.getGroupId() + ":" + + result.getArtifactId() + " from repository " + + ( result.getRepository() != null ? result.getRepository().getId() : "null" ) ); + } + } + else if ( logger.isDebugEnabled() ) + { + logger.debug( "Resolved plugin prefix " + request.getPrefix() + " to " + result.getGroupId() + ":" + + result.getArtifactId() + " from POM " + request.getPom() ); + } + + return result; + } + + private PluginPrefixResult resolveFromProject( PluginPrefixRequest request ) + { + PluginPrefixResult result = null; + + if ( request.getPom() != null && request.getPom().getBuild() != null ) + { + Build build = request.getPom().getBuild(); + + result = resolveFromProject( request, build.getPlugins() ); + + if ( result == null && build.getPluginManagement() != null ) + { + result = resolveFromProject( request, build.getPluginManagement().getPlugins() ); + } + } + + return result; + } + + private PluginPrefixResult resolveFromProject( PluginPrefixRequest request, List<Plugin> plugins ) + { + for ( Plugin plugin : plugins ) + { + try + { + PluginDescriptor pluginDescriptor = + pluginManager.loadPlugin( plugin, request.getRepositories(), request.getRepositorySession() ); + + if ( request.getPrefix().equals( pluginDescriptor.getGoalPrefix() ) ) + { + return new DefaultPluginPrefixResult( plugin ); + } + } + catch ( Exception e ) + { + if ( logger.isDebugEnabled() ) + { + logger.warn( "Failed to retrieve plugin descriptor for " + plugin.getId() + ": " + e.getMessage(), + e ); + } + else + { + logger.warn( "Failed to retrieve plugin descriptor for " + plugin.getId() + ": " + e.getMessage() ); + } + } + } + + return null; + } + + private PluginPrefixResult resolveFromRepository( PluginPrefixRequest request ) + { + RequestTrace trace = RequestTrace.newChild( null, request ); + + List<MetadataRequest> requests = new ArrayList<MetadataRequest>(); + + for ( String pluginGroup : request.getPluginGroups() ) + { + org.eclipse.aether.metadata.Metadata metadata = + new DefaultMetadata( pluginGroup, "maven-metadata.xml", DefaultMetadata.Nature.RELEASE_OR_SNAPSHOT ); + + requests.add( new MetadataRequest( metadata, null, REPOSITORY_CONTEXT ).setTrace( trace ) ); + + for ( RemoteRepository repository : request.getRepositories() ) + { + requests.add( new MetadataRequest( metadata, repository, REPOSITORY_CONTEXT ).setTrace( trace ) ); + } + } + + // initial try, use locally cached metadata + + List<MetadataResult> results = repositorySystem.resolveMetadata( request.getRepositorySession(), requests ); + requests.clear(); + + PluginPrefixResult result = processResults( request, trace, results, requests ); + + if ( result != null ) + { + return result; + } + + // second try, refetch all (possibly outdated) metadata that wasn't updated in the first attempt + + if ( !request.getRepositorySession().isOffline() && !requests.isEmpty() ) + { + DefaultRepositorySystemSession session = + new DefaultRepositorySystemSession( request.getRepositorySession() ); + session.setUpdatePolicy( RepositoryPolicy.UPDATE_POLICY_ALWAYS ); + + results = repositorySystem.resolveMetadata( session, requests ); + + return processResults( request, trace, results, null ); + } + + return null; + } + + private PluginPrefixResult processResults( PluginPrefixRequest request, RequestTrace trace, + List<MetadataResult> results, List<MetadataRequest> requests ) + { + for ( MetadataResult res : results ) + { + org.eclipse.aether.metadata.Metadata metadata = res.getMetadata(); + + if ( metadata != null ) + { + ArtifactRepository repository = res.getRequest().getRepository(); + if ( repository == null ) + { + repository = request.getRepositorySession().getLocalRepository(); + } + + PluginPrefixResult result = + resolveFromRepository( request, trace, metadata.getGroupId(), metadata, repository ); + + if ( result != null ) + { + return result; + } + } + + if ( requests != null && !res.isUpdated() ) + { + requests.add( res.getRequest() ); + } + } + + return null; + } + + private PluginPrefixResult resolveFromRepository( PluginPrefixRequest request, RequestTrace trace, + String pluginGroup, + org.eclipse.aether.metadata.Metadata metadata, + ArtifactRepository repository ) + { + if ( metadata != null && metadata.getFile() != null && metadata.getFile().isFile() ) + { + try + { + Map<String, ?> options = Collections.singletonMap( MetadataReader.IS_STRICT, Boolean.FALSE ); + + Metadata pluginGroupMetadata = metadataReader.read( metadata.getFile(), options ); + + List<org.apache.maven.artifact.repository.metadata.Plugin> plugins = pluginGroupMetadata.getPlugins(); + + if ( plugins != null ) + { + for ( org.apache.maven.artifact.repository.metadata.Plugin plugin : plugins ) + { + if ( request.getPrefix().equals( plugin.getPrefix() ) ) + { + return new DefaultPluginPrefixResult( pluginGroup, plugin.getArtifactId(), repository ); + } + } + } + } + catch ( IOException e ) + { + invalidMetadata( request.getRepositorySession(), trace, metadata, repository, e ); + } + } + + return null; + } + + private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, + org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository, + Exception exception ) + { + RepositoryListener listener = session.getRepositoryListener(); + if ( listener != null ) + { + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID ); + event.setTrace( trace ); + event.setMetadata( metadata ); + event.setException( exception ); + event.setRepository( repository ); + listener.metadataInvalid( event.build() ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResult.java new file mode 100644 index 00000000..6a248bff --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResult.java @@ -0,0 +1,90 @@ +package org.apache.maven.plugin.prefix.internal; + +/* + * 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.model.Plugin; +import org.apache.maven.plugin.prefix.PluginPrefixResult; +import org.eclipse.aether.repository.ArtifactRepository; + +/** + * Describes the result of a plugin prefix resolution request. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +class DefaultPluginPrefixResult + implements PluginPrefixResult +{ + + private String groupId; + + private String artifactId; + + private ArtifactRepository repository; + + public DefaultPluginPrefixResult() + { + // does nothing + } + + public DefaultPluginPrefixResult( Plugin plugin ) + { + groupId = plugin.getGroupId(); + artifactId = plugin.getArtifactId(); + } + + public DefaultPluginPrefixResult( String groupId, String artifactId, ArtifactRepository repository ) + { + this.groupId = groupId; + this.artifactId = artifactId; + this.repository = repository; + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public ArtifactRepository getRepository() + { + return repository; + } + + public void setRepository( ArtifactRepository repository ) + { + this.repository = repository; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionRequest.java new file mode 100644 index 00000000..9907066b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionRequest.java @@ -0,0 +1,165 @@ +package org.apache.maven.plugin.version; + +/* + * 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.Collections; +import java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.apache.maven.project.MavenProject; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Collects settings required to resolve the version for a plugin. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public class DefaultPluginVersionRequest + implements PluginVersionRequest +{ + + private String groupId; + + private String artifactId; + + private Model pom; + + private List<RemoteRepository> repositories = Collections.emptyList(); + + private RepositorySystemSession session; + + /** + * Creates an empty request. + */ + public DefaultPluginVersionRequest() + { + } + + /** + * Creates a request for the specified plugin by copying settings from the specified build session. If the session + * has a current project, its plugin repositories will be used as well. + * + * @param plugin The plugin for which to resolve a version, must not be {@code null}. + * @param session The Maven session to use, must not be {@code null}. + */ + public DefaultPluginVersionRequest( Plugin plugin, MavenSession session ) + { + setGroupId( plugin.getGroupId() ); + setArtifactId( plugin.getArtifactId() ); + + setRepositorySession( session.getRepositorySession() ); + + MavenProject project = session.getCurrentProject(); + if ( project != null ) + { + setRepositories( project.getRemotePluginRepositories() ); + } + } + + /** + * Creates a request for the specified plugin using the given repository session and plugin repositories. + * + * @param plugin The plugin for which to resolve a version, must not be {@code null}. + * @param session The repository session to use, must not be {@code null}. + * @param repositories The plugin repositories to query, may be {@code null}. + */ + public DefaultPluginVersionRequest( Plugin plugin, RepositorySystemSession session, + List<RemoteRepository> repositories ) + { + setGroupId( plugin.getGroupId() ); + setArtifactId( plugin.getArtifactId() ); + + setRepositorySession( session ); + + setRepositories( repositories ); + } + + public String getGroupId() + { + return groupId; + } + + public DefaultPluginVersionRequest setGroupId( String groupId ) + { + this.groupId = groupId; + + return this; + } + + public String getArtifactId() + { + return artifactId; + } + + public DefaultPluginVersionRequest setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + + return this; + } + + public Model getPom() + { + return pom; + } + + public DefaultPluginVersionRequest setPom( Model pom ) + { + this.pom = pom; + + return this; + } + + public List<RemoteRepository> getRepositories() + { + return repositories; + } + + public DefaultPluginVersionRequest setRepositories( List<RemoteRepository> repositories ) + { + if ( repositories != null ) + { + this.repositories = repositories; + } + else + { + this.repositories = Collections.emptyList(); + } + + return this; + } + + public RepositorySystemSession getRepositorySession() + { + return session; + } + + public DefaultPluginVersionRequest setRepositorySession( RepositorySystemSession session ) + { + this.session = session; + + return this; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java new file mode 100644 index 00000000..b5539be0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionNotFoundException.java @@ -0,0 +1,47 @@ +package org.apache.maven.plugin.version; + +/* + * 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 PluginVersionNotFoundException + extends Exception +{ + private final String groupId; + + private final String artifactId; + + public PluginVersionNotFoundException( String groupId, String artifactId ) + { + super( "The plugin \'" + groupId + ":" + artifactId + "\' does not exist or no valid version could be found" ); + + this.groupId = groupId; + this.artifactId = artifactId; + } + + public String getGroupId() + { + return groupId; + } + + public String getArtifactId() + { + return artifactId; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionRequest.java new file mode 100644 index 00000000..b22f9e1d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionRequest.java @@ -0,0 +1,115 @@ +package org.apache.maven.plugin.version; + +/* + * 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.model.Model; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * Collects settings required to resolve the version for a plugin. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginVersionRequest +{ + + /** + * Gets the group id of the plugin. + * + * @return The group id of the plugin. + */ + String getGroupId(); + + /** + * Sets the group id of the plugin. + * + * @param groupId The group id of the plugin. + * @return This request, never {@code null}. + */ + PluginVersionRequest setGroupId( String groupId ); + + /** + * Gets the artifact id of the plugin. + * + * @return The artifact id of the plugin. + */ + String getArtifactId(); + + /** + * Sets the artifact id of the plugin. + * + * @param artifactId The artifact id of the plugin. + * @return This request, never {@code null}. + */ + PluginVersionRequest setArtifactId( String artifactId ); + + /** + * Gets the POM whose build plugins are to be scanned for the version. + * + * @return The POM whose build plugins are to be scanned for the verion or {@code null} to only search the plugin + * repositories. + */ + Model getPom(); + + /** + * Sets the POM whose build plugins are to be scanned for the version. + * + * @param pom The POM whose build plugins are to be scanned for the version, may be {@code null} to only search the + * plugin repositories. + * @return This request, never {@code null}. + */ + PluginVersionRequest setPom( Model pom ); + + /** + * Gets the remote repositories to use. + * + * @return The remote repositories to use, never {@code null}. + */ + List<RemoteRepository> getRepositories(); + + /** + * Sets the remote repositories to use. <em>Note:</em> When creating a request from a project, be sure to use the + * plugin repositories and not the regular project repositories. + * + * @param repositories The remote repositories to use. + * @return This request, never {@code null}. + */ + PluginVersionRequest setRepositories( List<RemoteRepository> repositories ); + + /** + * Gets the session to use for repository access. + * + * @return The repository session or {@code null} if not set. + */ + RepositorySystemSession getRepositorySession(); + + /** + * Sets the session to use for repository access. + * + * @param repositorySession The repository session to use. + * @return This request, never {@code null}. + */ + PluginVersionRequest setRepositorySession( RepositorySystemSession repositorySession ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java new file mode 100644 index 00000000..84ec0967 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolutionException.java @@ -0,0 +1,107 @@ +package org.apache.maven.plugin.version; + +/* + * 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.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.RemoteRepository; + +public class PluginVersionResolutionException + extends Exception +{ + private final String groupId; + + private final String artifactId; + + private final String baseMessage; + + public PluginVersionResolutionException( String groupId, String artifactId, String baseMessage, Throwable cause ) + { + super( "Error resolving version for plugin \'" + groupId + ":" + artifactId + "\': " + baseMessage, cause ); + + this.groupId = groupId; + this.artifactId = artifactId; + this.baseMessage = baseMessage; + } + + public PluginVersionResolutionException( String groupId, String artifactId, String baseMessage ) + { + super( "Error resolving version for plugin \'" + groupId + ":" + artifactId + "\': " + baseMessage ); + + this.groupId = groupId; + this.artifactId = artifactId; + this.baseMessage = baseMessage; + } + + public PluginVersionResolutionException( String groupId, String artifactId, LocalRepository localRepository, + List<RemoteRepository> remoteRepositories, String baseMessage ) + { + super( "Error resolving version for plugin \'" + groupId + ":" + artifactId + "\' from the repositories " + + format( localRepository, remoteRepositories ) + ": " + baseMessage ); + + this.groupId = groupId; + this.artifactId = artifactId; + this.baseMessage = baseMessage; + } + + public String getGroupId() + { + return groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public String getBaseMessage() + { + return baseMessage; + } + + private static String format( LocalRepository localRepository, List<RemoteRepository> remoteRepositories ) + { + String repos = "["; + + if ( localRepository != null ) + { + repos += localRepository.getId() + " (" + localRepository.getBasedir() + ")"; + } + + if ( remoteRepositories != null && !remoteRepositories.isEmpty() ) + { + for ( RemoteRepository repository : remoteRepositories ) + { + repos += ", "; + + if ( repository != null ) + { + repos += repository.getId() + " (" + repository.getUrl() + ")"; + } + } + } + + repos += "]"; + + return repos; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolver.java new file mode 100644 index 00000000..935fdfc5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResolver.java @@ -0,0 +1,42 @@ +package org.apache.maven.plugin.version; + +/* + * 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. + */ + +/** + * Resolves a version for a plugin. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginVersionResolver +{ + + /** + * Resolves the version for the specified request. + * + * @param request The request that holds the details about the plugin and the repositories to consult, must not be + * {@code null}. + * @return The result of the version resolution, never {@code null}. + * @throws PluginVersionResolutionException If the plugin version could not be resolved. + */ + PluginVersionResult resolve( PluginVersionRequest request ) + throws PluginVersionResolutionException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResult.java new file mode 100644 index 00000000..09a69e96 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/PluginVersionResult.java @@ -0,0 +1,47 @@ +package org.apache.maven.plugin.version; + +/* + * 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.eclipse.aether.repository.ArtifactRepository; + +/** + * Describes the result of a plugin version resolution request. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public interface PluginVersionResult +{ + + /** + * The resolved plugin version. + * + * @return The resolved plugin version, never {@code null}. + */ + String getVersion(); + + /** + * The repository from which the plugin version was resolved. + * + * @return The repository from which the plugin version was resolved, never {@code null}. + */ + ArtifactRepository getRepository(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java new file mode 100644 index 00000000..76b6bfd6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java @@ -0,0 +1,408 @@ +package org.apache.maven.plugin.version.internal; + +/* + * 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.util.ArrayList; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeSet; + +import org.apache.maven.artifact.repository.metadata.Metadata; +import org.apache.maven.artifact.repository.metadata.Versioning; +import org.apache.maven.artifact.repository.metadata.io.MetadataReader; +import org.apache.maven.model.Build; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.MavenPluginManager; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.version.PluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolver; +import org.apache.maven.plugin.version.PluginVersionResult; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.RepositoryEvent.EventType; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RepositoryListener; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.metadata.DefaultMetadata; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.MetadataRequest; +import org.eclipse.aether.resolution.MetadataResult; +import org.eclipse.aether.util.version.GenericVersionScheme; +import org.eclipse.aether.version.InvalidVersionSpecificationException; +import org.eclipse.aether.version.Version; +import org.eclipse.aether.version.VersionScheme; + +/** + * Resolves a version for a plugin. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +@Component( role = PluginVersionResolver.class ) +public class DefaultPluginVersionResolver + implements PluginVersionResolver +{ + + private static final String REPOSITORY_CONTEXT = "plugin"; + + @Requirement + private Logger logger; + + @Requirement + private RepositorySystem repositorySystem; + + @Requirement + private MetadataReader metadataReader; + + @Requirement + private MavenPluginManager pluginManager; + + public PluginVersionResult resolve( PluginVersionRequest request ) + throws PluginVersionResolutionException + { + logger.debug( "Resolving plugin version for " + request.getGroupId() + ":" + request.getArtifactId() ); + + PluginVersionResult result = resolveFromProject( request ); + + if ( result == null ) + { + result = resolveFromRepository( request ); + + if ( logger.isDebugEnabled() ) + { + logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId() + + " to " + result.getVersion() + " from repository " + result.getRepository() ); + } + } + else if ( logger.isDebugEnabled() ) + { + logger.debug( "Resolved plugin version for " + request.getGroupId() + ":" + request.getArtifactId() + + " to " + result.getVersion() + " from POM " + request.getPom() ); + } + + return result; + } + + private PluginVersionResult resolveFromRepository( PluginVersionRequest request ) + throws PluginVersionResolutionException + { + RequestTrace trace = RequestTrace.newChild( null, request ); + + DefaultPluginVersionResult result = new DefaultPluginVersionResult(); + + org.eclipse.aether.metadata.Metadata metadata = + new DefaultMetadata( request.getGroupId(), request.getArtifactId(), "maven-metadata.xml", + DefaultMetadata.Nature.RELEASE_OR_SNAPSHOT ); + + List<MetadataRequest> requests = new ArrayList<MetadataRequest>(); + + requests.add( new MetadataRequest( metadata, null, REPOSITORY_CONTEXT ).setTrace( trace ) ); + + for ( RemoteRepository repository : request.getRepositories() ) + { + requests.add( new MetadataRequest( metadata, repository, REPOSITORY_CONTEXT ).setTrace( trace ) ); + } + + List<MetadataResult> results = repositorySystem.resolveMetadata( request.getRepositorySession(), requests ); + + Versions versions = new Versions(); + + for ( MetadataResult res : results ) + { + ArtifactRepository repository = res.getRequest().getRepository(); + if ( repository == null ) + { + repository = request.getRepositorySession().getLocalRepository(); + } + + mergeMetadata( request.getRepositorySession(), trace, versions, res.getMetadata(), repository ); + } + + selectVersion( result, request, versions ); + + return result; + } + + private void selectVersion( DefaultPluginVersionResult result, PluginVersionRequest request, Versions versions ) + throws PluginVersionResolutionException + { + String version = null; + ArtifactRepository repo = null; + + if ( StringUtils.isNotEmpty( versions.releaseVersion ) ) + { + version = versions.releaseVersion; + repo = versions.releaseRepository; + } + else if ( StringUtils.isNotEmpty( versions.latestVersion ) ) + { + version = versions.latestVersion; + repo = versions.latestRepository; + } + if ( version != null && !isCompatible( request, version ) ) + { + versions.versions.remove( version ); + version = null; + } + + if ( version == null ) + { + VersionScheme versionScheme = new GenericVersionScheme(); + + TreeSet<Version> releases = new TreeSet<Version>( Collections.reverseOrder() ); + TreeSet<Version> snapshots = new TreeSet<Version>( Collections.reverseOrder() ); + + for ( String ver : versions.versions.keySet() ) + { + try + { + Version v = versionScheme.parseVersion( ver ); + + if ( ver.endsWith( "-SNAPSHOT" ) ) + { + snapshots.add( v ); + } + else + { + releases.add( v ); + } + } + catch ( InvalidVersionSpecificationException e ) + { + // ignore + } + } + + for ( Version v : releases ) + { + String ver = v.toString(); + if ( isCompatible( request, ver ) ) + { + version = ver; + repo = versions.versions.get( version ); + break; + } + } + + if ( version == null ) + { + for ( Version v : snapshots ) + { + String ver = v.toString(); + if ( isCompatible( request, ver ) ) + { + version = ver; + repo = versions.versions.get( version ); + break; + } + } + } + } + + if ( version != null ) + { + result.setVersion( version ); + result.setRepository( repo ); + } + else + { + throw new PluginVersionResolutionException( request.getGroupId(), request.getArtifactId(), + request.getRepositorySession().getLocalRepository(), + request.getRepositories(), + "Plugin not found in any plugin repository" ); + } + } + + private boolean isCompatible( PluginVersionRequest request, String version ) + { + Plugin plugin = new Plugin(); + plugin.setGroupId( request.getGroupId() ); + plugin.setArtifactId( request.getArtifactId() ); + plugin.setVersion( version ); + + PluginDescriptor pluginDescriptor; + + try + { + pluginDescriptor = + pluginManager.getPluginDescriptor( plugin, request.getRepositories(), request.getRepositorySession() ); + } + catch ( PluginResolutionException e ) + { + logger.debug( "Ignoring unresolvable plugin version " + version, e ); + return false; + } + catch ( Exception e ) + { + // ignore for now and delay failure to higher level processing + return true; + } + + try + { + pluginManager.checkRequiredMavenVersion( pluginDescriptor ); + } + catch ( Exception e ) + { + logger.debug( "Ignoring incompatible plugin version " + version + ": " + e.getMessage() ); + return false; + } + + return true; + } + + private void mergeMetadata( RepositorySystemSession session, RequestTrace trace, Versions versions, + org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository ) + { + if ( metadata != null && metadata.getFile() != null && metadata.getFile().isFile() ) + { + try + { + Map<String, ?> options = Collections.singletonMap( MetadataReader.IS_STRICT, Boolean.FALSE ); + + Metadata repoMetadata = metadataReader.read( metadata.getFile(), options ); + + mergeMetadata( versions, repoMetadata, repository ); + } + catch ( IOException e ) + { + invalidMetadata( session, trace, metadata, repository, e ); + } + } + } + + private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, + org.eclipse.aether.metadata.Metadata metadata, ArtifactRepository repository, + Exception exception ) + { + RepositoryListener listener = session.getRepositoryListener(); + if ( listener != null ) + { + RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID ); + event.setTrace( trace ); + event.setMetadata( metadata ); + event.setException( exception ); + event.setRepository( repository ); + listener.metadataInvalid( event.build() ); + } + } + + private void mergeMetadata( Versions versions, Metadata source, ArtifactRepository repository ) + { + Versioning versioning = source.getVersioning(); + if ( versioning != null ) + { + String timestamp = StringUtils.clean( versioning.getLastUpdated() ); + + if ( StringUtils.isNotEmpty( versioning.getRelease() ) + && timestamp.compareTo( versions.releaseTimestamp ) > 0 ) + { + versions.releaseVersion = versioning.getRelease(); + versions.releaseTimestamp = timestamp; + versions.releaseRepository = repository; + } + + if ( StringUtils.isNotEmpty( versioning.getLatest() ) + && timestamp.compareTo( versions.latestTimestamp ) > 0 ) + { + versions.latestVersion = versioning.getLatest(); + versions.latestTimestamp = timestamp; + versions.latestRepository = repository; + } + + for ( String version : versioning.getVersions() ) + { + if ( !versions.versions.containsKey( version ) ) + { + versions.versions.put( version, repository ); + } + } + } + } + + private PluginVersionResult resolveFromProject( PluginVersionRequest request ) + { + PluginVersionResult result = null; + + if ( request.getPom() != null && request.getPom().getBuild() != null ) + { + Build build = request.getPom().getBuild(); + + result = resolveFromProject( request, build.getPlugins() ); + + if ( result == null && build.getPluginManagement() != null ) + { + result = resolveFromProject( request, build.getPluginManagement().getPlugins() ); + } + } + + return result; + } + + private PluginVersionResult resolveFromProject( PluginVersionRequest request, List<Plugin> plugins ) + { + for ( Plugin plugin : plugins ) + { + if ( request.getGroupId().equals( plugin.getGroupId() ) + && request.getArtifactId().equals( plugin.getArtifactId() ) ) + { + if ( plugin.getVersion() != null ) + { + return new DefaultPluginVersionResult( plugin.getVersion() ); + } + else + { + return null; + } + } + } + return null; + } + + static class Versions + { + + String releaseVersion = ""; + + String releaseTimestamp = ""; + + ArtifactRepository releaseRepository; + + String latestVersion = ""; + + String latestTimestamp = ""; + + ArtifactRepository latestRepository; + + Map<String, ArtifactRepository> versions = new LinkedHashMap<String, ArtifactRepository>(); + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResult.java new file mode 100644 index 00000000..9027a532 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResult.java @@ -0,0 +1,69 @@ +package org.apache.maven.plugin.version.internal; + +/* + * 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.plugin.version.PluginVersionResult; +import org.eclipse.aether.repository.ArtifactRepository; + +/** + * Describes the result of a plugin version resolution request. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +class DefaultPluginVersionResult + implements PluginVersionResult +{ + + private String version; + + private ArtifactRepository repository; + + public DefaultPluginVersionResult() + { + // does nothing + } + + public DefaultPluginVersionResult( String version ) + { + this.version = version; + } + + public String getVersion() + { + return version; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public ArtifactRepository getRepository() + { + return repository; + } + + public void setRepository( ArtifactRepository repository ) + { + this.repository = repository; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionRequest.java new file mode 100644 index 00000000..cf5b0d70 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionRequest.java @@ -0,0 +1,82 @@ +package org.apache.maven.project; + +/* + * 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.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; + +/** + * @author Benjamin Bentmann + */ +public class DefaultDependencyResolutionRequest + implements DependencyResolutionRequest +{ + + private MavenProject project; + + private DependencyFilter filter; + + private RepositorySystemSession session; + + public DefaultDependencyResolutionRequest() + { + // enables default constructor + } + + public DefaultDependencyResolutionRequest( MavenProject project, RepositorySystemSession session ) + { + setMavenProject( project ); + setRepositorySession( session ); + } + + public DependencyFilter getResolutionFilter() + { + return filter; + } + + public MavenProject getMavenProject() + { + return project; + } + + public RepositorySystemSession getRepositorySession() + { + return session; + } + + public DependencyResolutionRequest setResolutionFilter( DependencyFilter filter ) + { + this.filter = filter; + return this; + } + + public DependencyResolutionRequest setMavenProject( MavenProject project ) + { + this.project = project; + return this; + } + + public DependencyResolutionRequest setRepositorySession( RepositorySystemSession repositorySession ) + { + this.session = repositorySession; + return this; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java new file mode 100644 index 00000000..07c6a2f9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultDependencyResolutionResult.java @@ -0,0 +1,111 @@ +package org.apache.maven.project; + +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +/** + * @author Benjamin Bentmann + */ +class DefaultDependencyResolutionResult + implements DependencyResolutionResult +{ + + private DependencyNode root; + + private List<Dependency> dependencies = new ArrayList<Dependency>(); + + private List<Dependency> resolvedDependencies = new ArrayList<Dependency>(); + + private List<Dependency> unresolvedDependencies = new ArrayList<Dependency>(); + + private List<Exception> collectionErrors = new ArrayList<Exception>(); + + private Map<Dependency, List<Exception>> resolutionErrors = new IdentityHashMap<Dependency, List<Exception>>(); + + public DependencyNode getDependencyGraph() + { + return root; + } + + public void setDependencyGraph( DependencyNode root ) + { + this.root = root; + } + + public List<Dependency> getDependencies() + { + return dependencies; + } + + public List<Dependency> getResolvedDependencies() + { + return resolvedDependencies; + } + + public void addResolvedDependency( Dependency dependency ) + { + dependencies.add( dependency ); + resolvedDependencies.add( dependency ); + } + + public List<Dependency> getUnresolvedDependencies() + { + return unresolvedDependencies; + } + + public List<Exception> getCollectionErrors() + { + return collectionErrors; + } + + public void setCollectionErrors( List<Exception> exceptions ) + { + if ( exceptions != null ) + { + this.collectionErrors = exceptions; + } + else + { + this.collectionErrors = new ArrayList<Exception>(); + } + } + + public List<Exception> getResolutionErrors( Dependency dependency ) + { + List<Exception> errors = resolutionErrors.get( dependency ); + return ( errors != null ) ? errors : Collections.<Exception>emptyList(); + } + + public void setResolutionErrors( Dependency dependency, List<Exception> errors ) + { + dependencies.add( dependency ); + unresolvedDependencies.add( dependency ); + resolutionErrors.put( dependency, errors ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java new file mode 100644 index 00000000..2cce9f6a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java @@ -0,0 +1,128 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.model.Resource; +import org.apache.maven.project.artifact.AttachedArtifact; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.AbstractLogEnabled; + +@SuppressWarnings( "deprecation" ) +@Component( role = MavenProjectHelper.class ) +public class DefaultMavenProjectHelper + extends AbstractLogEnabled + implements MavenProjectHelper +{ + @Requirement + private ArtifactHandlerManager artifactHandlerManager; + + public void attachArtifact( MavenProject project, String artifactType, String artifactClassifier, + File artifactFile ) + { + String type = artifactType; + + ArtifactHandler handler = null; + + if ( type != null ) + { + handler = artifactHandlerManager.getArtifactHandler( artifactType ); + } + + if ( handler == null ) + { + handler = artifactHandlerManager.getArtifactHandler( "jar" ); + } + + Artifact artifact = new AttachedArtifact( project.getArtifact(), artifactType, artifactClassifier, handler ); + + artifact.setFile( artifactFile ); + artifact.setResolved( true ); + + attachArtifact( project, artifact ); + } + + public void attachArtifact( MavenProject project, String artifactType, File artifactFile ) + { + ArtifactHandler handler = artifactHandlerManager.getArtifactHandler( artifactType ); + + Artifact artifact = new AttachedArtifact( project.getArtifact(), artifactType, handler ); + + artifact.setFile( artifactFile ); + artifact.setResolved( true ); + + attachArtifact( project, artifact ); + } + + public void attachArtifact( MavenProject project, File artifactFile, String artifactClassifier ) + { + Artifact projectArtifact = project.getArtifact(); + + Artifact artifact = + new AttachedArtifact( projectArtifact, projectArtifact.getType(), artifactClassifier, + projectArtifact.getArtifactHandler() ); + + artifact.setFile( artifactFile ); + artifact.setResolved( true ); + + attachArtifact( project, artifact ); + } + + /** + * Add an attached artifact or replace the file for an existing artifact. + * + * @see MavenProject#addAttachedArtifact(org.apache.maven.artifact.Artifact) + * @param project project reference. + * @param artifact artifact to add or replace. + */ + public void attachArtifact( MavenProject project, Artifact artifact ) + { + project.addAttachedArtifact( artifact ); + } + + public void addResource( MavenProject project, String resourceDirectory, List<String> includes, + List<String> excludes ) + { + Resource resource = new Resource(); + resource.setDirectory( resourceDirectory ); + resource.setIncludes( includes ); + resource.setExcludes( excludes ); + + project.addResource( resource ); + } + + public void addTestResource( MavenProject project, String resourceDirectory, List<String> includes, + List<String> excludes ) + { + Resource resource = new Resource(); + resource.setDirectory( resourceDirectory ); + resource.setIncludes( includes ); + resource.setExcludes( excludes ); + + project.addTestResource( resource ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java new file mode 100644 index 00000000..a5365621 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultModelBuildingListener.java @@ -0,0 +1,155 @@ +package org.apache.maven.project; + +/* + * 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.artifact.repository.ArtifactRepository; +import org.apache.maven.model.Model; +import org.apache.maven.model.building.AbstractModelBuildingListener; +import org.apache.maven.model.building.ModelBuildingEvent; +import org.apache.maven.model.building.ModelProblem.Severity; +import org.apache.maven.model.building.ModelProblem.Version; +import org.apache.maven.model.building.ModelProblemCollectorRequest; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; + +/** + * Processes events from the model builder while building the effective model for a {@link MavenProject} instance. + * + * @author Benjamin Bentmann + */ +public class DefaultModelBuildingListener + extends AbstractModelBuildingListener +{ + + private MavenProject project; + + private ProjectBuildingHelper projectBuildingHelper; + + private ProjectBuildingRequest projectBuildingRequest; + + private List<ArtifactRepository> remoteRepositories; + + private List<ArtifactRepository> pluginRepositories; + + public DefaultModelBuildingListener( MavenProject project, ProjectBuildingHelper projectBuildingHelper, + ProjectBuildingRequest projectBuildingRequest ) + { + if ( project == null ) + { + throw new IllegalArgumentException( "project missing" ); + } + this.project = project; + + if ( projectBuildingHelper == null ) + { + throw new IllegalArgumentException( "project building helper missing" ); + } + this.projectBuildingHelper = projectBuildingHelper; + + if ( projectBuildingRequest == null ) + { + throw new IllegalArgumentException( "project building request missing" ); + } + this.projectBuildingRequest = projectBuildingRequest; + this.remoteRepositories = projectBuildingRequest.getRemoteRepositories(); + this.pluginRepositories = projectBuildingRequest.getPluginArtifactRepositories(); + } + + /** + * Gets the project whose model is being built. + * + * @return The project, never {@code null}. + */ + public MavenProject getProject() + { + return project; + } + + @Override + public void buildExtensionsAssembled( ModelBuildingEvent event ) + { + Model model = event.getModel(); + + try + { + pluginRepositories = + projectBuildingHelper.createArtifactRepositories( model.getPluginRepositories(), pluginRepositories, + projectBuildingRequest ); + } + catch ( Exception e ) + { + event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Invalid plugin repository: " + e.getMessage() ) + .setException( e ) ); + } + project.setPluginArtifactRepositories( pluginRepositories ); + + if ( event.getRequest().isProcessPlugins() ) + { + try + { + ProjectRealmCache.CacheRecord record = + projectBuildingHelper.createProjectRealm( project, model, projectBuildingRequest ); + + project.setClassRealm( record.realm ); + project.setExtensionDependencyFilter( record.extensionArtifactFilter ); + } + catch ( PluginResolutionException e ) + { + event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Unresolveable build extension: " + e.getMessage() ) + .setException( e ) ); + } + catch ( PluginVersionResolutionException e ) + { + event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Unresolveable build extension: " + e.getMessage() ) + .setException( e ) ); + } + catch ( PluginManagerException e ) + { + event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Unresolveable build extension: " + e.getMessage() ) + .setException( e ) ); + } + + projectBuildingHelper.selectProjectRealm( project ); + } + + // build the regular repos after extensions are loaded to allow for custom layouts + try + { + remoteRepositories = + projectBuildingHelper.createArtifactRepositories( model.getRepositories(), remoteRepositories, + projectBuildingRequest ); + } + catch ( Exception e ) + { + event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE ) + .setMessage( "Invalid artifact repository: " + e.getMessage() ) + .setException( e ) ); + } + project.setRemoteArtifactRepositories( remoteRepositories ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java new file mode 100644 index 00000000..99edc802 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -0,0 +1,929 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.LegacyLocalRepositoryManager; +import org.apache.maven.bridge.MavenRepositorySystem; +import org.apache.maven.model.Build; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.DeploymentRepository; +import org.apache.maven.model.Extension; +import org.apache.maven.model.Model; +import org.apache.maven.model.Parent; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.Profile; +import org.apache.maven.model.ReportPlugin; +import org.apache.maven.model.building.DefaultModelBuildingRequest; +import org.apache.maven.model.building.DefaultModelProblem; +import org.apache.maven.model.building.FileModelSource; +import org.apache.maven.model.building.ModelBuilder; +import org.apache.maven.model.building.ModelBuildingException; +import org.apache.maven.model.building.ModelBuildingRequest; +import org.apache.maven.model.building.ModelBuildingResult; +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.model.building.ModelProcessor; +import org.apache.maven.model.building.ModelSource; +import org.apache.maven.model.building.StringModelSource; +import org.apache.maven.model.resolution.ModelResolver; +import org.apache.maven.repository.internal.ArtifactDescriptorUtils; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.Os; +import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.impl.RemoteRepositoryManager; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.repository.WorkspaceRepository; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.resolution.VersionRangeRequest; +import org.eclipse.aether.resolution.VersionRangeResolutionException; +import org.eclipse.aether.resolution.VersionRangeResult; + +/** + */ +@Component( role = ProjectBuilder.class ) +public class DefaultProjectBuilder + implements ProjectBuilder +{ + + @Requirement + private Logger logger; + + @Requirement + private ModelBuilder modelBuilder; + + @Requirement + private ModelProcessor modelProcessor; + + @Requirement + private ProjectBuildingHelper projectBuildingHelper; + + @Requirement + private MavenRepositorySystem repositorySystem; + + @Requirement + private org.eclipse.aether.RepositorySystem repoSystem; + + @Requirement + private RemoteRepositoryManager repositoryManager; + + @Requirement + private ProjectDependenciesResolver dependencyResolver; + + // ---------------------------------------------------------------------- + // MavenProjectBuilder Implementation + // ---------------------------------------------------------------------- + + @Override + public ProjectBuildingResult build( File pomFile, ProjectBuildingRequest request ) + throws ProjectBuildingException + { + return build( pomFile, new FileModelSource( pomFile ), new InternalConfig( request, null ) ); + } + + @Override + public ProjectBuildingResult build( ModelSource modelSource, ProjectBuildingRequest request ) + throws ProjectBuildingException + { + return build( null, modelSource, new InternalConfig( request, null ) ); + } + + private ProjectBuildingResult build( File pomFile, ModelSource modelSource, InternalConfig config ) + throws ProjectBuildingException + { + ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); + + try + { + ProjectBuildingRequest projectBuildingRequest = config.request; + + MavenProject project = projectBuildingRequest.getProject(); + + List<ModelProblem> modelProblems = null; + Throwable error = null; + + if ( project == null ) + { + ModelBuildingRequest request = getModelBuildingRequest( config ); + + project = new MavenProject(); + project.setFile( pomFile ); + + DefaultModelBuildingListener listener = + new DefaultModelBuildingListener( project, projectBuildingHelper, projectBuildingRequest ); + request.setModelBuildingListener( listener ); + + request.setPomFile( pomFile ); + request.setModelSource( modelSource ); + request.setLocationTracking( true ); + + ModelBuildingResult result; + try + { + result = modelBuilder.build( request ); + } + catch ( ModelBuildingException e ) + { + result = e.getResult(); + if ( result == null || result.getEffectiveModel() == null ) + { + throw new ProjectBuildingException( e.getModelId(), e.getMessage(), pomFile, e ); + } + // validation error, continue project building and delay failing to help IDEs + error = e; + } + + modelProblems = result.getProblems(); + + initProject( project, Collections.<String, MavenProject>emptyMap(), result, + new HashMap<File, Boolean>(), projectBuildingRequest ); + } + else if ( projectBuildingRequest.isResolveDependencies() ) + { + projectBuildingHelper.selectProjectRealm( project ); + } + + DependencyResolutionResult resolutionResult = null; + + if ( projectBuildingRequest.isResolveDependencies() ) + { + resolutionResult = resolveDependencies( project, config.session ); + } + + ProjectBuildingResult result = new DefaultProjectBuildingResult( project, modelProblems, resolutionResult ); + + if ( error != null ) + { + ProjectBuildingException e = new ProjectBuildingException( Arrays.asList( result ) ); + e.initCause( error ); + throw e; + } + + return result; + } + finally + { + Thread.currentThread().setContextClassLoader( oldContextClassLoader ); + } + } + + private DependencyResolutionResult resolveDependencies( MavenProject project, RepositorySystemSession session ) + { + DependencyResolutionResult resolutionResult; + + try + { + DefaultDependencyResolutionRequest resolution = new DefaultDependencyResolutionRequest( project, session ); + resolutionResult = dependencyResolver.resolve( resolution ); + } + catch ( DependencyResolutionException e ) + { + resolutionResult = e.getResult(); + } + + Set<Artifact> artifacts = new LinkedHashSet<Artifact>(); + if ( resolutionResult.getDependencyGraph() != null ) + { + RepositoryUtils.toArtifacts( artifacts, resolutionResult.getDependencyGraph().getChildren(), + Collections.singletonList( project.getArtifact().getId() ), null ); + + // Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not + LocalRepositoryManager lrm = session.getLocalRepositoryManager(); + for ( Artifact artifact : artifacts ) + { + if ( !artifact.isResolved() ) + { + String path = lrm.getPathForLocalArtifact( RepositoryUtils.toArtifact( artifact ) ); + artifact.setFile( new File( lrm.getRepository().getBasedir(), path ) ); + } + } + } + project.setResolvedArtifacts( artifacts ); + project.setArtifacts( artifacts ); + + return resolutionResult; + } + + private List<String> getProfileIds( List<Profile> profiles ) + { + List<String> ids = new ArrayList<String>( profiles.size() ); + + for ( Profile profile : profiles ) + { + ids.add( profile.getId() ); + } + + return ids; + } + + private ModelBuildingRequest getModelBuildingRequest( InternalConfig config ) + { + ProjectBuildingRequest configuration = config.request; + + ModelBuildingRequest request = new DefaultModelBuildingRequest(); + + RequestTrace trace = RequestTrace.newChild( null, configuration ).newChild( request ); + + ModelResolver resolver = + new ProjectModelResolver( config.session, trace, repoSystem, repositoryManager, config.repositories, + configuration.getRepositoryMerging(), config.modelPool ); + + request.setValidationLevel( configuration.getValidationLevel() ); + request.setProcessPlugins( configuration.isProcessPlugins() ); + request.setProfiles( configuration.getProfiles() ); + request.setActiveProfileIds( configuration.getActiveProfileIds() ); + request.setInactiveProfileIds( configuration.getInactiveProfileIds() ); + request.setSystemProperties( configuration.getSystemProperties() ); + request.setUserProperties( configuration.getUserProperties() ); + request.setBuildStartTime( configuration.getBuildStartTime() ); + request.setModelResolver( resolver ); + request.setModelCache( new ReactorModelCache() ); + + return request; + } + + @Override + public ProjectBuildingResult build( Artifact artifact, ProjectBuildingRequest request ) + throws ProjectBuildingException + { + return build( artifact, false, request ); + } + + @Override + public ProjectBuildingResult build( Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request ) + throws ProjectBuildingException + { + org.eclipse.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact ); + pomArtifact = ArtifactDescriptorUtils.toPomArtifact( pomArtifact ); + + InternalConfig config = new InternalConfig( request, null ); + + boolean localProject; + + if ( request.isResolveVersionRanges() ) + { + VersionRangeRequest versionRangeRequest = new VersionRangeRequest( pomArtifact, config.repositories, null ); + + try + { + VersionRangeResult versionRangeResult = + repoSystem.resolveVersionRange( config.session, versionRangeRequest ); + + if ( versionRangeResult.getHighestVersion() == null ) + { + throw new ProjectBuildingException( + artifact.getId(), "Error resolving project artifact: No versions matched the requested range", + (Throwable) null ); + + } + + if ( versionRangeResult.getVersionConstraint() != null + && versionRangeResult.getVersionConstraint().getRange() != null + && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) + { + throw new ProjectBuildingException( + artifact.getId(), + "Error resolving project artifact: The requested version range does not specify an upper bound", + (Throwable) null ); + + } + + pomArtifact = pomArtifact.setVersion( versionRangeResult.getHighestVersion().toString() ); + } + catch ( VersionRangeResolutionException e ) + { + throw new ProjectBuildingException( + artifact.getId(), "Error resolving project artifact: " + e.getMessage(), e ); + + } + } + + try + { + ArtifactRequest pomRequest = new ArtifactRequest(); + pomRequest.setArtifact( pomArtifact ); + pomRequest.setRepositories( config.repositories ); + ArtifactResult pomResult = repoSystem.resolveArtifact( config.session, pomRequest ); + + pomArtifact = pomResult.getArtifact(); + localProject = pomResult.getRepository() instanceof WorkspaceRepository; + } + catch ( org.eclipse.aether.resolution.ArtifactResolutionException e ) + { + if ( e.getResults().get( 0 ).isMissing() && allowStubModel ) + { + return build( null, createStubModelSource( artifact ), config ); + } + throw new ProjectBuildingException( artifact.getId(), + "Error resolving project artifact: " + e.getMessage(), e ); + } + + File pomFile = pomArtifact.getFile(); + + if ( "pom".equals( artifact.getType() ) ) + { + artifact.selectVersion( pomArtifact.getVersion() ); + artifact.setFile( pomFile ); + artifact.setResolved( true ); + } + + return build( localProject ? pomFile : null, new FileModelSource( pomFile ), config ); + } + + private ModelSource createStubModelSource( Artifact artifact ) + { + StringBuilder buffer = new StringBuilder( 1024 ); + + buffer.append( "<?xml version='1.0'?>" ); + buffer.append( "<project>" ); + buffer.append( "<modelVersion>4.0.0</modelVersion>" ); + buffer.append( "<groupId>" ).append( artifact.getGroupId() ).append( "</groupId>" ); + buffer.append( "<artifactId>" ).append( artifact.getArtifactId() ).append( "</artifactId>" ); + buffer.append( "<version>" ).append( artifact.getBaseVersion() ).append( "</version>" ); + buffer.append( "<packaging>" ).append( artifact.getType() ).append( "</packaging>" ); + buffer.append( "</project>" ); + + return new StringModelSource( buffer, artifact.getId() ); + } + + @Override + public List<ProjectBuildingResult> build( List<File> pomFiles, boolean recursive, ProjectBuildingRequest request ) + throws ProjectBuildingException + { + List<ProjectBuildingResult> results = new ArrayList<ProjectBuildingResult>(); + + List<InterimResult> interimResults = new ArrayList<InterimResult>(); + + ReactorModelPool modelPool = new ReactorModelPool(); + + InternalConfig config = new InternalConfig( request, modelPool ); + + Map<String, MavenProject> projectIndex = new HashMap<String, MavenProject>( 256 ); + + boolean noErrors = + build( results, interimResults, projectIndex, pomFiles, new LinkedHashSet<File>(), true, recursive, + config ); + + populateReactorModelPool( modelPool, interimResults ); + + ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); + + try + { + noErrors = + build( results, new ArrayList<MavenProject>(), projectIndex, interimResults, request, + new HashMap<File, Boolean>() ) && noErrors; + } + finally + { + Thread.currentThread().setContextClassLoader( oldContextClassLoader ); + } + + if ( !noErrors ) + { + throw new ProjectBuildingException( results ); + } + + return results; + } + + private boolean build( List<ProjectBuildingResult> results, List<InterimResult> interimResults, + Map<String, MavenProject> projectIndex, List<File> pomFiles, Set<File> aggregatorFiles, + boolean isRoot, boolean recursive, InternalConfig config ) + { + boolean noErrors = true; + + for ( File pomFile : pomFiles ) + { + aggregatorFiles.add( pomFile ); + + if ( !build( results, interimResults, projectIndex, pomFile, aggregatorFiles, isRoot, recursive, config ) ) + { + noErrors = false; + } + + aggregatorFiles.remove( pomFile ); + } + + return noErrors; + } + + private boolean build( List<ProjectBuildingResult> results, List<InterimResult> interimResults, + Map<String, MavenProject> projectIndex, File pomFile, Set<File> aggregatorFiles, + boolean isRoot, boolean recursive, InternalConfig config ) + { + boolean noErrors = true; + + ModelBuildingRequest request = getModelBuildingRequest( config ); + + MavenProject project = new MavenProject(); + + request.setPomFile( pomFile ); + request.setTwoPhaseBuilding( true ); + request.setLocationTracking( true ); + + DefaultModelBuildingListener listener = + new DefaultModelBuildingListener( project, projectBuildingHelper, config.request ); + request.setModelBuildingListener( listener ); + + try + { + ModelBuildingResult result = modelBuilder.build( request ); + + Model model = result.getEffectiveModel(); + + projectIndex.put( result.getModelIds().get( 0 ), project ); + + InterimResult interimResult = new InterimResult( pomFile, request, result, listener, isRoot ); + interimResults.add( interimResult ); + + if ( recursive && !model.getModules().isEmpty() ) + { + File basedir = pomFile.getParentFile(); + + List<File> moduleFiles = new ArrayList<File>(); + + for ( String module : model.getModules() ) + { + if ( StringUtils.isEmpty( module ) ) + { + continue; + } + + module = module.replace( '\\', File.separatorChar ).replace( '/', File.separatorChar ); + + File moduleFile = new File( basedir, module ); + + if ( moduleFile.isDirectory() ) + { + moduleFile = modelProcessor.locatePom( moduleFile ); + } + + if ( !moduleFile.isFile() ) + { + ModelProblem problem = + new DefaultModelProblem( "Child module " + moduleFile + " of " + pomFile + + " does not exist", ModelProblem.Severity.ERROR, ModelProblem.Version.BASE, model, -1, + -1, null ); + result.getProblems().add( problem ); + + noErrors = false; + + continue; + } + + if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) + { + // we don't canonicalize on unix to avoid interfering with symlinks + try + { + moduleFile = moduleFile.getCanonicalFile(); + } + catch ( IOException e ) + { + moduleFile = moduleFile.getAbsoluteFile(); + } + } + else + { + moduleFile = new File( moduleFile.toURI().normalize() ); + } + + if ( aggregatorFiles.contains( moduleFile ) ) + { + StringBuilder buffer = new StringBuilder( 256 ); + for ( File aggregatorFile : aggregatorFiles ) + { + buffer.append( aggregatorFile ).append( " -> " ); + } + buffer.append( moduleFile ); + + ModelProblem problem = + new DefaultModelProblem( "Child module " + moduleFile + " of " + pomFile + + " forms aggregation cycle " + buffer, ModelProblem.Severity.ERROR, + ModelProblem.Version.BASE, model, -1, -1, null ); + result.getProblems().add( problem ); + + noErrors = false; + + continue; + } + + moduleFiles.add( moduleFile ); + } + + interimResult.modules = new ArrayList<InterimResult>(); + + if ( !build( results, interimResult.modules, projectIndex, moduleFiles, aggregatorFiles, false, + recursive, config ) ) + { + noErrors = false; + } + } + } + catch ( ModelBuildingException e ) + { + results.add( new DefaultProjectBuildingResult( e.getModelId(), pomFile, e.getProblems() ) ); + + noErrors = false; + } + + return noErrors; + } + + static class InterimResult + { + + File pomFile; + + ModelBuildingRequest request; + + ModelBuildingResult result; + + DefaultModelBuildingListener listener; + + boolean root; + + List<InterimResult> modules = Collections.emptyList(); + + InterimResult( File pomFile, ModelBuildingRequest request, ModelBuildingResult result, + DefaultModelBuildingListener listener, boolean root ) + { + this.pomFile = pomFile; + this.request = request; + this.result = result; + this.listener = listener; + this.root = root; + } + + } + + private void populateReactorModelPool( ReactorModelPool reactorModelPool, List<InterimResult> interimResults ) + { + for ( InterimResult interimResult : interimResults ) + { + Model model = interimResult.result.getEffectiveModel(); + reactorModelPool.put( model.getGroupId(), model.getArtifactId(), model.getVersion(), model.getPomFile() ); + + populateReactorModelPool( reactorModelPool, interimResult.modules ); + } + } + + private boolean build( List<ProjectBuildingResult> results, List<MavenProject> projects, + Map<String, MavenProject> projectIndex, List<InterimResult> interimResults, + ProjectBuildingRequest request, Map<File, Boolean> profilesXmls ) + { + boolean noErrors = true; + + for ( InterimResult interimResult : interimResults ) + { + try + { + ModelBuildingResult result = modelBuilder.build( interimResult.request, interimResult.result ); + + MavenProject project = interimResult.listener.getProject(); + initProject( project, projectIndex, result, profilesXmls, request ); + + List<MavenProject> modules = new ArrayList<MavenProject>(); + noErrors = + build( results, modules, projectIndex, interimResult.modules, request, profilesXmls ) && noErrors; + + projects.addAll( modules ); + projects.add( project ); + + project.setExecutionRoot( interimResult.root ); + project.setCollectedProjects( modules ); + + results.add( new DefaultProjectBuildingResult( project, result.getProblems(), null ) ); + } + catch ( ModelBuildingException e ) + { + results.add( new DefaultProjectBuildingResult( e.getModelId(), interimResult.pomFile, + e.getProblems() ) ); + + noErrors = false; + } + } + + return noErrors; + } + + private void initProject( MavenProject project, Map<String, MavenProject> projects, ModelBuildingResult result, + Map<File, Boolean> profilesXmls, ProjectBuildingRequest projectBuildingRequest ) + { + Model model = result.getEffectiveModel(); + + project.setModel( model ); + project.setOriginalModel( result.getRawModel() ); + project.setFile( model.getPomFile() ); + Parent p = model.getParent(); + if ( p != null ) + { + project.setParentArtifact( repositorySystem.createProjectArtifact( p.getGroupId(), p.getArtifactId(), + p.getVersion() ) ); + // org.apache.maven.its.mng4834:parent:0.1 + String parentModelId = result.getModelIds().get( 1 ); + File parentPomFile = result.getRawModel( parentModelId ).getPomFile(); + MavenProject parent = projects.get( parentModelId ); + if ( parent == null ) + { + // + // At this point the DefaultModelBuildingListener has fired and it populates the + // remote repositories with those found in the pom.xml, along with the existing externally + // defined repositories. + // + projectBuildingRequest.setRemoteRepositories( project.getRemoteArtifactRepositories() ); + if ( parentPomFile != null ) + { + project.setParentFile( parentPomFile ); + try + { + parent = build( parentPomFile, projectBuildingRequest ).getProject(); + } + catch ( ProjectBuildingException e ) + { + // MNG-4488 where let invalid parents slide on by + logger.warn( "Failed to build parent project for " + project.getId() ); + } + } + else + { + Artifact parentArtifact = project.getParentArtifact(); + try + { + parent = build( parentArtifact, projectBuildingRequest ).getProject(); + } + catch ( ProjectBuildingException e ) + { + // MNG-4488 where let invalid parents slide on by + logger.warn( "Failed to build parent project for " + project.getId() ); + } + } + } + project.setParent( parent ); + } + + Artifact projectArtifact = + repositorySystem.createArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(), null, + project.getPackaging() ); + project.setArtifact( projectArtifact ); + + if ( project.getFile() != null ) + { + Build build = project.getBuild(); + project.addScriptSourceRoot( build.getScriptSourceDirectory() ); + project.addCompileSourceRoot( build.getSourceDirectory() ); + project.addTestCompileSourceRoot( build.getTestSourceDirectory() ); + } + + List<Profile> activeProfiles = new ArrayList<Profile>(); + activeProfiles.addAll( result.getActivePomProfiles( result.getModelIds().get( 0 ) ) ); + activeProfiles.addAll( result.getActiveExternalProfiles() ); + project.setActiveProfiles( activeProfiles ); + + project.setInjectedProfileIds( "external", getProfileIds( result.getActiveExternalProfiles() ) ); + for ( String modelId : result.getModelIds() ) + { + project.setInjectedProfileIds( modelId, getProfileIds( result.getActivePomProfiles( modelId ) ) ); + } + + String modelId = findProfilesXml( result, profilesXmls ); + if ( modelId != null ) + { + ModelProblem problem = + new DefaultModelProblem( "Detected profiles.xml alongside " + modelId + + ", this file is no longer supported and was ignored" + ", please use the settings.xml instead", + ModelProblem.Severity.WARNING, ModelProblem.Version.V30, model, -1, -1, null ); + result.getProblems().add( problem ); + } + + // + // All the parts that were taken out of MavenProject for Maven 4.0.0 + // + + project.setProjectBuildingRequest( projectBuildingRequest ); + + // pluginArtifacts + Set<Artifact> pluginArtifacts = new HashSet<Artifact>(); + for ( Plugin plugin : project.getBuildPlugins() ) + { + Artifact artifact = repositorySystem.createPluginArtifact( plugin ); + + if ( artifact != null ) + { + pluginArtifacts.add( artifact ); + } + } + project.setPluginArtifacts( pluginArtifacts ); + + // reportArtifacts + Set<Artifact> reportArtifacts = new HashSet<Artifact>(); + for ( ReportPlugin report : project.getReportPlugins() ) + { + Plugin pp = new Plugin(); + pp.setGroupId( report.getGroupId() ); + pp.setArtifactId( report.getArtifactId() ); + pp.setVersion( report.getVersion() ); + + Artifact artifact = repositorySystem.createPluginArtifact( pp ); + + if ( artifact != null ) + { + reportArtifacts.add( artifact ); + } + } + project.setReportArtifacts( reportArtifacts ); + + // extensionArtifacts + Set<Artifact> extensionArtifacts = new HashSet<Artifact>(); + List<Extension> extensions = project.getBuildExtensions(); + if ( extensions != null ) + { + for ( Extension ext : extensions ) + { + String version; + if ( StringUtils.isEmpty( ext.getVersion() ) ) + { + version = "RELEASE"; + } + else + { + version = ext.getVersion(); + } + + Artifact artifact = + repositorySystem.createArtifact( ext.getGroupId(), ext.getArtifactId(), version, null, "jar" ); + + if ( artifact != null ) + { + extensionArtifacts.add( artifact ); + } + } + } + project.setExtensionArtifacts( extensionArtifacts ); + + // managedVersionMap + Map<String, Artifact> map = null; + if ( repositorySystem != null ) + { + List<Dependency> deps; + DependencyManagement dependencyManagement = project.getDependencyManagement(); + if ( ( dependencyManagement != null ) && ( ( deps = dependencyManagement.getDependencies() ) != null ) + && ( deps.size() > 0 ) ) + { + map = new HashMap<String, Artifact>(); + for ( Dependency d : dependencyManagement.getDependencies() ) + { + Artifact artifact = repositorySystem.createDependencyArtifact( d ); + + if ( artifact != null ) + { + map.put( d.getManagementKey(), artifact ); + } + } + } + else + { + map = Collections.emptyMap(); + } + } + project.setManagedVersionMap( map ); + + // release artifact repository + if ( project.getDistributionManagement() != null + && project.getDistributionManagement().getRepository() != null ) + { + try + { + DeploymentRepository r = project.getDistributionManagement().getRepository(); + if ( !StringUtils.isEmpty( r.getId() ) && !StringUtils.isEmpty( r.getUrl() ) ) + { + ArtifactRepository repo = repositorySystem.buildArtifactRepository( r ); + repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(), + Arrays.asList( repo ) ); + repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(), + Arrays.asList( repo ) ); + project.setReleaseArtifactRepository( repo ); + } + } + catch ( InvalidRepositoryException e ) + { + throw new IllegalStateException( "Failed to create release distribution repository for " + + project.getId(), e ); + } + } + + // snapshot artifact repository + if ( project.getDistributionManagement() != null + && project.getDistributionManagement().getSnapshotRepository() != null ) + { + try + { + DeploymentRepository r = project.getDistributionManagement().getSnapshotRepository(); + if ( !StringUtils.isEmpty( r.getId() ) && !StringUtils.isEmpty( r.getUrl() ) ) + { + ArtifactRepository repo = repositorySystem.buildArtifactRepository( r ); + repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(), + Arrays.asList( repo ) ); + repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(), + Arrays.asList( repo ) ); + project.setSnapshotArtifactRepository( repo ); + } + } + catch ( InvalidRepositoryException e ) + { + throw new IllegalStateException( "Failed to create snapshot distribution repository for " + + project.getId(), e ); + } + } + } + + private String findProfilesXml( ModelBuildingResult result, Map<File, Boolean> profilesXmls ) + { + for ( String modelId : result.getModelIds() ) + { + Model model = result.getRawModel( modelId ); + + File basedir = model.getProjectDirectory(); + if ( basedir == null ) + { + break; + } + + Boolean profilesXml = profilesXmls.get( basedir ); + if ( profilesXml == null ) + { + profilesXml = new File( basedir, "profiles.xml" ).exists(); + profilesXmls.put( basedir, profilesXml ); + } + if ( profilesXml ) + { + return modelId; + } + } + + return null; + } + + class InternalConfig + { + + public final ProjectBuildingRequest request; + + public final RepositorySystemSession session; + + public final List<RemoteRepository> repositories; + + public final ReactorModelPool modelPool; + + InternalConfig( ProjectBuildingRequest request, ReactorModelPool modelPool ) + { + this.request = request; + this.modelPool = modelPool; + session = + LegacyLocalRepositoryManager.overlay( request.getLocalRepository(), request.getRepositorySession(), + repoSystem ); + repositories = RepositoryUtils.toRepos( request.getRemoteRepositories() ); + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java new file mode 100644 index 00000000..aea8fdbe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingHelper.java @@ -0,0 +1,295 @@ +package org.apache.maven.project; + +/* + * 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.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.classrealm.ClassRealmManager; +import org.apache.maven.model.Build; +import org.apache.maven.model.Extension; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.Repository; +import org.apache.maven.plugin.ExtensionRealmCache; +import org.apache.maven.plugin.MavenPluginManager; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.repository.RepositorySystem; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; + +/** + * Assists the project builder. <strong>Warning:</strong> This is an internal utility class that is only public for + * technical reasons, it is not part of the public API. In particular, this class can be changed or deleted without + * prior notice. + * + * @author Benjamin Bentmann + */ +@Component( role = ProjectBuildingHelper.class ) +public class DefaultProjectBuildingHelper + implements ProjectBuildingHelper +{ + + @Requirement + private Logger logger; + + @Requirement + private PlexusContainer container; + + @Requirement + private ClassRealmManager classRealmManager; + + @Requirement + private ProjectRealmCache projectRealmCache; + + @Requirement + private RepositorySystem repositorySystem; + + @Requirement + private MavenPluginManager pluginManager; + + public List<ArtifactRepository> createArtifactRepositories( List<Repository> pomRepositories, + List<ArtifactRepository> externalRepositories, + ProjectBuildingRequest request ) + throws InvalidRepositoryException + { + List<ArtifactRepository> internalRepositories = new ArrayList<ArtifactRepository>(); + + for ( Repository repository : pomRepositories ) + { + internalRepositories.add( repositorySystem.buildArtifactRepository( repository ) ); + } + + repositorySystem.injectMirror( request.getRepositorySession(), internalRepositories ); + + repositorySystem.injectProxy( request.getRepositorySession(), internalRepositories ); + + repositorySystem.injectAuthentication( request.getRepositorySession(), internalRepositories ); + + List<ArtifactRepository> dominantRepositories; + List<ArtifactRepository> recessiveRepositories; + + if ( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT.equals( request.getRepositoryMerging() ) ) + { + dominantRepositories = externalRepositories; + recessiveRepositories = internalRepositories; + } + else + { + dominantRepositories = internalRepositories; + recessiveRepositories = externalRepositories; + } + + List<ArtifactRepository> artifactRepositories = new ArrayList<ArtifactRepository>(); + Collection<String> repoIds = new HashSet<String>(); + + if ( dominantRepositories != null ) + { + for ( ArtifactRepository repository : dominantRepositories ) + { + repoIds.add( repository.getId() ); + artifactRepositories.add( repository ); + } + } + + if ( recessiveRepositories != null ) + { + for ( ArtifactRepository repository : recessiveRepositories ) + { + if ( repoIds.add( repository.getId() ) ) + { + artifactRepositories.add( repository ); + } + } + } + + artifactRepositories = repositorySystem.getEffectiveRepositories( artifactRepositories ); + + return artifactRepositories; + } + + public synchronized ProjectRealmCache.CacheRecord createProjectRealm( MavenProject project, Model model, + ProjectBuildingRequest request ) + throws PluginResolutionException, PluginVersionResolutionException, PluginManagerException + { + ClassRealm projectRealm; + + List<Plugin> extensionPlugins = new ArrayList<Plugin>(); + + Build build = model.getBuild(); + + if ( build != null ) + { + for ( Extension extension : build.getExtensions() ) + { + Plugin plugin = new Plugin(); + plugin.setGroupId( extension.getGroupId() ); + plugin.setArtifactId( extension.getArtifactId() ); + plugin.setVersion( extension.getVersion() ); + extensionPlugins.add( plugin ); + } + + for ( Plugin plugin : build.getPlugins() ) + { + if ( plugin.isExtensions() ) + { + extensionPlugins.add( plugin ); + } + } + } + + if ( extensionPlugins.isEmpty() ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( "Extension realms for project " + model.getId() + ": (none)" ); + } + + return new ProjectRealmCache.CacheRecord( null, null ); + } + + List<ClassRealm> extensionRealms = new ArrayList<ClassRealm>(); + + Map<ClassRealm, List<String>> exportedPackages = new HashMap<ClassRealm, List<String>>(); + + Map<ClassRealm, List<String>> exportedArtifacts = new HashMap<ClassRealm, List<String>>(); + + List<Artifact> publicArtifacts = new ArrayList<Artifact>(); + + for ( Plugin plugin : extensionPlugins ) + { + ExtensionRealmCache.CacheRecord recordRealm = + pluginManager.setupExtensionsRealm( project, plugin, request.getRepositorySession() ); + + final ClassRealm extensionRealm = recordRealm.realm; + final ExtensionDescriptor extensionDescriptor = recordRealm.desciptor; + final List<Artifact> artifacts = recordRealm.artifacts; + + extensionRealms.add( extensionRealm ); + if ( extensionDescriptor != null ) + { + exportedPackages.put( extensionRealm, extensionDescriptor.getExportedPackages() ); + exportedArtifacts.put( extensionRealm, extensionDescriptor.getExportedArtifacts() ); + } + + if ( !plugin.isExtensions() && artifacts.size() == 2 && artifacts.get( 0 ).getFile() != null + && "plexus-utils".equals( artifacts.get( 1 ).getArtifactId() ) ) + { + /* + * This is purely for backward-compat with 2.x where <extensions> consisting of a single artifact where + * loaded into the core and hence available to plugins, in contrast to bigger extensions that were + * loaded into a dedicated realm which is invisible to plugins (MNG-2749). + */ + publicArtifacts.add( artifacts.get( 0 ) ); + } + } + + if ( logger.isDebugEnabled() ) + { + logger.debug( "Extension realms for project " + model.getId() + ": " + extensionRealms ); + } + + ProjectRealmCache.Key projectRealmKey = projectRealmCache.createKey( extensionRealms ); + + ProjectRealmCache.CacheRecord record = projectRealmCache.get( projectRealmKey ); + + if ( record == null ) + { + projectRealm = classRealmManager.createProjectRealm( model, toAetherArtifacts( publicArtifacts ) ); + + Set<String> exclusions = new LinkedHashSet<String>(); + + for ( ClassRealm extensionRealm : extensionRealms ) + { + List<String> excludes = exportedArtifacts.get( extensionRealm ); + + if ( excludes != null ) + { + exclusions.addAll( excludes ); + } + + List<String> exports = exportedPackages.get( extensionRealm ); + + if ( exports == null || exports.isEmpty() ) + { + /* + * Most existing extensions don't define exported packages, i.e. no classes are to be exposed to + * plugins, yet the components provided by the extension (e.g. artifact handlers) must be + * accessible, i.e. we still must import the extension realm into the project realm. + */ + exports = Arrays.asList( extensionRealm.getId() ); + } + + for ( String export : exports ) + { + projectRealm.importFrom( extensionRealm, export ); + } + } + + DependencyFilter extensionArtifactFilter = null; + if ( !exclusions.isEmpty() ) + { + extensionArtifactFilter = new ExclusionsDependencyFilter( exclusions ); + } + + record = projectRealmCache.put( projectRealmKey, projectRealm, extensionArtifactFilter ); + } + + projectRealmCache.register( project, projectRealmKey, record ); + + return record; + } + + public void selectProjectRealm( MavenProject project ) + { + ClassLoader projectRealm = project.getClassRealm(); + + if ( projectRealm == null ) + { + projectRealm = classRealmManager.getCoreRealm(); + } + + Thread.currentThread().setContextClassLoader( projectRealm ); + } + + private List<org.eclipse.aether.artifact.Artifact> toAetherArtifacts( final List<Artifact> pluginArtifacts ) + { + return new ArrayList<org.eclipse.aether.artifact.Artifact>( RepositoryUtils.toArtifacts( pluginArtifacts ) ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java new file mode 100644 index 00000000..185e4ca7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java @@ -0,0 +1,339 @@ +package org.apache.maven.project; + +/* + * 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.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Properties; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.model.Profile; +import org.apache.maven.model.building.ModelBuildingRequest; +import org.eclipse.aether.RepositorySystemSession; + +public class DefaultProjectBuildingRequest + implements ProjectBuildingRequest +{ + + private RepositorySystemSession repositorySession; + + private ArtifactRepository localRepository; + + private List<ArtifactRepository> remoteRepositories; + + private List<ArtifactRepository> pluginArtifactRepositories; + + private MavenProject project; + + private int validationLevel = ModelBuildingRequest.VALIDATION_LEVEL_STRICT; + + private boolean processPlugins; + + private List<Profile> profiles; + + private List<String> activeProfileIds; + + private List<String> inactiveProfileIds; + + private Properties systemProperties; + + private Properties userProperties; + + private Date buildStartTime; + + private boolean resolveDependencies; + + private boolean resolveVersionRanges; + + private RepositoryMerging repositoryMerging = RepositoryMerging.POM_DOMINANT; + + public DefaultProjectBuildingRequest() + { + processPlugins = true; + profiles = new ArrayList<Profile>(); + activeProfileIds = new ArrayList<String>(); + inactiveProfileIds = new ArrayList<String>(); + systemProperties = new Properties(); + userProperties = new Properties(); + remoteRepositories = new ArrayList<ArtifactRepository>(); + pluginArtifactRepositories = new ArrayList<ArtifactRepository>(); + } + + public DefaultProjectBuildingRequest( ProjectBuildingRequest request ) + { + this(); + setProcessPlugins( request.isProcessPlugins() ); + setProfiles( request.getProfiles() ); + setActiveProfileIds( request.getActiveProfileIds() ); + setInactiveProfileIds( request.getInactiveProfileIds() ); + setSystemProperties( request.getSystemProperties() ); + setUserProperties( request.getUserProperties() ); + setRemoteRepositories( request.getRemoteRepositories() ); + setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); + setRepositorySession( request.getRepositorySession() ); + setLocalRepository( request.getLocalRepository() ); + setBuildStartTime( request.getBuildStartTime() ); + setProject( request.getProject() ); + setResolveDependencies( request.isResolveDependencies() ); + setValidationLevel( request.getValidationLevel() ); + } + + public MavenProject getProject() + { + return project; + } + + public void setProject( MavenProject mavenProject ) + { + this.project = mavenProject; + } + + public ProjectBuildingRequest setLocalRepository( ArtifactRepository localRepository ) + { + this.localRepository = localRepository; + return this; + } + + public ArtifactRepository getLocalRepository() + { + return localRepository; + } + + public List<ArtifactRepository> getRemoteRepositories() + { + return remoteRepositories; + } + + public ProjectBuildingRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) + { + if ( remoteRepositories != null ) + { + this.remoteRepositories = new ArrayList<ArtifactRepository>( remoteRepositories ); + } + else + { + this.remoteRepositories.clear(); + } + + return this; + } + + public List<ArtifactRepository> getPluginArtifactRepositories() + { + return pluginArtifactRepositories; + } + + public ProjectBuildingRequest setPluginArtifactRepositories( List<ArtifactRepository> pluginArtifactRepositories ) + { + if ( pluginArtifactRepositories != null ) + { + this.pluginArtifactRepositories = new ArrayList<ArtifactRepository>( pluginArtifactRepositories ); + } + else + { + this.pluginArtifactRepositories.clear(); + } + + return this; + } + + public Properties getSystemProperties() + { + return systemProperties; + } + + public ProjectBuildingRequest setSystemProperties( Properties systemProperties ) + { + if ( systemProperties != null ) + { + this.systemProperties = new Properties(); + synchronized ( systemProperties ) + { // avoid concurrentmodification if someone else sets/removes an unrelated system property + this.systemProperties.putAll( systemProperties ); + } + } + else + { + this.systemProperties.clear(); + } + + return this; + } + + public Properties getUserProperties() + { + return userProperties; + } + + public ProjectBuildingRequest setUserProperties( Properties userProperties ) + { + if ( userProperties != null ) + { + this.userProperties = new Properties(); + this.userProperties.putAll( userProperties ); + } + else + { + this.userProperties.clear(); + } + + return this; + } + + public boolean isProcessPlugins() + { + return processPlugins; + } + + public ProjectBuildingRequest setProcessPlugins( boolean processPlugins ) + { + this.processPlugins = processPlugins; + return this; + } + + public ProjectBuildingRequest setResolveDependencies( boolean resolveDependencies ) + { + this.resolveDependencies = resolveDependencies; + return this; + } + + public boolean isResolveDependencies() + { + return resolveDependencies; + } + + /** @since 3.2.2 */ + public ProjectBuildingRequest setResolveVersionRanges( boolean value ) + { + this.resolveVersionRanges = value; + return this; + } + + /** @since 3.2.2 */ + public boolean isResolveVersionRanges() + { + return this.resolveVersionRanges; + } + + public ProjectBuildingRequest setValidationLevel( int validationLevel ) + { + this.validationLevel = validationLevel; + return this; + } + + public int getValidationLevel() + { + return validationLevel; + } + + public List<String> getActiveProfileIds() + { + return activeProfileIds; + } + + public void setActiveProfileIds( List<String> activeProfileIds ) + { + if ( activeProfileIds != null ) + { + this.activeProfileIds = new ArrayList<String>( activeProfileIds ); + } + else + { + this.activeProfileIds.clear(); + } + } + + public List<String> getInactiveProfileIds() + { + return inactiveProfileIds; + } + + public void setInactiveProfileIds( List<String> inactiveProfileIds ) + { + if ( inactiveProfileIds != null ) + { + this.inactiveProfileIds = new ArrayList<String>( inactiveProfileIds ); + } + else + { + this.inactiveProfileIds.clear(); + } + } + + public void setProfiles( List<Profile> profiles ) + { + if ( profiles != null ) + { + this.profiles = new ArrayList<Profile>( profiles ); + } + else + { + this.profiles.clear(); + } + } + + public void addProfile( Profile profile ) + { + profiles.add( profile ); + } + + public List<Profile> getProfiles() + { + return profiles; + } + + public Date getBuildStartTime() + { + return buildStartTime; + } + + public void setBuildStartTime( Date buildStartTime ) + { + this.buildStartTime = buildStartTime; + } + + public RepositorySystemSession getRepositorySession() + { + return repositorySession; + } + + public DefaultProjectBuildingRequest setRepositorySession( RepositorySystemSession repositorySession ) + { + this.repositorySession = repositorySession; + return this; + } + + public DefaultProjectBuildingRequest setRepositoryMerging( RepositoryMerging repositoryMerging ) + { + if ( repositoryMerging == null ) + { + throw new IllegalArgumentException( "repository merge mode not specified" ); + } + this.repositoryMerging = repositoryMerging; + return this; + } + + public RepositoryMerging getRepositoryMerging() + { + return repositoryMerging; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingResult.java new file mode 100644 index 00000000..b64a395d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingResult.java @@ -0,0 +1,110 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.model.building.ModelProblem; + +/** + * Collects the output of the project builder. + * + * @author Benjamin Bentmann + */ +class DefaultProjectBuildingResult + implements ProjectBuildingResult +{ + + private String projectId; + + private File pomFile; + + private MavenProject project; + + private List<ModelProblem> problems; + + private DependencyResolutionResult dependencyResolutionResult; + + /** + * Creates a new result with the specified contents. + * + * @param project The project that was built, may be {@code null}. + * @param problems The problems that were encouterned, may be {@code null}. + * @param dependencyResolutionResult The result of the resolution for the project dependencies, may be {@code null}. + */ + public DefaultProjectBuildingResult( MavenProject project, List<ModelProblem> problems, + DependencyResolutionResult dependencyResolutionResult ) + { + this.projectId = + ( project != null ) ? project.getGroupId() + ':' + project.getArtifactId() + ':' + project.getVersion() + : ""; + this.pomFile = ( project != null ) ? project.getFile() : null; + this.project = project; + this.problems = problems; + this.dependencyResolutionResult = dependencyResolutionResult; + } + + /** + * Creates a new result with the specified contents. + * + * @param projectId The identifier of the project, may be {@code null}. + * @param pomFile The POM file from which the project was built, may be {@code null}. + * @param problems The problems that were encouterned, may be {@code null}. + */ + public DefaultProjectBuildingResult( String projectId, File pomFile, List<ModelProblem> problems ) + { + this.projectId = ( projectId != null ) ? projectId : ""; + this.pomFile = pomFile; + this.problems = problems; + } + + public String getProjectId() + { + return projectId; + } + + public File getPomFile() + { + return pomFile; + } + + public MavenProject getProject() + { + return project; + } + + public List<ModelProblem> getProblems() + { + if ( problems == null ) + { + problems = new ArrayList<ModelProblem>(); + } + + return problems; + } + + public DependencyResolutionResult getDependencyResolutionResult() + { + return dependencyResolutionResult; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java new file mode 100644 index 00000000..1287eb14 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java @@ -0,0 +1,333 @@ +package org.apache.maven.project; + +/* + * 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.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Exclusion; +import org.apache.maven.model.InputLocation; +import org.apache.maven.model.InputSource; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.artifact.ArtifactType; +import org.eclipse.aether.artifact.ArtifactTypeRegistry; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.collection.DependencyCollectionException; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.graph.DependencyVisitor; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.util.artifact.ArtifactIdUtils; +import org.eclipse.aether.util.artifact.JavaScopes; +import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; + +/** + * @author Benjamin Bentmann + */ +@Component( role = ProjectDependenciesResolver.class ) +public class DefaultProjectDependenciesResolver + implements ProjectDependenciesResolver +{ + + @Requirement + private Logger logger; + + @Requirement + private RepositorySystem repoSystem; + + @Requirement + private List<RepositorySessionDecorator> decorators; + + public DependencyResolutionResult resolve( DependencyResolutionRequest request ) + throws DependencyResolutionException + { + final RequestTrace trace = RequestTrace.newChild( null, request ); + + final DefaultDependencyResolutionResult result = new DefaultDependencyResolutionResult(); + + final MavenProject project = request.getMavenProject(); + final DependencyFilter filter = request.getResolutionFilter(); + RepositorySystemSession session = request.getRepositorySession(); + ArtifactTypeRegistry stereotypes = session.getArtifactTypeRegistry(); + + if ( logger.isDebugEnabled() + && session.getConfigProperties().get( DependencyManagerUtils.CONFIG_PROP_VERBOSE ) == null ) + { + DefaultRepositorySystemSession verbose = new DefaultRepositorySystemSession( session ); + verbose.setConfigProperty( DependencyManagerUtils.CONFIG_PROP_VERBOSE, Boolean.TRUE ); + session = verbose; + } + + for ( RepositorySessionDecorator decorator : decorators ) + { + RepositorySystemSession decorated = decorator.decorate( project, session ); + if ( decorated != null ) + { + session = decorated; + } + } + + CollectRequest collect = new CollectRequest(); + collect.setRootArtifact( RepositoryUtils.toArtifact( project.getArtifact() ) ); + collect.setRequestContext( "project" ); + collect.setRepositories( project.getRemoteProjectRepositories() ); + + if ( project.getDependencyArtifacts() == null ) + { + for ( Dependency dependency : project.getDependencies() ) + { + if ( StringUtils.isEmpty( dependency.getGroupId() ) || StringUtils.isEmpty( dependency.getArtifactId() ) + || StringUtils.isEmpty( dependency.getVersion() ) ) + { + // guard against case where best-effort resolution for invalid models is requested + continue; + } + collect.addDependency( RepositoryUtils.toDependency( dependency, stereotypes ) ); + } + } + else + { + Map<String, Dependency> dependencies = new HashMap<String, Dependency>(); + for ( Dependency dependency : project.getDependencies() ) + { + String classifier = dependency.getClassifier(); + if ( classifier == null ) + { + ArtifactType type = stereotypes.get( dependency.getType() ); + if ( type != null ) + { + classifier = type.getClassifier(); + } + } + String key = + ArtifactIdUtils.toVersionlessId( dependency.getGroupId(), dependency.getArtifactId(), + dependency.getType(), classifier ); + dependencies.put( key, dependency ); + } + for ( Artifact artifact : project.getDependencyArtifacts() ) + { + String key = artifact.getDependencyConflictId(); + Dependency dependency = dependencies.get( key ); + Collection<Exclusion> exclusions = dependency != null ? dependency.getExclusions() : null; + org.eclipse.aether.graph.Dependency dep = RepositoryUtils.toDependency( artifact, exclusions ); + if ( !JavaScopes.SYSTEM.equals( dep.getScope() ) && dep.getArtifact().getFile() != null ) + { + // enable re-resolution + org.eclipse.aether.artifact.Artifact art = dep.getArtifact(); + art = art.setFile( null ).setVersion( art.getBaseVersion() ); + dep = dep.setArtifact( art ); + } + collect.addDependency( dep ); + } + } + + DependencyManagement depMngt = project.getDependencyManagement(); + if ( depMngt != null ) + { + for ( Dependency dependency : depMngt.getDependencies() ) + { + collect.addManagedDependency( RepositoryUtils.toDependency( dependency, stereotypes ) ); + } + } + + DependencyRequest depRequest = new DependencyRequest( collect, filter ); + depRequest.setTrace( trace ); + + DependencyNode node; + try + { + collect.setTrace( RequestTrace.newChild( trace, depRequest ) ); + node = repoSystem.collectDependencies( session, collect ).getRoot(); + result.setDependencyGraph( node ); + } + catch ( DependencyCollectionException e ) + { + result.setDependencyGraph( e.getResult().getRoot() ); + result.setCollectionErrors( e.getResult().getExceptions() ); + + throw new DependencyResolutionException( result, "Could not resolve dependencies for project " + + project.getId() + ": " + e.getMessage(), e ); + } + + depRequest.setRoot( node ); + + if ( logger.isWarnEnabled() ) + { + for ( DependencyNode child : node.getChildren() ) + { + if ( !child.getRelocations().isEmpty() ) + { + logger.warn( "The artifact " + child.getRelocations().get( 0 ) + " has been relocated to " + + child.getDependency().getArtifact() ); + } + } + } + + if ( logger.isDebugEnabled() ) + { + node.accept( new GraphLogger( project ) ); + } + + try + { + process( result, repoSystem.resolveDependencies( session, depRequest ).getArtifactResults() ); + } + catch ( org.eclipse.aether.resolution.DependencyResolutionException e ) + { + process( result, e.getResult().getArtifactResults() ); + + throw new DependencyResolutionException( result, "Could not resolve dependencies for project " + + project.getId() + ": " + e.getMessage(), e ); + } + + return result; + } + + private void process( DefaultDependencyResolutionResult result, Collection<ArtifactResult> results ) + { + for ( ArtifactResult ar : results ) + { + DependencyNode node = ar.getRequest().getDependencyNode(); + if ( ar.isResolved() ) + { + result.addResolvedDependency( node.getDependency() ); + } + else + { + result.setResolutionErrors( node.getDependency(), ar.getExceptions() ); + } + } + } + + class GraphLogger + implements DependencyVisitor + { + + private final MavenProject project; + + private String indent = ""; + + private Map<String, Dependency> managed; + + public GraphLogger( MavenProject project ) + { + this.project = project; + } + + public boolean visitEnter( DependencyNode node ) + { + StringBuilder buffer = new StringBuilder( 128 ); + buffer.append( indent ); + org.eclipse.aether.graph.Dependency dep = node.getDependency(); + if ( dep != null ) + { + org.eclipse.aether.artifact.Artifact art = dep.getArtifact(); + + buffer.append( art ); + buffer.append( ':' ).append( dep.getScope() ); + + String premanagedScope = DependencyManagerUtils.getPremanagedScope( node ); + if ( premanagedScope != null && !premanagedScope.equals( dep.getScope() ) ) + { + buffer.append( " (scope managed from " ).append( premanagedScope ); + appendManagementSource( buffer, art, "scope" ); + buffer.append( ")" ); + } + + String premanagedVersion = DependencyManagerUtils.getPremanagedVersion( node ); + if ( premanagedVersion != null && !premanagedVersion.equals( art.getVersion() ) ) + { + buffer.append( " (version managed from " ).append( premanagedVersion ); + appendManagementSource( buffer, art, "version" ); + buffer.append( ")" ); + } + } + else + { + buffer.append( project.getGroupId() ); + buffer.append( ':' ).append( project.getArtifactId() ); + buffer.append( ':' ).append( project.getPackaging() ); + buffer.append( ':' ).append( project.getVersion() ); + } + + logger.debug( buffer.toString() ); + indent += " "; + return true; + } + + public boolean visitLeave( DependencyNode node ) + { + indent = indent.substring( 0, indent.length() - 3 ); + return true; + } + + private void appendManagementSource( StringBuilder buffer, org.eclipse.aether.artifact.Artifact artifact, + String field ) + { + if ( managed == null ) + { + managed = new HashMap<String, Dependency>(); + if ( project.getDependencyManagement() != null ) + { + for ( Dependency dep : project.getDependencyManagement().getDependencies() ) + { + managed.put( dep.getManagementKey(), dep ); + } + } + } + + String key = + ArtifactIdUtils.toVersionlessId( artifact.getGroupId(), artifact.getArtifactId(), + artifact.getProperty( ArtifactProperties.TYPE, "jar" ), + artifact.getClassifier() ); + + Dependency dependency = managed.get( key ); + if ( dependency != null ) + { + InputLocation location = dependency.getLocation( field ); + if ( location != null ) + { + InputSource source = location.getSource(); + if ( source != null ) + { + buffer.append( " by " ).append( source.getModelId() ); + } + } + } + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java new file mode 100644 index 00000000..53b82bcf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DefaultProjectRealmCache.java @@ -0,0 +1,147 @@ +package org.apache.maven.project; + +/* + * 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.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.classworlds.realm.NoSuchRealmException; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable; +import org.eclipse.aether.graph.DependencyFilter; + +/** + * Default project realm cache implementation. Assumes cached data does not change. + */ +@Component( role = ProjectRealmCache.class ) +public class DefaultProjectRealmCache + implements ProjectRealmCache, Disposable +{ + + protected static class CacheKey + implements Key + { + + private final List<? extends ClassRealm> extensionRealms; + + private final int hashCode; + + public CacheKey( List<? extends ClassRealm> extensionRealms ) + { + this.extensionRealms = ( extensionRealms != null ) ? extensionRealms : Collections.<ClassRealm>emptyList(); + + this.hashCode = this.extensionRealms.hashCode(); + } + + @Override + public int hashCode() + { + return hashCode; + } + + @Override + public boolean equals( Object o ) + { + if ( o == this ) + { + return true; + } + + if ( !( o instanceof CacheKey ) ) + { + return false; + } + + CacheKey other = (CacheKey) o; + + return extensionRealms.equals( other.extensionRealms ); + } + + @Override + public String toString() + { + return extensionRealms.toString(); + } + } + + protected final Map<Key, CacheRecord> cache = new ConcurrentHashMap<Key, CacheRecord>(); + + @Override + public Key createKey( List<? extends ClassRealm> extensionRealms ) + { + return new CacheKey( extensionRealms ); + } + + public CacheRecord get( Key key ) + { + return cache.get( key ); + } + + public CacheRecord put( Key key, ClassRealm projectRealm, DependencyFilter extensionArtifactFilter ) + { + if ( projectRealm == null ) + { + throw new NullPointerException(); + } + + if ( cache.containsKey( key ) ) + { + throw new IllegalStateException( "Duplicate project realm for extensions " + key ); + } + + CacheRecord record = new CacheRecord( projectRealm, extensionArtifactFilter ); + + cache.put( key, record ); + + return record; + } + + public void flush() + { + for ( CacheRecord record : cache.values() ) + { + ClassRealm realm = record.realm; + try + { + realm.getWorld().disposeRealm( realm.getId() ); + } + catch ( NoSuchRealmException e ) + { + // ignore + } + } + cache.clear(); + } + + public void register( MavenProject project, Key key, CacheRecord record ) + { + // default cache does not track record usage + } + + @Override + public void dispose() + { + flush(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionException.java new file mode 100644 index 00000000..50e601e7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionException.java @@ -0,0 +1,42 @@ +package org.apache.maven.project; + +/* + * 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. + */ + +/** + * @author Benjamin Bentmann + */ +public class DependencyResolutionException + extends Exception +{ + + private DependencyResolutionResult result; + + public DependencyResolutionException( DependencyResolutionResult result, String message, Throwable cause ) + { + super( message, cause ); + this.result = result; + } + + public DependencyResolutionResult getResult() + { + return result; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionRequest.java new file mode 100644 index 00000000..c120a137 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionRequest.java @@ -0,0 +1,81 @@ +package org.apache.maven.project; + +/* + * 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.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.graph.DependencyFilter; + +/** + * A request to resolve the dependencies of a project. + * + * @author Benjamin Bentmann + */ +public interface DependencyResolutionRequest +{ + + /** + * Gets the project to resolve dependencies for. + * + * @return The project to resolve dependencies for or {@code null} if not set. + */ + MavenProject getMavenProject(); + + /** + * Sets the project to resolve dependencies for. + * + * @param project The project to resolve dependencies for, may be {@code null}. + * @return This request for chaining, never {@code null}. + */ + DependencyResolutionRequest setMavenProject( MavenProject project ); + + /** + * Gets the filter used to exclude some dependencies from resolution. + * + * @return The filter to exclude dependencies from resolution or {@code null} to resolve all dependencies. + */ + DependencyFilter getResolutionFilter(); + + /** + * Sets the filter used to exclude some dependencies from resolution. Note that this filter only controls the + * resolution/download of dependency artifacts, not the inclusion of dependency nodes in the resolved dependency + * graph. + * + * @param filter The filter to exclude dependencies from resolution, may be {@code null} to resolve all + * dependencies. + * @return This request for chaining, never {@code null}. + */ + DependencyResolutionRequest setResolutionFilter( DependencyFilter filter ); + + /** + * Gets the session to use for repository access. + * + * @return The repository session or {@code null} if not set. + */ + RepositorySystemSession getRepositorySession(); + + /** + * Sets the session to use for repository access. + * + * @param repositorySession The repository session to use. + * @return This request for chaining, never {@code null}. + */ + DependencyResolutionRequest setRepositorySession( RepositorySystemSession repositorySession ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionResult.java new file mode 100644 index 00000000..6ad55fae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DependencyResolutionResult.java @@ -0,0 +1,80 @@ +package org.apache.maven.project; + +/* + * 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.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +/** + * The result of a project dependency resolution. + * + * @author Benjamin Bentmann + */ +public interface DependencyResolutionResult +{ + + /** + * Gets the dependency graph of the project. + * + * @return The dependency graph or {@code null} if not available. + */ + DependencyNode getDependencyGraph(); + + /** + * Gets the transitive dependencies of the project that were not excluded by + * {@link DependencyResolutionRequest#getResolutionFilter()}. This list is a union of the results from + * {@link #getResolvedDependencies()} and {@link #getUnresolvedDependencies()}. + * + * @return The transitive dependencies, never {@code null}. + */ + List<Dependency> getDependencies(); + + /** + * Gets the dependencies that were successfully resolved. + * + * @return The resolved dependencies, never {@code null}. + */ + List<Dependency> getResolvedDependencies(); + + /** + * Gets the dependencies that could not be resolved. + * + * @return The unresolved dependencies, never {@code null}. + */ + List<Dependency> getUnresolvedDependencies(); + + /** + * Gets the errors that occurred while building the dependency graph. + * + * @return The errors that occurred while building the dependency graph, never {@code null}. + */ + List<Exception> getCollectionErrors(); + + /** + * Gets the errors that occurred while resolving the specified dependency. + * + * @param dependency The dependency for which to retrieve the errors, must not be {@code null}. + * @return The resolution errors for the specified dependency, never {@code null}. + */ + List<Exception> getResolutionErrors( Dependency dependency ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DuplicateArtifactAttachmentException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DuplicateArtifactAttachmentException.java new file mode 100644 index 00000000..6121473d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DuplicateArtifactAttachmentException.java @@ -0,0 +1,64 @@ +package org.apache.maven.project; + +/* + * 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.Artifact; + +/** + * This exception is thrown if an application attempts to attach + * two of the same artifacts to a single project. + * + * @author pgier + * @author jdcasey + * @todo Make this a checked exception, and modify the API of MavenProjectHelper. + * Currently, this modification would create compatibility problems for existing plugins. + */ +public class DuplicateArtifactAttachmentException + extends RuntimeException +{ + + private static final String DEFAULT_MESSAGE = "Duplicate artifact attachment detected."; + + private Artifact artifact; + + private final MavenProject project; + + public DuplicateArtifactAttachmentException( MavenProject project, Artifact artifact ) + { + super( constructMessage( project, artifact ) ); + this.project = project; + this.artifact = artifact; + } + + private static String constructMessage( MavenProject project, Artifact artifact ) + { + return DEFAULT_MESSAGE + " (project: " + project.getId() + "; illegal attachment: " + artifact.getId() + ")"; + } + + public MavenProject getProject() + { + return project; + } + + public Artifact getArtifact() + { + return artifact; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DuplicateProjectException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DuplicateProjectException.java new file mode 100644 index 00000000..f73c46b2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/DuplicateProjectException.java @@ -0,0 +1,80 @@ +package org.apache.maven.project; + +/* + * 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.File; + +/** + * Exception that occurs when the project list contains duplicate projects instead of ignoring one. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class DuplicateProjectException + extends Exception +{ + private final String projectId; + + private final File existingProjectFile; + + private final File conflictingProjectFile; + + /** + * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} + */ + public DuplicateProjectException( String message ) + { + this( null, null, null, message ); + } + + /** + * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} + */ + public DuplicateProjectException( String message, Exception e ) + { + super( message, e ); + this.projectId = null; + this.existingProjectFile = null; + this.conflictingProjectFile = null; + } + + public DuplicateProjectException( String projectId, File existingProjectFile, File conflictingProjectFile, + String message ) + { + super( message ); + this.projectId = projectId; + this.existingProjectFile = existingProjectFile; + this.conflictingProjectFile = conflictingProjectFile; + } + + public String getProjectId() + { + return projectId; + } + + public File getExistingProjectFile() + { + return existingProjectFile; + } + + public File getConflictingProjectFile() + { + return conflictingProjectFile; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ExtensionDescriptor.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ExtensionDescriptor.java new file mode 100644 index 00000000..062b8b77 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ExtensionDescriptor.java @@ -0,0 +1,88 @@ +package org.apache.maven.project; + +/* + * 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.ArrayList; +import java.util.List; + +/** + * Provides metadata about a build extension. <strong>Warning:</strong> This is an internal utility class that is only + * public for technical reasons, it is not part of the public API. In particular, this class can be changed or deleted + * without prior notice. + * + * @author Benjamin Bentmann + */ +public class ExtensionDescriptor +{ + + private List<String> exportedPackages; + + private List<String> exportedArtifacts; + + ExtensionDescriptor() + { + // hide constructor + } + + public List<String> getExportedPackages() + { + if ( exportedPackages == null ) + { + exportedPackages = new ArrayList<String>(); + } + + return exportedPackages; + } + + public void setExportedPackages( List<String> exportedPackages ) + { + if ( exportedPackages == null ) + { + this.exportedPackages = null; + } + else + { + this.exportedPackages = new ArrayList<String>( exportedPackages ); + } + } + + public List<String> getExportedArtifacts() + { + if ( exportedArtifacts == null ) + { + exportedArtifacts = new ArrayList<String>(); + } + + return exportedArtifacts; + } + + public void setExportedArtifacts( List<String> exportedArtifacts ) + { + if ( exportedArtifacts == null ) + { + this.exportedArtifacts = null; + } + else + { + this.exportedArtifacts = new ArrayList<String>( exportedArtifacts ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ExtensionDescriptorBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ExtensionDescriptorBuilder.java new file mode 100644 index 00000000..c835eff5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ExtensionDescriptorBuilder.java @@ -0,0 +1,168 @@ +package org.apache.maven.project; + +/* + * 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.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.jar.JarFile; +import java.util.zip.ZipEntry; + +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.codehaus.plexus.util.xml.Xpp3DomBuilder; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * Creates an extension descriptor from some XML stream. + * + * @author Benjamin Bentmann + */ +public class ExtensionDescriptorBuilder +{ + + /** + * @since 3.3.0 + */ + public String getExtensionDescriptorLocation() + { + return "META-INF/maven/extension.xml"; + } + + /** + * Extracts the extension descriptor (if any) from the specified JAR file. + * + * @param extensionJar The JAR file or directory to extract the descriptor from, must not be {@code null}. + * @return The extracted descriptor or {@code null} if no descriptor was found. + * @throws IOException If the descriptor is present but could not be parsed. + */ + public ExtensionDescriptor build( File extensionJar ) + throws IOException + { + ExtensionDescriptor extensionDescriptor = null; + + if ( extensionJar.isFile() ) + { + JarFile pluginJar = new JarFile( extensionJar, false ); + try + { + ZipEntry pluginDescriptorEntry = pluginJar.getEntry( getExtensionDescriptorLocation() ); + + if ( pluginDescriptorEntry != null ) + { + InputStream is = pluginJar.getInputStream( pluginDescriptorEntry ); + + try + { + extensionDescriptor = build( is ); + } + finally + { + IOUtil.close( is ); + } + } + } + finally + { + pluginJar.close(); + } + } + else + { + File pluginXml = new File( extensionJar, getExtensionDescriptorLocation() ); + + if ( pluginXml.canRead() ) + { + InputStream is = new BufferedInputStream( new FileInputStream( pluginXml ) ); + try + { + extensionDescriptor = build( is ); + } + finally + { + IOUtil.close( is ); + } + } + } + + return extensionDescriptor; + } + + /** + * @since 3.3.0 + */ + public ExtensionDescriptor build( InputStream is ) + throws IOException + { + ExtensionDescriptor extensionDescriptor = new ExtensionDescriptor(); + + Xpp3Dom dom; + try + { + dom = Xpp3DomBuilder.build( ReaderFactory.newXmlReader( is ) ); + } + catch ( XmlPullParserException e ) + { + throw (IOException) new IOException( e.getMessage() ).initCause( e ); + } + + if ( !"extension".equals( dom.getName() ) ) + { + throw new IOException( "Unexpected root element \"" + dom.getName() + "\", expected \"extension\"" ); + } + + extensionDescriptor.setExportedPackages( parseStrings( dom.getChild( "exportedPackages" ) ) ); + + extensionDescriptor.setExportedArtifacts( parseStrings( dom.getChild( "exportedArtifacts" ) ) ); + + return extensionDescriptor; + } + + private List<String> parseStrings( Xpp3Dom dom ) + { + List<String> strings = null; + + if ( dom != null ) + { + strings = new ArrayList<String>(); + + for ( Xpp3Dom child : dom.getChildren() ) + { + String string = child.getValue(); + if ( string != null ) + { + string = string.trim(); + if ( string.length() > 0 ) + { + strings.add( string ); + } + } + } + } + + return strings; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/InvalidProjectVersionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/InvalidProjectVersionException.java new file mode 100644 index 00000000..5e42ee46 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/InvalidProjectVersionException.java @@ -0,0 +1,59 @@ +package org.apache.maven.project; + +/* + * 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.File; + +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; + +public class InvalidProjectVersionException + extends ProjectBuildingException +{ + + private final String locationInPom; + + private final String offendingVersion; + + public InvalidProjectVersionException( String projectId, String locationInPom, String offendingVersion, + File pomFile, InvalidVersionSpecificationException cause ) + { + super( projectId, formatMessage( projectId, locationInPom, offendingVersion, cause ), pomFile, cause ); + this.locationInPom = locationInPom; + this.offendingVersion = offendingVersion; + } + + private static String formatMessage( String projectId, String locationInPom, String offendingVersion, + InvalidVersionSpecificationException cause ) + { + return "Invalid version: " + offendingVersion + " found for: " + locationInPom + " in project: " + projectId + + ". Reason: " + cause.getMessage(); + } + + public String getOffendingVersion() + { + return offendingVersion; + } + + public String getLocationInPom() + { + return locationInPom; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/MavenProject.java new file mode 100644 index 00000000..8587a5c3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/MavenProject.java @@ -0,0 +1,1976 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.apache.maven.RepositoryUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.artifact.DependencyResolutionRequiredException; +// remove once createArtifacts() is removed +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.model.Build; +import org.apache.maven.model.CiManagement; +import org.apache.maven.model.Contributor; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Developer; +import org.apache.maven.model.DistributionManagement; +import org.apache.maven.model.Extension; +import org.apache.maven.model.IssueManagement; +import org.apache.maven.model.License; +import org.apache.maven.model.MailingList; +import org.apache.maven.model.Model; +import org.apache.maven.model.Organization; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.model.PluginManagement; +import org.apache.maven.model.Prerequisites; +import org.apache.maven.model.Profile; +import org.apache.maven.model.ReportPlugin; +import org.apache.maven.model.ReportSet; +import org.apache.maven.model.Reporting; +import org.apache.maven.model.Repository; +import org.apache.maven.model.Resource; +import org.apache.maven.model.Scm; +import org.apache.maven.model.io.xpp3.MavenXpp3Writer; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; +import org.apache.maven.project.artifact.MavenMetadataSource; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * The concern of the project is provide runtime values based on the model. + * <p/> + * The values in the model remain untouched but during the process of building a project notions like inheritance and + * interpolation can be added. This allows to have an entity which is useful in a runtime while preserving the model so + * that it can be marshalled and unmarshalled without being tainted by runtime requirements. + * <p/> + * <p> + * With changes during 3.2.2 release MavenProject is closer to being immutable after construction with the removal of + * all components from this class, and the upfront construction taken care of entirely by the @{ProjectBuilder}. There + * is still the issue of having to run the lifecycle in order to find all the compile source roots and resource + * directories but I hope to take care of this during the Maven 4.0 release (jvz). + * </p> + */ +public class MavenProject + implements Cloneable +{ + public static final String EMPTY_PROJECT_GROUP_ID = "unknown"; + + public static final String EMPTY_PROJECT_ARTIFACT_ID = "empty-project"; + + public static final String EMPTY_PROJECT_VERSION = "0"; + + private Model model; + + private MavenProject parent; + + private File file; + + private File basedir; + + private Set<Artifact> resolvedArtifacts; + + private ArtifactFilter artifactFilter; + + private Set<Artifact> artifacts; + + private Artifact parentArtifact; + + private Set<Artifact> pluginArtifacts; + + private List<ArtifactRepository> remoteArtifactRepositories; + + private List<ArtifactRepository> pluginArtifactRepositories; + + private List<RemoteRepository> remoteProjectRepositories; + + private List<RemoteRepository> remotePluginRepositories; + + private List<Artifact> attachedArtifacts; + + private MavenProject executionProject; + + private List<MavenProject> collectedProjects; + + private List<String> compileSourceRoots = new ArrayList<String>(); + + private List<String> testCompileSourceRoots = new ArrayList<String>(); + + private List<String> scriptSourceRoots = new ArrayList<String>(); + + private ArtifactRepository releaseArtifactRepository; + + private ArtifactRepository snapshotArtifactRepository; + + private List<Profile> activeProfiles = new ArrayList<Profile>(); + + private Map<String, List<String>> injectedProfileIds = new LinkedHashMap<String, List<String>>(); + + private Set<Artifact> dependencyArtifacts; + + private Artifact artifact; + + // calculated. + private Map<String, Artifact> artifactMap; + + private Model originalModel; + + private Map<String, Artifact> pluginArtifactMap; + + private Set<Artifact> reportArtifacts; + + private Map<String, Artifact> reportArtifactMap; + + private Set<Artifact> extensionArtifacts; + + private Map<String, Artifact> extensionArtifactMap; + + private Map<String, Artifact> managedVersionMap; + + private Map<String, MavenProject> projectReferences = new HashMap<String, MavenProject>(); + + private boolean executionRoot; + + private File parentFile; + + private Map<String, Object> context; + + private ClassRealm classRealm; + + private DependencyFilter extensionDependencyFilter; + + private final Set<String> lifecyclePhases = Collections.synchronizedSet( new LinkedHashSet<String>() ); + + public MavenProject() + { + Model model = new Model(); + + model.setGroupId( EMPTY_PROJECT_GROUP_ID ); + model.setArtifactId( EMPTY_PROJECT_ARTIFACT_ID ); + model.setVersion( EMPTY_PROJECT_VERSION ); + + setModel( model ); + } + + public MavenProject( Model model ) + { + setModel( model ); + } + + public MavenProject( MavenProject project ) + { + deepCopy( project ); + } + + public File getParentFile() + { + return parentFile; + } + + public void setParentFile( File parentFile ) + { + this.parentFile = parentFile; + } + + // ---------------------------------------------------------------------- + // Accessors + // ---------------------------------------------------------------------- + + public Artifact getArtifact() + { + return artifact; + } + + public void setArtifact( Artifact artifact ) + { + this.artifact = artifact; + } + + // @todo I would like to get rid of this. jvz. + public Model getModel() + { + return model; + } + + /** + * Returns the project corresponding to a declared parent. + * + * @return the parent, or null if no parent is declared or there was an error building it + */ + public MavenProject getParent() + { + return parent; + } + + public void setParent( MavenProject parent ) + { + this.parent = parent; + } + + public boolean hasParent() + { + return getParent() != null; + } + + public File getFile() + { + return file; + } + + public void setFile( File file ) + { + this.file = file; + this.basedir = file != null ? file.getParentFile() : null; + } + + /** + * Sets project {@code file} without changing project {@code basedir}. + * + * @since 3.2.4 + */ + public void setPomFile( File file ) + { + this.file = file; + } + + public File getBasedir() + { + return basedir; + } + + public void setDependencies( List<Dependency> dependencies ) + { + getModel().setDependencies( dependencies ); + } + + public List<Dependency> getDependencies() + { + return getModel().getDependencies(); + } + + public DependencyManagement getDependencyManagement() + { + return getModel().getDependencyManagement(); + } + + // ---------------------------------------------------------------------- + // Test and compile sourceroots. + // ---------------------------------------------------------------------- + + private void addPath( List<String> paths, String path ) + { + if ( path != null ) + { + path = path.trim(); + if ( path.length() > 0 ) + { + File file = new File( path ); + if ( file.isAbsolute() ) + { + path = file.getAbsolutePath(); + } + else + { + path = new File( getBasedir(), path ).getAbsolutePath(); + } + + if ( !paths.contains( path ) ) + { + paths.add( path ); + } + } + } + } + + public void addCompileSourceRoot( String path ) + { + addPath( getCompileSourceRoots(), path ); + } + + public void addTestCompileSourceRoot( String path ) + { + addPath( getTestCompileSourceRoots(), path ); + } + + public List<String> getCompileSourceRoots() + { + return compileSourceRoots; + } + + public List<String> getTestCompileSourceRoots() + { + return testCompileSourceRoots; + } + + public List<String> getCompileClasspathElements() + throws DependencyResolutionRequiredException + { + List<String> list = new ArrayList<String>( getArtifacts().size() + 1 ); + + String d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } + + for ( Artifact a : getArtifacts() ) + { + if ( a.getArtifactHandler().isAddedToClasspath() ) + { + // TODO: let the scope handler deal with this + if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) + || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) + { + addArtifactPath( a, list ); + } + } + } + + return list; + } + + // TODO: this checking for file == null happens because the resolver has been confused about the root + // artifact or not. things like the stupid dummy artifact coming from surefire. + public List<String> getTestClasspathElements() + throws DependencyResolutionRequiredException + { + List<String> list = new ArrayList<String>( getArtifacts().size() + 2 ); + + String d = getBuild().getTestOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } + + d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } + + for ( Artifact a : getArtifacts() ) + { + if ( a.getArtifactHandler().isAddedToClasspath() ) + { + addArtifactPath( a, list ); + } + } + + return list; + } + + public List<String> getRuntimeClasspathElements() + throws DependencyResolutionRequiredException + { + List<String> list = new ArrayList<String>( getArtifacts().size() + 1 ); + + String d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } + + for ( Artifact a : getArtifacts() ) + { + if ( a.getArtifactHandler().isAddedToClasspath() + // TODO: let the scope handler deal with this + && ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) ) + { + addArtifactPath( a, list ); + } + } + return list; + } + + // ---------------------------------------------------------------------- + // Delegate to the model + // ---------------------------------------------------------------------- + + public void setModelVersion( String pomVersion ) + { + getModel().setModelVersion( pomVersion ); + } + + public String getModelVersion() + { + return getModel().getModelVersion(); + } + + public String getId() + { + return getModel().getId(); + } + + public void setGroupId( String groupId ) + { + getModel().setGroupId( groupId ); + } + + public String getGroupId() + { + String groupId = getModel().getGroupId(); + + if ( ( groupId == null ) && ( getModel().getParent() != null ) ) + { + groupId = getModel().getParent().getGroupId(); + } + + return groupId; + } + + public void setArtifactId( String artifactId ) + { + getModel().setArtifactId( artifactId ); + } + + public String getArtifactId() + { + return getModel().getArtifactId(); + } + + public void setName( String name ) + { + getModel().setName( name ); + } + + public String getName() + { + // TODO: this should not be allowed to be null. + if ( getModel().getName() != null ) + { + return getModel().getName(); + } + else + { + return getArtifactId(); + } + } + + public void setVersion( String version ) + { + getModel().setVersion( version ); + } + + public String getVersion() + { + String version = getModel().getVersion(); + + if ( ( version == null ) && ( getModel().getParent() != null ) ) + { + version = getModel().getParent().getVersion(); + } + + return version; + } + + public String getPackaging() + { + return getModel().getPackaging(); + } + + public void setPackaging( String packaging ) + { + getModel().setPackaging( packaging ); + } + + public void setInceptionYear( String inceptionYear ) + { + getModel().setInceptionYear( inceptionYear ); + } + + public String getInceptionYear() + { + return getModel().getInceptionYear(); + } + + public void setUrl( String url ) + { + getModel().setUrl( url ); + } + + public String getUrl() + { + return getModel().getUrl(); + } + + public Prerequisites getPrerequisites() + { + return getModel().getPrerequisites(); + } + + public void setIssueManagement( IssueManagement issueManagement ) + { + getModel().setIssueManagement( issueManagement ); + } + + public CiManagement getCiManagement() + { + return getModel().getCiManagement(); + } + + public void setCiManagement( CiManagement ciManagement ) + { + getModel().setCiManagement( ciManagement ); + } + + public IssueManagement getIssueManagement() + { + return getModel().getIssueManagement(); + } + + public void setDistributionManagement( DistributionManagement distributionManagement ) + { + getModel().setDistributionManagement( distributionManagement ); + } + + public DistributionManagement getDistributionManagement() + { + return getModel().getDistributionManagement(); + } + + public void setDescription( String description ) + { + getModel().setDescription( description ); + } + + public String getDescription() + { + return getModel().getDescription(); + } + + public void setOrganization( Organization organization ) + { + getModel().setOrganization( organization ); + } + + public Organization getOrganization() + { + return getModel().getOrganization(); + } + + public void setScm( Scm scm ) + { + getModel().setScm( scm ); + } + + public Scm getScm() + { + return getModel().getScm(); + } + + public void setMailingLists( List<MailingList> mailingLists ) + { + getModel().setMailingLists( mailingLists ); + } + + public List<MailingList> getMailingLists() + { + return getModel().getMailingLists(); + } + + public void addMailingList( MailingList mailingList ) + { + getModel().addMailingList( mailingList ); + } + + public void setDevelopers( List<Developer> developers ) + { + getModel().setDevelopers( developers ); + } + + public List<Developer> getDevelopers() + { + return getModel().getDevelopers(); + } + + public void addDeveloper( Developer developer ) + { + getModel().addDeveloper( developer ); + } + + public void setContributors( List<Contributor> contributors ) + { + getModel().setContributors( contributors ); + } + + public List<Contributor> getContributors() + { + return getModel().getContributors(); + } + + public void addContributor( Contributor contributor ) + { + getModel().addContributor( contributor ); + } + + public void setBuild( Build build ) + { + getModel().setBuild( build ); + } + + public Build getBuild() + { + return getModelBuild(); + } + + public List<Resource> getResources() + { + return getBuild().getResources(); + } + + public List<Resource> getTestResources() + { + return getBuild().getTestResources(); + } + + public void addResource( Resource resource ) + { + getBuild().addResource( resource ); + } + + public void addTestResource( Resource testResource ) + { + getBuild().addTestResource( testResource ); + } + + public void setLicenses( List<License> licenses ) + { + getModel().setLicenses( licenses ); + } + + public List<License> getLicenses() + { + return getModel().getLicenses(); + } + + public void addLicense( License license ) + { + getModel().addLicense( license ); + } + + public void setArtifacts( Set<Artifact> artifacts ) + { + this.artifacts = artifacts; + + // flush the calculated artifactMap + artifactMap = null; + } + + /** + * All dependencies that this project has, including transitive ones. Contents are lazily populated, so depending on + * what phases have run dependencies in some scopes won't be included. eg. if only compile phase has run, + * dependencies with scope test won't be included. + * + * @return {@link Set} < {@link Artifact} > + * @see #getDependencyArtifacts() to get only direct dependencies + */ + public Set<Artifact> getArtifacts() + { + if ( artifacts == null ) + { + if ( artifactFilter == null || resolvedArtifacts == null ) + { + artifacts = new LinkedHashSet<Artifact>(); + } + else + { + artifacts = new LinkedHashSet<Artifact>( resolvedArtifacts.size() * 2 ); + for ( Artifact artifact : resolvedArtifacts ) + { + if ( artifactFilter.include( artifact ) ) + { + artifacts.add( artifact ); + } + } + } + } + return artifacts; + } + + public Map<String, Artifact> getArtifactMap() + { + if ( artifactMap == null ) + { + artifactMap = ArtifactUtils.artifactMapByVersionlessId( getArtifacts() ); + } + return artifactMap; + } + + public void setPluginArtifacts( Set<Artifact> pluginArtifacts ) + { + this.pluginArtifacts = pluginArtifacts; + + this.pluginArtifactMap = null; + } + + public Set<Artifact> getPluginArtifacts() + { + return pluginArtifacts; + } + + public Map<String, Artifact> getPluginArtifactMap() + { + if ( pluginArtifactMap == null ) + { + pluginArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getPluginArtifacts() ); + } + + return pluginArtifactMap; + } + + public void setParentArtifact( Artifact parentArtifact ) + { + this.parentArtifact = parentArtifact; + } + + public Artifact getParentArtifact() + { + return parentArtifact; + } + + public List<Repository> getRepositories() + { + return getModel().getRepositories(); + } + + // ---------------------------------------------------------------------- + // Plugins + // ---------------------------------------------------------------------- + + public List<Plugin> getBuildPlugins() + { + if ( getModel().getBuild() == null ) + { + return Collections.emptyList(); + } + return getModel().getBuild().getPlugins(); + } + + public List<String> getModules() + { + return getModel().getModules(); + } + + public PluginManagement getPluginManagement() + { + PluginManagement pluginMgmt = null; + + Build build = getModel().getBuild(); + if ( build != null ) + { + pluginMgmt = build.getPluginManagement(); + } + + return pluginMgmt; + } + + private Build getModelBuild() + { + Build build = getModel().getBuild(); + + if ( build == null ) + { + build = new Build(); + + getModel().setBuild( build ); + } + + return build; + } + + public void setRemoteArtifactRepositories( List<ArtifactRepository> remoteArtifactRepositories ) + { + this.remoteArtifactRepositories = remoteArtifactRepositories; + this.remoteProjectRepositories = RepositoryUtils.toRepos( getRemoteArtifactRepositories() ); + } + + public List<ArtifactRepository> getRemoteArtifactRepositories() + { + if ( remoteArtifactRepositories == null ) + { + remoteArtifactRepositories = new ArrayList<ArtifactRepository>(); + } + + return remoteArtifactRepositories; + } + + public void setPluginArtifactRepositories( List<ArtifactRepository> pluginArtifactRepositories ) + { + this.pluginArtifactRepositories = pluginArtifactRepositories; + this.remotePluginRepositories = RepositoryUtils.toRepos( getPluginArtifactRepositories() ); + } + + /** + * @return a list of ArtifactRepository objects constructed from the Repository objects returned by + * getPluginRepositories. + */ + public List<ArtifactRepository> getPluginArtifactRepositories() + { + if ( pluginArtifactRepositories == null ) + { + pluginArtifactRepositories = new ArrayList<ArtifactRepository>(); + } + + return pluginArtifactRepositories; + } + + public ArtifactRepository getDistributionManagementArtifactRepository() + { + return getArtifact().isSnapshot() && ( getSnapshotArtifactRepository() != null ) + ? getSnapshotArtifactRepository() + : getReleaseArtifactRepository(); + } + + public List<Repository> getPluginRepositories() + { + return getModel().getPluginRepositories(); + } + + public List<RemoteRepository> getRemoteProjectRepositories() + { + return remoteProjectRepositories; + } + + public List<RemoteRepository> getRemotePluginRepositories() + { + return remotePluginRepositories; + } + + public void setActiveProfiles( List<Profile> activeProfiles ) + { + this.activeProfiles = activeProfiles; + } + + public List<Profile> getActiveProfiles() + { + return activeProfiles; + } + + public void setInjectedProfileIds( String source, List<String> injectedProfileIds ) + { + if ( injectedProfileIds != null ) + { + this.injectedProfileIds.put( source, new ArrayList<String>( injectedProfileIds ) ); + } + else + { + this.injectedProfileIds.remove( source ); + } + } + + /** + * Gets the identifiers of all profiles that contributed to this project's effective model. This includes active + * profiles from the project's POM and all its parent POMs as well as from external sources like the + * {@code settings.xml}. The profile identifiers are grouped by the identifier of their source, e.g. + * {@code <groupId>:<artifactId>:<version>} for a POM profile or {@code external} for profiles from the + * {@code settings.xml}. + * + * @return The identifiers of all injected profiles, indexed by the source from which the profiles originated, never + * {@code null}. + */ + public Map<String, List<String>> getInjectedProfileIds() + { + return this.injectedProfileIds; + } + + /** + * Add or replace an artifact. This method is now deprecated. Use the @{MavenProjectHelper} to attach artifacts to a + * project. In spite of the 'throws' declaration on this API, this method has never thrown an exception since Maven + * 3.0.x. Historically, it logged and ignored a second addition of the same g/a/v/c/t. Now it replaces the file for + * the artifact, so that plugins (e.g. shade) can change the pathname of the file for a particular set of + * coordinates. + * + * @param artifact the artifact to add or replace. + * @throws DuplicateArtifactAttachmentException + */ + public void addAttachedArtifact( Artifact artifact ) + throws DuplicateArtifactAttachmentException + { + getAttachedArtifacts().add( artifact ); + } + + public List<Artifact> getAttachedArtifacts() + { + if ( attachedArtifacts == null ) + { + attachedArtifacts = new ArrayList<Artifact>(); + } + return attachedArtifacts; + } + + public Xpp3Dom getGoalConfiguration( String pluginGroupId, String pluginArtifactId, String executionId, + String goalId ) + { + Xpp3Dom dom = null; + + if ( getBuildPlugins() != null ) + { + for ( Plugin plugin : getBuildPlugins() ) + { + if ( pluginGroupId.equals( plugin.getGroupId() ) && pluginArtifactId.equals( plugin.getArtifactId() ) ) + { + dom = (Xpp3Dom) plugin.getConfiguration(); + + if ( executionId != null ) + { + PluginExecution execution = plugin.getExecutionsAsMap().get( executionId ); + if ( execution != null ) + { + // NOTE: The PluginConfigurationExpander already merged the plugin-level config in + dom = (Xpp3Dom) execution.getConfiguration(); + } + } + break; + } + } + } + + if ( dom != null ) + { + // make a copy so the original in the POM doesn't get messed with + dom = new Xpp3Dom( dom ); + } + + return dom; + } + + public MavenProject getExecutionProject() + { + return ( executionProject == null ? this : executionProject ); + } + + public void setExecutionProject( MavenProject executionProject ) + { + this.executionProject = executionProject; + } + + public List<MavenProject> getCollectedProjects() + { + return collectedProjects; + } + + public void setCollectedProjects( List<MavenProject> collectedProjects ) + { + this.collectedProjects = collectedProjects; + } + + /** + * Direct dependencies that this project has. + * + * @return {@link Set} < {@link Artifact} > + * @see #getArtifacts() to get all transitive dependencies + */ + public Set<Artifact> getDependencyArtifacts() + { + return dependencyArtifacts; + } + + public void setDependencyArtifacts( Set<Artifact> dependencyArtifacts ) + { + this.dependencyArtifacts = dependencyArtifacts; + } + + public void setReleaseArtifactRepository( ArtifactRepository releaseArtifactRepository ) + { + this.releaseArtifactRepository = releaseArtifactRepository; + } + + public void setSnapshotArtifactRepository( ArtifactRepository snapshotArtifactRepository ) + { + this.snapshotArtifactRepository = snapshotArtifactRepository; + } + + public void setOriginalModel( Model originalModel ) + { + this.originalModel = originalModel; + } + + public Model getOriginalModel() + { + return originalModel; + } + + public void setManagedVersionMap( Map<String, Artifact> map ) + { + managedVersionMap = map; + } + + public Map<String, Artifact> getManagedVersionMap() + { + return managedVersionMap; + } + + @Override + public boolean equals( Object other ) + { + if ( other == this ) + { + return true; + } + else if ( !( other instanceof MavenProject ) ) + { + return false; + } + + MavenProject that = (MavenProject) other; + + return eq( getArtifactId(), that.getArtifactId() ) && eq( getGroupId(), that.getGroupId() ) + && eq( getVersion(), that.getVersion() ); + } + + private static <T> boolean eq( T s1, T s2 ) + { + return ( s1 != null ) ? s1.equals( s2 ) : s2 == null; + } + + @Override + public int hashCode() + { + int hash = 17; + hash = 31 * hash + getGroupId().hashCode(); + hash = 31 * hash + getArtifactId().hashCode(); + hash = 31 * hash + getVersion().hashCode(); + return hash; + } + + public List<Extension> getBuildExtensions() + { + Build build = getBuild(); + if ( ( build == null ) || ( build.getExtensions() == null ) ) + { + return Collections.emptyList(); + } + else + { + return build.getExtensions(); + } + } + + public void addProjectReference( MavenProject project ) + { + projectReferences.put( getProjectReferenceId( project.getGroupId(), project.getArtifactId(), + project.getVersion() ), project ); + } + + public Properties getProperties() + { + return getModel().getProperties(); + } + + public List<String> getFilters() + { + return getBuild().getFilters(); + } + + public Map<String, MavenProject> getProjectReferences() + { + return projectReferences; + } + + public boolean isExecutionRoot() + { + return executionRoot; + } + + public void setExecutionRoot( boolean executionRoot ) + { + this.executionRoot = executionRoot; + } + + public String getDefaultGoal() + { + return getBuild() != null ? getBuild().getDefaultGoal() : null; + } + + public Plugin getPlugin( String pluginKey ) + { + return getBuild().getPluginsAsMap().get( pluginKey ); + } + + /** + * Default toString + */ + @Override + public String toString() + { + StringBuilder sb = new StringBuilder( 128 ); + sb.append( "MavenProject: " ); + sb.append( getGroupId() ); + sb.append( ":" ); + sb.append( getArtifactId() ); + sb.append( ":" ); + sb.append( getVersion() ); + sb.append( " @ " ); + + try + { + sb.append( getFile().getPath() ); + } + catch ( NullPointerException e ) + { + // don't log it. + } + + return sb.toString(); + } + + /** + * @throws CloneNotSupportedException + * @since 2.0.9 + */ + @Override + public MavenProject clone() + { + MavenProject clone; + try + { + clone = (MavenProject) super.clone(); + } + catch ( CloneNotSupportedException e ) + { + throw new UnsupportedOperationException( e ); + } + + clone.deepCopy( this ); + + return clone; + } + + public void setModel( Model model ) + { + this.model = model; + } + + protected void setAttachedArtifacts( List<Artifact> attachedArtifacts ) + { + this.attachedArtifacts = attachedArtifacts; + } + + protected void setCompileSourceRoots( List<String> compileSourceRoots ) + { + this.compileSourceRoots = compileSourceRoots; + } + + protected void setTestCompileSourceRoots( List<String> testCompileSourceRoots ) + { + this.testCompileSourceRoots = testCompileSourceRoots; + } + + protected ArtifactRepository getReleaseArtifactRepository() + { + return releaseArtifactRepository; + } + + protected ArtifactRepository getSnapshotArtifactRepository() + { + return snapshotArtifactRepository; + } + + private void deepCopy( MavenProject project ) + { + // disown the parent + + // copy fields + setFile( project.getFile() ); + + // don't need a deep copy, they don't get modified or added/removed to/from - but make them unmodifiable to be + // sure! + if ( project.getDependencyArtifacts() != null ) + { + setDependencyArtifacts( Collections.unmodifiableSet( project.getDependencyArtifacts() ) ); + } + + if ( project.getArtifacts() != null ) + { + setArtifacts( Collections.unmodifiableSet( project.getArtifacts() ) ); + } + + if ( project.getParentFile() != null ) + { + parentFile = new File( project.getParentFile().getAbsolutePath() ); + } + + if ( project.getPluginArtifacts() != null ) + { + setPluginArtifacts( Collections.unmodifiableSet( project.getPluginArtifacts() ) ); + } + + if ( project.getReportArtifacts() != null ) + { + setReportArtifacts( Collections.unmodifiableSet( project.getReportArtifacts() ) ); + } + + if ( project.getExtensionArtifacts() != null ) + { + setExtensionArtifacts( Collections.unmodifiableSet( project.getExtensionArtifacts() ) ); + } + + setParentArtifact( ( project.getParentArtifact() ) ); + + if ( project.getRemoteArtifactRepositories() != null ) + { + setRemoteArtifactRepositories( Collections.unmodifiableList( project.getRemoteArtifactRepositories() ) ); + } + + if ( project.getPluginArtifactRepositories() != null ) + { + setPluginArtifactRepositories( Collections.unmodifiableList( project.getPluginArtifactRepositories() ) ); + } + + if ( project.getActiveProfiles() != null ) + { + setActiveProfiles( ( Collections.unmodifiableList( project.getActiveProfiles() ) ) ); + } + + if ( project.getAttachedArtifacts() != null ) + { + // clone properties modifyable by plugins in a forked lifecycle + setAttachedArtifacts( new ArrayList<Artifact>( project.getAttachedArtifacts() ) ); + } + + if ( project.getCompileSourceRoots() != null ) + { + // clone source roots + setCompileSourceRoots( ( new ArrayList<String>( project.getCompileSourceRoots() ) ) ); + } + + if ( project.getTestCompileSourceRoots() != null ) + { + setTestCompileSourceRoots( ( new ArrayList<String>( project.getTestCompileSourceRoots() ) ) ); + } + + if ( project.getScriptSourceRoots() != null ) + { + setScriptSourceRoots( ( new ArrayList<String>( project.getScriptSourceRoots() ) ) ); + } + + if ( project.getModel() != null ) + { + setModel( project.getModel().clone() ); + } + + if ( project.getOriginalModel() != null ) + { + setOriginalModel( project.getOriginalModel() ); + } + + setExecutionRoot( project.isExecutionRoot() ); + + if ( project.getArtifact() != null ) + { + setArtifact( ArtifactUtils.copyArtifact( project.getArtifact() ) ); + } + + if ( project.getManagedVersionMap() != null ) + { + setManagedVersionMap( new HashMap<String, Artifact>( project.getManagedVersionMap() ) ); + } + + lifecyclePhases.addAll( project.lifecyclePhases ); + } + + private void addArtifactPath( Artifact artifact, List<String> classpath ) + { + File file = artifact.getFile(); + if ( file != null ) + { + classpath.add( file.getPath() ); + } + } + + private static String getProjectReferenceId( String groupId, String artifactId, String version ) + { + StringBuilder buffer = new StringBuilder( 128 ); + buffer.append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( version ); + return buffer.toString(); + } + + /** + * Sets the value of the context value of this project identified by the given key. If the supplied value is + * <code>null</code>, the context value is removed from this project. Context values are intended to allow core + * extensions to associate derived state with project instances. + */ + public void setContextValue( String key, Object value ) + { + if ( context == null ) + { + context = new HashMap<String, Object>(); + } + if ( value != null ) + { + context.put( key, value ); + } + else + { + context.remove( key ); + } + } + + /** + * Returns context value of this project associated with the given key or null if this project has no such value. + */ + public Object getContextValue( String key ) + { + if ( context == null ) + { + return null; + } + return context.get( key ); + } + + /** + * Sets the project's class realm. <strong>Warning:</strong> This is an internal utility method that is only public + * for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted + * without prior notice and must not be used by plugins. + * + * @param classRealm The class realm hosting the build extensions of this project, may be {@code null}. + */ + public void setClassRealm( ClassRealm classRealm ) + { + this.classRealm = classRealm; + } + + /** + * Gets the project's class realm. This class realm hosts the build extensions of the project. + * <strong>Warning:</strong> This is an internal utility method that is only public for technical reasons, it is not + * part of the public API. In particular, this method can be changed or deleted without prior notice and must not be + * used by plugins. + * + * @return The project's class realm or {@code null}. + */ + public ClassRealm getClassRealm() + { + return classRealm; + } + + /** + * Sets the artifact filter used to exclude shared extension artifacts from plugin realms. <strong>Warning:</strong> + * This is an internal utility method that is only public for technical reasons, it is not part of the public API. + * In particular, this method can be changed or deleted without prior notice and must not be used by plugins. + * + * @param extensionDependencyFilter The dependency filter to apply to plugins, may be {@code null}. + */ + public void setExtensionDependencyFilter( DependencyFilter extensionDependencyFilter ) + { + this.extensionDependencyFilter = extensionDependencyFilter; + } + + /** + * Gets the dependency filter used to exclude shared extension artifacts from plugin realms. + * <strong>Warning:</strong> This is an internal utility method that is only public for technical reasons, it is not + * part of the public API. In particular, this method can be changed or deleted without prior notice and must not be + * used by plugins. + * + * @return The dependency filter or {@code null}. + */ + public DependencyFilter getExtensionDependencyFilter() + { + return extensionDependencyFilter; + } + + /** + * Sets the transitive dependency artifacts that have been resolved/collected for this project. + * <strong>Warning:</strong> This is an internal utility method that is only public for technical reasons, it is not + * part of the public API. In particular, this method can be changed or deleted without prior notice and must not be + * used by plugins. + * + * @param artifacts The set of artifacts, may be {@code null}. + */ + public void setResolvedArtifacts( Set<Artifact> artifacts ) + { + this.resolvedArtifacts = ( artifacts != null ) ? artifacts : Collections.<Artifact>emptySet(); + this.artifacts = null; + this.artifactMap = null; + } + + /** + * Sets the scope filter to select the artifacts being exposed to the currently executed mojo. + * <strong>Warning:</strong> This is an internal utility method that is only public for technical reasons, it is not + * part of the public API. In particular, this method can be changed or deleted without prior notice and must not be + * used by plugins. + * + * @param artifactFilter The artifact filter, may be {@code null} to exclude all artifacts. + */ + public void setArtifactFilter( ArtifactFilter artifactFilter ) + { + this.artifactFilter = artifactFilter; + this.artifacts = null; + this.artifactMap = null; + } + + /** + * <strong>Warning:</strong> This is an internal utility method that is only public for technical reasons, it is not + * part of the public API. In particular, this method can be changed or deleted without prior notice and must not be + * used by plugins. + * + * @param phase The phase to check for, must not be {@code null}. + * @return {@code true} if the phase has been seen. + */ + public boolean hasLifecyclePhase( String phase ) + { + return lifecyclePhases.contains( phase ); + } + + /** + * <strong>Warning:</strong> This is an internal utility method that is only public for technical reasons, it is not + * part of the public API. In particular, this method can be changed or deleted without prior notice and must not be + * used by plugins. + * + * @param lifecyclePhase The lifecycle phase to add, must not be {@code null}. + */ + public void addLifecyclePhase( String lifecyclePhase ) + { + lifecyclePhases.add( lifecyclePhase ); + } + + // ---------------------------------------------------------------------------------------------------------------- + // + // + // D E P R E C A T E D + // + // + // ---------------------------------------------------------------------------------------------------------------- + // + // Everything below will be removed for Maven 4.0.0 + // + // ---------------------------------------------------------------------------------------------------------------- + + private ProjectBuildingRequest projectBuilderConfiguration; + + private Map<String, String> moduleAdjustments; + + @Deprecated // This appears only to be used in test code + public String getModulePathAdjustment( MavenProject moduleProject ) + throws IOException + { + // FIXME: This is hacky. What if module directory doesn't match artifactid, and parent + // is coming from the repository?? + String module = moduleProject.getArtifactId(); + + File moduleFile = moduleProject.getFile(); + + if ( moduleFile != null ) + { + File moduleDir = moduleFile.getCanonicalFile().getParentFile(); + + module = moduleDir.getName(); + } + + if ( moduleAdjustments == null ) + { + moduleAdjustments = new HashMap<String, String>(); + + List<String> modules = getModules(); + if ( modules != null ) + { + for ( String modulePath : modules ) + { + String moduleName = modulePath; + + if ( moduleName.endsWith( "/" ) || moduleName.endsWith( "\\" ) ) + { + moduleName = moduleName.substring( 0, moduleName.length() - 1 ); + } + + int lastSlash = moduleName.lastIndexOf( '/' ); + + if ( lastSlash < 0 ) + { + lastSlash = moduleName.lastIndexOf( '\\' ); + } + + String adjustment = null; + + if ( lastSlash > -1 ) + { + moduleName = moduleName.substring( lastSlash + 1 ); + adjustment = modulePath.substring( 0, lastSlash ); + } + + moduleAdjustments.put( moduleName, adjustment ); + } + } + } + + return moduleAdjustments.get( module ); + } + + @Deprecated + public Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, String inheritedScope, + ArtifactFilter filter ) + throws InvalidDependencyVersionException + { + return MavenMetadataSource.createArtifacts( artifactFactory, getDependencies(), inheritedScope, filter, this ); + } + + @Deprecated + protected void setScriptSourceRoots( List<String> scriptSourceRoots ) + { + this.scriptSourceRoots = scriptSourceRoots; + } + + @Deprecated + public void addScriptSourceRoot( String path ) + { + if ( path != null ) + { + path = path.trim(); + if ( path.length() != 0 ) + { + if ( !getScriptSourceRoots().contains( path ) ) + { + getScriptSourceRoots().add( path ); + } + } + } + } + + @Deprecated + public List<String> getScriptSourceRoots() + { + return scriptSourceRoots; + } + + @Deprecated + public List<Artifact> getCompileArtifacts() + { + List<Artifact> list = new ArrayList<Artifact>( getArtifacts().size() ); + + for ( Artifact a : getArtifacts() ) + { + // TODO: classpath check doesn't belong here - that's the other method + if ( a.getArtifactHandler().isAddedToClasspath() ) + { + // TODO: let the scope handler deal with this + if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) + || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) + { + list.add( a ); + } + } + } + return list; + } + + @Deprecated + public List<Dependency> getCompileDependencies() + { + Set<Artifact> artifacts = getArtifacts(); + + if ( ( artifacts == null ) || artifacts.isEmpty() ) + { + return Collections.emptyList(); + } + + List<Dependency> list = new ArrayList<Dependency>( artifacts.size() ); + + for ( Artifact a : getArtifacts() ) + { + // TODO: let the scope handler deal with this + if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) + || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) + { + Dependency dependency = new Dependency(); + + dependency.setArtifactId( a.getArtifactId() ); + dependency.setGroupId( a.getGroupId() ); + dependency.setVersion( a.getVersion() ); + dependency.setScope( a.getScope() ); + dependency.setType( a.getType() ); + dependency.setClassifier( a.getClassifier() ); + + list.add( dependency ); + } + } + return list; + } + + @Deprecated + public List<Artifact> getTestArtifacts() + { + List<Artifact> list = new ArrayList<Artifact>( getArtifacts().size() ); + + for ( Artifact a : getArtifacts() ) + { + // TODO: classpath check doesn't belong here - that's the other method + if ( a.getArtifactHandler().isAddedToClasspath() ) + { + list.add( a ); + } + } + return list; + } + + @Deprecated + public List<Dependency> getTestDependencies() + { + Set<Artifact> artifacts = getArtifacts(); + + if ( ( artifacts == null ) || artifacts.isEmpty() ) + { + return Collections.emptyList(); + } + + List<Dependency> list = new ArrayList<Dependency>( artifacts.size() ); + + for ( Artifact a : getArtifacts() ) + { + Dependency dependency = new Dependency(); + + dependency.setArtifactId( a.getArtifactId() ); + dependency.setGroupId( a.getGroupId() ); + dependency.setVersion( a.getVersion() ); + dependency.setScope( a.getScope() ); + dependency.setType( a.getType() ); + dependency.setClassifier( a.getClassifier() ); + + list.add( dependency ); + } + return list; + } + + @Deprecated // used by the Maven ITs + public List<Dependency> getRuntimeDependencies() + { + Set<Artifact> artifacts = getArtifacts(); + + if ( ( artifacts == null ) || artifacts.isEmpty() ) + { + return Collections.emptyList(); + } + + List<Dependency> list = new ArrayList<Dependency>( artifacts.size() ); + + for ( Artifact a : getArtifacts() ) + { + // TODO: let the scope handler deal with this + if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) + { + Dependency dependency = new Dependency(); + + dependency.setArtifactId( a.getArtifactId() ); + dependency.setGroupId( a.getGroupId() ); + dependency.setVersion( a.getVersion() ); + dependency.setScope( a.getScope() ); + dependency.setType( a.getType() ); + dependency.setClassifier( a.getClassifier() ); + + list.add( dependency ); + } + } + return list; + } + + @Deprecated + public List<Artifact> getRuntimeArtifacts() + { + List<Artifact> list = new ArrayList<Artifact>( getArtifacts().size() ); + + for ( Artifact a : getArtifacts() ) + { + // TODO: classpath check doesn't belong here - that's the other method + if ( a.getArtifactHandler().isAddedToClasspath() + // TODO: let the scope handler deal with this + && ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) ) + { + list.add( a ); + } + } + return list; + } + + @Deprecated + public List<String> getSystemClasspathElements() + throws DependencyResolutionRequiredException + { + List<String> list = new ArrayList<String>( getArtifacts().size() ); + + String d = getBuild().getOutputDirectory(); + if ( d != null ) + { + list.add( d ); + } + + for ( Artifact a : getArtifacts() ) + { + if ( a.getArtifactHandler().isAddedToClasspath() ) + { + // TODO: let the scope handler deal with this + if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) + { + addArtifactPath( a, list ); + } + } + } + return list; + } + + @Deprecated + public List<Artifact> getSystemArtifacts() + { + List<Artifact> list = new ArrayList<Artifact>( getArtifacts().size() ); + + for ( Artifact a : getArtifacts() ) + { + // TODO: classpath check doesn't belong here - that's the other method + if ( a.getArtifactHandler().isAddedToClasspath() ) + { + // TODO: let the scope handler deal with this + if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) + { + list.add( a ); + } + } + } + return list; + } + + @Deprecated + public List<Dependency> getSystemDependencies() + { + Set<Artifact> artifacts = getArtifacts(); + + if ( ( artifacts == null ) || artifacts.isEmpty() ) + { + return Collections.emptyList(); + } + + List<Dependency> list = new ArrayList<Dependency>( artifacts.size() ); + + for ( Artifact a : getArtifacts() ) + { + // TODO: let the scope handler deal with this + if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) + { + Dependency dependency = new Dependency(); + + dependency.setArtifactId( a.getArtifactId() ); + dependency.setGroupId( a.getGroupId() ); + dependency.setVersion( a.getVersion() ); + dependency.setScope( a.getScope() ); + dependency.setType( a.getType() ); + dependency.setClassifier( a.getClassifier() ); + + list.add( dependency ); + } + } + return list; + } + + @Deprecated + public void setReporting( Reporting reporting ) + { + getModel().setReporting( reporting ); + } + + @Deprecated + public Reporting getReporting() + { + return getModel().getReporting(); + } + + @Deprecated + public void setReportArtifacts( Set<Artifact> reportArtifacts ) + { + this.reportArtifacts = reportArtifacts; + + reportArtifactMap = null; + } + + @Deprecated + public Set<Artifact> getReportArtifacts() + { + return reportArtifacts; + } + + @Deprecated + public Map<String, Artifact> getReportArtifactMap() + { + if ( reportArtifactMap == null ) + { + reportArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getReportArtifacts() ); + } + + return reportArtifactMap; + } + + @Deprecated + public void setExtensionArtifacts( Set<Artifact> extensionArtifacts ) + { + this.extensionArtifacts = extensionArtifacts; + + extensionArtifactMap = null; + } + + @Deprecated + public Set<Artifact> getExtensionArtifacts() + { + return extensionArtifacts; + } + + @Deprecated + public Map<String, Artifact> getExtensionArtifactMap() + { + if ( extensionArtifactMap == null ) + { + extensionArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getExtensionArtifacts() ); + } + + return extensionArtifactMap; + } + + @Deprecated + public List<ReportPlugin> getReportPlugins() + { + if ( getModel().getReporting() == null ) + { + return Collections.emptyList(); + } + return getModel().getReporting().getPlugins(); + + } + + @Deprecated + public Xpp3Dom getReportConfiguration( String pluginGroupId, String pluginArtifactId, String reportSetId ) + { + Xpp3Dom dom = null; + + // ---------------------------------------------------------------------- + // I would like to be able to lookup the Mojo object using a key but + // we have a limitation in modello that will be remedied shortly. So + // for now I have to iterate through and see what we have. + // ---------------------------------------------------------------------- + + if ( getReportPlugins() != null ) + { + for ( ReportPlugin plugin : getReportPlugins() ) + { + if ( pluginGroupId.equals( plugin.getGroupId() ) && pluginArtifactId.equals( plugin.getArtifactId() ) ) + { + dom = (Xpp3Dom) plugin.getConfiguration(); + + if ( reportSetId != null ) + { + ReportSet reportSet = plugin.getReportSetsAsMap().get( reportSetId ); + if ( reportSet != null ) + { + Xpp3Dom executionConfiguration = (Xpp3Dom) reportSet.getConfiguration(); + if ( executionConfiguration != null ) + { + Xpp3Dom newDom = new Xpp3Dom( executionConfiguration ); + dom = Xpp3Dom.mergeXpp3Dom( newDom, dom ); + } + } + } + break; + } + } + } + + if ( dom != null ) + { + // make a copy so the original in the POM doesn't get messed with + dom = new Xpp3Dom( dom ); + } + + return dom; + } + + /** + * @deprecated Use MavenProjectHelper.attachArtifact(..) instead. + */ + @Deprecated + public void attachArtifact( String type, String classifier, File file ) + { + } + + /** + * @deprecated Use {@link org.apache.maven.model.io.ModelWriter}. + */ + @Deprecated + public void writeModel( Writer writer ) + throws IOException + { + MavenXpp3Writer pomWriter = new MavenXpp3Writer(); + pomWriter.write( writer, getModel() ); + } + + /** + * @deprecated Use {@link org.apache.maven.model.io.ModelWriter}. + */ + @Deprecated + public void writeOriginalModel( Writer writer ) + throws IOException + { + MavenXpp3Writer pomWriter = new MavenXpp3Writer(); + pomWriter.write( writer, getOriginalModel() ); + } + + @Deprecated + public Artifact replaceWithActiveArtifact( Artifact pluginArtifact ) + { + return pluginArtifact; + } + + /** + * Gets the project building request from which this project instance was created. <strong>Warning:</strong> This is + * an utility method that is meant to assist integrators of Maven, it must not be used by Maven plugins. + * + * @return The project building request or {@code null}. + * @since 2.1 + */ + @Deprecated + public ProjectBuildingRequest getProjectBuildingRequest() + { + return projectBuilderConfiguration; + } + + /** + * Sets the project building request from which this project instance was created. <strong>Warning:</strong> This is + * an utility method that is meant to assist integrators of Maven, it must not be used by Maven plugins. + * + * @param projectBuildingRequest The project building request, may be {@code null}. + * @since 2.1 + */ + // used by maven-dependency-tree + @Deprecated + public void setProjectBuildingRequest( ProjectBuildingRequest projectBuildingRequest ) + { + this.projectBuilderConfiguration = projectBuildingRequest; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/MavenProjectHelper.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/MavenProjectHelper.java new file mode 100644 index 00000000..0b54c004 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/MavenProjectHelper.java @@ -0,0 +1,76 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.List; + +/** + * Convenience interface for plugins to add or replace artifacts and resources on projects. + */ +public interface MavenProjectHelper +{ + String ROLE = MavenProjectHelper.class.getName(); + + /** + * See {@link #attachArtifact(MavenProject, String, String, java.io.File)}, but with type set to null. + * @param project project reference. + * @param artifactFile artifact file. + * @param artifactClassifier artifact classifier. + */ + void attachArtifact( MavenProject project, File artifactFile, String artifactClassifier ); + + /** + * * See {@link #attachArtifact(MavenProject, String, String, java.io.File)}, but with classifier set to null. + * @param project project reference. + * @param artifactType artifact type. + * @param artifactFile arrifact file. + */ + void attachArtifact( MavenProject project, String artifactType, File artifactFile ); + + /** + * Add or replace an artifact to the current project. + * @param project the project reference. + * @param artifactType the type (e.g. jar) or null. + * @param artifactClassifier the classifier or null. + * @param artifactFile the file for the artifact. + */ + void attachArtifact( MavenProject project, String artifactType, String artifactClassifier, File artifactFile ); + + /** + * Add a resource directory to the project. + * @param project project reference. + * @param resourceDirectory directory. + * @param includes include patterns. + * @param excludes exclude patterns. + */ + void addResource( MavenProject project, String resourceDirectory, List<String> includes, List<String> excludes ); + + /** + * Add a test resource directory to the project. + * @param project project reference. + * @param resourceDirectory directory. + * @param includes include patterns. + * @param excludes exclude patterns. + */ + void addTestResource( MavenProject project, String resourceDirectory, List<String> includes, + List<String> excludes ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuilder.java new file mode 100644 index 00000000..4ac83972 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuilder.java @@ -0,0 +1,98 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.building.ModelSource; + +/** + * Builds in-memory descriptions of projects. + */ +public interface ProjectBuilder +{ + + /** + * Builds a project descriptor from the specified POM file. + * + * @param projectFile The POM file to build the project from, must not be {@code null}. + * @param request The project building request that holds further parameters, must not be {@code null}. + * @return The result of the project building, never {@code null}. + * @throws ProjectBuildingException If the project descriptor could not be successfully built. + */ + ProjectBuildingResult build( File projectFile, ProjectBuildingRequest request ) + throws ProjectBuildingException; + + /** + * Builds a project descriptor for the specified artifact. + * + * @param projectArtifact The POM artifact to build the project from, must not be {@code null}. + * @param request The project building request that holds further parameters, must not be {@code null}. + * @return The result of the project building, never {@code null}. + * @throws ProjectBuildingException If the project descriptor could not be successfully built. + */ + ProjectBuildingResult build( Artifact projectArtifact, ProjectBuildingRequest request ) + throws ProjectBuildingException; + + /** + * Builds a project descriptor for the specified artifact. + * + * @param projectArtifact The POM artifact to build the project from, must not be {@code null}. + * @param allowStubModel A flag controlling the case of a missing POM artifact. If {@code true} and the specified + * POM artifact does not exist, a simple stub model will be returned. If {@code false}, an exception will + * be thrown. + * @param request The project building request that holds further parameters, must not be {@code null}. + * @return The result of the project building, never {@code null}. + * @throws ProjectBuildingException If the project descriptor could not be successfully built. + */ + ProjectBuildingResult build( Artifact projectArtifact, boolean allowStubModel, ProjectBuildingRequest request ) + throws ProjectBuildingException; + + /** + * Builds a project descriptor for the specified model source. + * + * @param modelSource The source of the model to built the project descriptor from, must not be {@code null}. + * @param request The project building request that holds further parameters, must not be {@code null}. + * @return The result of the project building, never {@code null}. + * @throws ProjectBuildingException If the project descriptor could not be successfully built. + * + * @see org.apache.maven.model.building.ModelSource2 + */ + ProjectBuildingResult build( ModelSource modelSource, ProjectBuildingRequest request ) + throws ProjectBuildingException; + + /** + * Builds the projects for the specified POM files and optionally their children. + * + * @param pomFiles The POM files to build, must not be {@code null}. + * @param recursive {@code true} to recursively build sub modules referenced by the POM files, {@code false} to + * build only the specified POM files. + * @param request The project builder configuration that provides further parameters, must not be {@code null}. + * @return The results of the project builder where each result corresponds to one project that was built, never + * {@code null}. + * @throws ProjectBuildingException If an error was encountered during building of any project. + * {@link ProjectBuildingException#getResults()} provides access to the details of the problems. + */ + List<ProjectBuildingResult> build( List<File> pomFiles, boolean recursive, ProjectBuildingRequest request ) + throws ProjectBuildingException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingException.java new file mode 100644 index 00000000..47c12315 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingException.java @@ -0,0 +1,145 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.List; + +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.model.building.ModelProblemUtils; + +/** + * @author Jason van Zyl + */ +public class ProjectBuildingException + extends Exception +{ + private final String projectId; + + private File pomFile; + + private List<ProjectBuildingResult> results; + + public ProjectBuildingException( String projectId, String message, Throwable cause ) + { + super( createMessage( message, projectId, null ), cause ); + this.projectId = projectId; + } + + /** + * @param projectId + * @param message + * @param pomFile pom file location + */ + public ProjectBuildingException( String projectId, String message, File pomFile ) + { + super( createMessage( message, projectId, pomFile ) ); + this.projectId = projectId; + this.pomFile = pomFile; + } + + /** + * @param projectId + * @param message + * @param pomFile pom file location + * @param cause + */ + protected ProjectBuildingException( String projectId, String message, File pomFile, Throwable cause ) + { + super( createMessage( message, projectId, pomFile ), cause ); + this.projectId = projectId; + this.pomFile = pomFile; + } + + public ProjectBuildingException( List<ProjectBuildingResult> results ) + { + super( createMessage( results ) ); + this.projectId = ""; + this.results = results; + } + + public File getPomFile() + { + return pomFile; + } + + /** + * @deprecated use {@link #getPomFile()} + */ + public String getPomLocation() + { + if ( getPomFile() != null ) + { + return getPomFile().getAbsolutePath(); + } + else + { + return "null"; + } + } + + public String getProjectId() + { + return projectId; + } + + public List<ProjectBuildingResult> getResults() + { + return results; + } + + private static String createMessage( String message, String projectId, File pomFile ) + { + StringBuilder buffer = new StringBuilder( 256 ); + buffer.append( message ); + buffer.append( " for project " ).append( projectId ); + if ( pomFile != null ) + { + buffer.append( " at " ).append( pomFile.getAbsolutePath() ); + } + return buffer.toString(); + } + + private static String createMessage( List<ProjectBuildingResult> results ) + { + StringWriter buffer = new StringWriter( 1024 ); + + PrintWriter writer = new PrintWriter( buffer ); + writer.println( "Some problems were encountered while processing the POMs:" ); + for ( ProjectBuildingResult result : results ) + { + for ( ModelProblem problem : result.getProblems() ) + { + writer.print( "[" ); + writer.print( problem.getSeverity() ); + writer.print( "] " ); + writer.print( problem.getMessage() ); + writer.print( " @ " ); + writer.println( ModelProblemUtils.formatLocation( problem, result.getProjectId() ) ); + } + } + writer.close(); + + return buffer.toString(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingHelper.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingHelper.java new file mode 100644 index 00000000..45fff6e6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingHelper.java @@ -0,0 +1,81 @@ +package org.apache.maven.project; + +/* + * 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.artifact.InvalidRepositoryException; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.model.Model; +import org.apache.maven.model.Repository; +import org.apache.maven.plugin.PluginManagerException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; + +/** + * Assists the project builder. <strong>Warning:</strong> This is an internal utility interface that is only public for + * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without + * prior notice. + * + * @author Benjamin Bentmann + */ +public interface ProjectBuildingHelper +{ + + /** + * Creates the effective artifact repositories from the specified POM repositories. + * + * @param pomRepositories The POM repositories to create the artifact repositories from, must not be {@code null}. + * @param externalRepositories The external (and already mirrored) repositories to merge into the result list, may + * be {@code null}. + * @param request The project building request holding further settings like repository settings, must not be + * {@code null}. + * @return The effective artifact repositories, never {@code null}. + * @throws InvalidRepositoryException + */ + List<ArtifactRepository> createArtifactRepositories( List<Repository> pomRepositories, + List<ArtifactRepository> externalRepositories, + ProjectBuildingRequest request ) + throws InvalidRepositoryException; + + /** + * Creates the project realm that hosts the build extensions of the specified model. + * + * @param project The project to create the project realm for, must not be {@code null} + * @param model The model to create the project realm for, must not be {@code null} + * @param request The project building request holding further settings like repository settings, must not be + * {@code null}. + * @return The record with the project realm and extension artifact filter, never {@code null}. + * @throws PluginResolutionException If any build extension could not be resolved. + */ + ProjectRealmCache.CacheRecord createProjectRealm( MavenProject project, Model model, + ProjectBuildingRequest request ) + throws PluginResolutionException, PluginVersionResolutionException, PluginManagerException; + + /** + * Updates the context class loader such that the container will search the project realm when the model builder + * injects the lifecycle bindings from the packaging in the next step. The context class loader is to be reset by + * the project builder when the project is fully assembled. + * + * @param project The project whose class realm should be selected, must not be {@code null}. + */ + void selectProjectRealm( MavenProject project ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java new file mode 100644 index 00000000..0380278b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java @@ -0,0 +1,194 @@ +package org.apache.maven.project; + +/* + * 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.Date; +import java.util.List; +import java.util.Properties; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.model.Profile; +import org.eclipse.aether.RepositorySystemSession; + +public interface ProjectBuildingRequest +{ + + ProjectBuildingRequest setLocalRepository( ArtifactRepository localRepository ); + + ArtifactRepository getLocalRepository(); + + ProjectBuildingRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); + + List<ArtifactRepository> getRemoteRepositories(); + + ProjectBuildingRequest setPluginArtifactRepositories( List<ArtifactRepository> pluginArtifacgRepositories ); + + List<ArtifactRepository> getPluginArtifactRepositories(); + + /** + * Sets the system properties to use for interpolation and profile activation. The system properties are collected + * from the runtime environment like {@link System#getProperties()} and environment variables. + * + * @param systemProperties The system properties, may be {@code null}. + * @return This request, never {@code null}. + */ + ProjectBuildingRequest setSystemProperties( Properties systemProperties ); + + /** + * Gets the system properties to use for interpolation and profile activation. The system properties are collected + * from the runtime environment like {@link System#getProperties()} and environment variables. + * + * @return The system properties, never {@code null}. + */ + Properties getSystemProperties(); + + /** + * Sets the user properties to use for interpolation and profile activation. The user properties have been + * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command + * line. + * + * @param userProperties The user properties, may be {@code null}. + * @return This request, never {@code null}. + */ + ProjectBuildingRequest setUserProperties( Properties userProperties ); + + /** + * Gets the user properties to use for interpolation and profile activation. The user properties have been + * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command + * line. + * + * @return The user properties, never {@code null}. + */ + Properties getUserProperties(); + + void setProject( MavenProject mavenProject ); + + MavenProject getProject(); + + ProjectBuildingRequest setProcessPlugins( boolean processPlugins ); + + boolean isProcessPlugins(); + + ProjectBuildingRequest setResolveDependencies( boolean resolveDependencies ); + + boolean isResolveDependencies(); + + /** + * Controls the level of validation to perform on processed models. By default, models are validated in strict mode. + * + * @param validationLevel The level of validation to perform on processed models, e.g. + * {@link org.apache.maven.model.building.ModelBuildingRequest#VALIDATION_LEVEL_STRICT}. + * @return This configuration, never {@code null}. + */ + ProjectBuildingRequest setValidationLevel( int validationLevel ); + + /** + * Gets the level of validation to perform on processed models. + * + * @return The level of validation to perform on processed models. + */ + int getValidationLevel(); + + // Profiles + + /** + * Set any active profiles that the {@link ProjectBuilder} should consider while constructing + * a {@link MavenProject}. + */ + void setActiveProfileIds( List<String> activeProfileIds ); + + List<String> getActiveProfileIds(); + + void setInactiveProfileIds( List<String> inactiveProfileIds ); + + List<String> getInactiveProfileIds(); + + /** + * Add a {@link org.apache.maven.model.Profile} that has come from an external source. This may be from a custom + * configuration like the MavenCLI settings.xml file, or from a custom dialog in an IDE integration like M2Eclipse. + * + * @param profile + */ + void addProfile( Profile profile ); + + void setProfiles( List<Profile> profiles ); + + List<Profile> getProfiles(); + + /** + * Gets the start time of the build. + * + * @return The start time of the build or {@code null} if unknown. + */ + Date getBuildStartTime(); + + /** + * Sets the start time of the build. + * + * @param buildStartTime The start time of the build, may be {@code null}. + */ + void setBuildStartTime( Date buildStartTime ); + + RepositorySystemSession getRepositorySession(); + + ProjectBuildingRequest setRepositorySession( RepositorySystemSession repositorySession ); + + /** + * Sets the merge mode used to combine repositories declared in the POM with the repositories specified in this + * request. + * + * @param mode The repository merge mode, must not be {@code null}. + * @return This request for chaining, never {@code null}. + * @see #setRemoteRepositories(List) + */ + ProjectBuildingRequest setRepositoryMerging( RepositoryMerging mode ); + + /** + * Gets the merge mode used to combine repositories declared in the POM with the repositories specified in this + * request + * + * @return The merge mode, never {@code null}. + */ + RepositoryMerging getRepositoryMerging(); + + /** @since 3.2.2 */ + boolean isResolveVersionRanges(); + + /** @since 3.2.2 */ + ProjectBuildingRequest setResolveVersionRanges( boolean value ); + + /** + * The possible merge modes for combining remote repositories. + */ + enum RepositoryMerging + { + + /** + * The repositories declared in the POM have precedence over the repositories specified in the request. + */ + POM_DOMINANT, + + /** + * The repositories specified in the request have precedence over the repositories declared in the POM. + */ + REQUEST_DOMINANT, + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingResult.java new file mode 100644 index 00000000..9a43154c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingResult.java @@ -0,0 +1,74 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.List; + +import org.apache.maven.model.building.ModelProblem; + +/** + * Collects the output of the project builder. + * + * @author Benjamin Bentmann + */ +public interface ProjectBuildingResult +{ + + /** + * 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}. + */ + String getProjectId(); + + /** + * Gets the POM file from which the project was built. + * + * @return The POM file or {@code null} if unknown. + */ + File 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 ProjectBuildingException}. + */ + MavenProject 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}. + */ + List<ModelProblem> getProblems(); + + /** + * Gets the result of the dependency resolution for the project. + * + * @return The result of the dependency resolution for the project or {@code null} if the project dependencies were + * not requested. + */ + DependencyResolutionResult getDependencyResolutionResult(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectDependenciesResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectDependenciesResolver.java new file mode 100644 index 00000000..539055ca --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectDependenciesResolver.java @@ -0,0 +1,40 @@ +package org.apache.maven.project; + +/* + * 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. + */ + +/** + * Resolves the transitive dependencies of a project. + * + * @author Benjamin Bentmann + */ +public interface ProjectDependenciesResolver +{ + + /** + * Resolves the transitive dependencies of a project. + * + * @param request The resolution request holding the parameters, must not be {@code null}. + * @return The resolution result, never {@code null}. + * @throws DependencyResolutionException If any project dependency could not be resolved. + */ + DependencyResolutionResult resolve( DependencyResolutionRequest request ) + throws DependencyResolutionException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java new file mode 100644 index 00000000..3e33eb57 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java @@ -0,0 +1,248 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; + +import org.apache.maven.model.Parent; +import org.apache.maven.model.Repository; +import org.apache.maven.model.building.FileModelSource; +import org.apache.maven.model.building.ModelSource; +import org.apache.maven.model.resolution.InvalidRepositoryException; +import org.apache.maven.model.resolution.ModelResolver; +import org.apache.maven.model.resolution.UnresolvableModelException; +import org.apache.maven.repository.internal.ArtifactDescriptorUtils; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.impl.RemoteRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.resolution.VersionRangeRequest; +import org.eclipse.aether.resolution.VersionRangeResolutionException; +import org.eclipse.aether.resolution.VersionRangeResult; + +/** + * A model resolver to assist building of projects. This resolver gives priority to those repositories that have been + * declared in the POM. + * + * @author Benjamin Bentmann + */ +public class ProjectModelResolver + implements ModelResolver +{ + + private final RepositorySystemSession session; + + private final RequestTrace trace; + + private final String context = "project"; + + private List<RemoteRepository> repositories; + + private List<RemoteRepository> pomRepositories; + + private final List<RemoteRepository> externalRepositories; + + private final RepositorySystem resolver; + + private final RemoteRepositoryManager remoteRepositoryManager; + + private final Set<String> repositoryIds; + + private final ReactorModelPool modelPool; + + private final ProjectBuildingRequest.RepositoryMerging repositoryMerging; + + public ProjectModelResolver( RepositorySystemSession session, RequestTrace trace, RepositorySystem resolver, + RemoteRepositoryManager remoteRepositoryManager, List<RemoteRepository> repositories, + ProjectBuildingRequest.RepositoryMerging repositoryMerging, + ReactorModelPool modelPool ) + { + this.session = session; + this.trace = trace; + this.resolver = resolver; + this.remoteRepositoryManager = remoteRepositoryManager; + this.pomRepositories = new ArrayList<RemoteRepository>(); + List<RemoteRepository> externalRepositories = new ArrayList<RemoteRepository>(); + externalRepositories.addAll( repositories ); + this.externalRepositories = Collections.unmodifiableList( externalRepositories ); + this.repositories = new ArrayList<RemoteRepository>(); + this.repositories.addAll( externalRepositories ); + this.repositoryMerging = repositoryMerging; + this.repositoryIds = new HashSet<String>(); + this.modelPool = modelPool; + } + + private ProjectModelResolver( ProjectModelResolver original ) + { + this.session = original.session; + this.trace = original.trace; + this.resolver = original.resolver; + this.remoteRepositoryManager = original.remoteRepositoryManager; + this.pomRepositories = new ArrayList<RemoteRepository>( original.pomRepositories ); + this.externalRepositories = original.externalRepositories; + this.repositories = new ArrayList<RemoteRepository>( original.repositories ); + this.repositoryMerging = original.repositoryMerging; + this.repositoryIds = new HashSet<String>( original.repositoryIds ); + this.modelPool = original.modelPool; + } + + public void addRepository( Repository repository ) + throws InvalidRepositoryException + { + addRepository( repository, false ); + } + + @Override + public void addRepository( final Repository repository, boolean replace ) + throws InvalidRepositoryException + { + if ( !repositoryIds.add( repository.getId() ) ) + { + if ( !replace ) + { + return; + } + + // Remove any previous repository with this Id + removeMatchingRepository( repositories, repository.getId() ); + removeMatchingRepository( pomRepositories, repository.getId() ); + } + + List<RemoteRepository> newRepositories = + Collections.singletonList( ArtifactDescriptorUtils.toRemoteRepository( repository ) ); + + if ( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT.equals( repositoryMerging ) ) + { + repositories = remoteRepositoryManager.aggregateRepositories( session, repositories, newRepositories, + true ); + } + else + { + pomRepositories = + remoteRepositoryManager.aggregateRepositories( session, pomRepositories, newRepositories, true ); + repositories = + remoteRepositoryManager.aggregateRepositories( session, pomRepositories, externalRepositories, false ); + } + } + + private static void removeMatchingRepository( Iterable<RemoteRepository> repositories, final String id ) + { + Iterables.removeIf( repositories, new Predicate<RemoteRepository>() + { + @Override + public boolean apply( RemoteRepository remoteRepository ) + { + return remoteRepository.getId().equals( id ); + } + } ); + } + + public ModelResolver newCopy() + { + return new ProjectModelResolver( this ); + } + + public ModelSource resolveModel( String groupId, String artifactId, String version ) + throws UnresolvableModelException + { + File pomFile = null; + + if ( modelPool != null ) + { + pomFile = modelPool.get( groupId, artifactId, version ); + } + + if ( pomFile == null ) + { + Artifact pomArtifact = new DefaultArtifact( groupId, artifactId, "", "pom", version ); + + try + { + ArtifactRequest request = new ArtifactRequest( pomArtifact, repositories, context ); + request.setTrace( trace ); + pomArtifact = resolver.resolveArtifact( session, request ).getArtifact(); + } + catch ( ArtifactResolutionException e ) + { + throw new UnresolvableModelException( e.getMessage(), groupId, artifactId, version, e ); + } + + pomFile = pomArtifact.getFile(); + } + + return new FileModelSource( pomFile ); + } + + public ModelSource resolveModel( Parent parent ) + throws UnresolvableModelException + { + Artifact artifact = new DefaultArtifact( parent.getGroupId(), parent.getArtifactId(), "", "pom", + parent.getVersion() ); + + VersionRangeRequest versionRangeRequest = new VersionRangeRequest( artifact, repositories, context ); + versionRangeRequest.setTrace( trace ); + + try + { + VersionRangeResult versionRangeResult = resolver.resolveVersionRange( session, versionRangeRequest ); + + if ( versionRangeResult.getHighestVersion() == null ) + { + throw new UnresolvableModelException( "No versions matched the requested range '" + parent.getVersion() + + "'", parent.getGroupId(), parent.getArtifactId(), + parent.getVersion() ); + + } + + if ( versionRangeResult.getVersionConstraint() != null + && versionRangeResult.getVersionConstraint().getRange() != null + && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null ) + { + throw new UnresolvableModelException( "The requested version range '" + parent.getVersion() + + "' does not specify an upper bound", parent.getGroupId(), + parent.getArtifactId(), parent.getVersion() ); + + } + + parent.setVersion( versionRangeResult.getHighestVersion().toString() ); + } + catch ( VersionRangeResolutionException e ) + { + throw new UnresolvableModelException( e.getMessage(), parent.getGroupId(), parent.getArtifactId(), + parent.getVersion(), e ); + + } + + return resolveModel( parent.getGroupId(), parent.getArtifactId(), parent.getVersion() ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectRealmCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectRealmCache.java new file mode 100644 index 00000000..9265b894 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectRealmCache.java @@ -0,0 +1,79 @@ +package org.apache.maven.project; + +/* + * 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.codehaus.plexus.classworlds.realm.ClassRealm; +import org.eclipse.aether.graph.DependencyFilter; + +/** + * Caches project class realms. <strong>Warning:</strong> This is an internal utility interface that is only public for + * technical reasons, it is not part of the public API. In particular, this interface can be changed or deleted without + * prior notice. + * + * @author Igor Fedorenko + * @author Benjamin Bentmann + */ +public interface ProjectRealmCache +{ + + /** + * A cache key. + */ + interface Key + { + // marker interface for cache keys + } + + static class CacheRecord + { + + public final ClassRealm realm; + + public final DependencyFilter extensionArtifactFilter; + + public CacheRecord( ClassRealm realm, DependencyFilter extensionArtifactFilter ) + { + this.realm = realm; + this.extensionArtifactFilter = extensionArtifactFilter; + } + + } + + Key createKey( List<? extends ClassRealm> extensionRealms ); + + CacheRecord get( Key key ); + + CacheRecord put( Key key, ClassRealm projectRealm, DependencyFilter extensionArtifactFilter ); + + void flush(); + + /** + * Registers the specified cache record for usage with the given project. Integrators can use the information + * collected from this method in combination with a custom cache implementation to dispose unused records from the + * cache. + * + * @param project The project that employs the plugin realm, must not be {@code null}. + * @param record The cache record being used for the project, must not be {@code null}. + */ + void register( MavenProject project, Key key, CacheRecord record ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectSorter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectSorter.java new file mode 100644 index 00000000..16985e2a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ProjectSorter.java @@ -0,0 +1,289 @@ +package org.apache.maven.project; + +/* + * 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.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Extension; +import org.apache.maven.model.Parent; +import org.apache.maven.model.Plugin; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.dag.CycleDetectedException; +import org.codehaus.plexus.util.dag.DAG; +import org.codehaus.plexus.util.dag.TopologicalSorter; +import org.codehaus.plexus.util.dag.Vertex; + +public class ProjectSorter +{ + private DAG dag; + + private List<MavenProject> sortedProjects; + + private Map<String, MavenProject> projectMap; + + private MavenProject topLevelProject; + + /** + * Sort a list of projects. + * <ul> + * <li>collect all the vertices for the projects that we want to build.</li> + * <li>iterate through the deps of each project and if that dep is within + * the set of projects we want to build then add an edge, otherwise throw + * the edge away because that dependency is not within the set of projects + * we are trying to build. we assume a closed set.</li> + * <li>do a topo sort on the graph that remains.</li> + * </ul> + * @throws DuplicateProjectException if any projects are duplicated by id + */ + // MAVENAPI FIXME: the DAG used is NOT only used to represent the dependency relation, + // but also for <parent>, <build><plugin>, <reports>. We need multiple DAG's + // since a DAG can only handle 1 type of relationship properly. + // Usecase: This is detected as a cycle: + // org.apache.maven:maven-plugin-api -(PARENT)-> + // org.apache.maven:maven -(inherited REPORTING)-> + // org.apache.maven.plugins:maven-checkstyle-plugin -(DEPENDENCY)-> + // org.apache.maven:maven-plugin-api + // In this case, both the verify and the report goals are called + // in a different lifecycle. Though the compiler-plugin has a valid usecase, although + // that seems to work fine. We need to take versions and lifecycle into account. + public ProjectSorter( Collection<MavenProject> projects ) + throws CycleDetectedException, DuplicateProjectException + { + dag = new DAG(); + + // groupId:artifactId:version -> project + projectMap = new HashMap<String, MavenProject>( projects.size() * 2 ); + + // groupId:artifactId -> (version -> vertex) + Map<String, Map<String, Vertex>> vertexMap = new HashMap<String, Map<String, Vertex>>( projects.size() * 2 ); + + for ( MavenProject project : projects ) + { + String projectId = getId( project ); + + MavenProject conflictingProject = projectMap.put( projectId, project ); + + if ( conflictingProject != null ) + { + throw new DuplicateProjectException( projectId, conflictingProject.getFile(), project.getFile(), + "Project '" + projectId + "' is duplicated in the reactor" ); + } + + String projectKey = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ); + + Map<String, Vertex> vertices = vertexMap.get( projectKey ); + if ( vertices == null ) + { + vertices = new HashMap<String, Vertex>( 2, 1 ); + vertexMap.put( projectKey, vertices ); + } + vertices.put( project.getVersion(), dag.addVertex( projectId ) ); + } + + for ( Vertex projectVertex : dag.getVerticies() ) + { + String projectId = projectVertex.getLabel(); + + MavenProject project = projectMap.get( projectId ); + + for ( Dependency dependency : project.getDependencies() ) + { + addEdge( projectMap, vertexMap, project, projectVertex, dependency.getGroupId(), + dependency.getArtifactId(), dependency.getVersion(), false, false ); + } + + Parent parent = project.getModel().getParent(); + + if ( parent != null ) + { + // Parent is added as an edge, but must not cause a cycle - so we remove any other edges it has + // in conflict + addEdge( projectMap, vertexMap, null, projectVertex, parent.getGroupId(), parent.getArtifactId(), + parent.getVersion(), true, false ); + } + + List<Plugin> buildPlugins = project.getBuildPlugins(); + if ( buildPlugins != null ) + { + for ( Plugin plugin : buildPlugins ) + { + addEdge( projectMap, vertexMap, project, projectVertex, plugin.getGroupId(), + plugin.getArtifactId(), plugin.getVersion(), false, true ); + + for ( Dependency dependency : plugin.getDependencies() ) + { + addEdge( projectMap, vertexMap, project, projectVertex, dependency.getGroupId(), + dependency.getArtifactId(), dependency.getVersion(), false, true ); + } + } + } + + List<Extension> buildExtensions = project.getBuildExtensions(); + if ( buildExtensions != null ) + { + for ( Extension extension : buildExtensions ) + { + addEdge( projectMap, vertexMap, project, projectVertex, extension.getGroupId(), + extension.getArtifactId(), extension.getVersion(), false, true ); + } + } + } + + List<MavenProject> sortedProjects = new ArrayList<MavenProject>( projects.size() ); + + List<String> sortedProjectLabels = TopologicalSorter.sort( dag ); + + for ( String id : sortedProjectLabels ) + { + sortedProjects.add( projectMap.get( id ) ); + } + + this.sortedProjects = Collections.unmodifiableList( sortedProjects ); + } + + private void addEdge( Map<String, MavenProject> projectMap, Map<String, Map<String, Vertex>> vertexMap, + MavenProject project, Vertex projectVertex, String groupId, String artifactId, + String version, boolean force, boolean safe ) + throws CycleDetectedException + { + String projectKey = ArtifactUtils.versionlessKey( groupId, artifactId ); + + Map<String, Vertex> vertices = vertexMap.get( projectKey ); + + if ( vertices != null ) + { + if ( isSpecificVersion( version ) ) + { + Vertex vertex = vertices.get( version ); + if ( vertex != null ) + { + addEdge( projectVertex, vertex, project, projectMap, force, safe ); + } + } + else + { + for ( Vertex vertex : vertices.values() ) + { + addEdge( projectVertex, vertex, project, projectMap, force, safe ); + } + } + } + } + + private void addEdge( Vertex fromVertex, Vertex toVertex, MavenProject fromProject, + Map<String, MavenProject> projectMap, boolean force, boolean safe ) + throws CycleDetectedException + { + if ( fromVertex.equals( toVertex ) ) + { + return; + } + + if ( fromProject != null ) + { + MavenProject toProject = projectMap.get( toVertex.getLabel() ); + fromProject.addProjectReference( toProject ); + } + + if ( force && toVertex.getChildren().contains( fromVertex ) ) + { + dag.removeEdge( toVertex, fromVertex ); + } + + try + { + dag.addEdge( fromVertex, toVertex ); + } + catch ( CycleDetectedException e ) + { + if ( !safe ) + { + throw e; + } + } + } + + private boolean isSpecificVersion( String version ) + { + return !( StringUtils.isEmpty( version ) || version.startsWith( "[" ) || version.startsWith( "(" ) ); + } + + // TODO: !![jc; 28-jul-2005] check this; if we're using '-r' and there are aggregator tasks, this will result in weirdness. + public MavenProject getTopLevelProject() + { + if ( topLevelProject == null ) + { + for ( Iterator<MavenProject> i = sortedProjects.iterator(); i.hasNext() && ( topLevelProject == null ); ) + { + MavenProject project = i.next(); + if ( project.isExecutionRoot() ) + { + topLevelProject = project; + } + } + } + + return topLevelProject; + } + + public List<MavenProject> getSortedProjects() + { + return sortedProjects; + } + + public boolean hasMultipleProjects() + { + return sortedProjects.size() > 1; + } + + public List<String> getDependents( String id ) + { + return dag.getParentLabels( id ); + } + + public List<String> getDependencies( String id ) + { + return dag.getChildLabels( id ); + } + + public static String getId( MavenProject project ) + { + return ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + } + + public DAG getDAG() + { + return dag; + } + + public Map<String, MavenProject> getProjectMap() + { + return projectMap; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ReactorModelCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ReactorModelCache.java new file mode 100644 index 00000000..24425da1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ReactorModelCache.java @@ -0,0 +1,103 @@ +package org.apache.maven.project; + +/* + * 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.HashMap; +import java.util.Map; + +import org.apache.maven.model.building.ModelCache; + +/** + * A simple model cache used to accelerate model building during a reactor build. + * + * @author Benjamin Bentmann + */ +class ReactorModelCache + implements ModelCache +{ + + private final Map<CacheKey, Object> models = new HashMap<CacheKey, Object>( 256 ); + + public Object get( String groupId, String artifactId, String version, String tag ) + { + return models.get( new CacheKey( groupId, artifactId, version, tag ) ); + } + + public void put( String groupId, String artifactId, String version, String tag, Object data ) + { + models.put( new CacheKey( groupId, artifactId, version, tag ), data ); + } + + private static final class CacheKey + { + + private final String groupId; + + private final String artifactId; + + private final String version; + + private final String tag; + + private final int hashCode; + + public CacheKey( String groupId, String artifactId, String version, String tag ) + { + this.groupId = ( groupId != null ) ? groupId : ""; + this.artifactId = ( artifactId != null ) ? artifactId : ""; + this.version = ( version != null ) ? version : ""; + this.tag = ( tag != null ) ? tag : ""; + + int hash = 17; + hash = hash * 31 + this.groupId.hashCode(); + hash = hash * 31 + this.artifactId.hashCode(); + hash = hash * 31 + this.version.hashCode(); + hash = hash * 31 + this.tag.hashCode(); + hashCode = hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof CacheKey ) ) + { + return false; + } + + CacheKey that = (CacheKey) obj; + + return artifactId.equals( that.artifactId ) && groupId.equals( that.groupId ) + && version.equals( that.version ) && tag.equals( that.tag ); + } + + @Override + public int hashCode() + { + return hashCode; + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ReactorModelPool.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ReactorModelPool.java new file mode 100644 index 00000000..294fccdb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/ReactorModelPool.java @@ -0,0 +1,106 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.HashMap; +import java.util.Map; + +/** + * Holds all POM files that are known to the reactor. This allows the project builder to resolve imported POMs from the + * reactor when building another project's effective model. + * + * @author Benjamin Bentmann + */ +class ReactorModelPool +{ + + private final Map<CacheKey, File> pomFiles = new HashMap<CacheKey, File>(); + + public File get( String groupId, String artifactId, String version ) + { + return pomFiles.get( new CacheKey( groupId, artifactId, version ) ); + } + + public void put( String groupId, String artifactId, String version, File pomFile ) + { + pomFiles.put( new CacheKey( groupId, artifactId, version ), pomFile ); + } + + private static final class CacheKey + { + + private final String groupId; + + private final String artifactId; + + private final String version; + + private final int hashCode; + + public CacheKey( String groupId, String artifactId, String version ) + { + this.groupId = ( groupId != null ) ? groupId : ""; + this.artifactId = ( artifactId != null ) ? artifactId : ""; + this.version = ( version != null ) ? version : ""; + + int hash = 17; + hash = hash * 31 + this.groupId.hashCode(); + hash = hash * 31 + this.artifactId.hashCode(); + hash = hash * 31 + this.version.hashCode(); + hashCode = hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof CacheKey ) ) + { + return false; + } + + CacheKey that = (CacheKey) obj; + + return artifactId.equals( that.artifactId ) && groupId.equals( that.groupId ) + && version.equals( that.version ); + } + + @Override + public int hashCode() + { + return hashCode; + } + + @Override + public String toString() + { + StringBuilder buffer = new StringBuilder( 96 ); + buffer.append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( version ); + return buffer.toString(); + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java new file mode 100644 index 00000000..679ee008 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/RepositorySessionDecorator.java @@ -0,0 +1,36 @@ +package org.apache.maven.project; + +/* + * 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.eclipse.aether.RepositorySystemSession; + +/** + * Component interface that allows per-project customization of Aether repository system sessions. + * + * @since 3.2.4 + * @provisional This interface is part of work in progress and can be changed or removed without notice. + */ +public interface RepositorySessionDecorator +{ + /** + * Returns possibly {@code null} Aether repository system session to be used to resolve project dependencies. + */ + RepositorySystemSession decorate( MavenProject project, RepositorySystemSession session ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ActiveProjectArtifact.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ActiveProjectArtifact.java new file mode 100644 index 00000000..6e13d332 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ActiveProjectArtifact.java @@ -0,0 +1,403 @@ +package org.apache.maven.project.artifact; + +/* + * 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.Artifact; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.OverConstrainedVersionException; +import org.apache.maven.artifact.versioning.VersionRange; +import org.apache.maven.project.MavenProject; + +import java.io.File; +import java.util.Collection; +import java.util.List; + +/** + * Wraps an active project instance to be able to receive updates from its artifact without affecting the original + * attributes of this artifact. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + * @todo I think this exposes a design flaw in that the immutable and mutable parts of an artifact are in one class and + * should be split. ie scope, file, etc depend on the context of use, whereas everything else is immutable. + */ +@Deprecated +public class ActiveProjectArtifact + implements Artifact +{ + private final Artifact artifact; + + private final MavenProject project; + + public ActiveProjectArtifact( MavenProject project, Artifact artifact ) + { + this.artifact = artifact; + this.project = project; + + artifact.setFile( project.getArtifact().getFile() ); + artifact.setResolved( true ); + } + + /** {@inheritDoc} */ + public File getFile() + { + // we need to get the latest file for the project, not the artifact that was created at one point in time + return project.getArtifact().getFile(); + } + + /** {@inheritDoc} */ + public String getGroupId() + { + return artifact.getGroupId(); + } + + /** {@inheritDoc} */ + public String getArtifactId() + { + return artifact.getArtifactId(); + } + + /** {@inheritDoc} */ + public String getVersion() + { + return artifact.getVersion(); + } + + /** {@inheritDoc} */ + public void setVersion( String version ) + { + artifact.setVersion( version ); + } + + /** {@inheritDoc} */ + public String getScope() + { + return artifact.getScope(); + } + + /** {@inheritDoc} */ + public String getType() + { + return artifact.getType(); + } + + /** {@inheritDoc} */ + public String getClassifier() + { + return artifact.getClassifier(); + } + + /** {@inheritDoc} */ + public boolean hasClassifier() + { + return artifact.hasClassifier(); + } + + /** {@inheritDoc} */ + public void setFile( File destination ) + { + artifact.setFile( destination ); + project.getArtifact().setFile( destination ); + } + + /** {@inheritDoc} */ + public String getBaseVersion() + { + return artifact.getBaseVersion(); + } + + /** {@inheritDoc} */ + public void setBaseVersion( String baseVersion ) + { + artifact.setBaseVersion( baseVersion ); + } + + /** {@inheritDoc} */ + public String getId() + { + return artifact.getId(); + } + + /** {@inheritDoc} */ + public String getDependencyConflictId() + { + return artifact.getDependencyConflictId(); + } + + /** {@inheritDoc} */ + public void addMetadata( ArtifactMetadata metadata ) + { + artifact.addMetadata( metadata ); + } + + /** {@inheritDoc} */ + public Collection<ArtifactMetadata> getMetadataList() + { + return artifact.getMetadataList(); + } + + /** {@inheritDoc} */ + public void setRepository( ArtifactRepository remoteRepository ) + { + artifact.setRepository( remoteRepository ); + } + + /** {@inheritDoc} */ + public ArtifactRepository getRepository() + { + return artifact.getRepository(); + } + + /** {@inheritDoc} */ + public void updateVersion( String version, ArtifactRepository localRepository ) + { + artifact.updateVersion( version, localRepository ); + } + + /** {@inheritDoc} */ + public String getDownloadUrl() + { + return artifact.getDownloadUrl(); + } + + /** {@inheritDoc} */ + public void setDownloadUrl( String downloadUrl ) + { + artifact.setDownloadUrl( downloadUrl ); + } + + /** {@inheritDoc} */ + public ArtifactFilter getDependencyFilter() + { + return artifact.getDependencyFilter(); + } + + /** {@inheritDoc} */ + public void setDependencyFilter( ArtifactFilter artifactFilter ) + { + artifact.setDependencyFilter( artifactFilter ); + } + + /** {@inheritDoc} */ + public ArtifactHandler getArtifactHandler() + { + return artifact.getArtifactHandler(); + } + + /** {@inheritDoc} */ + public List<String> getDependencyTrail() + { + return artifact.getDependencyTrail(); + } + + /** {@inheritDoc} */ + public void setDependencyTrail( List<String> dependencyTrail ) + { + artifact.setDependencyTrail( dependencyTrail ); + } + + /** {@inheritDoc} */ + public void setScope( String scope ) + { + artifact.setScope( scope ); + } + + /** {@inheritDoc} */ + public VersionRange getVersionRange() + { + return artifact.getVersionRange(); + } + + /** {@inheritDoc} */ + public void setVersionRange( VersionRange newRange ) + { + artifact.setVersionRange( newRange ); + } + + /** {@inheritDoc} */ + public void selectVersion( String version ) + { + artifact.selectVersion( version ); + } + + /** {@inheritDoc} */ + public void setGroupId( String groupId ) + { + artifact.setGroupId( groupId ); + } + + /** {@inheritDoc} */ + public void setArtifactId( String artifactId ) + { + artifact.setArtifactId( artifactId ); + } + + /** {@inheritDoc} */ + public boolean isSnapshot() + { + return artifact.isSnapshot(); + } + + /** {@inheritDoc} */ + public int compareTo( Artifact a ) + { + return artifact.compareTo( a ); + } + + /** {@inheritDoc} */ + public void setResolved( boolean resolved ) + { + artifact.setResolved( resolved ); + } + + /** {@inheritDoc} */ + public boolean isResolved() + { + return artifact.isResolved(); + } + + /** {@inheritDoc} */ + public void setResolvedVersion( String version ) + { + artifact.setResolvedVersion( version ); + } + + /** {@inheritDoc} */ + public void setArtifactHandler( ArtifactHandler handler ) + { + artifact.setArtifactHandler( handler ); + } + + /** {@inheritDoc} */ + public String toString() + { + return "active project artifact:\n\tartifact = " + artifact + ";\n\tproject: " + project; + } + + /** {@inheritDoc} */ + public boolean isRelease() + { + return artifact.isRelease(); + } + + /** {@inheritDoc} */ + public void setRelease( boolean release ) + { + artifact.setRelease( release ); + } + + /** {@inheritDoc} */ + public List<ArtifactVersion> getAvailableVersions() + { + return artifact.getAvailableVersions(); + } + + /** {@inheritDoc} */ + public void setAvailableVersions( List<ArtifactVersion> versions ) + { + artifact.setAvailableVersions( versions ); + } + + /** {@inheritDoc} */ + public boolean isOptional() + { + return artifact.isOptional(); + } + + /** {@inheritDoc} */ + public ArtifactVersion getSelectedVersion() + throws OverConstrainedVersionException + { + return artifact.getSelectedVersion(); + } + + /** {@inheritDoc} */ + public boolean isSelectedVersionKnown() + throws OverConstrainedVersionException + { + return artifact.isSelectedVersionKnown(); + } + + /** {@inheritDoc} */ + public void setOptional( boolean optional ) + { + artifact.setOptional( optional ); + } + + /** {@inheritDoc} */ + public int hashCode() + { + int result = 17; + + result = 37 * result + getGroupId().hashCode(); + result = 37 * result + getArtifactId().hashCode(); + result = 37 * result + getType().hashCode(); + if ( getVersion() != null ) + { + result = 37 * result + getVersion().hashCode(); + } + result = 37 * result + ( getClassifier() != null ? getClassifier().hashCode() : 0 ); + + return result; + } + + /** {@inheritDoc} */ + public boolean equals( Object o ) + { + if ( o == this ) + { + return true; + } + + if ( !( o instanceof Artifact ) ) + { + return false; + } + + Artifact a = (Artifact) o; + + if ( !a.getGroupId().equals( getGroupId() ) ) + { + return false; + } + else if ( !a.getArtifactId().equals( getArtifactId() ) ) + { + return false; + } + else if ( !a.getVersion().equals( getVersion() ) ) + { + return false; + } + else if ( !a.getType().equals( getType() ) ) + { + return false; + } + else if ( a.getClassifier() == null ? getClassifier() != null : !a.getClassifier().equals( getClassifier() ) ) + { + return false; + } + + return true; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ArtifactWithDependencies.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ArtifactWithDependencies.java new file mode 100644 index 00000000..cb06b70f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ArtifactWithDependencies.java @@ -0,0 +1,33 @@ +package org.apache.maven.project.artifact; + +/* + * 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.model.Dependency; + +public interface ArtifactWithDependencies +{ + + List<Dependency> getDependencies(); + + List<Dependency> getManagedDependencies(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java new file mode 100644 index 00000000..fd2b956c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java @@ -0,0 +1,185 @@ +package org.apache.maven.project.artifact; + +/* + * 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.Artifact; +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.InvalidArtifactRTException; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.VersionRange; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + *<strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part + * of the public API. In particular, this class can be changed or deleted without prior notice. Use + * {@link org.apache.maven.project.MavenProjectHelper#attachArtifact} instead. + */ +@Deprecated +public class AttachedArtifact + extends DefaultArtifact +{ + + private final Artifact parent; + + public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler ) + { + super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type, + classifier, artifactHandler, parent.isOptional() ); + + setDependencyTrail( Collections.singletonList( parent.getId() ) ); + + this.parent = parent; + + if ( getId().equals( parent.getId() ) ) + { + throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), + parent.getType(), "An attached artifact must have a different ID" + + " than its corresponding main artifact." ); + } + } + + public AttachedArtifact( Artifact parent, String type, ArtifactHandler artifactHandler ) + { + this( parent, type, null, artifactHandler ); + } + + public void setArtifactId( String artifactId ) + { + throw new UnsupportedOperationException( "Cannot change the artifactId for an attached artifact." + + " It is derived from the main artifact." ); + } + + public List<ArtifactVersion> getAvailableVersions() + { + return parent.getAvailableVersions(); + } + + public void setAvailableVersions( List<ArtifactVersion> availableVersions ) + { + throw new UnsupportedOperationException( "Cannot change the version information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public String getBaseVersion() + { + return parent.getBaseVersion(); + } + + public void setBaseVersion( String baseVersion ) + { + throw new UnsupportedOperationException( "Cannot change the version information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public String getDownloadUrl() + { + return parent.getDownloadUrl(); + } + + public void setDownloadUrl( String downloadUrl ) + { + throw new UnsupportedOperationException( "Cannot change the download information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public void setGroupId( String groupId ) + { + throw new UnsupportedOperationException( "Cannot change the groupId for an attached artifact." + + " It is derived from the main artifact." ); + } + + public ArtifactRepository getRepository() + { + return parent.getRepository(); + } + + public void setRepository( ArtifactRepository repository ) + { + throw new UnsupportedOperationException( "Cannot change the repository information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public String getScope() + { + return parent.getScope(); + } + + public void setScope( String scope ) + { + throw new UnsupportedOperationException( "Cannot change the scoping information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public String getVersion() + { + return parent.getVersion(); + } + + public void setVersion( String version ) + { + throw new UnsupportedOperationException( "Cannot change the version information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public VersionRange getVersionRange() + { + return parent.getVersionRange(); + } + + public void setVersionRange( VersionRange range ) + { + throw new UnsupportedOperationException( "Cannot change the version information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public boolean isRelease() + { + return parent.isRelease(); + } + + public void setRelease( boolean release ) + { + throw new UnsupportedOperationException( "Cannot change the version information for an attached artifact." + + " It is derived from the main artifact." ); + } + + public boolean isSnapshot() + { + return parent.isSnapshot(); + } + + public void addMetadata( ArtifactMetadata metadata ) + { + // ignore. The parent artifact will handle metadata. + // we must fail silently here to avoid problems with the artifact transformers. + } + + public Collection<ArtifactMetadata> getMetadataList() + { + return Collections.emptyList(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java new file mode 100644 index 00000000..07fd11da --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMavenMetadataCache.java @@ -0,0 +1,347 @@ +package org.apache.maven.project.artifact; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.artifact.metadata.ResolutionGroup; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; +import org.codehaus.plexus.component.annotations.Component; + +@Component( role = MavenMetadataCache.class ) +public class DefaultMavenMetadataCache + implements MavenMetadataCache +{ + + protected final Map<CacheKey, CacheRecord> cache = new ConcurrentHashMap<CacheKey, CacheRecord>(); + + public static class CacheKey + { + private final Artifact artifact; + private final long pomHash; + private final boolean resolveManagedVersions; + private final List<ArtifactRepository> repositories = new ArrayList<ArtifactRepository>(); + private final int hashCode; + + public CacheKey( Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + { + File file = artifact.getFile(); + this.artifact = ArtifactUtils.copyArtifact( artifact ); + if ( "pom".equals( artifact.getType() ) && file != null ) + { + pomHash = file.getPath().hashCode() + file.lastModified(); + } + else + { + pomHash = 0; + } + this.resolveManagedVersions = resolveManagedVersions; + this.repositories.add( localRepository ); + this.repositories.addAll( remoteRepositories ); + + int hash = 17; + hash = hash * 31 + artifactHashCode( artifact ); + hash = hash * 31 + ( resolveManagedVersions ? 1 : 2 ); + hash = hash * 31 + repositoriesHashCode( repositories ); + this.hashCode = hash; + } + + @Override + public int hashCode() + { + return hashCode; + } + + @Override + public boolean equals( Object o ) + { + if ( o == this ) + { + return true; + } + + if ( !( o instanceof CacheKey ) ) + { + return false; + } + + CacheKey other = (CacheKey) o; + + return pomHash == other.pomHash && artifactEquals( artifact, other.artifact ) + && resolveManagedVersions == other.resolveManagedVersions + && repositoriesEquals( repositories, other.repositories ); + } + } + + private static int artifactHashCode( Artifact a ) + { + int result = 17; + result = 31 * result + a.getGroupId().hashCode(); + result = 31 * result + a.getArtifactId().hashCode(); + result = 31 * result + a.getType().hashCode(); + if ( a.getVersion() != null ) + { + result = 31 * result + a.getVersion().hashCode(); + } + result = 31 * result + ( a.getClassifier() != null ? a.getClassifier().hashCode() : 0 ); + result = 31 * result + ( a.getScope() != null ? a.getScope().hashCode() : 0 ); + result = 31 * result + ( a.getDependencyFilter() != null ? a.getDependencyFilter().hashCode() : 0 ); + result = 31 * result + ( a.isOptional() ? 1 : 0 ); + return result; + } + + private static boolean artifactEquals( Artifact a1, Artifact a2 ) + { + if ( a1 == a2 ) + { + return true; + } + + return eq( a1.getGroupId(), a2.getGroupId() ) + && eq( a1.getArtifactId(), a2.getArtifactId() ) + && eq( a1.getType(), a2.getType() ) + && eq( a1.getVersion(), a2.getVersion() ) + && eq( a1.getClassifier(), a2.getClassifier() ) + && eq( a1.getScope(), a2.getScope() ) + && eq( a1.getDependencyFilter(), a2.getDependencyFilter() ) + && a1.isOptional() == a2.isOptional(); + } + + private static int repositoryHashCode( ArtifactRepository repository ) + { + int result = 17; + result = 31 * result + ( repository.getId() != null ? repository.getId().hashCode() : 0 ); + return result; + } + + private static int repositoriesHashCode( List<ArtifactRepository> repositories ) + { + int result = 17; + for ( ArtifactRepository repository : repositories ) + { + result = 31 * result + repositoryHashCode( repository ); + } + return result; + } + + private static boolean repositoryEquals( ArtifactRepository r1, ArtifactRepository r2 ) + { + if ( r1 == r2 ) + { + return true; + } + + return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() ) + && repositoryPolicyEquals( r1.getReleases(), r2.getReleases() ) + && repositoryPolicyEquals( r1.getSnapshots(), r2.getSnapshots() ); + } + + private static boolean repositoryPolicyEquals( ArtifactRepositoryPolicy p1, ArtifactRepositoryPolicy p2 ) + { + if ( p1 == p2 ) + { + return true; + } + + return p1.isEnabled() == p2.isEnabled() && eq( p1.getUpdatePolicy(), p2.getUpdatePolicy() ); + } + + private static boolean repositoriesEquals( List<ArtifactRepository> r1, List<ArtifactRepository> r2 ) + { + if ( r1.size() != r2.size() ) + { + return false; + } + + for ( Iterator<ArtifactRepository> it1 = r1.iterator(), it2 = r2.iterator(); it1.hasNext(); ) + { + if ( !repositoryEquals( it1.next(), it2.next() ) ) + { + return false; + } + } + + return true; + } + + private static <T> boolean eq( T s1, T s2 ) + { + return s1 != null ? s1.equals( s2 ) : s2 == null; + } + + public class CacheRecord + { + private Artifact pomArtifact; + private Artifact relocatedArtifact; + private List<Artifact> artifacts; + private Map<String, Artifact> managedVersions; + private List<ArtifactRepository> remoteRepositories; + + private long length; + private long timestamp; + + CacheRecord( Artifact pomArtifact, Artifact relocatedArtifact, Set<Artifact> artifacts, + Map<String, Artifact> managedVersions, List<ArtifactRepository> remoteRepositories ) + { + this.pomArtifact = ArtifactUtils.copyArtifact( pomArtifact ); + this.relocatedArtifact = ArtifactUtils.copyArtifactSafe( relocatedArtifact ); + this.artifacts = ArtifactUtils.copyArtifacts( artifacts, new ArrayList<Artifact>() ); + this.remoteRepositories = new ArrayList<ArtifactRepository>( remoteRepositories ); + + this.managedVersions = managedVersions; + if ( managedVersions != null ) + { + this.managedVersions = + ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<String, Artifact>() ); + } + + File pomFile = pomArtifact.getFile(); + if ( pomFile != null && pomFile.canRead() ) + { + this.length = pomFile.length(); + this.timestamp = pomFile.lastModified(); + } + else + { + this.length = -1; + this.timestamp = -1; + } + } + + public Artifact getArtifact() + { + return pomArtifact; + } + + public Artifact getRelocatedArtifact() + { + return relocatedArtifact; + } + + public List<Artifact> getArtifacts() + { + return artifacts; + } + + public Map<String, Artifact> getManagedVersions() + { + return managedVersions; + } + + public List<ArtifactRepository> getRemoteRepositories() + { + return remoteRepositories; + } + + public boolean isStale() + { + File pomFile = pomArtifact.getFile(); + if ( pomFile != null ) + { + if ( pomFile.canRead() ) + { + return length != pomFile.length() || timestamp != pomFile.lastModified(); + } + else + { + // if the POM didn't exist, retry if any repo is configured to always update + boolean snapshot = pomArtifact.isSnapshot(); + for ( ArtifactRepository repository : remoteRepositories ) + { + ArtifactRepositoryPolicy policy = + snapshot ? repository.getSnapshots() : repository.getReleases(); + if ( ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( policy.getUpdatePolicy() ) ) + { + return true; + } + } + } + } + + return length != -1 || timestamp != -1; + } + } + + + public ResolutionGroup get( Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + { + CacheKey cacheKey = newCacheKey( artifact, resolveManagedVersions, localRepository, remoteRepositories ); + + CacheRecord cacheRecord = cache.get( cacheKey ); + + if ( cacheRecord != null && !cacheRecord.isStale() ) + { + Artifact pomArtifact = ArtifactUtils.copyArtifact( cacheRecord.getArtifact() ); + Artifact relocatedArtifact = ArtifactUtils.copyArtifactSafe( cacheRecord.getRelocatedArtifact() ); + Set<Artifact> artifacts = + ArtifactUtils.copyArtifacts( cacheRecord.getArtifacts(), new LinkedHashSet<Artifact>() ); + Map<String, Artifact> managedVersions = cacheRecord.getManagedVersions(); + if ( managedVersions != null ) + { + managedVersions = ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<String, Artifact>() ); + } + return new ResolutionGroup( pomArtifact, relocatedArtifact, artifacts, managedVersions, + cacheRecord.getRemoteRepositories() ); + } + + cache.remove( cacheKey ); + + return null; + } + + public void put( Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, ResolutionGroup result ) + { + put( newCacheKey( artifact, resolveManagedVersions, localRepository, remoteRepositories ), result ); + } + + protected CacheKey newCacheKey( Artifact artifact, boolean resolveManagedVersions, + ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories ) + { + return new CacheKey( artifact, resolveManagedVersions, localRepository, remoteRepositories ); + } + + protected void put( CacheKey cacheKey, ResolutionGroup result ) + { + CacheRecord cacheRecord = + new CacheRecord( result.getPomArtifact(), result.getRelocatedArtifact(), result.getArtifacts(), + result.getManagedVersions(), result.getResolutionRepositories() ); + + cache.put( cacheKey, cacheRecord ); + } + + public void flush() + { + cache.clear(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMetadataSource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMetadataSource.java new file mode 100644 index 00000000..91f665b5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/DefaultMetadataSource.java @@ -0,0 +1,37 @@ +package org.apache.maven.project.artifact; + +/* + * 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.metadata.ArtifactMetadataSource; +import org.codehaus.plexus.component.annotations.Component; + +/** + * This realizes the metadata source via the default hint to provide backward-compat with Maven 2.x whose Plexus version + * registered component descriptors twice: once keyed by role+roleHint and once keyed by role only. This effectively + * made the metadata source available with its original role hint ("maven") as well as the default hint. + * + * @author Benjamin Bentmann + */ +@Component( role = ArtifactMetadataSource.class ) +public class DefaultMetadataSource + extends MavenMetadataSource +{ + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/InvalidDependencyVersionException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/InvalidDependencyVersionException.java new file mode 100644 index 00000000..8a1de685 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/InvalidDependencyVersionException.java @@ -0,0 +1,55 @@ +package org.apache.maven.project.artifact; + +/* + * 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.File; + +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.model.Dependency; +import org.apache.maven.project.InvalidProjectVersionException; + +/** + * Thrown if a dependency has an invalid version. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class InvalidDependencyVersionException + extends InvalidProjectVersionException +{ + private Dependency dependency; + + public InvalidDependencyVersionException( String projectId, Dependency dependency, File pomFile, + InvalidVersionSpecificationException cause ) + { + super( projectId, formatLocationInPom( dependency ), dependency.getVersion(), pomFile, cause ); + this.dependency = dependency; + } + + private static String formatLocationInPom( Dependency dependency ) + { + return "Dependency: " + ArtifactUtils.versionlessKey( dependency.getGroupId(), dependency.getArtifactId() ); + } + + public Dependency getDependency() + { + return dependency; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataCache.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataCache.java new file mode 100644 index 00000000..036ee86c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataCache.java @@ -0,0 +1,38 @@ +package org.apache.maven.project.artifact; + +/* + * 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.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.metadata.ResolutionGroup; + +public interface MavenMetadataCache +{ + + ResolutionGroup get( Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ); + + void put( Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, ResolutionGroup result ); + + void flush(); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java new file mode 100644 index 00000000..1fb5c545 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java @@ -0,0 +1,770 @@ +package org.apache.maven.project.artifact; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.artifact.metadata.ResolutionGroup; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; +import org.apache.maven.artifact.repository.metadata.Metadata; +import org.apache.maven.artifact.repository.metadata.RepositoryMetadata; +import org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager; +import org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException; +import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; +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.DependencyManagement; +import org.apache.maven.model.DistributionManagement; +import org.apache.maven.model.Exclusion; +import org.apache.maven.model.Relocation; +import org.apache.maven.model.building.ModelBuildingException; +import org.apache.maven.model.building.ModelBuildingRequest; +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.model.resolution.UnresolvableModelException; +import org.apache.maven.plugin.LegacySupport; +import org.apache.maven.project.DefaultProjectBuildingRequest; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuilder; +import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.properties.internal.EnvironmentUtils; +import org.apache.maven.properties.internal.SystemProperties; +import org.apache.maven.repository.legacy.metadata.DefaultMetadataResolutionRequest; +import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.logging.Logger; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RepositoryPolicy; +import org.eclipse.aether.transfer.ArtifactNotFoundException; + +/** + * @author Jason van Zyl + */ +@Component( role = ArtifactMetadataSource.class, hint = "maven" ) +public class MavenMetadataSource + implements ArtifactMetadataSource +{ + @Requirement + private RepositoryMetadataManager repositoryMetadataManager; + + @Requirement + private ArtifactFactory repositorySystem; + + //TODO: This prevents a cycle in the composition which shows us another problem we need to deal with. + //@Requirement + private ProjectBuilder projectBuilder; + + @Requirement + private PlexusContainer container; + + @Requirement + private Logger logger; + + @Requirement + private MavenMetadataCache cache; + + @Requirement + private LegacySupport legacySupport; + + private void injectSession( MetadataResolutionRequest request ) + { + RepositorySystemSession session = legacySupport.getRepositorySession(); + + if ( session != null ) + { + request.setOffline( session.isOffline() ); + request.setForceUpdate( RepositoryPolicy.UPDATE_POLICY_ALWAYS.equals( session.getUpdatePolicy() ) ); + } + } + + public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + throws ArtifactMetadataRetrievalException + { + return retrieve( artifact, localRepository, remoteRepositories, false ); + } + + public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories, boolean resolveManagedVersions ) + throws ArtifactMetadataRetrievalException + { + MetadataResolutionRequest request = new DefaultMetadataResolutionRequest(); + injectSession( request ); + request.setArtifact( artifact ); + request.setLocalRepository( localRepository ); + request.setRemoteRepositories( remoteRepositories ); + request.setResolveManagedVersions( resolveManagedVersions ); + return retrieve( request ); + } + + public ResolutionGroup retrieve( MetadataResolutionRequest request ) + throws ArtifactMetadataRetrievalException + { + Artifact artifact = request.getArtifact(); + + // + // If we have a system scoped artifact then we do not want any searching in local or remote repositories + // and we want artifact resolution to only return the system scoped artifact itself. + // + if ( artifact.getScope() != null && artifact.getScope().equals( Artifact.SCOPE_SYSTEM ) ) + { + return new ResolutionGroup( null, null, null ); + } + + ResolutionGroup cached = + cache.get( artifact, request.isResolveManagedVersions(), request.getLocalRepository(), + request.getRemoteRepositories() ); + + if ( cached != null + // if the POM has no file, we cached a missing artifact, only return the cached data if no update forced + && ( !request.isForceUpdate() || hasFile( cached.getPomArtifact() ) ) ) + { + return cached; + } + + List<Dependency> dependencies; + + List<Dependency> managedDependencies = null; + + List<ArtifactRepository> pomRepositories = null; + + Artifact pomArtifact; + + Artifact relocatedArtifact = null; + + //TODO: Not even sure this is really required as the project will be cached in the builder, we'll see this + // is currently the biggest hotspot + if ( artifact instanceof ArtifactWithDependencies ) + { + pomArtifact = artifact; + + dependencies = ( (ArtifactWithDependencies) artifact ).getDependencies(); + + managedDependencies = ( (ArtifactWithDependencies) artifact ).getManagedDependencies(); + } + else + { + ProjectRelocation rel = retrieveRelocatedProject( artifact, request ); + + if ( rel == null ) + { + return null; + } + + pomArtifact = rel.pomArtifact; + + relocatedArtifact = rel.relocatedArtifact; + + if ( rel.project == null ) + { + // When this happens we have a Maven 1.x POM, or some invalid POM. + // It should have never found its way into Maven 2.x repository but it did. + dependencies = Collections.emptyList(); + } + else + { + dependencies = rel.project.getDependencies(); + + DependencyManagement depMngt = rel.project.getDependencyManagement(); + managedDependencies = ( depMngt != null ) ? depMngt.getDependencies() : null; + + pomRepositories = rel.project.getRemoteArtifactRepositories(); + } + } + + Set<Artifact> artifacts = Collections.<Artifact>emptySet(); + + if ( !artifact.getArtifactHandler().isIncludesDependencies() ) + { + artifacts = new LinkedHashSet<Artifact>(); + + for ( Dependency dependency : dependencies ) + { + Artifact dependencyArtifact = createDependencyArtifact( dependency, artifact, pomArtifact ); + + if ( dependencyArtifact != null ) + { + artifacts.add( dependencyArtifact ); + } + } + } + + Map<String, Artifact> managedVersions = null; + + if ( managedDependencies != null && request.isResolveManagedVersions() ) + { + managedVersions = new HashMap<String, Artifact>(); + + for ( Dependency managedDependency : managedDependencies ) + { + Artifact managedArtifact = createDependencyArtifact( managedDependency, null, pomArtifact ); + + managedVersions.put( managedDependency.getManagementKey(), managedArtifact ); + } + } + + List<ArtifactRepository> aggregatedRepositories = + aggregateRepositories( request.getRemoteRepositories(), pomRepositories ); + + ResolutionGroup result = + new ResolutionGroup( pomArtifact, relocatedArtifact, artifacts, managedVersions, aggregatedRepositories ); + + cache.put( artifact, request.isResolveManagedVersions(), request.getLocalRepository(), + request.getRemoteRepositories(), result ); + + return result; + } + + private boolean hasFile( Artifact artifact ) + { + return artifact != null && artifact.getFile() != null && artifact.getFile().exists(); + } + + private List<ArtifactRepository> aggregateRepositories( List<ArtifactRepository> requestRepositories, + List<ArtifactRepository> pomRepositories ) + { + List<ArtifactRepository> repositories = requestRepositories; + + if ( pomRepositories != null && !pomRepositories.isEmpty() ) + { + Map<String, ArtifactRepository> repos = new LinkedHashMap<String, ArtifactRepository>(); + + for ( ArtifactRepository repo : requestRepositories ) + { + if ( !repos.containsKey( repo.getId() ) ) + { + repos.put( repo.getId(), repo ); + } + } + + for ( ArtifactRepository repo : pomRepositories ) + { + if ( !repos.containsKey( repo.getId() ) ) + { + repos.put( repo.getId(), repo ); + } + } + + repositories = new ArrayList<ArtifactRepository>( repos.values() ); + } + + return repositories; + } + + private Artifact createDependencyArtifact( Dependency dependency, Artifact owner, Artifact pom ) + throws ArtifactMetadataRetrievalException + { + try + { + String inheritedScope = ( owner != null ) ? owner.getScope() : null; + + ArtifactFilter inheritedFilter = ( owner != null ) ? owner.getDependencyFilter() : null; + + return createDependencyArtifact( repositorySystem, dependency, inheritedScope, inheritedFilter ); + } + catch ( InvalidVersionSpecificationException e ) + { + throw new ArtifactMetadataRetrievalException( "Invalid version for dependency " + + dependency.getManagementKey() + ": " + e.getMessage(), e, pom ); + } + } + + private static Artifact createDependencyArtifact( ArtifactFactory factory, Dependency dependency, + String inheritedScope, ArtifactFilter inheritedFilter ) + throws InvalidVersionSpecificationException + { + String effectiveScope = getEffectiveScope( dependency.getScope(), inheritedScope ); + + if ( effectiveScope == null ) + { + return null; + } + + VersionRange versionRange = VersionRange.createFromVersionSpec( dependency.getVersion() ); + + Artifact dependencyArtifact = + factory.createDependencyArtifact( dependency.getGroupId(), dependency.getArtifactId(), versionRange, + dependency.getType(), dependency.getClassifier(), effectiveScope, + dependency.isOptional() ); + + ArtifactFilter dependencyFilter = inheritedFilter; + + if ( dependencyFilter != null && !dependencyFilter.include( dependencyArtifact ) ) + { + return null; + } + + if ( Artifact.SCOPE_SYSTEM.equals( effectiveScope ) ) + { + dependencyArtifact.setFile( new File( dependency.getSystemPath() ) ); + } + + dependencyArtifact.setDependencyFilter( createDependencyFilter( dependency, dependencyFilter ) ); + + return dependencyArtifact; + } + + private static String getEffectiveScope( String originalScope, String inheritedScope ) + { + String effectiveScope = Artifact.SCOPE_RUNTIME; + + if ( originalScope == null ) + { + originalScope = Artifact.SCOPE_COMPILE; + } + + if ( inheritedScope == null ) + { + // direct dependency retains its scope + effectiveScope = originalScope; + } + else if ( Artifact.SCOPE_TEST.equals( originalScope ) || Artifact.SCOPE_PROVIDED.equals( originalScope ) ) + { + // test and provided are not transitive, so exclude them + effectiveScope = null; + } + else if ( Artifact.SCOPE_SYSTEM.equals( originalScope ) ) + { + // system scope come through unchanged... + effectiveScope = Artifact.SCOPE_SYSTEM; + } + else if ( Artifact.SCOPE_COMPILE.equals( originalScope ) && Artifact.SCOPE_COMPILE.equals( inheritedScope ) ) + { + // added to retain compile scope. Remove if you want compile inherited as runtime + effectiveScope = Artifact.SCOPE_COMPILE; + } + else if ( Artifact.SCOPE_TEST.equals( inheritedScope ) ) + { + effectiveScope = Artifact.SCOPE_TEST; + } + else if ( Artifact.SCOPE_PROVIDED.equals( inheritedScope ) ) + { + effectiveScope = Artifact.SCOPE_PROVIDED; + } + + return effectiveScope; + } + + private static ArtifactFilter createDependencyFilter( Dependency dependency, ArtifactFilter inheritedFilter ) + { + ArtifactFilter effectiveFilter = inheritedFilter; + + if ( !dependency.getExclusions().isEmpty() ) + { + List<String> exclusions = new ArrayList<String>(); + + for ( Exclusion e : dependency.getExclusions() ) + { + exclusions.add( e.getGroupId() + ':' + e.getArtifactId() ); + } + + effectiveFilter = new ExcludesArtifactFilter( exclusions ); + + if ( inheritedFilter != null ) + { + effectiveFilter = new AndArtifactFilter( Arrays.asList( inheritedFilter, effectiveFilter ) ); + } + } + + return effectiveFilter; + } + + public List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + throws ArtifactMetadataRetrievalException + { + MetadataResolutionRequest request = new DefaultMetadataResolutionRequest(); + injectSession( request ); + request.setArtifact( artifact ); + request.setLocalRepository( localRepository ); + request.setRemoteRepositories( remoteRepositories ); + return retrieveAvailableVersions( request ); + } + + public List<ArtifactVersion> retrieveAvailableVersions( MetadataResolutionRequest request ) + throws ArtifactMetadataRetrievalException + { + RepositoryMetadata metadata = new ArtifactRepositoryMetadata( request.getArtifact() ); + + try + { + repositoryMetadataManager.resolve( metadata, request ); + } + catch ( RepositoryMetadataResolutionException e ) + { + throw new ArtifactMetadataRetrievalException( e.getMessage(), e, request.getArtifact() ); + } + + List<String> availableVersions = request.getLocalRepository().findVersions( request.getArtifact() ); + + return retrieveAvailableVersionsFromMetadata( metadata.getMetadata(), availableVersions ); + } + + public List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository( Artifact artifact, + ArtifactRepository localRepository, + ArtifactRepository deploymentRepository ) + throws ArtifactMetadataRetrievalException + { + RepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + + try + { + repositoryMetadataManager.resolveAlways( metadata, localRepository, deploymentRepository ); + } + catch ( RepositoryMetadataResolutionException e ) + { + throw new ArtifactMetadataRetrievalException( e.getMessage(), e, artifact ); + } + + List<String> availableVersions = localRepository.findVersions( artifact ); + + return retrieveAvailableVersionsFromMetadata( metadata.getMetadata(), availableVersions ); + } + + private List<ArtifactVersion> retrieveAvailableVersionsFromMetadata( Metadata repoMetadata, + List<String> availableVersions ) + { + Collection<String> versions = new LinkedHashSet<String>(); + + if ( ( repoMetadata != null ) && ( repoMetadata.getVersioning() != null ) ) + { + versions.addAll( repoMetadata.getVersioning().getVersions() ); + } + + versions.addAll( availableVersions ); + + List<ArtifactVersion> artifactVersions = new ArrayList<ArtifactVersion>( versions.size() ); + + for ( String version : versions ) + { + artifactVersions.add( new DefaultArtifactVersion( version ) ); + } + + return artifactVersions; + } + + // USED BY MAVEN ASSEMBLY PLUGIN + @Deprecated + public static Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, List<Dependency> dependencies, + String inheritedScope, ArtifactFilter dependencyFilter, + MavenProject project ) + throws InvalidDependencyVersionException + { + Set<Artifact> artifacts = new LinkedHashSet<Artifact>(); + + for ( Dependency d : dependencies ) + { + Artifact dependencyArtifact; + try + { + dependencyArtifact = createDependencyArtifact( artifactFactory, d, inheritedScope, dependencyFilter ); + } + catch ( InvalidVersionSpecificationException e ) + { + throw new InvalidDependencyVersionException( project.getId(), d, project.getFile(), e ); + } + + if ( dependencyArtifact != null ) + { + artifacts.add( dependencyArtifact ); + } + } + + return artifacts; + } + + private ProjectBuilder getProjectBuilder() + { + if ( projectBuilder != null ) + { + return projectBuilder; + } + + try + { + projectBuilder = container.lookup( ProjectBuilder.class ); + } + catch ( ComponentLookupException e ) + { + // Won't happen + } + + return projectBuilder; + } + + private ProjectRelocation retrieveRelocatedProject( Artifact artifact, MetadataResolutionRequest repositoryRequest ) + throws ArtifactMetadataRetrievalException + { + MavenProject project; + + Artifact pomArtifact; + Artifact relocatedArtifact = null; + boolean done = false; + do + { + project = null; + + pomArtifact = + repositorySystem.createProjectArtifact( artifact.getGroupId(), + artifact.getArtifactId(), + artifact.getVersion(), artifact.getScope() ); + + if ( "pom".equals( artifact.getType() ) ) + { + pomArtifact.setFile( artifact.getFile() ); + } + + if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) + { + done = true; + } + else + { + try + { + ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); + configuration.setLocalRepository( repositoryRequest.getLocalRepository() ); + configuration.setRemoteRepositories( repositoryRequest.getRemoteRepositories() ); + configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL ); + configuration.setProcessPlugins( false ); + configuration.setRepositoryMerging( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT ); + configuration.setSystemProperties( getSystemProperties() ); + configuration.setRepositorySession( legacySupport.getRepositorySession() ); + + project = getProjectBuilder().build( pomArtifact, configuration ).getProject(); + } + catch ( ProjectBuildingException e ) + { + ModelProblem missingParentPom = hasMissingParentPom( e ); + if ( missingParentPom != null ) + { + throw new ArtifactMetadataRetrievalException( "Failed to process POM for " + + artifact.getId() + ": " + missingParentPom.getMessage(), + missingParentPom.getException(), + artifact ); + } + + String message; + + if ( isMissingPom( e ) ) + { + message = "Missing POM for " + artifact.getId(); + } + else if ( isNonTransferrablePom( e ) ) + { + throw new ArtifactMetadataRetrievalException( "Failed to retrieve POM for " + + artifact.getId() + ": " + e.getCause().getMessage(), e.getCause(), + artifact ); + } + else + { + message = + "Invalid POM for " + artifact.getId() + + ", transitive dependencies (if any) will not be available" + + ", enable debug logging for more details"; + } + + if ( logger.isDebugEnabled() ) + { + message += ": " + e.getMessage(); + } + + logger.warn( message ); + } + + if ( project != null ) + { + Relocation relocation = null; + + DistributionManagement distMgmt = project.getDistributionManagement(); + if ( distMgmt != null ) + { + relocation = distMgmt.getRelocation(); + + artifact.setDownloadUrl( distMgmt.getDownloadUrl() ); + pomArtifact.setDownloadUrl( distMgmt.getDownloadUrl() ); + } + + if ( relocation != null ) + { + if ( relocation.getGroupId() != null ) + { + artifact.setGroupId( relocation.getGroupId() ); + relocatedArtifact = artifact; + project.setGroupId( relocation.getGroupId() ); + } + if ( relocation.getArtifactId() != null ) + { + artifact.setArtifactId( relocation.getArtifactId() ); + relocatedArtifact = artifact; + project.setArtifactId( relocation.getArtifactId() ); + } + if ( relocation.getVersion() != null ) + { + // note: see MNG-3454. This causes a problem, but fixing it may break more. + artifact.setVersionRange( VersionRange.createFromVersion( relocation.getVersion() ) ); + relocatedArtifact = artifact; + project.setVersion( relocation.getVersion() ); + } + + if ( artifact.getDependencyFilter() != null + && !artifact.getDependencyFilter().include( artifact ) ) + { + return null; + } + + // MNG-2861: the artifact data has changed. If the available versions where previously + // retrieved, we need to update it. + // TODO: shouldn't the versions be merged across relocations? + List<ArtifactVersion> available = artifact.getAvailableVersions(); + if ( available != null && !available.isEmpty() ) + { + MetadataResolutionRequest metadataRequest = + new DefaultMetadataResolutionRequest( repositoryRequest ); + metadataRequest.setArtifact( artifact ); + available = retrieveAvailableVersions( metadataRequest ); + artifact.setAvailableVersions( available ); + } + + String message = + "\n This artifact has been relocated to " + artifact.getGroupId() + ":" + + artifact.getArtifactId() + ":" + artifact.getVersion() + ".\n"; + + if ( relocation.getMessage() != null ) + { + message += " " + relocation.getMessage() + "\n"; + } + + if ( artifact.getDependencyTrail() != null && artifact.getDependencyTrail().size() == 1 ) + { + logger.warn( "While downloading " + pomArtifact.getGroupId() + ":" + + pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" ); + } + else + { + logger.debug( "While downloading " + pomArtifact.getGroupId() + ":" + + pomArtifact.getArtifactId() + ":" + pomArtifact.getVersion() + message + "\n" ); + } + } + else + { + done = true; + } + } + else + { + done = true; + } + } + } + while ( !done ); + + ProjectRelocation rel = new ProjectRelocation(); + rel.project = project; + rel.pomArtifact = pomArtifact; + rel.relocatedArtifact = relocatedArtifact; + + return rel; + } + + private ModelProblem hasMissingParentPom( ProjectBuildingException e ) + { + if ( e.getCause() instanceof ModelBuildingException ) + { + ModelBuildingException mbe = (ModelBuildingException) e.getCause(); + for ( ModelProblem problem : mbe.getProblems() ) + { + if ( problem.getException() instanceof UnresolvableModelException ) + { + return problem; + } + } + + } + return null; + } + + private boolean isMissingPom( Exception e ) + { + if ( e.getCause() instanceof MultipleArtifactsNotFoundException ) + { + return true; + } + return e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException + && e.getCause().getCause() instanceof ArtifactNotFoundException; + } + + private boolean isNonTransferrablePom( Exception e ) + { + if ( e.getCause() instanceof ArtifactResolutionException ) + { + return true; + } + return e.getCause() instanceof org.eclipse.aether.resolution.ArtifactResolutionException + && !( e.getCause().getCause() instanceof ArtifactNotFoundException ); + } + + private Properties getSystemProperties() + { + Properties props = new Properties(); + + EnvironmentUtils.addEnvVars( props ); + + SystemProperties.addSystemProperties( props ); + + return props; + } + + private static final class ProjectRelocation + { + private MavenProject project; + + private Artifact pomArtifact; + + private Artifact relocatedArtifact; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/PluginArtifact.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/PluginArtifact.java new file mode 100644 index 00000000..d348d59c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/PluginArtifact.java @@ -0,0 +1,94 @@ +package org.apache.maven.project.artifact; + +/* + * 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.Collections; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Plugin; + +public class PluginArtifact + extends DefaultArtifact + implements ArtifactWithDependencies +{ + private Plugin plugin; + + public PluginArtifact( Plugin plugin, Artifact pluginArtifact ) + { + super( plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(), null, "maven-plugin", null, + new PluginArtifactHandler() ); + this.plugin = plugin; + setFile( pluginArtifact.getFile() ); + setResolved( true ); + } + + public List<Dependency> getDependencies() + { + return plugin.getDependencies(); + } + + public List<Dependency> getManagedDependencies() + { + return Collections.emptyList(); + } + + static class PluginArtifactHandler + implements ArtifactHandler + { + public String getClassifier() + { + return null; + } + + public String getDirectory() + { + return null; + } + + public String getExtension() + { + return "jar"; + } + + public String getLanguage() + { + return "none"; + } + + public String getPackaging() + { + return "maven-plugin"; + } + + public boolean isAddedToClasspath() + { + return true; + } + + public boolean isIncludesDependencies() + { + return false; + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java new file mode 100644 index 00000000..1d4a2a31 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifact.java @@ -0,0 +1,100 @@ +package org.apache.maven.project.artifact; + +/* + * 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.Collections; +import java.util.List; + +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.DependencyManagement; +import org.apache.maven.project.MavenProject; + +public class ProjectArtifact + extends DefaultArtifact + implements ArtifactWithDependencies +{ + private MavenProject project; + + public ProjectArtifact( MavenProject project ) + { + super( project.getGroupId(), project.getArtifactId(), project.getVersion(), null, "pom", null, + new PomArtifactHandler() ); + this.project = project; + setFile( project.getFile() ); + setResolved( true ); + } + + public MavenProject getProject() + { + return project; + } + + public List<Dependency> getDependencies() + { + return project.getDependencies(); + } + + public List<Dependency> getManagedDependencies() + { + DependencyManagement depMngt = project.getDependencyManagement(); + return ( depMngt != null ) ? depMngt.getDependencies() : Collections.<Dependency>emptyList(); + } + + static class PomArtifactHandler + implements ArtifactHandler + { + public String getClassifier() + { + return null; + } + + public String getDirectory() + { + return null; + } + + public String getExtension() + { + return "pom"; + } + + public String getLanguage() + { + return "none"; + } + + public String getPackaging() + { + return "pom"; + } + + public boolean isAddedToClasspath() + { + return false; + } + + public boolean isIncludesDependencies() + { + return false; + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java new file mode 100644 index 00000000..7ea99bf0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java @@ -0,0 +1,130 @@ +package org.apache.maven.project.artifact; + +/* + * 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.File; +import java.io.IOException; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.metadata.AbstractArtifactMetadata; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException; +import org.codehaus.plexus.util.FileUtils; + +/** + * Attach a POM to an artifact. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class ProjectArtifactMetadata + extends AbstractArtifactMetadata +{ + private final File file; + + public ProjectArtifactMetadata( Artifact artifact ) + { + this( artifact, null ); + } + + public ProjectArtifactMetadata( Artifact artifact, File file ) + { + super( artifact ); + this.file = file; + } + + public File getFile() + { + return file; + } + + public String getRemoteFilename() + { + return getFilename(); + } + + public String getLocalFilename( ArtifactRepository repository ) + { + return getFilename(); + } + + private String getFilename() + { + return getArtifactId() + "-" + artifact.getVersion() + ".pom"; + } + + public void storeInLocalRepository( ArtifactRepository localRepository, ArtifactRepository remoteRepository ) + throws RepositoryMetadataStoreException + { + File destination = + new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( this, + remoteRepository ) ); + + // ---------------------------------------------------------------------------- + // I'm fully aware that the file could just be moved using File.rename but + // there are bugs in various JVM that have problems doing this across + // different filesystem. So we'll incur the small hit to actually copy + // here and be safe. jvz. + // ---------------------------------------------------------------------------- + + try + { + FileUtils.copyFile( file, destination ); + } + catch ( IOException e ) + { + throw new RepositoryMetadataStoreException( "Error copying POM to the local repository.", e ); + } + } + + public String toString() + { + return "project information for " + artifact.getArtifactId() + " " + artifact.getVersion(); + } + + public boolean storedInArtifactVersionDirectory() + { + return true; + } + + public String getBaseVersion() + { + return artifact.getBaseVersion(); + } + + public Object getKey() + { + return "project " + artifact.getGroupId() + ":" + artifact.getArtifactId(); + } + + public void merge( ArtifactMetadata metadata ) + { + ProjectArtifactMetadata m = (ProjectArtifactMetadata) metadata; + if ( !m.file.equals( file ) ) + { + throw new IllegalStateException( "Cannot add two different pieces of metadata for: " + getKey() ); + } + } + + public void merge( org.apache.maven.repository.legacy.metadata.ArtifactMetadata metadata ) + { + this.merge( (ArtifactMetadata) metadata ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/path/PathTranslator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/path/PathTranslator.java new file mode 100644 index 00000000..18e349ac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/project/path/PathTranslator.java @@ -0,0 +1,41 @@ +package org.apache.maven.project.path; + +/* + * 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.File; + +import org.apache.maven.model.Model; + +/** + * @author Jason van Zyl + */ +@Deprecated +public interface PathTranslator +{ + String ROLE = PathTranslator.class.getName(); + + void alignToBaseDirectory( Model model, File basedir ); + + String alignToBaseDirectory( String path, File basedir ); + + void unalignFromBaseDirectory( Model model, File basedir ); + + String unalignFromBaseDirectory( String directory, File basedir ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/properties/internal/EnvironmentUtils.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/properties/internal/EnvironmentUtils.java new file mode 100644 index 00000000..2c3196fb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/properties/internal/EnvironmentUtils.java @@ -0,0 +1,70 @@ +package org.apache.maven.properties.internal; + +/* + * 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.Locale; +import java.util.Map; +import java.util.Properties; + +import org.codehaus.plexus.util.Os; + +/** + * Assists the project builder. <strong>Warning:</strong> This is an internal utility class that is only public for + * technical reasons, it is not part of the public API. In particular, this class can be changed or deleted without + * prior notice. + * + * @since 3.0 + * @author Benjamin Bentmann + */ +public class EnvironmentUtils +{ + + private static Properties envVars; + + /** + * Adds the environment variables in the form of properties whose keys are prefixed with {@code env.}, e.g. {@code + * env.PATH}. Unlike native environment variables, properties are always case-sensitive. For the sake of + * determinism, the environment variable names will be normalized to upper case on platforms with case-insensitive + * variable lookup. + * + * @param props The properties to add the environment variables to, may be {@code null}. + */ + public static void addEnvVars( Properties props ) + { + if ( props != null ) + { + if ( envVars == null ) + { + Properties tmp = new Properties(); + boolean caseSensitive = !Os.isFamily( Os.FAMILY_WINDOWS ); + for ( Map.Entry<String, String> entry : System.getenv().entrySet() ) + { + String key = + "env." + ( caseSensitive ? entry.getKey() : entry.getKey().toUpperCase( Locale.ENGLISH ) ); + tmp.setProperty( key, entry.getValue() ); + } + envVars = tmp; + } + + props.putAll( envVars ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java new file mode 100644 index 00000000..608df2dc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/properties/internal/SystemProperties.java @@ -0,0 +1,51 @@ +package org.apache.maven.properties.internal; + +/* + * 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.Properties; + +/** + * @since 3.2.3 + */ +public class SystemProperties +{ + /** + * Thread-safe System.properties copy implementation. + * + * @see http://jira.codehaus.org/browse/MNG-5670 + */ + public static void addSystemProperties( Properties props ) + { + for ( String key : System.getProperties().stringPropertyNames() ) + { + props.put( key, System.getProperty( key ) ); + } + } + + /** + * Returns System.properties copy. + */ + public static Properties getSystemProperties() + { + Properties systemProperties = new Properties(); + addSystemProperties( systemProperties ); + return systemProperties; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactDoesNotExistException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactDoesNotExistException.java new file mode 100644 index 00000000..296f4ea5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactDoesNotExistException.java @@ -0,0 +1,34 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +public class ArtifactDoesNotExistException + extends Exception +{ + public ArtifactDoesNotExistException( final String message ) + { + super( message ); + } + + public ArtifactDoesNotExistException( final String message, final Throwable cause ) + { + super( message, cause ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java new file mode 100644 index 00000000..80189e7b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java @@ -0,0 +1,343 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +import java.io.File; +import java.util.EventObject; + +/** + * TransferEvent is used to notify TransferListeners about progress + * in transfer of resources form/to the repository + * + * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a> + */ +public class ArtifactTransferEvent + extends EventObject +{ + /** + * A transfer was attempted, but has not yet commenced. + */ + public static final int TRANSFER_INITIATED = 0; + + /** + * A transfer was started. + */ + public static final int TRANSFER_STARTED = 1; + + /** + * A transfer is completed. + */ + public static final int TRANSFER_COMPLETED = 2; + + /** + * A transfer is in progress. + */ + public static final int TRANSFER_PROGRESS = 3; + + /** + * An error occurred during transfer + */ + public static final int TRANSFER_ERROR = 4; + + /** + * Indicates GET transfer (from the repository) + */ + public static final int REQUEST_GET = 5; + + /** + * Indicates PUT transfer (to the repository) + */ + public static final int REQUEST_PUT = 6; + + private int eventType; + + private int requestType; + + private Exception exception; + + private File localFile; + + private ArtifactTransferResource artifact; + + private long transferredBytes; + + private byte[] dataBuffer; + + private int dataOffset; + + private int dataLength; + + public ArtifactTransferEvent( String wagon, final int eventType, final int requestType, + ArtifactTransferResource artifact ) + { + super( wagon ); + + setEventType( eventType ); + + setRequestType( requestType ); + + this.artifact = artifact; + } + + public ArtifactTransferEvent( String wagon, final Exception exception, final int requestType, + ArtifactTransferResource artifact ) + { + this( wagon, TRANSFER_ERROR, requestType, artifact ); + + this.exception = exception; + } + + public ArtifactTransferResource getResource() + { + return artifact; + } + + /** + * @return Returns the exception. + */ + public Exception getException() + { + return exception; + } + + /** + * Returns the request type. + * + * @return Returns the request type. The Request type is one of + * <code>TransferEvent.REQUEST_GET<code> or <code>TransferEvent.REQUEST_PUT<code> + */ + public int getRequestType() + { + return requestType; + } + + /** + * Sets the request type + * + * @param requestType The requestType to set. + * The Request type value should be either + * <code>TransferEvent.REQUEST_GET<code> or <code>TransferEvent.REQUEST_PUT<code>. + * @throws IllegalArgumentException when + */ + public void setRequestType( final int requestType ) + { + switch ( requestType ) + { + + case REQUEST_PUT: + break; + case REQUEST_GET: + break; + + default : + throw new IllegalArgumentException( "Illegal request type: " + requestType ); + } + + this.requestType = requestType; + } + + /** + * @return Returns the eventType. + */ + public int getEventType() + { + return eventType; + } + + /** + * @param eventType The eventType to set. + */ + public void setEventType( final int eventType ) + { + switch ( eventType ) + { + + case TRANSFER_INITIATED: + break; + case TRANSFER_STARTED: + break; + case TRANSFER_COMPLETED: + break; + case TRANSFER_PROGRESS: + break; + case TRANSFER_ERROR: + break; + default : + throw new IllegalArgumentException( "Illegal event type: " + eventType ); + } + + this.eventType = eventType; + } + + /** + * @return Returns the local file. + */ + public File getLocalFile() + { + return localFile; + } + + /** + * @param localFile The local file to set. + */ + public void setLocalFile( File localFile ) + { + this.localFile = localFile; + } + + public long getTransferredBytes() + { + return transferredBytes; + } + + public void setTransferredBytes( long transferredBytes ) + { + this.transferredBytes = transferredBytes; + } + + public byte[] getDataBuffer() + { + return dataBuffer; + } + + public void setDataBuffer( byte[] dataBuffer ) + { + this.dataBuffer = dataBuffer; + } + + public int getDataOffset() + { + return dataOffset; + } + + public void setDataOffset( int dataOffset ) + { + this.dataOffset = dataOffset; + } + + public int getDataLength() + { + return dataLength; + } + + public void setDataLength( int dataLength ) + { + this.dataLength = dataLength; + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + sb.append( "TransferEvent[" ); + + switch ( this.getRequestType() ) + { + case REQUEST_GET: + sb.append( "GET" ); + break; + case REQUEST_PUT: + sb.append( "PUT" ); + break; + default: + sb.append( this.getRequestType() ); + break; + } + + sb.append( "|" ); + switch ( this.getEventType() ) + { + case TRANSFER_COMPLETED: + sb.append( "COMPLETED" ); + break; + case TRANSFER_ERROR: + sb.append( "ERROR" ); + break; + case TRANSFER_INITIATED: + sb.append( "INITIATED" ); + break; + case TRANSFER_PROGRESS: + sb.append( "PROGRESS" ); + break; + case TRANSFER_STARTED: + sb.append( "STARTED" ); + break; + default: + sb.append( this.getEventType() ); + break; + } + + sb.append( "|" ); + sb.append( this.getLocalFile() ).append( "|" ); + sb.append( "]" ); + + return sb.toString(); + } + + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + eventType; + result = prime * result + ( ( exception == null ) ? 0 : exception.hashCode() ); + result = prime * result + ( ( localFile == null ) ? 0 : localFile.hashCode() ); + result = prime * result + requestType; + return result; + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + if ( ( obj == null ) || ( getClass() != obj.getClass() ) ) + { + return false; + } + final ArtifactTransferEvent other = (ArtifactTransferEvent) obj; + if ( eventType != other.eventType ) + { + return false; + } + if ( exception == null ) + { + if ( other.exception != null ) + { + return false; + } + } + else if ( !exception.getClass().equals( other.exception.getClass() ) ) + { + return false; + } + if ( requestType != other.requestType ) + { + return false; + } + else if ( !source.equals( other.source ) ) + { + return false; + } + return true; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferFailedException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferFailedException.java new file mode 100644 index 00000000..9315f4c7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferFailedException.java @@ -0,0 +1,35 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +public class ArtifactTransferFailedException + extends Exception +{ + public ArtifactTransferFailedException( final String message ) + { + super( message ); + } + + public ArtifactTransferFailedException( final String message, final Throwable cause ) + { + super( message, cause ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferListener.java new file mode 100644 index 00000000..72a56cf0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferListener.java @@ -0,0 +1,36 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +public interface ArtifactTransferListener +{ + boolean isShowChecksumEvents(); + + void setShowChecksumEvents( boolean showChecksumEvents ); + + void transferInitiated( ArtifactTransferEvent transferEvent ); + + void transferStarted( ArtifactTransferEvent transferEvent ); + + void transferProgress( ArtifactTransferEvent transferEvent ); + + void transferCompleted( ArtifactTransferEvent transferEvent ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferResource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferResource.java new file mode 100644 index 00000000..8ed081ff --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferResource.java @@ -0,0 +1,66 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Describes a resource being uploaded or downloaded by the repository system. + * + * @author Benjamin Bentmann + */ +public interface ArtifactTransferResource +{ + + /** + * The base URL of the repository, e.g. "http://repo1.maven.org/maven2/". Unless the URL is unknown, it will be + * terminated by a trailing slash. + * + * @return The base URL of the repository or an empty string if unknown, never {@code null}. + */ + String getRepositoryUrl(); + + /** + * The path of the artifact relative to the repository's base URL. + * + * @return The path of the artifact, never {@code null}. + */ + String getName(); + + /** + * Gets the full URL of the artifact. + * + * @return The full URL of the artifact, never {@code null}. + */ + String getUrl(); + + /** + * The size of the artifact in bytes. + * + * @return The of the artifact in bytes or a negative value if unknown. + */ + long getContentLength(); + + /** + * Gets the timestamp when the transfer of this artifact was started. + * + * @return The timestamp when the transfer of this artifact was started. + */ + long getTransferStartTime(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/DelegatingLocalArtifactRepository.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/DelegatingLocalArtifactRepository.java new file mode 100644 index 00000000..f47cb4b1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/DelegatingLocalArtifactRepository.java @@ -0,0 +1,195 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +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; + +/** + * Delegating local artifact repository chains the reactor, IDE workspace + * and user local repository. + */ +@Deprecated +public class DelegatingLocalArtifactRepository + extends MavenArtifactRepository +{ + private LocalArtifactRepository buildReactor; + + private LocalArtifactRepository ideWorkspace; + + private ArtifactRepository userLocalArtifactRepository; + + public DelegatingLocalArtifactRepository( ArtifactRepository artifactRepository ) + { + this.userLocalArtifactRepository = artifactRepository; + } + + public void setBuildReactor( LocalArtifactRepository localRepository ) + { + this.buildReactor = localRepository; + } + + public void setIdeWorkspace( LocalArtifactRepository localRepository ) + { + this.ideWorkspace = localRepository; + } + + public LocalArtifactRepository getIdeWorspace() + { + return ideWorkspace; + } + + @Override + public Artifact find( Artifact artifact ) + { + if ( !artifact.isRelease() && buildReactor != null ) + { + artifact = buildReactor.find( artifact ); + } + + if ( !artifact.isResolved() && ideWorkspace != null ) + { + artifact = ideWorkspace.find( artifact ); + } + + if ( !artifact.isResolved() ) + { + artifact = userLocalArtifactRepository.find( artifact ); + } + + return artifact; + } + + @Override + public List<String> findVersions( Artifact artifact ) + { + Collection<String> versions = new LinkedHashSet<String>(); + + if ( buildReactor != null ) + { + versions.addAll( buildReactor.findVersions( artifact ) ); + } + + if ( ideWorkspace != null ) + { + versions.addAll( ideWorkspace.findVersions( artifact ) ); + } + + versions.addAll( userLocalArtifactRepository.findVersions( artifact ) ); + + return Collections.unmodifiableList( new ArrayList<String>( versions ) ); + } + + public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository ) + { + return userLocalArtifactRepository.pathOfLocalRepositoryMetadata( metadata, repository ); + } + + public String getId() + { + return userLocalArtifactRepository.getId(); + } + + @Override + public String pathOf( Artifact artifact ) + { + return userLocalArtifactRepository.pathOf( artifact ); + } + + @Override + public String getBasedir() + { + return ( userLocalArtifactRepository != null ) ? userLocalArtifactRepository.getBasedir() : null; + } + + @Override + public ArtifactRepositoryLayout getLayout() + { + return userLocalArtifactRepository.getLayout(); + } + + @Override + public ArtifactRepositoryPolicy getReleases() + { + return userLocalArtifactRepository.getReleases(); + } + + @Override + public ArtifactRepositoryPolicy getSnapshots() + { + return userLocalArtifactRepository.getSnapshots(); + } + + @Override + public String getKey() + { + return userLocalArtifactRepository.getKey(); + } + + @Override + public String getUrl() + { + return userLocalArtifactRepository.getUrl(); + } + + @Override + public int hashCode() + { + int hash = 17; + hash = hash * 31 + ( buildReactor == null ? 0 : buildReactor.hashCode() ); + hash = hash * 31 + ( ideWorkspace == null ? 0 : ideWorkspace.hashCode() ); + hash = hash * 31 + ( userLocalArtifactRepository == null ? 0 : userLocalArtifactRepository.hashCode() ); + + return hash; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + if ( obj == null ) + { + return false; + } + if ( getClass() != obj.getClass() ) + { + return false; + } + + DelegatingLocalArtifactRepository other = (DelegatingLocalArtifactRepository) obj; + + return eq( buildReactor, other.buildReactor ) + && eq( ideWorkspace, other.ideWorkspace ) + && eq( userLocalArtifactRepository, other.userLocalArtifactRepository ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalArtifactRepository.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalArtifactRepository.java new file mode 100644 index 00000000..e33789e3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalArtifactRepository.java @@ -0,0 +1,33 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.MavenArtifactRepository; + +public abstract class LocalArtifactRepository + extends MavenArtifactRepository +{ + public static final String IDE_WORKSPACE = "ide-workspace"; + + public abstract Artifact find( Artifact artifact ); + + public abstract boolean hasLocalMetadata(); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalRepositoryNotAccessibleException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalRepositoryNotAccessibleException.java new file mode 100644 index 00000000..54e4ef4b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/LocalRepositoryNotAccessibleException.java @@ -0,0 +1,44 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.IOException; + +/** + * Signals a failure to store files within the local repository. + * + * @author Benjamin Bentmann + */ +public class LocalRepositoryNotAccessibleException + extends IOException +{ + + public LocalRepositoryNotAccessibleException( String message, Throwable cause ) + { + super( message ); + initCause( cause ); + } + + public LocalRepositoryNotAccessibleException( String message ) + { + super( message ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java new file mode 100644 index 00000000..fcc0f777 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java @@ -0,0 +1,164 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.File; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; +import org.apache.maven.artifact.resolver.ArtifactResolutionResult; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.Repository; +import org.apache.maven.settings.Mirror; +import org.apache.maven.settings.Server; +import org.eclipse.aether.RepositorySystemSession; + +/** + * @author Jason van Zyl + * @since 3.0-alpha + */ +public interface RepositorySystem +{ + String DEFAULT_LOCAL_REPO_ID = "local"; + + String userHome = System.getProperty( "user.home" ); + + File userMavenConfigurationHome = new File( userHome, ".m2" ); + + File defaultUserLocalRepository = new File( userMavenConfigurationHome, "repository" ); + + String DEFAULT_REMOTE_REPO_ID = "central"; + + String DEFAULT_REMOTE_REPO_URL = "https://repo.maven.apache.org/maven2"; + + Artifact createArtifact( String groupId, String artifactId, String version, String packaging ); + + Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type ); + + Artifact createProjectArtifact( String groupId, String artifactId, String version ); + + Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, + String classifier ); + + Artifact createPluginArtifact( Plugin plugin ); + + Artifact createDependencyArtifact( Dependency dependency ); + + ArtifactRepository buildArtifactRepository( Repository repository ) + throws InvalidRepositoryException; + + ArtifactRepository createDefaultRemoteRepository() + throws InvalidRepositoryException; + + ArtifactRepository createDefaultLocalRepository() + throws InvalidRepositoryException; + + ArtifactRepository createLocalRepository( File localRepository ) + throws InvalidRepositoryException; + + ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout, + ArtifactRepositoryPolicy snapshots, + ArtifactRepositoryPolicy releases ); + + /** + * Calculates the effective repositories for the given input repositories which are assumed to be already mirrored + * (if applicable). This process will essentially remove duplicate repositories by merging them into one equivalent + * repository. It is worth to point out that merging does not simply choose one of the input repositories and + * discards the others but actually combines their possibly different policies. + * + * @param repositories The original repositories, may be {@code null}. + * @return The effective repositories or {@code null} if the input was {@code null}. + */ + List<ArtifactRepository> getEffectiveRepositories( List<ArtifactRepository> repositories ); + + /** + * Determines the mirror for the specified repository. + * + * @param repository The repository to determine the mirror for, must not be {@code null}. + * @param mirrors The available mirrors, may be {@code null}. + * @return The mirror specification for the repository or {@code null} if no mirror matched. + */ + Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors ); + + /** + * Injects the mirroring information into the specified repositories. For each repository that is matched by a + * mirror, its URL and ID will be updated to match the values from the mirror specification. Repositories without a + * matching mirror will pass through unchanged. <em>Note:</em> This method must be called before + * {@link #injectAuthentication(List, List)} or the repositories will end up with the wrong credentials. + * + * @param repositories The repositories into which to inject the mirror information, may be {@code null}. + * @param mirrors The available mirrors, may be {@code null}. + */ + void injectMirror( List<ArtifactRepository> repositories, List<Mirror> mirrors ); + + /** + * Injects the proxy information into the specified repositories. For each repository that is matched by a proxy, + * its proxy data will be set accordingly. Repositories without a matching proxy will have their proxy cleared. + * <em>Note:</em> This method must be called after {@link #injectMirror(List, List)} or the repositories will end up + * with the wrong proxies. + * + * @param repositories The repositories into which to inject the proxy information, may be {@code null}. + * @param proxies The available proxies, may be {@code null}. + */ + void injectProxy( List<ArtifactRepository> repositories, List<org.apache.maven.settings.Proxy> proxies ); + + /** + * Injects the authentication information into the specified repositories. For each repository that is matched by a + * server, its credentials will be updated to match the values from the server specification. Repositories without a + * matching server will have their credentials cleared. <em>Note:</em> This method must be called after + * {@link #injectMirror(List, List)} or the repositories will end up with the wrong credentials. + * + * @param repositories The repositories into which to inject the authentication information, may be {@code null}. + * @param servers The available servers, may be {@code null}. + */ + void injectAuthentication( List<ArtifactRepository> repositories, List<Server> servers ); + + void injectMirror( RepositorySystemSession session, List<ArtifactRepository> repositories ); + + void injectProxy( RepositorySystemSession session, List<ArtifactRepository> repositories ); + + void injectAuthentication( RepositorySystemSession session, List<ArtifactRepository> repositories ); + + ArtifactResolutionResult resolve( ArtifactResolutionRequest request ); + + // Install + + // Deploy + + // Map types of artifacts + + // + // Raw file transfers + // + void publish( ArtifactRepository repository, File source, String remotePath, + ArtifactTransferListener transferListener ) + throws ArtifactTransferFailedException; + + void retrieve( ArtifactRepository repository, File destination, String remotePath, + ArtifactTransferListener transferListener ) + throws ArtifactTransferFailedException, ArtifactDoesNotExistException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java new file mode 100644 index 00000000..352e5bbb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java @@ -0,0 +1,65 @@ +package org.apache.maven.repository.legacy.metadata; + +/* + * 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.Artifact; + +/** + * Common elements of artifact metadata. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public abstract class AbstractArtifactMetadata + implements ArtifactMetadata +{ + protected Artifact artifact; + + protected AbstractArtifactMetadata( Artifact artifact ) + { + this.artifact = artifact; + } + + public boolean storedInGroupDirectory() + { + return false; + } + + public String getGroupId() + { + return artifact.getGroupId(); + } + + public String getArtifactId() + { + return artifact.getArtifactId(); + } + + public String extendedToString() + { + StringBuilder buffer = new StringBuilder(); + + buffer.append( "\nArtifact Metadata\n--------------------------" ); + buffer.append( "\nGroupId: " ).append( getGroupId() ); + buffer.append( "\nArtifactId: " ).append( getArtifactId() ); + buffer.append( "\nMetadata Type: " ).append( getClass().getName() ); + + return buffer.toString(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException.java new file mode 100644 index 00000000..67b4080b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataRetrievalException.java @@ -0,0 +1,68 @@ +package org.apache.maven.repository.legacy.metadata; + +/* + * 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.Artifact; + +/** + * Error while retrieving repository metadata from the repository. + * + * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> + */ +public class ArtifactMetadataRetrievalException + extends Exception +{ + private Artifact artifact; + + /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ + @Deprecated + public ArtifactMetadataRetrievalException( String message ) + { + this( message, null, null ); + } + + /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ + @Deprecated + public ArtifactMetadataRetrievalException( Throwable cause ) + { + this( null, cause, null ); + } + + /** @deprecated use {@link #ArtifactMetadataRetrievalException(String, Throwable, Artifact)} */ + @Deprecated + public ArtifactMetadataRetrievalException( String message, + Throwable cause ) + { + this( message, cause, null ); + } + + public ArtifactMetadataRetrievalException( String message, + Throwable cause, + Artifact artifact ) + { + super( message, cause ); + this.artifact = artifact; + } + + public Artifact getArtifact() + { + return artifact; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataSource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataSource.java new file mode 100644 index 00000000..aaa0ee34 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ArtifactMetadataSource.java @@ -0,0 +1,78 @@ +package org.apache.maven.repository.legacy.metadata; + +/* + * 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.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.versioning.ArtifactVersion; + +/** + * Provides some metadata operations, like querying the remote repository for a list of versions available for an + * artifact. + * + * @author <a href="mailto:jason@maven.org">Jason van Zyl </a> + */ +public interface ArtifactMetadataSource +{ + + ResolutionGroup retrieve( MetadataResolutionRequest request ) + throws ArtifactMetadataRetrievalException; + + ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + throws ArtifactMetadataRetrievalException; + + /** + * Get a list of available versions for an artifact in the remote repository + * + * @param artifact artifact we are interested in. Only <code>groupid</code> and <code>artifactId</code> + * are needed, for instance the following code will work + * <code>artifactFactory.createProjectArtifact( "org.apache.maven", "maven", "" )</code> + * @param localRepository local repository + * @param remoteRepositories remote repositories, {@link List} $lt; {@link ArtifactRepository} > + * @return {@link List} $lt; {@link ArtifactVersion} > + * @throws ArtifactMetadataRetrievalException + * in case of error while retrieving repository metadata from the repository. + */ + List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + throws ArtifactMetadataRetrievalException; + + /** + * Get a list of available versions for an artifact in the remote deployment repository. This ignores any update + * policy checks and mirrors and always retrieves the latest information from the given repository. + * + * @param artifact artifact we are interested in. Only <code>groupid</code> and <code>artifactId</code> are + * needed, for instance the following code will work + * <code>artifactFactory.createProjectArtifact( "org.apache.maven", "maven", "" )</code> + * @param localRepository local repository + * @param remoteRepository remote repository + * @return {@link List} $lt; {@link ArtifactVersion} > + * @throws ArtifactMetadataRetrievalException + * in case of error while retrieving repository metadata from the repository. + */ + List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository( Artifact artifact, + ArtifactRepository localRepository, + ArtifactRepository remoteRepository ) + throws ArtifactMetadataRetrievalException; + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java new file mode 100644 index 00000000..93b9d5da --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/DefaultMetadataResolutionRequest.java @@ -0,0 +1,132 @@ +package org.apache.maven.repository.legacy.metadata; + +/* + * 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.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.DefaultRepositoryRequest; +import org.apache.maven.artifact.repository.RepositoryRequest; +import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; + +/** + * Forms a request to retrieve artifact metadata. + * + * @author Benjamin Bentmann + */ +public class DefaultMetadataResolutionRequest + implements MetadataResolutionRequest +{ + + private Artifact artifact; + + private boolean resolveManagedVersions; + + private RepositoryRequest repositoryRequest; + + public DefaultMetadataResolutionRequest() + { + repositoryRequest = new DefaultRepositoryRequest(); + } + + public DefaultMetadataResolutionRequest( RepositoryRequest repositoryRequest ) + { + this.repositoryRequest = new DefaultRepositoryRequest( repositoryRequest ); + } + + public DefaultMetadataResolutionRequest( ArtifactResolutionRequest resolutionRequest ) + { + this.repositoryRequest = new DefaultRepositoryRequest( resolutionRequest ); + } + + public Artifact getArtifact() + { + return artifact; + } + + public DefaultMetadataResolutionRequest setArtifact( Artifact artifact ) + { + this.artifact = artifact; + + return this; + } + + public ArtifactRepository getLocalRepository() + { + return repositoryRequest.getLocalRepository(); + } + + public DefaultMetadataResolutionRequest setLocalRepository( ArtifactRepository localRepository ) + { + repositoryRequest.setLocalRepository( localRepository ); + + return this; + } + + public List<ArtifactRepository> getRemoteRepositories() + { + return repositoryRequest.getRemoteRepositories(); + } + + public DefaultMetadataResolutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ) + { + repositoryRequest.setRemoteRepositories( remoteRepositories ); + + return this; + } + + public boolean isResolveManagedVersions() + { + return resolveManagedVersions; + } + + public DefaultMetadataResolutionRequest setResolveManagedVersions( boolean resolveManagedVersions ) + { + this.resolveManagedVersions = resolveManagedVersions; + + return this; + } + + public boolean isOffline() + { + return repositoryRequest.isOffline(); + } + + public DefaultMetadataResolutionRequest setOffline( boolean offline ) + { + repositoryRequest.setOffline( offline ); + + return this; + } + + public boolean isForceUpdate() + { + return repositoryRequest.isForceUpdate(); + } + + public DefaultMetadataResolutionRequest setForceUpdate( boolean forceUpdate ) + { + repositoryRequest.setForceUpdate( forceUpdate ); + + return this; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java new file mode 100644 index 00000000..a652c977 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/MetadataResolutionRequest.java @@ -0,0 +1,113 @@ +package org.apache.maven.repository.legacy.metadata; + +/* + * 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.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.RepositoryRequest; + +/** + * Forms a request to retrieve artifact metadata. + * + * @author Benjamin Bentmann + */ +public interface MetadataResolutionRequest + extends RepositoryRequest +{ + + /** + * Indicates whether network access to remote repositories has been disabled. + * + * @return {@code true} if remote access has been disabled, {@code false} otherwise. + */ + boolean isOffline(); + + /** + * Enables/disables network access to remote repositories. + * + * @param offline {@code true} to disable remote access, {@code false} to allow network access. + * @return This request, never {@code null}. + */ + MetadataResolutionRequest setOffline( boolean offline ); + + /** + * Gets the artifact to resolve metadata for. + * + * @return The artifact to resolve metadata for or {@code null} if not set. + */ + Artifact getArtifact(); + + /** + * Sets the artifact for which to resolve metadata. + * + * @param artifact The artifact for which to resolve metadata. + * @return This request, never {@code null}. + */ + MetadataResolutionRequest setArtifact( Artifact artifact ); + + /** + * Gets the local repository to use for the resolution. + * + * @return The local repository to use for the resolution or {@code null} if not set. + */ + ArtifactRepository getLocalRepository(); + + /** + * Sets the local repository to use for the resolution. + * + * @param localRepository The local repository to use for the resolution. + * @return This request, never {@code null}. + */ + MetadataResolutionRequest setLocalRepository( ArtifactRepository localRepository ); + + /** + * Gets the remote repositories to use for the resolution. + * + * @return The remote repositories to use for the resolution, never {@code null}. + */ + List<ArtifactRepository> getRemoteRepositories(); + + /** + * Sets the remote repositories to use for the resolution. + * + * @param remoteRepositories The remote repositories to use for the resolution. + * @return This request, never {@code null}. + */ + MetadataResolutionRequest setRemoteRepositories( List<ArtifactRepository> remoteRepositories ); + + /** + * Determines whether the managed version information should be retrieved. + * + * @return {@code true} if the dependency management information should be retrieved, {@code false} otherwise. + */ + boolean isResolveManagedVersions(); + + /** + * Enables/disables resolution of the dependency manageemnt information. + * + * @param resolveManagedVersions {@code true} if the dependency management information should be retrieved, {@code + * false} otherwise. + * @return This request, never {@code null}. + */ + MetadataResolutionRequest setResolveManagedVersions( boolean resolveManagedVersions ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ResolutionGroup.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ResolutionGroup.java new file mode 100644 index 00000000..e942f70a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/ResolutionGroup.java @@ -0,0 +1,83 @@ +package org.apache.maven.repository.legacy.metadata; + +/* + * 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.Map; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; + +public class ResolutionGroup +{ + + private final Set<Artifact> artifacts; + + private final List<ArtifactRepository> resolutionRepositories; + + private final Artifact pomArtifact; + + private final Artifact relocatedArtifact; + + private final Map<String, Artifact> managedVersions; + + public ResolutionGroup( Artifact pomArtifact, Set<Artifact> artifacts, + List<ArtifactRepository> resolutionRepositories ) + { + this( pomArtifact, null, artifacts, null, resolutionRepositories ); + } + + public ResolutionGroup( Artifact pomArtifact, Artifact relocatedArtifact, Set<Artifact> artifacts, + Map<String, Artifact> managedVersions, List<ArtifactRepository> resolutionRepositories ) + { + this.pomArtifact = pomArtifact; + this.relocatedArtifact = relocatedArtifact; + this.artifacts = artifacts; + this.managedVersions = managedVersions; + this.resolutionRepositories = resolutionRepositories; + } + + public Artifact getPomArtifact() + { + return pomArtifact; + } + + public Artifact getRelocatedArtifact() + { + return relocatedArtifact; + } + + public Set<Artifact> getArtifacts() + { + return artifacts; + } + + public List<ArtifactRepository> getResolutionRepositories() + { + return resolutionRepositories; + } + + public Map<String, Artifact> getManagedVersions() + { + return managedVersions; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/rtinfo/RuntimeInformation.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/rtinfo/RuntimeInformation.java new file mode 100644 index 00000000..4e3520db --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/rtinfo/RuntimeInformation.java @@ -0,0 +1,49 @@ +package org.apache.maven.rtinfo; + +/* + * 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. + */ + +/** + * Provides information about the current Maven runtime. + * + * @since 3.0.2 + */ +public interface RuntimeInformation +{ + + /** + * Retrieves the current Maven version, for example "3.0.2". + * + * @return The current Maven version or an empty string if unknown, never {@code null}. + */ + String getMavenVersion(); + + /** + * Checks whether the current Maven runtime matches the specified version range. A version range can either use the + * usual mathematical syntax "[2.0.10,2.1.0),[3.0,)" or use a single version "2.2.1". The latter is a short form for + * "[2.2.1,)", i.e. denotes the minimum version required. + * + * @param versionRange The version range to match the current Maven runtime against, must not be {@code null}. + * @return {@code true} if the current Maven runtime matches the specified version range, {@code false} otherwise. + * @throws IllegalArgumentException If the specified version range is {@code null}, empty or otherwise not a valid + * version specification. + */ + boolean isMavenVersion( String versionRange ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java new file mode 100644 index 00000000..6a733f9b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java @@ -0,0 +1,150 @@ +package org.apache.maven.rtinfo.internal; + +/* + * 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; +import java.util.Properties; + +import org.apache.maven.rtinfo.RuntimeInformation; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.util.version.GenericVersionScheme; +import org.eclipse.aether.version.InvalidVersionSpecificationException; +import org.eclipse.aether.version.Version; +import org.eclipse.aether.version.VersionConstraint; +import org.eclipse.aether.version.VersionScheme; + +/** + * Provides information about the current Maven runtime. + */ +@Component( role = RuntimeInformation.class ) +public class DefaultRuntimeInformation + implements RuntimeInformation +{ + + @Requirement + private Logger logger; + + private String mavenVersion; + + public String getMavenVersion() + { + if ( mavenVersion == null ) + { + Properties props = new Properties(); + + String resource = "META-INF/maven/org.apache.maven/maven-core/pom.properties"; + + InputStream is = DefaultRuntimeInformation.class.getResourceAsStream( "/" + resource ); + if ( is != null ) + { + try + { + props.load( is ); + } + catch ( IOException e ) + { + String msg = "Could not parse " + resource + ", Maven runtime information not available"; + if ( logger.isDebugEnabled() ) + { + logger.warn( msg, e ); + } + else + { + logger.warn( msg ); + } + } + finally + { + IOUtil.close( is ); + } + } + else + { + logger.warn( "Could not locate " + resource + + " on classpath, Maven runtime information not available" ); + } + + String version = props.getProperty( "version", "" ).trim(); + + if ( !version.startsWith( "${" ) ) + { + mavenVersion = version; + } + else + { + mavenVersion = ""; + } + } + + return mavenVersion; + } + + public boolean isMavenVersion( String versionRange ) + { + VersionScheme versionScheme = new GenericVersionScheme(); + + if ( versionRange == null ) + { + throw new IllegalArgumentException( "Version range must not be null" ); + } + if ( StringUtils.isBlank( versionRange ) ) + { + throw new IllegalArgumentException( "Version range must not be empty" ); + } + + VersionConstraint constraint; + try + { + constraint = versionScheme.parseVersionConstraint( versionRange ); + } + catch ( InvalidVersionSpecificationException e ) + { + throw new IllegalArgumentException( e.getMessage(), e ); + } + + Version current; + try + { + String mavenVersion = getMavenVersion(); + if ( mavenVersion.length() <= 0 ) + { + throw new IllegalStateException( "Could not determine current Maven version" ); + } + + current = versionScheme.parseVersion( mavenVersion ); + } + catch ( InvalidVersionSpecificationException e ) + { + throw new IllegalStateException( "Could not parse current Maven version: " + e.getMessage(), e ); + } + + if ( constraint.getRange() == null ) + { + return constraint.getVersion().compareTo( current ) <= 0; + } + return constraint.containsVersion( current ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java new file mode 100644 index 00000000..6d8913f5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java @@ -0,0 +1,169 @@ +package org.apache.maven.session.scope.internal; + +/* + * 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.Collections; +import java.util.LinkedList; +import java.util.Map; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import com.google.inject.Key; +import com.google.inject.OutOfScopeException; +import com.google.inject.Provider; +import com.google.inject.Scope; +import com.google.inject.util.Providers; + +public class SessionScope + implements Scope +{ + /** + * @since 3.3.0 + */ + public static class Memento + { + final Map<Key<?>, Provider<?>> seeded; + + Memento( final Map<Key<?>, Provider<?>> seeded ) + { + this.seeded = ImmutableMap.copyOf( seeded ); + } + } + + private static final Provider<Object> SEEDED_KEY_PROVIDER = new Provider<Object>() + { + public Object get() + { + throw new IllegalStateException(); + } + }; + + private static final class ScopeState + { + public final Map<Key<?>, Provider<?>> seeded = Maps.newHashMap(); + + public final Map<Key<?>, Object> provided = Maps.newHashMap(); + } + + private final ThreadLocal<LinkedList<ScopeState>> values = new ThreadLocal<LinkedList<ScopeState>>(); + + public void enter() + { + LinkedList<ScopeState> stack = values.get(); + if ( stack == null ) + { + stack = new LinkedList<ScopeState>(); + values.set( stack ); + } + stack.addFirst( new ScopeState() ); + } + + /** + * @since 3.3.0 + */ + public void enter( Memento memento ) + { + enter(); + getScopeState().seeded.putAll( memento.seeded ); + } + + private ScopeState getScopeState() + { + LinkedList<ScopeState> stack = values.get(); + if ( stack == null || stack.isEmpty() ) + { + throw new IllegalStateException(); + } + return stack.getFirst(); + } + + public void exit() + { + final LinkedList<ScopeState> stack = values.get(); + if ( stack == null || stack.isEmpty() ) + { + throw new IllegalStateException(); + } + stack.removeFirst(); + if ( stack.isEmpty() ) + { + values.remove(); + } + } + + /** + * @since 3.3.0 + */ + public Memento memento() + { + LinkedList<ScopeState> stack = values.get(); + return new Memento( stack != null ? stack.getFirst().seeded : Collections.<Key<?>, Provider<?>>emptyMap() ); + } + + public <T> void seed( Class<T> clazz, Provider<T> value ) + { + getScopeState().seeded.put( Key.get( clazz ), value ); + } + + public <T> void seed( Class<T> clazz, final T value ) + { + getScopeState().seeded.put( Key.get( clazz ), Providers.of( value ) ); + } + + public <T> Provider<T> scope( final Key<T> key, final Provider<T> unscoped ) + { + return new Provider<T>() + { + @SuppressWarnings( "unchecked" ) + public T get() + { + LinkedList<ScopeState> stack = values.get(); + if ( stack == null || stack.isEmpty() ) + { + throw new OutOfScopeException( "Cannot access " + key + " outside of a scoping block" ); + } + + ScopeState state = stack.getFirst(); + + Provider<?> seeded = state.seeded.get( key ); + + if ( seeded != null ) + { + return (T) seeded.get(); + } + + T provided = (T) state.provided.get( key ); + if ( provided == null && unscoped != null ) + { + provided = unscoped.get(); + state.provided.put( key, provided ); + } + + return provided; + } + }; + } + + @SuppressWarnings( { "unchecked" } ) + public static <T> Provider<T> seededKeyProvider() + { + return (Provider<T>) SEEDED_KEY_PROVIDER; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java new file mode 100644 index 00000000..585d683a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScopeModule.java @@ -0,0 +1,63 @@ +package org.apache.maven.session.scope.internal; + +/* + * 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 org.apache.maven.SessionScoped; +import org.apache.maven.execution.MavenSession; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +import com.google.inject.AbstractModule; + +@Named +public class SessionScopeModule + extends AbstractModule +{ + private final SessionScope scope; + + @Inject + public SessionScopeModule() + { + this( new SessionScope() ); + } + + public SessionScopeModule( PlexusContainer container ) + throws ComponentLookupException + { + this( container.lookup( SessionScope.class ) ); + } + + private SessionScopeModule( SessionScope scope ) + { + this.scope = scope; + } + + @Override + protected void configure() + { + bindScope( SessionScoped.class, scope ); + bind( SessionScope.class ).toInstance( scope ); + + bind( MavenSession.class ).toProvider( SessionScope.<MavenSession>seededKeyProvider() ).in( scope ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java new file mode 100644 index 00000000..820d886e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java @@ -0,0 +1,158 @@ +package org.apache.maven.settings; + +/* + * 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.File; +import java.io.IOException; + +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.properties.internal.SystemProperties; +import org.apache.maven.settings.building.DefaultSettingsBuildingRequest; +import org.apache.maven.settings.building.SettingsBuilder; +import org.apache.maven.settings.building.SettingsBuildingException; +import org.apache.maven.settings.building.SettingsBuildingRequest; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.AbstractLogEnabled; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * @author jdcasey + */ +@Component( role = MavenSettingsBuilder.class ) +public class DefaultMavenSettingsBuilder + extends AbstractLogEnabled + implements MavenSettingsBuilder +{ + + @Requirement + private SettingsBuilder settingsBuilder; + + public Settings buildSettings() + throws IOException, XmlPullParserException + { + File userSettingsFile = + getFile( "${user.home}/.m2/settings.xml", "user.home", + MavenSettingsBuilder.ALT_USER_SETTINGS_XML_LOCATION ); + + return buildSettings( userSettingsFile ); + } + + public Settings buildSettings( boolean useCachedSettings ) + throws IOException, XmlPullParserException + { + return buildSettings(); + } + + public Settings buildSettings( File userSettingsFile ) + throws IOException, XmlPullParserException + { + File globalSettingsFile = + getFile( "${maven.home}/conf/settings.xml", "maven.home", + MavenSettingsBuilder.ALT_GLOBAL_SETTINGS_XML_LOCATION ); + + SettingsBuildingRequest request = new DefaultSettingsBuildingRequest(); + request.setUserSettingsFile( userSettingsFile ); + request.setGlobalSettingsFile( globalSettingsFile ); + request.setSystemProperties( SystemProperties.getSystemProperties() ); + return build( request ); + } + + public Settings buildSettings( File userSettingsFile, boolean useCachedSettings ) + throws IOException, XmlPullParserException + { + return buildSettings( userSettingsFile ); + } + + private Settings build( SettingsBuildingRequest request ) + throws IOException, XmlPullParserException + { + try + { + return settingsBuilder.build( request ).getEffectiveSettings(); + } + catch ( SettingsBuildingException e ) + { + throw (IOException) new IOException( e.getMessage() ).initCause( e ); + } + } + + /** @since 2.1 */ + public Settings buildSettings( MavenExecutionRequest request ) + throws IOException, XmlPullParserException + { + SettingsBuildingRequest settingsRequest = new DefaultSettingsBuildingRequest(); + settingsRequest.setUserSettingsFile( request.getUserSettingsFile() ); + settingsRequest.setGlobalSettingsFile( request.getGlobalSettingsFile() ); + settingsRequest.setUserProperties( request.getUserProperties() ); + settingsRequest.setSystemProperties( request.getSystemProperties() ); + + return build( settingsRequest ); + } + + private File getFile( String pathPattern, String basedirSysProp, String altLocationSysProp ) + { + // ------------------------------------------------------------------------------------- + // Alright, here's the justification for all the regexp wizardry below... + // + // Continuum and other server-like apps may need to locate the user-level and + // global-level settings somewhere other than ${user.home} and ${maven.home}, + // respectively. Using a simple replacement of these patterns will allow them + // to specify the absolute path to these files in a customized components.xml + // file. Ideally, we'd do full pattern-evaluation against the sysprops, but this + // is a first step. There are several replacements below, in order to normalize + // the path character before we operate on the string as a regex input, and + // in order to avoid surprises with the File construction... + // ------------------------------------------------------------------------------------- + + String path = System.getProperty( altLocationSysProp ); + + if ( StringUtils.isEmpty( path ) ) + { + // TODO: This replacing shouldn't be necessary as user.home should be in the + // context of the container and thus the value would be interpolated by Plexus + String basedir = System.getProperty( basedirSysProp ); + if ( basedir == null ) + { + basedir = System.getProperty( "user.dir" ); + } + + basedir = basedir.replaceAll( "\\\\", "/" ); + basedir = basedir.replaceAll( "\\$", "\\\\\\$" ); + + path = pathPattern.replaceAll( "\\$\\{" + basedirSysProp + "\\}", basedir ); + path = path.replaceAll( "\\\\", "/" ); + // --------------------------------------------------------------------------------- + // I'm not sure if this last regexp was really intended to disallow the usage of + // network paths as user.home directory. Unfortunately it did. I removed it and + // have not detected any problems yet. + // --------------------------------------------------------------------------------- + // path = path.replaceAll( "//", "/" ); + + return new File( path ).getAbsoluteFile(); + } + else + { + return new File( path ).getAbsoluteFile(); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java new file mode 100644 index 00000000..c79a843d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java @@ -0,0 +1,81 @@ +package org.apache.maven.settings; + +/* + * 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.File; +import java.io.IOException; + +import org.apache.maven.execution.MavenExecutionRequest; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * @author jdcasey + * @author Jason van Zyl + */ +@Deprecated +public interface MavenSettingsBuilder +{ + + String ROLE = MavenSettingsBuilder.class.getName(); + + String ALT_USER_SETTINGS_XML_LOCATION = "org.apache.maven.user-settings"; + String ALT_GLOBAL_SETTINGS_XML_LOCATION = "org.apache.maven.global-settings"; + String ALT_LOCAL_REPOSITORY_LOCATION = "maven.repo.local"; + + Settings buildSettings( MavenExecutionRequest request ) + throws IOException, XmlPullParserException; + + /** + * @return a <code>Settings</code> object from the user settings file. + * @throws IOException if any + * @throws XmlPullParserException if any + */ + Settings buildSettings() + throws IOException, XmlPullParserException; + + /** + * @param useCachedSettings if true, doesn't reload the user settings + * @return a <code>Settings</code> object from the user settings file. + * @throws IOException if any + * @throws XmlPullParserException if any + */ + Settings buildSettings( boolean useCachedSettings ) + throws IOException, XmlPullParserException; + + /** + * @param userSettingsFile a given user settings file + * @return a <code>Settings</code> object from the user settings file. + * @throws IOException if any + * @throws XmlPullParserException if any + */ + Settings buildSettings( File userSettingsFile ) + throws IOException, XmlPullParserException; + + /** + * @param userSettingsFile a given user settings file + * @param useCachedSettings if true, doesn't reload the user settings + * @return a <code>Settings</code> object from the user settings file. + * @throws IOException if any + * @throws XmlPullParserException if any + */ + Settings buildSettings( File userSettingsFile, boolean useCachedSettings ) + throws IOException, XmlPullParserException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/SettingsConfigurationException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/SettingsConfigurationException.java new file mode 100644 index 00000000..6fab6501 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/SettingsConfigurationException.java @@ -0,0 +1,63 @@ +package org.apache.maven.settings; + +/* + * 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. + */ + +/** + * If there was an error in the settings file. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class SettingsConfigurationException + extends Exception +{ + private int lineNumber; + + private int columnNumber; + + public SettingsConfigurationException( String message ) + { + super( message ); + } + + public SettingsConfigurationException( String message, Throwable cause ) + { + super( message, cause ); + } + + public SettingsConfigurationException( String message, Throwable cause, int lineNumber, int columnNumber ) + { + super( message + ( lineNumber > 0 ? "\n Line: " + lineNumber : "" ) + + ( columnNumber > 0 ? "\n Column: " + columnNumber : "" ), cause ); + this.lineNumber = lineNumber; + this.columnNumber = columnNumber; + } + + public int getColumnNumber() + { + return columnNumber; + } + + public int getLineNumber() + { + return lineNumber; + } + + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java new file mode 100644 index 00000000..8da696e8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/settings/SettingsUtils.java @@ -0,0 +1,321 @@ +package org.apache.maven.settings; + +/* + * 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.model.ActivationFile; +import org.apache.maven.settings.merge.MavenSettingsMerger; + +import java.util.List; + +/** + * Several convenience methods to handle settings + * + * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a> + */ +public final class SettingsUtils +{ + + private SettingsUtils() + { + // don't allow construction. + } + + /** + * @param dominant + * @param recessive + * @param recessiveSourceLevel + */ + public static void merge( Settings dominant, Settings recessive, String recessiveSourceLevel ) + { + new MavenSettingsMerger().merge( dominant, recessive, recessiveSourceLevel ); + } + + /** + * @param modelProfile + * @return a profile + */ + public static Profile convertToSettingsProfile( org.apache.maven.model.Profile modelProfile ) + { + Profile profile = new Profile(); + + profile.setId( modelProfile.getId() ); + + org.apache.maven.model.Activation modelActivation = modelProfile.getActivation(); + + if ( modelActivation != null ) + { + Activation activation = new Activation(); + + activation.setActiveByDefault( modelActivation.isActiveByDefault() ); + + activation.setJdk( modelActivation.getJdk() ); + + org.apache.maven.model.ActivationProperty modelProp = modelActivation.getProperty(); + + if ( modelProp != null ) + { + ActivationProperty prop = new ActivationProperty(); + prop.setName( modelProp.getName() ); + prop.setValue( modelProp.getValue() ); + activation.setProperty( prop ); + } + + org.apache.maven.model.ActivationOS modelOs = modelActivation.getOs(); + + if ( modelOs != null ) + { + ActivationOS os = new ActivationOS(); + + os.setArch( modelOs.getArch() ); + os.setFamily( modelOs.getFamily() ); + os.setName( modelOs.getName() ); + os.setVersion( modelOs.getVersion() ); + + activation.setOs( os ); + } + + ActivationFile modelFile = modelActivation.getFile(); + + if ( modelFile != null ) + { + org.apache.maven.settings.ActivationFile file = new org.apache.maven.settings.ActivationFile(); + + file.setExists( modelFile.getExists() ); + file.setMissing( modelFile.getMissing() ); + + activation.setFile( file ); + } + + profile.setActivation( activation ); + } + + profile.setProperties( modelProfile.getProperties() ); + + List<org.apache.maven.model.Repository> repos = modelProfile.getRepositories(); + if ( repos != null ) + { + for ( org.apache.maven.model.Repository repo : repos ) + { + profile.addRepository( convertToSettingsRepository( repo ) ); + } + } + + List<org.apache.maven.model.Repository> pluginRepos = modelProfile.getPluginRepositories(); + if ( pluginRepos != null ) + { + for ( org.apache.maven.model.Repository pluginRepo : pluginRepos ) + { + profile.addPluginRepository( convertToSettingsRepository( pluginRepo ) ); + } + } + + return profile; + } + + /** + * @param settingsProfile + * @return a profile + */ + public static org.apache.maven.model.Profile convertFromSettingsProfile( Profile settingsProfile ) + { + org.apache.maven.model.Profile profile = new org.apache.maven.model.Profile(); + + profile.setId( settingsProfile.getId() ); + + profile.setSource( "settings.xml" ); + + Activation settingsActivation = settingsProfile.getActivation(); + + if ( settingsActivation != null ) + { + org.apache.maven.model.Activation activation = new org.apache.maven.model.Activation(); + + activation.setActiveByDefault( settingsActivation.isActiveByDefault() ); + + activation.setJdk( settingsActivation.getJdk() ); + + ActivationProperty settingsProp = settingsActivation.getProperty(); + + if ( settingsProp != null ) + { + org.apache.maven.model.ActivationProperty prop = new org.apache.maven.model.ActivationProperty(); + + prop.setName( settingsProp.getName() ); + prop.setValue( settingsProp.getValue() ); + + activation.setProperty( prop ); + } + + ActivationOS settingsOs = settingsActivation.getOs(); + + if ( settingsOs != null ) + { + org.apache.maven.model.ActivationOS os = new org.apache.maven.model.ActivationOS(); + + os.setArch( settingsOs.getArch() ); + os.setFamily( settingsOs.getFamily() ); + os.setName( settingsOs.getName() ); + os.setVersion( settingsOs.getVersion() ); + + activation.setOs( os ); + } + + org.apache.maven.settings.ActivationFile settingsFile = settingsActivation.getFile(); + + if ( settingsFile != null ) + { + ActivationFile file = new ActivationFile(); + + file.setExists( settingsFile.getExists() ); + file.setMissing( settingsFile.getMissing() ); + + activation.setFile( file ); + } + + profile.setActivation( activation ); + } + + profile.setProperties( settingsProfile.getProperties() ); + + List<Repository> repos = settingsProfile.getRepositories(); + if ( repos != null ) + { + for ( Repository repo : repos ) + { + profile.addRepository( convertFromSettingsRepository( repo ) ); + } + } + + List<Repository> pluginRepos = settingsProfile.getPluginRepositories(); + if ( pluginRepos != null ) + { + for ( Repository pluginRepo : pluginRepos ) + { + profile.addPluginRepository( convertFromSettingsRepository( pluginRepo ) ); + } + } + + return profile; + } + + /** + * @param settingsRepo + * @return a repository + */ + private static org.apache.maven.model.Repository convertFromSettingsRepository( Repository settingsRepo ) + { + org.apache.maven.model.Repository repo = new org.apache.maven.model.Repository(); + + repo.setId( settingsRepo.getId() ); + repo.setLayout( settingsRepo.getLayout() ); + repo.setName( settingsRepo.getName() ); + repo.setUrl( settingsRepo.getUrl() ); + + if ( settingsRepo.getSnapshots() != null ) + { + repo.setSnapshots( convertRepositoryPolicy( settingsRepo.getSnapshots() ) ); + } + if ( settingsRepo.getReleases() != null ) + { + repo.setReleases( convertRepositoryPolicy( settingsRepo.getReleases() ) ); + } + + return repo; + } + + /** + * @param settingsPolicy + * @return a RepositoryPolicy + */ + private static org.apache.maven.model.RepositoryPolicy convertRepositoryPolicy( RepositoryPolicy settingsPolicy ) + { + org.apache.maven.model.RepositoryPolicy policy = new org.apache.maven.model.RepositoryPolicy(); + policy.setEnabled( settingsPolicy.isEnabled() ); + policy.setUpdatePolicy( settingsPolicy.getUpdatePolicy() ); + policy.setChecksumPolicy( settingsPolicy.getChecksumPolicy() ); + return policy; + } + + /** + * @param modelRepo + * @return a repository + */ + private static Repository convertToSettingsRepository( org.apache.maven.model.Repository modelRepo ) + { + Repository repo = new Repository(); + + repo.setId( modelRepo.getId() ); + repo.setLayout( modelRepo.getLayout() ); + repo.setName( modelRepo.getName() ); + repo.setUrl( modelRepo.getUrl() ); + + if ( modelRepo.getSnapshots() != null ) + { + repo.setSnapshots( convertRepositoryPolicy( modelRepo.getSnapshots() ) ); + } + if ( modelRepo.getReleases() != null ) + { + repo.setReleases( convertRepositoryPolicy( modelRepo.getReleases() ) ); + } + + return repo; + } + + /** + * @param modelPolicy + * @return a RepositoryPolicy + */ + private static RepositoryPolicy convertRepositoryPolicy( org.apache.maven.model.RepositoryPolicy modelPolicy ) + { + RepositoryPolicy policy = new RepositoryPolicy(); + policy.setEnabled( modelPolicy.isEnabled() ); + policy.setUpdatePolicy( modelPolicy.getUpdatePolicy() ); + policy.setChecksumPolicy( modelPolicy.getChecksumPolicy() ); + return policy; + } + + /** + * @param settings could be null + * @return a new instance of settings or null if settings was null. + */ + public static Settings copySettings( Settings settings ) + { + if ( settings == null ) + { + return null; + } + + Settings clone = new Settings(); + clone.setActiveProfiles( settings.getActiveProfiles() ); + clone.setInteractiveMode( settings.isInteractiveMode() ); + clone.setLocalRepository( settings.getLocalRepository() ); + clone.setMirrors( settings.getMirrors() ); + clone.setModelEncoding( settings.getModelEncoding() ); + clone.setOffline( settings.isOffline() ); + clone.setPluginGroups( settings.getPluginGroups() ); + clone.setProfiles( settings.getProfiles() ); + clone.setProxies( settings.getProxies() ); + clone.setServers( settings.getServers() ); + clone.setSourceLevel( settings.getSourceLevel() ); + clone.setUsePluginRegistry( settings.isUsePluginRegistry() ); + + return clone; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java new file mode 100644 index 00000000..043e5e68 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchain.java @@ -0,0 +1,190 @@ +package org.apache.maven.toolchain; + +/* + * 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.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.logging.Logger; + +/** + * Default abstract toolchain implementation, to be used as base class for any toolchain implementation + * to avoid rewriting usual code. + * + * @author mkleint + * @since 2.0.9 + */ +public abstract class DefaultToolchain // should have been AbstractToolchain... + implements Toolchain, ToolchainPrivate +{ + + private String type; + + private Map<String, RequirementMatcher> provides = new HashMap<String, RequirementMatcher>(); + + public static final String KEY_TYPE = "type"; //NOI18N + + private ToolchainModel model; + + private Logger logger; + + /** + * + * @param model the model, must not be {@code null} + * @param logger the logger, must not be {@code null} + */ + protected DefaultToolchain( ToolchainModel model, Logger logger ) + { + this.model = model; + + this.logger = logger; + } + + /** + * + * @param model the model, must not be {@code null} + * @param type the type + * @param logger the logger, must not be {@code null} + */ + protected DefaultToolchain( ToolchainModel model, String type, Logger logger ) + { + this( model, logger ); + this.type = type; + } + + @Override + public final String getType() + { + return type != null ? type : model.getType(); + } + + @Override + public final ToolchainModel getModel() + { + return model; + } + + public final void addProvideToken( String type, RequirementMatcher matcher ) + { + provides.put( type, matcher ); + } + + @Override + public boolean matchesRequirements( Map<String, String> requirements ) + { + for ( Map.Entry<String, String> requirement : requirements.entrySet() ) + { + String key = requirement.getKey(); + + RequirementMatcher matcher = provides.get( key ); + + if ( matcher == null ) + { + getLog().debug( "Toolchain " + this + " is missing required property: " + key ); + return false; + } + if ( !matcher.matches( requirement.getValue() ) ) + { + getLog().debug( "Toolchain " + this + " doesn't match required property: " + key ); + return false; + } + } + return true; + } + + protected Logger getLog() + { + return logger; + } + + @Override + public boolean equals( Object obj ) + { + if ( obj == null ) + { + return false; + } + + if ( this == obj ) + { + return true; + } + + if ( !( obj instanceof DefaultToolchain ) ) + { + return false; + } + + DefaultToolchain other = (DefaultToolchain) obj; + + if ( type == null ? other.type != null : !type.equals( other.type ) ) + { + return false; + } + + Properties thisProvides = this.getModel().getProvides(); + Properties otherProvides = other.getModel().getProvides(); + + if ( thisProvides == null ? otherProvides != null : !thisProvides.equals( otherProvides ) ) + { + return false; + } + + return true; + } + + @Override + public int hashCode() + { + int hashCode = ( type == null ) ? 0 : type.hashCode(); + + if ( this.getModel().getProvides() != null ) + { + hashCode = 31 * hashCode + this.getModel().getProvides().hashCode(); + } + return hashCode; + } + + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(); + builder.append( "type:" ).append( getType() ); + builder.append( '{' ); + + Iterator<Map.Entry<String, RequirementMatcher>> providesIter = provides.entrySet().iterator(); + while ( providesIter.hasNext() ) + { + Map.Entry<String, RequirementMatcher> provideEntry = providesIter.next(); + builder.append( provideEntry.getKey() ).append( " = " ).append( provideEntry.getValue() ); + if ( providesIter.hasNext() ) + { + builder.append( ';' ); + } + } + + builder.append( '}' ); + + return builder.toString(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java new file mode 100644 index 00000000..8093bbd6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManager.java @@ -0,0 +1,140 @@ +package org.apache.maven.toolchain; + +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.MavenProject; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; + +/** + * @author mkleint + */ +@Component( role = ToolchainManager.class ) +public class DefaultToolchainManager + implements ToolchainManager +{ + @Requirement + Logger logger; + + @Requirement( role = ToolchainFactory.class ) + Map<String, ToolchainFactory> factories; + + @Override + public Toolchain getToolchainFromBuildContext( String type, MavenSession session ) + { + Map<String, Object> context = retrieveContext( session ); + + ToolchainModel model = (ToolchainModel) context.get( getStorageKey( type ) ); + + if ( model != null ) + { + List<Toolchain> toolchains = selectToolchains( Collections.singletonList( model ), type, null ); + + if ( !toolchains.isEmpty() ) + { + return toolchains.get( 0 ); + } + } + + return null; + } + + @Override + public List<Toolchain> getToolchains( MavenSession session, String type, Map<String, String> requirements ) + { + List<ToolchainModel> models = session.getRequest().getToolchains().get( type ); + + return selectToolchains( models, type, requirements ); + } + + private List<Toolchain> selectToolchains( List<ToolchainModel> models, String type, + Map<String, String> requirements ) + { + List<Toolchain> toolchains = new ArrayList<Toolchain>(); + + if ( models != null ) + { + ToolchainFactory fact = factories.get( type ); + + if ( fact == null ) + { + logger.error( "Missing toolchain factory for type: " + type + + ". Possibly caused by misconfigured project." ); + } + else + { + for ( ToolchainModel model : models ) + { + try + { + ToolchainPrivate toolchain = fact.createToolchain( model ); + if ( requirements == null || toolchain.matchesRequirements( requirements ) ) + { + toolchains.add( toolchain ); + } + } + catch ( MisconfiguredToolchainException ex ) + { + logger.error( "Misconfigured toolchain.", ex ); + } + } + } + } + return toolchains; + } + + Map<String, Object> retrieveContext( MavenSession session ) + { + Map<String, Object> context = null; + + if ( session != null ) + { + PluginDescriptor desc = new PluginDescriptor(); + desc.setGroupId( PluginDescriptor.getDefaultPluginGroupId() ); + desc.setArtifactId( PluginDescriptor.getDefaultPluginArtifactId( "toolchains" ) ); + + MavenProject current = session.getCurrentProject(); + + if ( current != null ) + { + //TODO: why is this using the context + context = session.getPluginContext( desc, current ); + } + } + + return ( context != null ) ? context : new HashMap<String, Object>(); + } + + public static final String getStorageKey( String type ) + { + return "toolchain-" + type; // NOI18N + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java new file mode 100644 index 00000000..cac8e297 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.java @@ -0,0 +1,82 @@ +package org.apache.maven.toolchain; + +/* + * 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.ArrayList; +import java.util.List; +import java.util.Map; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.component.annotations.Component; + +/** + * @author mkleint + * @author Robert Scholte + */ +@Component( role = ToolchainManagerPrivate.class ) +public class DefaultToolchainManagerPrivate + extends DefaultToolchainManager + implements ToolchainManagerPrivate +{ + + @Override + public ToolchainPrivate[] getToolchainsForType( String type, MavenSession context ) + throws MisconfiguredToolchainException + { + List<ToolchainPrivate> toRet = new ArrayList<ToolchainPrivate>(); + + ToolchainFactory fact = factories.get( type ); + if ( fact == null ) + { + logger.error( "Missing toolchain factory for type: " + type + + ". Possibly caused by misconfigured project." ); + } + else + { + List<ToolchainModel> availableToolchains = context.getRequest().getToolchains().get( type ); + + if ( availableToolchains != null ) + { + for ( ToolchainModel toolchainModel : availableToolchains ) + { + toRet.add( fact.createToolchain( toolchainModel ) ); + } + } + + // add default toolchain + ToolchainPrivate tool = fact.createDefaultToolchain(); + if ( tool != null ) + { + toRet.add( tool ); + } + } + + return toRet.toArray( new ToolchainPrivate[toRet.size()] ); + } + + @Override + public void storeToolchainToBuildContext( ToolchainPrivate toolchain, MavenSession session ) + { + Map<String, Object> context = retrieveContext( session ); + context.put( getStorageKey( toolchain.getType() ), toolchain.getModel() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainsBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainsBuilder.java new file mode 100644 index 00000000..5bd3e82a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/DefaultToolchainsBuilder.java @@ -0,0 +1,78 @@ +package org.apache.maven.toolchain; + +/* + * 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.File; +import java.io.Reader; + +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; + +/** + * @author Benjamin Bentmann + * + * @deprecated instead use {@link org.apache.maven.toolchain.building.DefaultToolchainsBuilder} + */ +@Deprecated +@Component( role = ToolchainsBuilder.class, hint = "default" ) +public class DefaultToolchainsBuilder + implements ToolchainsBuilder +{ + + @Requirement + private Logger logger; + + public PersistedToolchains build( File userToolchainsFile ) + throws MisconfiguredToolchainException + { + PersistedToolchains toolchains = null; + + if ( userToolchainsFile != null && userToolchainsFile.isFile() ) + { + Reader in = null; + try + { + in = ReaderFactory.newXmlReader( userToolchainsFile ); + toolchains = new MavenToolchainsXpp3Reader().read( in ); + } + catch ( Exception e ) + { + throw new MisconfiguredToolchainException( "Cannot read toolchains file at " + + userToolchainsFile.getAbsolutePath(), e ); + } + finally + { + IOUtil.close( in ); + } + } + else if ( userToolchainsFile != null ) + { + logger.debug( "Toolchains configuration was not found at " + userToolchainsFile ); + } + + return toolchains; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/MisconfiguredToolchainException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/MisconfiguredToolchainException.java new file mode 100644 index 00000000..140bc804 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/MisconfiguredToolchainException.java @@ -0,0 +1,39 @@ +package org.apache.maven.toolchain; + +/* + * 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. + */ + +/** + * + * @author mkleint + */ +public class MisconfiguredToolchainException + extends Exception +{ + + public MisconfiguredToolchainException( String message ) + { + super( message ); + } + + public MisconfiguredToolchainException( String message, Throwable orig ) + { + super( message, orig ); + } +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcher.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcher.java new file mode 100644 index 00000000..26390e40 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcher.java @@ -0,0 +1,30 @@ +package org.apache.maven.toolchain; + +/* + * 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. + */ + +/** + * + * @author mkleint + */ +public interface RequirementMatcher +{ + + boolean matches( String requirement ); +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java new file mode 100644 index 00000000..3d6917bd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/RequirementMatcherFactory.java @@ -0,0 +1,109 @@ +package org.apache.maven.toolchain; + +/* + * 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.versioning.DefaultArtifactVersion; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.artifact.versioning.VersionRange; + +/** + * + * @author mkleint + */ +public final class RequirementMatcherFactory +{ + private RequirementMatcherFactory() + { + } + + public static RequirementMatcher createExactMatcher( String provideValue ) + { + return new ExactMatcher( provideValue ); + } + + public static RequirementMatcher createVersionMatcher( String provideValue ) + { + return new VersionMatcher( provideValue ); + } + + private static final class ExactMatcher + implements RequirementMatcher + { + + private String provides; + + private ExactMatcher( String provides ) + { + this.provides = provides; + } + + @Override + public boolean matches( String requirement ) + { + return provides.equalsIgnoreCase( requirement ); + } + + @Override + public String toString() + { + return provides; + } + } + + private static final class VersionMatcher + implements RequirementMatcher + { + DefaultArtifactVersion version; + + private VersionMatcher( String version ) + { + this.version = new DefaultArtifactVersion( version ); + } + + @Override + public boolean matches( String requirement ) + { + try + { + VersionRange range = VersionRange.createFromVersionSpec( requirement ); + if ( range.hasRestrictions() ) + { + return range.containsVersion( version ); + } + else + { + return range.getRecommendedVersion().compareTo( version ) == 0; + } + } + catch ( InvalidVersionSpecificationException ex ) + { + //TODO error reporting + ex.printStackTrace(); + return false; + } + } + + @Override + public String toString() + { + return version.toString(); + } + } +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/Toolchain.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/Toolchain.java new file mode 100644 index 00000000..2a713465 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/Toolchain.java @@ -0,0 +1,46 @@ +package org.apache.maven.toolchain; + +/* + * 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. + */ + +/** + * Toolchain interface. + * + * @author Milos Kleint + * @author Jason van Zyl + * @since 2.0.9 + */ +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/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainFactory.java new file mode 100644 index 00000000..115eede3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainFactory.java @@ -0,0 +1,44 @@ +package org.apache.maven.toolchain; + +/* + * 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.toolchain.model.ToolchainModel; + +/** + * Internal toolchain factory, to prepare toolchains instances. + * + * @author mkleint + * @since 2.0.9 + */ +public interface ToolchainFactory +{ + /** + * Create instance of toolchain. + **/ + ToolchainPrivate createToolchain( ToolchainModel model ) + throws MisconfiguredToolchainException; + + /** + * Returns the default instance of the particular type of toolchain, can return <code>null</code> + * if not applicable. + * TODO keep around?? + **/ + ToolchainPrivate createDefaultToolchain(); +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java new file mode 100644 index 00000000..8eddac54 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManager.java @@ -0,0 +1,64 @@ +package org.apache.maven.toolchain; + +/* + * 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.Map; + +import org.apache.maven.execution.MavenSession; + + +/** + * Public API for a toolchain-aware plugin to get expected toolchain instance. + * + * @author mkleint + * @author Robert Scholte + * @since 2.0.9 + */ +public interface ToolchainManager +{ + + // NOTE: Some plugins like Surefire access this field directly! + @Deprecated + String ROLE = ToolchainManager.class.getName(); + + /** + * Retrieve toolchain of specified type from build context. It is expected that + * <code>maven-toolchains-plugin</code> contains the configuration to select the appropriate + * toolchain and is executed at the beginning of the build. + * + * @param session the Maven session, must not be {@code null} + * @param type the type, must not be {@code null} + * @return the toolchain selected by <code>maven-toolchains-plugin</code> + */ + Toolchain getToolchainFromBuildContext( String type, MavenSession context ); + + /** + * Select all toolchains available in user settings matching the type and requirements, + * independently from <code>maven-toolchains-plugin</code>. + * + * @param session the Maven session, must not be {@code null} + * @param type the type, must not be {@code null} + * @param requirements the requirements, may be {@code null} + * @return the matching toolchains, never {@code null} + * @since 3.3.0 + */ + List<Toolchain> getToolchains( MavenSession session, String type, Map<String, String> requirements ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java new file mode 100644 index 00000000..6836bf1c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainManagerPrivate.java @@ -0,0 +1,58 @@ +package org.apache.maven.toolchain; + +/* + * 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.execution.MavenSession; + +/** + * Component for use by the <code>maven-toolchains-plugin</code> only. + * It provides API: <ol> + * <li>to retrieve every toolchains available in user settings,</li> + * <li>to store chosen toolchain into build context for later use by toolchain-aware plugins.</li> + * </ol> + * + * @author mkleint + * @since 2.0.9 + * @see ToolchainManager#getToolchainFromBuildContext(String, MavenSession) + */ +public interface ToolchainManagerPrivate +{ + + /** + * Retrieves every toolchains of given type available in user settings. + * + * @param type the type, must not be {@code null} + * @param context the Maven session, must not be {@code null} + * @since 3.0 (addition of the <code>MavenSession</code> parameter) + */ + ToolchainPrivate[] getToolchainsForType( String type, MavenSession context ) + throws MisconfiguredToolchainException; + + /** + * Stores the toolchain into build context for later use by toolchain-aware plugins. + * + * @param toolchain the toolchain to store, must not be {@code null} + * @param context the Maven session, must not be {@code null} + * @since 2.0.9 + * @see ToolchainManager#getToolchainFromBuildContext(String, MavenSession) + */ + void storeToolchainToBuildContext( ToolchainPrivate toolchain, MavenSession context ); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java new file mode 100644 index 00000000..756cd957 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainPrivate.java @@ -0,0 +1,48 @@ +package org.apache.maven.toolchain; + +/* + * 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.Map; + +import org.apache.maven.toolchain.model.ToolchainModel; + +/** + * a private contract between the toolchains plugin and the components. + * @author mkleint + */ +public interface ToolchainPrivate + extends Toolchain +{ + + /** + * 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 ); + + /** + * + * @return the original model wrapped by this interface + */ + ToolchainModel getModel(); + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainsBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainsBuilder.java new file mode 100644 index 00000000..4bb4052a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/ToolchainsBuilder.java @@ -0,0 +1,46 @@ +package org.apache.maven.toolchain; + +/* + * 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.File; + +import org.apache.maven.toolchain.model.PersistedToolchains; + +/** + * Builds the toolchains model from a previously configured filesystem path to the toolchains file. + * <strong>Note:</strong> This is an internal component whose interface can change without prior notice. + * + * @author Benjamin Bentmann + */ +public interface ToolchainsBuilder +{ + + /** + * Builds the toolchains model from the configured toolchain files. + * + * @param userToolchainsFile The path to the toolchains file, may be <code>null</code> to disable parsing. + * @return The toolchains model or <code>null</code> if no toolchain file was configured or the configured file does + * not exist. + * @throws MisconfiguredToolchainException If the toolchain file exists but cannot be parsed. + */ + PersistedToolchains build( File userToolchainsFile ) + throws MisconfiguredToolchainException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java new file mode 100644 index 00000000..7983388b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilder.java @@ -0,0 +1,138 @@ +package org.apache.maven.toolchain.building; + +/* + * 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.util.Collections; +import java.util.List; +import java.util.Map; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; + +import org.apache.maven.building.Problem; +import org.apache.maven.building.ProblemCollector; +import org.apache.maven.building.ProblemCollectorFactory; +import org.apache.maven.building.Source; +import org.apache.maven.toolchain.io.ToolchainsParseException; +import org.apache.maven.toolchain.io.ToolchainsReader; +import org.apache.maven.toolchain.merge.MavenToolchainMerger; +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.TrackableBase; + +/** + * + * @author Robert Scholte + * @since 3.3.0 + */ +@Named +@Singleton +public class DefaultToolchainsBuilder + implements ToolchainsBuilder +{ + private MavenToolchainMerger toolchainsMerger = new MavenToolchainMerger(); + + @Inject + private ToolchainsReader toolchainsReader; + + @Override + public ToolchainsBuildingResult build( ToolchainsBuildingRequest request ) + throws ToolchainsBuildingException + { + ProblemCollector problems = ProblemCollectorFactory.newInstance( null ); + + PersistedToolchains globalToolchains = readToolchains( request.getGlobalToolchainsSource(), request, problems ); + + PersistedToolchains userToolchains = readToolchains( request.getUserToolchainsSource(), request, problems ); + + toolchainsMerger.merge( userToolchains, globalToolchains, TrackableBase.GLOBAL_LEVEL ); + + problems.setSource( "" ); + + if ( hasErrors( problems.getProblems() ) ) + { + throw new ToolchainsBuildingException( problems.getProblems() ); + } + + + return new DefaultToolchainsBuildingResult( userToolchains, problems.getProblems() ); + } + + private PersistedToolchains readToolchains( Source toolchainsSource, ToolchainsBuildingRequest request, + ProblemCollector problems ) + { + if ( toolchainsSource == null ) + { + return new PersistedToolchains(); + } + + PersistedToolchains toolchains; + + try + { + Map<String, ?> options = Collections.singletonMap( ToolchainsReader.IS_STRICT, Boolean.TRUE ); + + try + { + toolchains = toolchainsReader.read( toolchainsSource.getInputStream(), options ); + } + catch ( ToolchainsParseException e ) + { + options = Collections.singletonMap( ToolchainsReader.IS_STRICT, Boolean.FALSE ); + + toolchains = toolchainsReader.read( toolchainsSource.getInputStream(), options ); + + problems.add( Problem.Severity.WARNING, e.getMessage(), e.getLineNumber(), e.getColumnNumber(), + e ); + } + } + catch ( ToolchainsParseException e ) + { + problems.add( Problem.Severity.FATAL, "Non-parseable toolchains " + toolchainsSource.getLocation() + + ": " + e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); + return new PersistedToolchains(); + } + catch ( IOException e ) + { + problems.add( Problem.Severity.FATAL, "Non-readable toolchains " + toolchainsSource.getLocation() + + ": " + e.getMessage(), -1, -1, e ); + return new PersistedToolchains(); + } + + return toolchains; + } + + private boolean hasErrors( List<Problem> problems ) + { + if ( problems != null ) + { + for ( Problem problem : problems ) + { + if ( Problem.Severity.ERROR.compareTo( problem.getSeverity() ) >= 0 ) + { + return true; + } + } + } + + return false; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java new file mode 100644 index 00000000..144d724c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingRequest.java @@ -0,0 +1,63 @@ +package org.apache.maven.toolchain.building; + +/* + * 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.building.Source; + +/** + * Collects toolchains that control building of effective toolchains. + * + * @author Robert Scholte + * @since 3.3.0 + */ +public class DefaultToolchainsBuildingRequest + implements ToolchainsBuildingRequest +{ + private Source globalToolchainsSource; + + private Source userToolchainsSource; + + @Override + public Source getGlobalToolchainsSource() + { + return globalToolchainsSource; + } + + @Override + public ToolchainsBuildingRequest setGlobalToolchainsSource( Source globalToolchainsSource ) + { + this.globalToolchainsSource = globalToolchainsSource; + return this; + } + + @Override + public Source getUserToolchainsSource() + { + return userToolchainsSource; + } + + @Override + public ToolchainsBuildingRequest setUserToolchainsSource( Source userToolchainsSource ) + { + this.userToolchainsSource = userToolchainsSource; + return this; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java new file mode 100644 index 00000000..60ca2441 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/DefaultToolchainsBuildingResult.java @@ -0,0 +1,66 @@ +package org.apache.maven.toolchain.building; + +/* + * 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.ArrayList; +import java.util.List; + +import org.apache.maven.building.Problem; +import org.apache.maven.toolchain.model.PersistedToolchains; + +/** + * Holds the result of the merged toolchains and holds the problems during this build, if any. + * + * @author Robert Scholte + * @since 3.3.0 + */ +public class DefaultToolchainsBuildingResult + implements ToolchainsBuildingResult +{ + + private PersistedToolchains effectiveToolchains; + + private List<Problem> problems; + + /** + * Default constructor + * + * @param effectiveToolchains the merged toolchains, may not be {@code null} + * @param problems the problems while building the effectiveToolchains, if any. + */ + public DefaultToolchainsBuildingResult( PersistedToolchains effectiveToolchains, List<Problem> problems ) + { + this.effectiveToolchains = effectiveToolchains; + this.problems = ( problems != null ) ? problems : new ArrayList<Problem>(); + } + + @Override + public PersistedToolchains getEffectiveToolchains() + { + return effectiveToolchains; + } + + @Override + public List<Problem> getProblems() + { + return problems; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuilder.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuilder.java new file mode 100644 index 00000000..b2ef0d10 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuilder.java @@ -0,0 +1,41 @@ +package org.apache.maven.toolchain.building; + +/* + * 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. + */ + +/** + * Builds the effective toolchains from a user toolchains file and/or a global toolchains file. + * + * @author Robert Scholte + * @since 3.3.0 + */ +public interface ToolchainsBuilder +{ + + /** + * Builds the effective toolchains of the specified toolchains files. + * + * @param request The toolchains building request that holds the parameters, must not be {@code null}. + * @return The result of the toolchains building, never {@code null}. + * @throws ToolchainsBuildingException If the effective toolchains could not be built. + */ + ToolchainsBuildingResult build( ToolchainsBuildingRequest request ) + throws ToolchainsBuildingException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingException.java new file mode 100644 index 00000000..56ed1d3e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingException.java @@ -0,0 +1,93 @@ +package org.apache.maven.toolchain.building; + +/* + * 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.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.building.Problem; + +/** + * @author Robert Scholte + * @since 3.3.0 + */ +public class ToolchainsBuildingException + extends Exception +{ + + private final List<Problem> problems; + + /** + * Creates a new exception with the specified problems. + * + * @param problems The problems that causes this exception, must not be {@code null}. + */ + public ToolchainsBuildingException( List<Problem> problems ) + { + super( toMessage( problems ) ); + + this.problems = new ArrayList<Problem>(); + if ( problems != null ) + { + this.problems.addAll( problems ); + } + } + + /** + * Gets the problems that caused this exception. + * + * @return The problems that caused this exception, never {@code null}. + */ + public List<Problem> getProblems() + { + return problems; + } + + private static String toMessage( List<Problem> problems ) + { + StringWriter buffer = new StringWriter( 1024 ); + + PrintWriter writer = new PrintWriter( buffer ); + + writer.print( problems.size() ); + writer.print( ( problems.size() == 1 ) ? " problem was " : " problems were " ); + writer.print( "encountered while building the effective toolchains" ); + writer.println(); + + for ( Problem problem : problems ) + { + writer.print( "[" ); + writer.print( problem.getSeverity() ); + writer.print( "] " ); + writer.print( problem.getMessage() ); + String location = problem.getLocation(); + if ( !location.isEmpty() ) + { + writer.print( " @ " ); + writer.print( location ); + } + writer.println(); + } + + return buffer.toString(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingRequest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingRequest.java new file mode 100644 index 00000000..cf65d4cd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingRequest.java @@ -0,0 +1,64 @@ +package org.apache.maven.toolchain.building; + +/* + * 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.building.Source; + +/** + * Collects toolchains that control the building of effective toolchains. + * + * @author Robert Scholte + * @since 3.3.0 + */ +public interface ToolchainsBuildingRequest +{ + + /** + * Gets the global toolchains source. + * + * @return The global toolchains source or {@code null} if none. + */ + Source getGlobalToolchainsSource(); + + /** + * Sets the global toolchains source. If both user toolchains and a global toolchains are given, the user toolchains + * take precedence. + * + * @param globalToolchainsSource The global toolchains source, may be {@code null} to disable global toolchains. + * @return This request, never {@code null}. + */ + ToolchainsBuildingRequest setGlobalToolchainsSource( Source globalToolchainsSource ); + + /** + * Gets the user toolchains source. + * + * @return The user toolchains source or {@code null} if none. + */ + Source getUserToolchainsSource(); + + /** + * Sets the user toolchains source. If both user toolchains and a global toolchains are given, the user toolchains + * take precedence. + * + * @param userToolchainsSource The user toolchains source, may be {@code null} to disable user toolchains. + * @return This request, never {@code null}. + */ + ToolchainsBuildingRequest setUserToolchainsSource( Source userToolchainsSource ); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java new file mode 100644 index 00000000..592fb98c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingResult.java @@ -0,0 +1,50 @@ +package org.apache.maven.toolchain.building; + +/* + * 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.building.Problem; +import org.apache.maven.toolchain.model.PersistedToolchains; + +/** + * Collects the output of the toolchains builder. + * + * @author Robert Scholte + * @since 3.3.0 + */ +public interface ToolchainsBuildingResult +{ + + /** + * Gets the assembled toolchains. + * + * @return The assembled toolchains, never {@code null}. + */ + PersistedToolchains getEffectiveToolchains(); + + /** + * Return a list of problems, if any. + * + * @return a list of problems, never {@code null}. + */ + List<Problem> getProblems(); + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/DefaultToolchainsReader.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/DefaultToolchainsReader.java new file mode 100644 index 00000000..8aeefe8b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/DefaultToolchainsReader.java @@ -0,0 +1,115 @@ +package org.apache.maven.toolchain.io; + +/* + * 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.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.util.Map; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * Handles deserialization of toolchains from the default textual format. + * + * @author Robert Scholte + * @since 3.3.0 + */ +@Named +@Singleton +public class DefaultToolchainsReader + implements ToolchainsReader +{ + + @Override + public PersistedToolchains read( File input, Map<String, ?> options ) + throws IOException + { + if ( input == null ) + { + throw new IllegalArgumentException( "input file missing" ); + } + + return read( ReaderFactory.newXmlReader( input ), options ); + } + + @Override + public PersistedToolchains read( Reader input, Map<String, ?> options ) + throws IOException + { + if ( input == null ) + { + throw new IllegalArgumentException( "input reader missing" ); + } + + try + { + MavenToolchainsXpp3Reader r = new MavenToolchainsXpp3Reader(); + return r.read( input, isStrict( options ) ); + } + catch ( XmlPullParserException e ) + { + throw new ToolchainsParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); + } + finally + { + IOUtil.close( input ); + } + } + + @Override + public PersistedToolchains read( InputStream input, Map<String, ?> options ) + throws IOException + { + if ( input == null ) + { + throw new IllegalArgumentException( "input stream missing" ); + } + + try + { + MavenToolchainsXpp3Reader r = new MavenToolchainsXpp3Reader(); + return r.read( input, isStrict( options ) ); + } + catch ( XmlPullParserException e ) + { + throw new ToolchainsParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e ); + } + finally + { + IOUtil.close( input ); + } + } + + private boolean isStrict( Map<String, ?> options ) + { + Object value = ( options != null ) ? options.get( IS_STRICT ) : null; + return value == null || Boolean.parseBoolean( value.toString() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/ToolchainsParseException.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/ToolchainsParseException.java new file mode 100644 index 00000000..95c2aed8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/ToolchainsParseException.java @@ -0,0 +1,94 @@ +package org.apache.maven.toolchain.io; + +/* + * 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; + +/** + * Signals a failure to parse the toolchains due to invalid syntax (e.g. non-wellformed XML or unknown elements). + * + * @author Robert Scholte + * @since 3.3.0 + */ +public class ToolchainsParseException + extends IOException +{ + + /** + * The one-based index of the line containing the error. + */ + private final int lineNumber; + + /** + * The one-based index of the column containing the error. + */ + private final int columnNumber; + + /** + * Creates a new parser exception with the specified details. + * + * @param message The error message, may be {@code null}. + * @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown. + * @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown. + */ + public ToolchainsParseException( String message, int lineNumber, int columnNumber ) + { + super( message ); + this.lineNumber = lineNumber; + this.columnNumber = columnNumber; + } + + /** + * Creates a new parser exception with the specified details. + * + * @param message The error message, may be {@code null}. + * @param lineNumber The one-based index of the line containing the error or {@code -1} if unknown. + * @param columnNumber The one-based index of the column containing the error or {@code -1} if unknown. + * @param cause The nested cause of this error, may be {@code null}. + */ + public ToolchainsParseException( String message, int lineNumber, int columnNumber, Throwable cause ) + { + super( message ); + initCause( cause ); + this.lineNumber = lineNumber; + this.columnNumber = columnNumber; + } + + /** + * Gets the one-based index of the line containing the error. + * + * @return The one-based index of the line containing the error or a non-positive value if unknown. + */ + public int getLineNumber() + { + return lineNumber; + } + + /** + * Gets the one-based index of the column containing the error. + * + * @return The one-based index of the column containing the error or non-positive value if unknown. + */ + public int getColumnNumber() + { + return columnNumber; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/ToolchainsReader.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/ToolchainsReader.java new file mode 100644 index 00000000..44dc2bdc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/io/ToolchainsReader.java @@ -0,0 +1,83 @@ +package org.apache.maven.toolchain.io; + +/* + * 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.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.util.Map; + +import org.apache.maven.toolchain.model.PersistedToolchains; + +/** + * Handles deserialization of toolchains from some kind of textual format like XML. + * + * @author Robert Scholte + * @since 3.3.0 + */ +public interface ToolchainsReader +{ + + /** + * The key for the option to enable strict parsing. This option is of type {@link Boolean} and defaults to {@code + * true}. If {@code false}, unknown elements will be ignored instead of causing a failure. + */ + String IS_STRICT = "org.apache.maven.toolchains.io.isStrict"; + + /** + * Reads the toolchains from the specified file. + * + * @param input The file to deserialize the toolchains from, must not be {@code null}. + * @param options The options to use for deserialization, may be {@code null} to use the default values. + * @return The deserialized toolchains, never {@code null}. + * @throws IOException If the toolchains could not be deserialized. + * @throws ToolchainsParseException If the input format could not be parsed. + */ + PersistedToolchains read( File input, Map<String, ?> options ) + throws IOException, ToolchainsParseException; + + /** + * Reads the toolchains from the specified character reader. The reader will be automatically closed before the + * method returns. + * + * @param input The reader to deserialize the toolchains from, must not be {@code null}. + * @param options The options to use for deserialization, may be {@code null} to use the default values. + * @return The deserialized toolchains, never {@code null}. + * @throws IOException If the toolchains could not be deserialized. + * @throws ToolchainsParseException If the input format could not be parsed. + */ + PersistedToolchains read( Reader input, Map<String, ?> options ) + throws IOException, ToolchainsParseException; + + /** + * Reads the toolchains from the specified byte stream. The stream will be automatically closed before the method + * returns. + * + * @param input The stream to deserialize the toolchains from, must not be {@code null}. + * @param options The options to use for deserialization, may be {@code null} to use the default values. + * @return The deserialized toolchains, never {@code null}. + * @throws IOException If the toolchains could not be deserialized. + * @throws ToolchainsParseException If the input format could not be parsed. + */ + PersistedToolchains read( InputStream input, Map<String, ?> options ) + throws IOException, ToolchainsParseException; + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java new file mode 100644 index 00000000..9cfcff38 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/DefaultJavaToolChain.java @@ -0,0 +1,55 @@ +package org.apache.maven.toolchain.java; + +/* + * 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.toolchain.model.ToolchainModel; +import org.codehaus.plexus.logging.Logger; + +/** + * Provides backwards compatibility with Maven 3.2.3 and earlier. Clients that do not require compatibility with Maven + * 3.2.3 and earlier are encouraged to use {@link JavaToolchainImpl}. + * <strong>Note:</strong> This is an internal component whose interface can change without prior notice. + * + * @deprecated clients that do not require compatibility with Maven 3.2.3 and earlier should link to + * {@link JavaToolchainImpl} instead. + */ +public class DefaultJavaToolChain + extends JavaToolchainImpl +{ + public static final String KEY_JAVAHOME = JavaToolchainImpl.KEY_JAVAHOME; + + public DefaultJavaToolChain( ToolchainModel model, Logger logger ) + { + super( model, logger ); + } + + @Override + public String getJavaHome() + { + return super.getJavaHome(); + } + + @Override + public void setJavaHome( String javaHome ) + { + super.setJavaHome( javaHome ); + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java new file mode 100644 index 00000000..cb14ada1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java @@ -0,0 +1,67 @@ +package org.apache.maven.toolchain.java; + +/* + * 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.toolchain.Toolchain; + +/** + * JDK toolchain interface. + * + * @author Jason van Zyl + * @author Milos Kleint + * @since 2.0.9, renamed from JavaToolChain in 3.2.4 + */ +public interface JavaToolchain + extends Toolchain +{ +// /** +// * Returns a list of {@link java.io.File}s which represents the bootstrap libraries for the +// * runtime environment. The Bootstrap libraries include libraries in JRE's +// * extension directory, if there are any. +// * +// * @return List +// */ +// List getBootstrapLibraries(); +// +// /** +// * Returns a list of {@link java.io.File}s which represent the libraries recognized by +// * default by the platform. Usually it corresponds to contents of CLASSPATH +// * environment variable. +// * +// * @return List +// */ +// List getStandardLibraries(); +// +// /** +// * Returns a {@link java.io.File}s which represent the locations of the source of the JDK, +// * or an empty collection when the location is not set or is invalid. +// * +// * @return List +// */ +// List getSourceDirectories(); +// +// /** +// * Returns a {@link java.io.File}s which represent the locations of the Javadoc for this platform, +// * or empty collection if the location is not set or invalid +// * +// * @return List +// */ +// List getJavadocFolders(); +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java new file mode 100644 index 00000000..cd4aef01 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainFactory.java @@ -0,0 +1,127 @@ +package org.apache.maven.toolchain.java; + +/* + * 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.File; +import java.util.Map.Entry; +import java.util.Properties; + +import org.apache.maven.toolchain.MisconfiguredToolchainException; +import org.apache.maven.toolchain.RequirementMatcher; +import org.apache.maven.toolchain.RequirementMatcherFactory; +import org.apache.maven.toolchain.ToolchainFactory; +import org.apache.maven.toolchain.ToolchainPrivate; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * JDK toolchain factory. + * This is a <code>ToolchainFactory</code> Plexus component registered with + * <code>jdk</code> hint. + * + * @author mkleint + * @since 2.0.9, renamed from <code>DefaultJavaToolchainFactory</code> in 3.2.4 + */ +@Component( role = ToolchainFactory.class, hint = "jdk" ) +public class JavaToolchainFactory + implements ToolchainFactory +{ + + @Requirement + private Logger logger; + + public ToolchainPrivate createToolchain( ToolchainModel model ) + throws MisconfiguredToolchainException + { + if ( model == null ) + { + return null; + } + + // use DefaultJavaToolChain for compatibility with maven 3.2.3 and earlier + + @SuppressWarnings( "deprecation" ) + JavaToolchainImpl jtc = new DefaultJavaToolChain( model, logger ); + + // populate the provides section + Properties provides = model.getProvides(); + for ( Entry<Object, Object> provide : provides.entrySet() ) + { + String key = (String) provide.getKey(); + String value = (String) provide.getValue(); + + if ( value == null ) + { + throw new MisconfiguredToolchainException( + "Provides token '" + key + "' doesn't have any value configured." ); + } + + RequirementMatcher matcher; + if ( "version".equals( key ) ) + { + matcher = RequirementMatcherFactory.createVersionMatcher( value ); + } + else + { + matcher = RequirementMatcherFactory.createExactMatcher( value ); + } + + jtc.addProvideToken( key, matcher ); + } + + // populate the configuration section + Xpp3Dom dom = (Xpp3Dom) model.getConfiguration(); + Xpp3Dom javahome = dom.getChild( JavaToolchainImpl.KEY_JAVAHOME ); + if ( javahome == null ) + { + throw new MisconfiguredToolchainException( "Java toolchain without the " + + JavaToolchainImpl.KEY_JAVAHOME + " configuration element." ); + } + File normal = new File( FileUtils.normalize( javahome.getValue() ) ); + if ( normal.exists() ) + { + jtc.setJavaHome( FileUtils.normalize( javahome.getValue() ) ); + } + else + { + throw new MisconfiguredToolchainException( "Non-existing JDK home configuration at " + + normal.getAbsolutePath() ); + } + + return jtc; + } + + public ToolchainPrivate createDefaultToolchain() + { + //not sure it's necessary to provide a default toolchain here. + //only version can be eventually supplied, and + return null; + } + + protected Logger getLogger() + { + return logger; + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainImpl.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainImpl.java new file mode 100644 index 00000000..4a09ee06 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/java/JavaToolchainImpl.java @@ -0,0 +1,87 @@ +package org.apache.maven.toolchain.java; + +/* + * 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.File; + +import org.apache.maven.toolchain.DefaultToolchain; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.Os; + +/** + * JDK toolchain implementation. + * + * @author Milos Kleint + * @since 2.0.9, renamed from DefaultJavaToolChain in 3.2.4 + */ +class JavaToolchainImpl + extends DefaultToolchain + implements JavaToolchain +{ + private String javaHome; + + public static final String KEY_JAVAHOME = "jdkHome"; //NOI18N + + public JavaToolchainImpl( ToolchainModel model, Logger logger ) + { + super( model, "jdk", logger ); + } + + public String getJavaHome() + { + return javaHome; + } + + public void setJavaHome( String javaHome ) + { + this.javaHome = javaHome; + } + + public String toString() + { + return "JDK[" + getJavaHome() + "]"; + } + + public String findTool( String toolName ) + { + File toRet = findTool( toolName, new File( FileUtils.normalize( getJavaHome() ) ) ); + if ( toRet != null ) + { + return toRet.getAbsolutePath(); + } + return null; + } + + private static File findTool( String toolName, File installFolder ) + { + File bin = new File( installFolder, "bin" ); //NOI18N + if ( bin.exists() ) + { + File tool = new File( bin, toolName + ( Os.isFamily( "windows" ) ? ".exe" : "" ) ); // NOI18N + if ( tool.exists() ) + { + return tool; + } + } + return null; + } +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java new file mode 100644 index 00000000..538f79b3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/toolchain/merge/MavenToolchainMerger.java @@ -0,0 +1,103 @@ +package org.apache.maven.toolchain.merge; + +/* + * 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.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * + * @author Robert Scholte + * @since 3.2.4 + */ +public class MavenToolchainMerger +{ + + public void merge( PersistedToolchains dominant, PersistedToolchains recessive, String recessiveSourceLevel ) + { + if ( dominant == null || recessive == null ) + { + return; + } + + recessive.setSourceLevel( recessiveSourceLevel ); + + shallowMerge( dominant.getToolchains(), recessive.getToolchains(), recessiveSourceLevel ); + } + + private void shallowMerge( List<ToolchainModel> dominant, List<ToolchainModel> recessive, + String recessiveSourceLevel ) + { + Map<Object, ToolchainModel> merged = new LinkedHashMap<Object, ToolchainModel>(); + + for ( ToolchainModel dominantModel : dominant ) + { + Object key = getToolchainModelKey( dominantModel ); + + merged.put( key, dominantModel ); + } + + for ( ToolchainModel recessiveModel : recessive ) + { + Object key = getToolchainModelKey( recessiveModel ); + + ToolchainModel dominantModel = merged.get( key ); + if ( dominantModel == null ) + { + recessiveModel.setSourceLevel( recessiveSourceLevel ); + dominant.add( recessiveModel ); + } + else + { + mergeToolchainModel_Configuration( dominantModel, recessiveModel ); + } + } + } + + protected void mergeToolchainModel_Configuration( ToolchainModel target, + ToolchainModel source ) + { + Xpp3Dom src = (Xpp3Dom) source.getConfiguration(); + if ( src != null ) + { + Xpp3Dom tgt = (Xpp3Dom) target.getConfiguration(); + if ( tgt == null ) + { + tgt = Xpp3Dom.mergeXpp3Dom( new Xpp3Dom( src ), tgt ); + } + else + { + tgt = Xpp3Dom.mergeXpp3Dom( tgt, src ); + } + target.setConfiguration( tgt ); + } + } + + protected Object getToolchainModelKey( ToolchainModel model ) + { + return model; + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/mdo/extension.mdo b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/mdo/extension.mdo new file mode 100644 index 00000000..4b2e4604 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/mdo/extension.mdo @@ -0,0 +1,65 @@ +<!-- +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. +--> + +<model xmlns="http://modello.codehaus.org/MODELLO/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.4.0 http://modello.codehaus.org/xsd/modello-1.4.0.xsd"> + <id>extension</id> + <name>ExtensionDescriptor</name> + <description><![CDATA[ + Extension descriptor, stored in <code>META-INF/maven/extension.xml</code> in an extension's jar artifact to + precisely control parts of the extension and dependencies to expose. + <p><i>Notice:</i> this documentation is generated from a Modello model but the code executed is not generated + from this descriptor. Please report if you find anything wrong.</p> + ]]></description> + <defaults> + <default> + <key>package</key> + <value>extension descriptor XML documentation (no java generation)</value><!-- intentionally non-buildable value --> + </default> + </defaults> + <classes> + <class rootElement="true" xml.tagName="extension"> + <name>ExtensionDescriptor</name> + <version>1.0.0</version> + <description><![CDATA[Root element of the <code>extension.xml</code> file.]]></description> + <fields> + <field> + <name>exportedPackages</name> + <version>1.0.0</version> + <association> + <type>String</type> + <multiplicity>*</multiplicity> + </association> + <description>Packages from the artifact that are exposed.</description> + <!-- TODO explain package vs package.class vs package.* --> + </field> + <field> + <name>exportedArtifacts</name> + <version>1.0.0</version> + <association> + <type>String</type> + <multiplicity>*</multiplicity> + </association> + <description><![CDATA[Artifacts that are exposed: <code>groupId:artifactId</code> file.]]> + </description> + </field> + </fields> + </class> + </classes> +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/mdo/toolchains.mdo b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/mdo/toolchains.mdo new file mode 100644 index 00000000..830a5275 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/mdo/toolchains.mdo @@ -0,0 +1,231 @@ +<?xml version="1.0"?> + +<!-- + 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. + +--> +<model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd" + xml.namespace="http://maven.apache.org/TOOLCHAINS/${version}" + xml.schemaLocation="http://maven.apache.org/xsd/toolchains-${version}.xsd"> + <id>toolchains</id> + <name>MavenToolchains</name> + <description><![CDATA[ + <p>This is a reference for the Maven Toolchains descriptor.</p> + <p>The default location for the toolchains file is <code>~/.m2/toolchains.xml</code></p> + <p>A Toolchain is a preconfigured object that Maven plugins can use for tool configuration retrieval (location and other information).</p> + <p>The <a href="/plugins/maven-toolchains-plugin/">toolchains-plugin</a> can read available toolchains on the user's computer + and match them against the toolchain requirements of the project (as configured in <code>pom.xml</code>): + if match is found, the toolchain instance is made available to other Maven plugins.</p> + <p>With <code>jdk</code> toolchain, for example, instead of being stuck with the JDK used to run Maven, all plugins can use + the same other JDK instance without hardcoding absolute paths into the <code>pom.xml</code> + and without configuring every plugin that require path to JDK tools.</p> + <p>See the <a href="/guides/mini/guide-using-toolchains.html">Guide to Using Toolchains</a> for + more information.</p> + ]]></description> + + <defaults> + <default> + <key>package</key> + <value>org.apache.maven.toolchain.model</value> + </default> + </defaults> + + <classes> + <class java.clone="deep"> + <name>TrackableBase</name> + <version>1.1.0+</version> + <description> + common base class that contains code to track the source for + this instance (USER|GLOBAL) + </description> + <codeSegments> + <codeSegment> + <version>1.1.0+</version> + <code> + <![CDATA[ + public static final String USER_LEVEL = "user-level"; + public static final String GLOBAL_LEVEL = "global-level"; + + private String sourceLevel = USER_LEVEL; + private boolean sourceLevelSet = false; + + public void setSourceLevel( String sourceLevel ) + { + if ( sourceLevelSet ) + { + throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel ); + } + else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) ) + { + throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" ); + } + else + { + this.sourceLevel = sourceLevel; + this.sourceLevelSet = true; + } + } + + public String getSourceLevel() + { + return sourceLevel; + } + ]]> + </code> + </codeSegment> + </codeSegments> + </class> + <class rootElement="true" xml.tagName="toolchains" xsd.compositor="sequence"> + <name>PersistedToolchains</name> + <superClass>TrackableBase</superClass> + <description><![CDATA[ + The <code><toolchains></code> element is the root of the descriptor. + The following table lists all of the possible child elements. + ]]></description> + <version>1.0.0+</version> + <fields> + <field> + <name>toolchains</name> + <version>1.0.0+</version> + <description><![CDATA[The toolchain instance definition.]]></description> + <association xml.itemsStyle="flat"> + <type>ToolchainModel</type> + <multiplicity>*</multiplicity> + </association> + </field> + </fields> + </class> + <class> + <name>ToolchainModel</name> + <superClass>TrackableBase</superClass> + <version>1.0.0+</version> + <description>Definition of a toolchain instance.</description> + <fields> + <field> + <name>type</name> + <version>1.0.0+</version> + <!-- <identifier>true</identifier> --> + <description> + <![CDATA[Type of toolchain:<ul> + <li><code>jdk</code> for + <a href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html">JDK Standard Toolchain</a>,</li> + <li>other value for + <a href="http://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/custom.html">Custom Toolchain</a></li> + </ul> + ]]></description> + <type>String</type> + </field> + <field> + <name>provides</name> + <version>1.0.0/1.0.99</version> <!-- fake upperbound, it's inclusive --> + <type>DOM</type> <!-- DOM for Maven 2.0.9/2.3.3 --> + <description> + <![CDATA[ + <p>Toolchain identification information, which will be matched against project requirements.</p> + <p>Actual content structure is completely open: each toolchain type will define its own format and semantics.</p> + <p>In general, this is a properties format: <code><name>value</name></code> with + predefined properties names.</p> + ]]></description> + </field> + <field> + <name>provides</name> + <version>1.1.0+</version> + <type>Properties</type> <!-- Properties for Maven 2.3.4+ --> + <association xml.mapStyle="inline"> + <type>String</type> + <multiplicity>*</multiplicity> + </association> + <!-- <identifier>true</identifier> --> + <description> + <![CDATA[ + <p>Toolchain identification information, which will be matched against project requirements.</p> + <p>For Maven 2.0.9 to 3.2.3, the actual content structure was completely open: each toolchain type would define its own format and semantics. + In general, this was a properties format.</p> + <p>Since Maven 3.2.4, the type for this field has been changed to Properties to match the de-facto format.</p> + <p>Each toolchain defines its own properties names and semantics.</p> + ]]></description> + </field> + <field> + <name>configuration</name> + <version>1.0.0+</version> + <type>DOM</type> + <description> + <![CDATA[ + <p>Toolchain configuration information, like location or any information that is to be retrieved.</p> + <p>Actual content structure is completely open: each toochain type will define its own format and semantics.</p> + <p>In general, this is a properties format: <code><name>value</name></code> with + per-toolchain defined properties names.</p> + ]]></description> + </field> + </fields> + <codeSegments> + <codeSegment> + <version>1.1.0+</version> + <comment>Generated hashCode() and equals() based on identifier also calls its super, which breaks comparison</comment> + <code> + <![CDATA[ + /** + * Method hashCode. + * + * @return int + */ + public int hashCode() + { + int result = 17; + + result = 37 * result + ( type != null ? type.hashCode() : 0 ); + result = 37 * result + ( provides != null ? provides.hashCode() : 0 ); + + return result; + } //-- int hashCode() + + /** + * Method equals. + * + * @param other + * @return boolean + */ + public boolean equals( Object other ) + { + if ( this == other ) + { + return true; + } + + if ( !( other instanceof ToolchainModel ) ) + { + return false; + } + + ToolchainModel that = (ToolchainModel) other; + boolean result = true; + + result = result && ( getType() == null ? that.getType() == null : getType().equals( that.getType() ) ); + result = result && ( getProvides() == null ? that.getProvides() == null : getProvides().equals( that.getProvides() ) ); + + return result; + } //-- boolean equals( Object ) + ]]> + </code> + </codeSegment> + </codeSegments> + </class> + </classes> +</model> + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/maven/extension.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/maven/extension.xml new file mode 100644 index 00000000..6abf2186 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/maven/extension.xml @@ -0,0 +1,173 @@ +<?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. +--> + +<extension> + <exportedPackages> + <!-- maven-* --> + <exportedPackage>org.apache.maven.*</exportedPackage> + <exportedPackage>org.apache.maven.artifact</exportedPackage> + <exportedPackage>org.apache.maven.classrealm</exportedPackage> + <exportedPackage>org.apache.maven.cli</exportedPackage> + <exportedPackage>org.apache.maven.configuration</exportedPackage> + <exportedPackage>org.apache.maven.exception</exportedPackage> + <exportedPackage>org.apache.maven.execution</exportedPackage> + <exportedPackage>org.apache.maven.execution.scope</exportedPackage> + <exportedPackage>org.apache.maven.lifecycle</exportedPackage> + <exportedPackage>org.apache.maven.model</exportedPackage> + <exportedPackage>org.apache.maven.monitor</exportedPackage> + <exportedPackage>org.apache.maven.plugin</exportedPackage> + <exportedPackage>org.apache.maven.profiles</exportedPackage> + <exportedPackage>org.apache.maven.project</exportedPackage> + <exportedPackage>org.apache.maven.reporting</exportedPackage> + <exportedPackage>org.apache.maven.repository</exportedPackage> + <exportedPackage>org.apache.maven.rtinfo</exportedPackage> + <exportedPackage>org.apache.maven.settings</exportedPackage> + <exportedPackage>org.apache.maven.toolchain</exportedPackage> + <exportedPackage>org.apache.maven.usability</exportedPackage> + + + <!-- wagon-api --> + <exportedPackage>org.apache.maven.wagon.*</exportedPackage> + <exportedPackage>org.apache.maven.wagon.authentication</exportedPackage> + <exportedPackage>org.apache.maven.wagon.authorization</exportedPackage> + <exportedPackage>org.apache.maven.wagon.events</exportedPackage> + <exportedPackage>org.apache.maven.wagon.observers</exportedPackage> + <exportedPackage>org.apache.maven.wagon.proxy</exportedPackage> + <exportedPackage>org.apache.maven.wagon.repository</exportedPackage> + <exportedPackage>org.apache.maven.wagon.resource</exportedPackage> + + <!-- aether-api, aether-spi, aether-impl --> + <exportedPackage>org.eclipse.aether.*</exportedPackage> + <exportedPackage>org.eclipse.aether.artifact</exportedPackage> + <exportedPackage>org.eclipse.aether.collection</exportedPackage> + <exportedPackage>org.eclipse.aether.deployment</exportedPackage> + <exportedPackage>org.eclipse.aether.graph</exportedPackage> + <exportedPackage>org.eclipse.aether.impl</exportedPackage> + <exportedPackage>org.eclipse.aether.internal.impl</exportedPackage> + <exportedPackage>org.eclipse.aether.installation</exportedPackage> + <exportedPackage>org.eclipse.aether.metadata</exportedPackage> + <exportedPackage>org.eclipse.aether.repository</exportedPackage> + <exportedPackage>org.eclipse.aether.resolution</exportedPackage> + <exportedPackage>org.eclipse.aether.spi</exportedPackage> + <exportedPackage>org.eclipse.aether.transfer</exportedPackage> + <exportedPackage>org.eclipse.aether.version</exportedPackage> + + <!-- plexus-classworlds --> + <exportedPackage>org.codehaus.plexus.classworlds</exportedPackage> + + <!-- classworlds (for legacy code) --> + <exportedPackage>org.codehaus.classworlds</exportedPackage> + + <!-- plexus-utils (for DOM-type fields in maven-model) --> + <exportedPackage>org.codehaus.plexus.util.xml.Xpp3Dom</exportedPackage> + <exportedPackage>org.codehaus.plexus.util.xml.pull.XmlPullParser</exportedPackage> + <exportedPackage>org.codehaus.plexus.util.xml.pull.XmlPullParserException</exportedPackage> + <exportedPackage>org.codehaus.plexus.util.xml.pull.XmlSerializer</exportedPackage> + + <!-- plexus-container, plexus-component-annotations --> + <exportedPackage>org.codehaus.plexus.*</exportedPackage> + <exportedPackage>org.codehaus.plexus.component</exportedPackage> + <exportedPackage>org.codehaus.plexus.configuration</exportedPackage> + <exportedPackage>org.codehaus.plexus.container</exportedPackage> + <exportedPackage>org.codehaus.plexus.context</exportedPackage> + <exportedPackage>org.codehaus.plexus.lifecycle</exportedPackage> + <exportedPackage>org.codehaus.plexus.logging</exportedPackage> + <exportedPackage>org.codehaus.plexus.personality</exportedPackage> + + <!-- javax.inject (JSR-330) --> + <exportedPackage>javax.inject.*</exportedPackage> + <!-- javax.enterprise.inject (JSR-299) --> + <exportedPackage>javax.enterprise.util.*</exportedPackage> + <exportedPackage>javax.enterprise.inject.*</exportedPackage> + + + <!-- + | We may potentially want to export these, but right now I'm not sure that anything Guice specific needs + | to be made available to plugin authors. If we find people are getting fancy and want to take advantage of + | Guice specifics we can expose that later. Really some testing needs to be done to see full hiding + | of Guice has any impact on what we may categorize as a standard JSR-330 based Tesla/Maven plugin. + + <exportedPackage>com.google.inject.*</exportedPackage> + <exportedPackage>com.google.inject.binder.*</exportedPackage> + <exportedPackage>com.google.inject.matcher.*</exportedPackage> + <exportedPackage>com.google.inject.name.*</exportedPackage> + <exportedPackage>com.google.inject.spi.*</exportedPackage> + <exportedPackage>com.google.inject.util.*</exportedPackage> + --> + + <!-- SLF4J --> + <exportedPackage>org.slf4j.*</exportedPackage> + <exportedPackage>org.slf4j.spi.*</exportedPackage> + + </exportedPackages> + + <exportedArtifacts> + <exportedArtifact>classworlds:classworlds</exportedArtifact> + <exportedArtifact>org.codehaus.plexus:plexus-classworlds</exportedArtifact> + <exportedArtifact>org.codehaus.plexus:plexus-component-api</exportedArtifact> + <exportedArtifact>org.codehaus.plexus:plexus-container-default</exportedArtifact> + <exportedArtifact>plexus:plexus-container-default</exportedArtifact> + <exportedArtifact>org.sonatype.spice:spice-inject-plexus</exportedArtifact> + <exportedArtifact>org.sonatype.sisu:sisu-inject-plexus</exportedArtifact> + <exportedArtifact>org.eclipse.sisu:org.eclipse.sisu.plexus</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-artifact</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-aether-provider</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-artifact-manager</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-compat</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-core</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-error-diagnostics</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-lifecycle</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-model</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-model-builder</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-monitor</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-plugin-api</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-plugin-descriptor</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-plugin-parameter-documenter</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-plugin-registry</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-profile</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-project</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-repository-metadata</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-settings</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-settings-builder</exportedArtifact> + <exportedArtifact>org.apache.maven:maven-toolchain</exportedArtifact> + <exportedArtifact>org.apache.maven.wagon:wagon-provider-api</exportedArtifact> + <exportedArtifact>org.eclipse.aether:aether-api</exportedArtifact> + <exportedArtifact>org.eclipse.aether:aether-spi</exportedArtifact> + <exportedArtifact>org.eclipse.aether:aether-impl</exportedArtifact> + + <exportedArtifact>javax.inject:javax.inject</exportedArtifact> + <exportedArtifact>org.slf4j:slf4j-api</exportedArtifact> + + <!-- + | We must also filter out the old or NoClassDefFoundErrors will surface + --> + <exportedArtifact>org.sonatype.aether:aether-api</exportedArtifact> + <exportedArtifact>org.sonatype.aether:aether-spi</exportedArtifact> + <exportedArtifact>org.sonatype.aether:aether-impl</exportedArtifact> + + <!-- + | NOTE: Don't exclude the wagons or any of their dependencies (apart from the wagon API). This would otherwise + | provoke linkage errors for wagons contributed by build extensions. We also don't need to exclude the wagons + | from plugins. Plugins that use wagons directly and declare the corresponding dependency will simply use a + | wagon from their plugin realm. + --> + </exportedArtifacts> +</extension>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml new file mode 100644 index 00000000..05795beb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml @@ -0,0 +1,219 @@ +<?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. +--> + +<!-- + +Artifact handlers are required by the dependency resolution mechanism. + +--> + +<component-set> + <components> + <!-- + | POM + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>pom</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>pom</type> + </configuration> + </component> + + <!-- + | JAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>jar</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>jar</type> + <language>java</language> + <addedToClasspath>true</addedToClasspath> + </configuration> + </component> + + <!-- + | EJB + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>ejb</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>ejb</type> + <extension>jar</extension> + <language>java</language> + <addedToClasspath>true</addedToClasspath> + </configuration> + </component> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>ejb-client</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>ejb-client</type> + <extension>jar</extension> + <packaging>ejb</packaging> + <classifier>client</classifier> + <language>java</language> + <addedToClasspath>true</addedToClasspath> + </configuration> + </component> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>ejb3</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>ejb3</type> + <includesDependencies>true</includesDependencies> + <language>java</language> + <addedToClasspath>false</addedToClasspath> + </configuration> + </component> + + <!-- + | TEST JAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>test-jar</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <classifier>tests</classifier> + <extension>jar</extension> + <type>test-jar</type> + <packaging>jar</packaging> + <language>java</language> + <addedToClasspath>true</addedToClasspath> + </configuration> + </component> + + <!-- + | MAVEN PLUGIN + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>maven-plugin</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>maven-plugin</type> + <extension>jar</extension> + <language>java</language> + <addedToClasspath>true</addedToClasspath> + </configuration> + </component> + + <!-- + | SOURCE JAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>java-source</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <classifier>sources</classifier> + <type>java-source</type> + <extension>jar</extension> + <language>java</language> + <addedToClasspath>false</addedToClasspath> + </configuration> + </component> + + <!-- + | JAVADOC JAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>javadoc</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <classifier>javadoc</classifier> + <type>javadoc</type> + <extension>jar</extension> + <language>java</language> + <addedToClasspath>true</addedToClasspath> + </configuration> + </component> + + <!-- + | WAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>war</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>war</type> + <includesDependencies>true</includesDependencies> + <language>java</language> + <addedToClasspath>false</addedToClasspath> + </configuration> + </component> + + <!-- + | EAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>ear</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>ear</type> + <includesDependencies>true</includesDependencies> + <language>java</language> + <addedToClasspath>false</addedToClasspath> + </configuration> + </component> + + <!-- + | RAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>rar</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>rar</type> + <includesDependencies>true</includesDependencies> + <language>java</language> + <addedToClasspath>false</addedToClasspath> + </configuration> + </component> + + <!-- + | PAR + |--> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>par</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <type>par</type> + <includesDependencies>true</includesDependencies> + <language>java</language> + <addedToClasspath>false</addedToClasspath> + </configuration> + </component> + </components> +</component-set> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/components.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/components.xml new file mode 100644 index 00000000..3f099cb1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/components.xml @@ -0,0 +1,134 @@ +<?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. +--> + +<!-- + There is currently only one component descriptor that cannot be generated from annotations because of the + accompanying configuration. Our options are to embed this information programatically or use a configuration source + to pull in the lifecycle information. +--> +<component-set> + <components> + <!-- 'default' lifecycle, without any binding since it is dependent on packaging --> + <component> + <role>org.apache.maven.lifecycle.Lifecycle</role> + <implementation>org.apache.maven.lifecycle.Lifecycle</implementation> + <role-hint>default</role-hint> + <configuration> + <id>default</id> + <!-- START SNIPPET: lifecycle --> + <phases> + <phase>validate</phase> + <phase>initialize</phase> + <phase>generate-sources</phase> + <phase>process-sources</phase> + <phase>generate-resources</phase> + <phase>process-resources</phase> + <phase>compile</phase> + <phase>process-classes</phase> + <phase>generate-test-sources</phase> + <phase>process-test-sources</phase> + <phase>generate-test-resources</phase> + <phase>process-test-resources</phase> + <phase>test-compile</phase> + <phase>process-test-classes</phase> + <phase>test</phase> + <phase>prepare-package</phase> + <phase>package</phase> + <phase>pre-integration-test</phase> + <phase>integration-test</phase> + <phase>post-integration-test</phase> + <phase>verify</phase> + <phase>install</phase> + <phase>deploy</phase> + </phases> + <!-- END SNIPPET: lifecycle --> + </configuration> + </component> + + <!-- 'clean' lifecycle, with default binding --> + <component> + <role>org.apache.maven.lifecycle.Lifecycle</role> + <implementation>org.apache.maven.lifecycle.Lifecycle</implementation> + <role-hint>clean</role-hint> + <configuration> + <id>clean</id> + <!-- START SNIPPET: clean --> + <phases> + <phase>pre-clean</phase> + <phase>clean</phase> + <phase>post-clean</phase> + </phases> + <default-phases> + <clean> + org.apache.maven.plugins:maven-clean-plugin:2.5:clean + </clean> + </default-phases> + <!-- END SNIPPET: clean --> + </configuration> + </component> + + <!-- 'site' lifecycle, with default bindings --> + <component> + <role>org.apache.maven.lifecycle.Lifecycle</role> + <implementation>org.apache.maven.lifecycle.Lifecycle</implementation> + <role-hint>site</role-hint> + <configuration> + <id>site</id> + <!-- START SNIPPET: site --> + <phases> + <phase>pre-site</phase> + <phase>site</phase> + <phase>post-site</phase> + <phase>site-deploy</phase> + </phases> + <default-phases> + <site> + org.apache.maven.plugins:maven-site-plugin:3.3:site + </site> + <site-deploy> + org.apache.maven.plugins:maven-site-plugin:3.3:deploy + </site-deploy> + </default-phases> + <!-- END SNIPPET: site --> + </configuration> + </component> + + <component> + <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role> + <role-hint>maven</role-hint> + <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation> + <description>Maven Security dispatcher</description> + <requirements> + <requirement> + <role>org.sonatype.plexus.components.cipher.PlexusCipher</role> + <field-name>_cipher</field-name> + </requirement> + <requirement> + <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role> + <field-name>_decryptors</field-name> + </requirement> + </requirements> + <configuration> + <_configuration-file>~/.m2/settings-security.xml</_configuration-file> + </configuration> + </component> + </components> +</component-set> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/default-bindings.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/default-bindings.xml new file mode 100644 index 00000000..79d6c52e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/META-INF/plexus/default-bindings.xml @@ -0,0 +1,399 @@ +<?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. +--> + +<!-- + +Mappings to default lifecycle, specific for each packaging. + +--> + +<component-set> + <components> + <!-- + | POM + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>pom</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: pom-lifecycle --> + <phases> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: pom-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + + <!-- + | JAR + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>jar</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: jar-lifecycle --> + <phases> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:resources + </process-resources> + <compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:compile + </compile> + <process-test-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + </process-test-resources> + <test-compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile + </test-compile> + <test> + org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + </test> + <package> + org.apache.maven.plugins:maven-jar-plugin:2.4:jar + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: jar-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + + <!-- + | EJB + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>ejb</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: ejb-lifecycle --> + <phases> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:resources + </process-resources> + <compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:compile + </compile> + <process-test-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + </process-test-resources> + <test-compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile + </test-compile> + <test> + org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + </test> + <package> + org.apache.maven.plugins:maven-ejb-plugin:2.3:ejb + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: ejb-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>ejb3</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: ejb3-lifecycle --> + <phases> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:resources + </process-resources> + <compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:compile + </compile> + <process-test-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + </process-test-resources> + <test-compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile + </test-compile> + <test> + org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + </test> + <package> + org.apache.maven.plugins:maven-ejb3-plugin:ejb3 + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: ejb3-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + + <!-- + | MAVEN PLUGIN + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>maven-plugin</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: maven-plugin-lifecycle --> + <phases> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:resources + </process-resources> + <compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:compile + </compile> + <process-classes> + org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor + </process-classes> + <process-test-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + </process-test-resources> + <test-compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile + </test-compile> + <test> + org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + </test> + <package> + org.apache.maven.plugins:maven-jar-plugin:2.4:jar, + org.apache.maven.plugins:maven-plugin-plugin:3.2:addPluginArtifactMetadata + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: maven-plugin-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + + <!-- + | WAR + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>war</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: war-lifecycle --> + <phases> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:resources + </process-resources> + <compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:compile + </compile> + <process-test-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + </process-test-resources> + <test-compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile + </test-compile> + <test> + org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + </test> + <package> + org.apache.maven.plugins:maven-war-plugin:2.2:war + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: war-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + + <!-- + | EAR + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>ear</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: ear-lifecycle --> + <phases> + <generate-resources> + org.apache.maven.plugins:maven-ear-plugin:2.8:generate-application-xml + </generate-resources> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources + </process-resources> + <package> + org.apache.maven.plugins:maven-ear-plugin:2.8:ear + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: ear-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + + <!-- + | RAR + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>rar</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: rar-lifecycle --> + <phases> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:resources + </process-resources> + <compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:compile + </compile> + <process-test-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + </process-test-resources> + <test-compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile + </test-compile> + <test> + org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + </test> + <package> + org.apache.maven.plugins:maven-rar-plugin:2.2:rar + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: rar-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + + <!-- + | PAR + |--> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>par</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: par-lifecycle --> + <phases> + <process-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:resources + </process-resources> + <compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:compile + </compile> + <process-test-resources> + org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + </process-test-resources> + <test-compile> + org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile + </test-compile> + <test> + org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + </test> + <package> + org.apache.maven.plugins:maven-par-plugin:par + </package> + <install> + org.apache.maven.plugins:maven-install-plugin:2.4:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + </deploy> + </phases> + <!-- END SNIPPET: par-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + </components> +</component-set> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/build.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/build.properties new file mode 100644 index 00000000..d15784a7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/build.properties @@ -0,0 +1,23 @@ +# 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. + +buildNumber=${buildNumber} +timestamp=${timestamp} +version=${project.version} +distributionId=${distributionId} +distributionShortName=${distributionShortName} +distributionName=${distributionName}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages.properties new file mode 100644 index 00000000..d576d7aa --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages.properties @@ -0,0 +1,34 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +failed.download.warning=WARNING: Failed to download {0}. +remote.repository.disabled.warning=The use of the remote repository has been disabled. +directory.nonexistant.warning=Directory {0} does not exist. Attempting to create. +not.directory.warning={0} is not a directory. +not.writable.warning={0} is not writable. +cannot.create.directory.warning=Unable to create directory {0} +maven.repo.local.unset.warning=maven.repo.local is not set. +single.unsatisfied.dependency.error=The build cannot continue because of the following unsatisfied dependency: +multiple.unsatisfied.dependency.error=The build cannot continue because of the following unsatisfied dependencies: +offline.snapshot.warning=You are working offline so the build will continue, but {0} may be out of date! +download.message=Attempting to download {0}. +plugin.loading.error=The plugin {0} could not be loaded. +empty.descriptor.error=The file {0} you specified has zero length. +checksum.verification.error=The follow artifact is corrupt: {0}. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_de.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_de.properties new file mode 100644 index 00000000..d5c7dad0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_de.properties @@ -0,0 +1,34 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +failed.download.warning=WARNUNG: Herunterladen von {0} fehlgeschlagen. +remote.repository.disabled.warning=Verwendung entfernter Repositories deaktiviert. +directory.nonexistant.warning=Verzeichnis {0} existiert nicht, es wird erstellt. +not.directory.warning={0} ist kein Verzeichnis. +not.writable.warning=Kann {0} nicht schreiben. +cannot.create.directory.warning=Kann Verzeichnis {0} nicht erstellen. +maven.repo.local.unset.warning=maven.repo.local ist nicht gesetzt. +single.unsatisfied.dependency.error=Der Vorgang wurde aufgrund der folgenden nicht erf\u00FCllten Abh\u00E4ngigkeit abgebrochen: +multiple.unsatisfied.dependency.error=Der Vorgang wurde aufgrund der folgenden nicht erf\u00FCllten Abh\u00E4ngigkeiten abgebrochen: +offline.snapshot.warning={0} ist unter Umst\u00E4nden veraltet. Da Sie offline arbeiten, wird der Vorgang fortgesetzt. +download.message=Versuche {0} herunterzuladen. +plugin.loading.error=Kann Plugin {0} nicht laden. +empty.descriptor.error=Datei {0} ist leer. +checksum.verification.error=Artefakt {0} ist defekt. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_el.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_el.properties new file mode 100644 index 00000000..40a239e9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_el.properties @@ -0,0 +1,33 @@ +# 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. + +# -------------------------------------------------------------------------- +# \u00c5\u00eb\u00e5\u00e3\u00ea\u00f4\u00de\u00f2 \u00d3\u00f7\u00e5\u00e4\u00df\u00ef\u00f5 +# -------------------------------------------------------------------------- +failed.download.warning=\u00d0\u00f1\u00ef\u00f3\u00f9\u00f7\u00de! \u00c1\u00e4\u00fd\u00ed\u00e1\u00f4\u00f9\u00ed \u00e7 \u00ec\u00e5\u00f4\u00e1\u00f6\u00ef\u00f1\u00dc \u00f4\u00ef\u00f5 {0}! +remote.repository.disabled.warning=\u00c7 \u00f7\u00f1\u00de\u00f3\u00e7 \u00e1\u00f0\u00ef\u00ec\u00e1\u00ea\u00f1\u00f5\u00f3\u00ec\u00dd\u00ed\u00f9\u00ed \u00e1\u00f0\u00ef\u00e8\u00e7\u00ea\u00fe\u00ed \u00dd\u00f7\u00e5\u00e9 \u00e1\u00f0\u00e5\u00ed\u00e5\u00f1\u00e3\u00ef\u00f0\u00ef\u00e9\u00e7\u00e8\u00e5\u00df.. +directory.nonexistant.warning=\u00cf \u00ea\u00e1\u00f4\u00dc\u00eb\u00ef\u00e3\u00ef\u00f2 {0} \u00e4\u00e5\u00ed \u00f5\u00f0\u00dc\u00f1\u00f7\u00e5\u00e9! \u00c4\u00ef\u00ea\u00e9\u00ec\u00dc\u00e6\u00f9 \u00e4\u00e7\u00ec\u00e9\u00ef\u00fd\u00f1\u00e3\u00e7\u00f3\u00e7... +not.directory.warning={0} \u00e4\u00e5\u00ed \u00e5\u00df\u00ed\u00e1\u00e9 \u00ea\u00e1\u00f4\u00dc\u00eb\u00ef\u00e3\u00ef\u00f2! +not.writable.warning=\u00c1\u00e4\u00fd\u00ed\u00e1\u00f4\u00f9\u00ed \u00e7 \u00e4\u00e9\u00e5\u00e3\u00e3\u00f1\u00e1\u00f6\u00de \u00f3\u00f4\u00ef {0}! +cannot.create.directory.warning=\u00c1\u00e4\u00fd\u00ed\u00e1\u00f4\u00f9\u00ed \u00e7 \u00e4\u00e7\u00ec\u00e9\u00ef\u00f5\u00f1\u00e3\u00e5\u00df\u00e1 \u00f4\u00ef\u00fd \u00ea\u00e1\u00f4\u00e1\u00eb\u00fc\u00e3\u00ef\u00f5 {0}! +maven.repo.local.unset.warning=maven.repo.local \u00e4\u00e5\u00ed \u00dd\u00f7\u00e5\u00e9 \u00ef\u00f1\u00e9\u00f3\u00f4\u00e5\u00df. +single.unsatisfied.dependency.error= \u00c7 \u00e4\u00e9\u00e1\u00e4\u00e9\u00ea\u00e1\u00f3\u00df\u00e1 \u00e4\u00e5\u00ed \u00ec\u00f0\u00ef\u00f1\u00e5\u00df \u00ed\u00e1 \u00f3\u00f5\u00ed\u00e5\u00f7\u00e9\u00f3\u00f4\u00e5\u00df! \u00cb\u00e5\u00df\u00f0\u00e5\u00e9 \u00e7 \u00e1\u00ea\u00fc\u00eb\u00ef\u00f5\u00e8\u00e7 \u00e5\u00ee\u00dc\u00f1\u00f4\u00e7\u00f3\u00e5\u00e9: +multiple.unsatisfied.dependency.error=\u00c7 \u00e4\u00e9\u00e1\u00e4\u00e9\u00ea\u00e1\u00f3\u00df\u00e1 \u00e4\u00e5\u00ed \u00ec\u00f0\u00ef\u00f1\u00e5\u00df \u00ed\u00e1 \u00f3\u00f5\u00ed\u00e5\u00f7\u00e9\u00f3\u00f4\u00e5\u00df! \u00cb\u00e5\u00df\u00f0\u00ef\u00f5\u00ed \u00e7 \u00e1\u00ea\u00fc\u00eb\u00ef\u00f5\u00e8\u00e5\u00f2 \u00e5\u00ee\u00e1\u00f1\u00f4\u00de\u00f3\u00e5\u00e9\u00f2: +offline.snapshot.warning=\u00c5\u00f1\u00e3\u00dc\u00e6\u00e5\u00f3\u00e1\u00e9 \u00e1\u00f0\u00ef\u00f3\u00f5\u00ed\u00e4\u00e5\u00e4\u00ef\u00ec\u00dd\u00ed\u00ef\u00f2! \u00c7 \u00e4\u00e9\u00e1\u00e4\u00e9\u00ea\u00e1\u00f3\u00df\u00e1 \u00e8\u00e1 \u00f3\u00f5\u00ed\u00e5\u00f7\u00df\u00f3\u00e5\u00e9 \u00e1\u00eb\u00eb\u00dc \u00e5\u00df\u00ed\u00e1\u00e9 \u00e4\u00f5\u00ed\u00e1\u00f4\u00fe\u00ed {0} \u00ed\u00e1 \u00ec\u00e7\u00ed \u00e5\u00df\u00ed\u00e1\u00e9 \u00e5\u00ed\u00e7\u00ec\u00e5\u00f1\u00f9\u00ec\u00dd\u00ed\u00ef! +download.message=\u00d0\u00f1\u00f9\u00f3\u00f0\u00e1\u00e8\u00fe \u00ed\u00e1 \u00ec\u00e5\u00f4\u00e1\u00f6\u00dd\u00f1\u00f9 {0}. +plugin.loading.error=\u00c1\u00e4\u00fd\u00ed\u00e1\u00f4\u00f9\u00ed \u00ed\u00e1 \u00f6\u00ef\u00f1\u00f4\u00f9\u00e8\u00e5\u00df \u00f4\u00ef plugin {0}! +empty.descriptor.error=\u00d4\u00ef \u00e1\u00f1\u00f7\u00e5\u00df\u00ef {0} \u00f0\u00ef\u00fd \u00ea\u00e1\u00e8\u00ef\u00f1\u00df\u00f3\u00e1\u00f4\u00e5 \u00dd\u00f7\u00e5\u00e9 \u00ec\u00dd\u00e3\u00e5\u00e8\u00ef\u00f2 \u00ec\u00e7\u00e4\u00dd\u00ed. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_en.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_en.properties new file mode 100644 index 00000000..aaf95bfd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_en.properties @@ -0,0 +1,23 @@ +# 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. + +# NOTE: +# This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It +# must be provided nevertheless such that a request for locale "en" will not erroneously pick up the bundle for the +# JVM's default locale (which need not be "en"). See the method javadoc about +# ResourceBundle.getBundle(String, Locale, ClassLoader) +# for a full description of the lookup strategy. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_es.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_es.properties new file mode 100644 index 00000000..d54395e3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_es.properties @@ -0,0 +1,33 @@ +# 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. + +# -------------------------------------------------------------------------- +# Verificador de Proyecto +# -------------------------------------------------------------------------- +failed.download.warning=\u00a1ATENCION!: \u00a1Imposible descargar {0}! +remote.repository.disabled.warning=El uso de repositorios remotos est\u00e1 desactivado.. +directory.nonexistant.warning=\u00a1El directorio {0} no existe! Intentando crear... +not.directory.warning=\u00a1{0} no es un directorio! +not.writable.warning=\u00a1Imposible escribir en {0}! +cannot.create.directory.warning=\u00a1Imposible crear el directorio {0}! +maven.repo.local.unset.warning=\u00a1maven.repo.local no est\u00e1 definido! +single.unsatisfied.dependency.error=\u00a1El proceso no puede seguir! Falta la siguiente dependencia: +multiple.unsatisfied.dependency.error=\u00a1El proceso no puede seguir! Faltan las siguientes dependencias: +offline.snapshot.warning=\u00a1Est\u00e1s trabajando fuera de linea! \u00a1El proceso seguir\u00e1, pero es posible que {0} no est\u00e9 actualizado! +download.message=Intentando descargar {0}. +plugin.loading.error=\u00a1No se ha podido cargar el plugin {0}! +empty.descriptor.error=El fichero especificado, {0} , tiene longitud cero. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_fr.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_fr.properties new file mode 100644 index 00000000..06eb48f5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_fr.properties @@ -0,0 +1,33 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +failed.download.warning=ATTENTION: Impossible de t\u00e9l\u00e9charger {0}. +remote.repository.disabled.warning=L'utilisation du d\u00e9p\u00f4t distant est d\u00e9sactiv\u00e9e. +directory.nonexistant.warning=Le r\u00e9pertoire {0} n'existe pas. Tentative de cr\u00e9ation. +not.directory.warning={0} n'est pas un r\u00e9pertoire. +not.writable.warning=Impossible d'\u00e9crire sur {0}. +cannot.create.directory.warning=Impossible de cr\u00e9er le r\u00e9pertoire {0}. +maven.repo.local.unset.warning=maven.repo.local n'est pas d\u00e9fini. +single.unsatisfied.dependency.error=Le processus ne peut continuer \u00e0 cause de la d\u00e9pendance manquante suivante: +multiple.unsatisfied.dependency.error=Le processus ne peut continuer \u00e0 cause des d\u00e9pendances manquantes suivantes: +offline.snapshot.warning=Vous travaillez hors-connexion, alors le processus va continuer, mais {0} peut ne pas \u00eatre \u00e0 jour! +download.message=Tentative de t\u00e9l\u00e9chargement de {0}. +plugin.loading.error=Impossible de charger le plugin {0}. +empty.descriptor.error=Le fichier {0} que vous avez sp\u00e9cifi\u00e9 est vide. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_ja.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_ja.properties new file mode 100644 index 00000000..e1b65666 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_ja.properties @@ -0,0 +1,34 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +failed.download.warning=WARNING: {0} \u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f. +remote.repository.disabled.warning=\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u304c\u7121\u52b9\u3067\u3059. +directory.nonexistant.warning=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea {0} \u304c\u5b58\u5728\u3057\u307e\u305b\u3093. \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059. +not.directory.warning={0} \u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u306f\u3042\u308a\u307e\u305b\u3093. +not.writable.warning={0} \u306f\u66f8\u304d\u8fbc\u307f\u53ef\u80fd\u3067\u306f\u3042\u308a\u307e\u305b\u3093. +cannot.create.directory.warning=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea {0} \u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093. +maven.repo.local.unset.warning=maven.repo.local \u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093. +single.unsatisfied.dependency.error=\u4ee5\u4e0b\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u6e80\u305f\u3055\u308c\u306a\u304b\u3063\u305f\u305f\u3081\u3001\u30d3\u30eb\u30c9\u3092\u7d9a\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093: +multiple.unsatisfied.dependency.error=\u4ee5\u4e0b\u306e\u3044\u304f\u3064\u304b\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u6e80\u305f\u3055\u308c\u306a\u304b\u3063\u305f\u305f\u3081\u3001\u30d3\u30eb\u30c9\u3092\u7d9a\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093: +offline.snapshot.warning=\u30aa\u30d5\u30e9\u30a4\u30f3\u30e2\u30fc\u30c9\u3067\u30d3\u30eb\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059. {0} \u306f\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5229\u7528\u3055\u308c\u307e\u3059. +download.message={0} \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059. +plugin.loading.error=\u30d7\u30e9\u30b0\u30a4\u30f3 {0} \u3092\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093. +empty.descriptor.error=\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb {0} \u306f\u7a7a\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3059. +checksum.verification.error=\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8 {0} \u304c\u4e0d\u6b63\u3067\u3059. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_ko.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_ko.properties new file mode 100644 index 00000000..b3f1efac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_ko.properties @@ -0,0 +1,34 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +cannot.create.directory.warning = \uB514\uB809\uD130\uB9AC {0} \uC744/\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +checksum.verification.error = \uB2E4\uC74C\uC758 \uC544\uB9AC\uD329\uD2B8(artifact)\uC5D0\uC11C \uC5D0\uB7EC\uAC00 \uBC1C\uC0DD\uD569\uB2C8\uB2E4: {0} +directory.nonexistant.warning = \uB514\uB809\uD130\uB9AC {0} \uC774/\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0DD\uC131\uC744 \uC2DC\uB3C4\uD569\uB2C8\uB2E4. +download.message = {0} \uC744/\uB97C \uB2E4\uC6B4\uB85C\uB4DC \uD569\uB2C8\uB2E4. +empty.descriptor.error = \uD30C\uC77C {0} \uC758 \uAE38\uC774\uAC00 0\uC785\uB2C8\uB2E4. +failed.download.warning = \uACBD\uACE0: {0} \uC744/\uB97C \uB2E4\uC6B4\uB85C\uB4DC \uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. +maven.repo.local.unset.warning = maven.repo.local \uC774 \uC124\uC815\uB418\uC5B4\uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +multiple.unsatisfied.dependency.error = \uB2E4\uC74C\uC758 \uC758\uC874\uC131\uB4E4\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uBABB\uD588\uAE30 \uB54C\uBB38\uC5D0, \uBE4C\uB4DC\uB97C \uACC4\uC18D \uC9C4\uD589\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +not.directory.warning = {0} \uC740/\uB294 \uB514\uB809\uD130\uB9AC\uAC00 \uC544\uB2D9\uB2C8\uB2E4. +not.writable.warning = {0} \uC740/\uB294 \uC4F0\uAE30\uB97C \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +offline.snapshot.warning = \uC624\uD504\uB77C\uC778\uC73C\uB85C \uC791\uC5C5\uD558\uACE0 \uC788\uAE30 \uB54C\uBB38\uC5D0 \uBE4C\uB4DC\uB294 \uACC4\uC18D \uC9C4\uD589\uD558\uC9C0\uB9CC, {0} \uC740/\uB294 \uCD5C\uC2E0 \uBC84\uC804\uC774 \uC544\uB2D0 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4! +plugin.loading.error = \uD50C\uB7EC\uADF8\uC778 {0} \uC744/\uB97C \uC77D\uC5B4\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +remote.repository.disabled.warning = \uC6D0\uACA9 \uC800\uC7A5\uC18C \uC0AC\uC6A9\uC744 \uD5C8\uAC00\uD558\uC9C0 \uC54A\uC740(disabled) \uC0C1\uD0DC\uC785\uB2C8\uB2E4. +single.unsatisfied.dependency.error = \uB2E4\uC74C\uC758 \uC758\uC874\uC131\uB4E4\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uBABB\uD588\uAE30 \uB54C\uBB38\uC5D0, \uBE4C\uB4DC\uB97C \uACC4\uC18D \uC9C4\uD589\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_nl.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_nl.properties new file mode 100644 index 00000000..0e22d6ce --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_nl.properties @@ -0,0 +1,33 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +failed.download.warning=WAARSCHUWING: Kan {0} niet downloaden. +remote.repository.disabled.warning=Het gebruik van de remote repository is uitgezet. +directory.nonexistant.warning=Directory {0} bestaat niet. Probeer hem aan te maken. +not.directory.warning={0} is geen directory. +not.writable.warning={0} is niet schrijfbaar. +cannot.create.directory.warning=Kan {0} directory niet aanmaken +maven.repo.local.unset.warning=maven.repo.local is niet ingesteld. +single.unsatisfied.dependency.error=Het bouwen kan niet doorgaan, omdat de volgende afhankelijkheid niet achterhaald kan worden: +multiple.unsatisfied.dependency.error=Het bouwen kan niet doorgaan, omdat de volgende afhankelijkheden niet achterhaald kunnen worden: +offline.snapshot.warning=Je werkt offline, dus het bouwen gaat verder, maar {0} kan eventueel niet up-to-date zijn! +download.message=Probeer {0} te downloaden. +plugin.loading.error=De {0} plugin kan niet worden geladen. +empty.descriptor.error=The {0} file you specified has zero length. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_no.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_no.properties new file mode 100644 index 00000000..af320f6b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_no.properties @@ -0,0 +1,33 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +failed.download.warning=ADVARSEL: Mislykket nedlasting av {0}. +remote.repository.disabled.warning=Bruk av fjernlager er deaktivert. +directory.nonexistant.warning=Mappen {0} finnes ikke. Fors\u00f8ker \u00e5 opprette. +not.directory.warning={0} er ikke en mappe. +not.writable.warning=Kan ikke skirve til {0}. +cannot.create.directory.warning=Kan ikke opprette mappen {0}. +maven.repo.local.unset.warning=maven.repo.local er ikke definert. +single.unsatisfied.dependency.error=Byggeprosessen kan ikke fortsette p\u00e5 grunn av f\u00f8lgende mislykkede avhengighet: +multiple.unsatisfied.dependency.error=The build cannot continue because of the following unsatisfied dependencies: +offline.snapshot.warning=Du arbeider frakoblet. Byggeprosessen vil fortsette, men {0} kan bli utdatert! +download.message=Fors\u00f8ker \u00e5 laste ned {0}. +plugin.loading.error=Plugin {0} kunne ikke lastes. +empty.descriptor.error=The {0} file you specified has zero length. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_pl.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_pl.properties new file mode 100644 index 00000000..36a292bd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_pl.properties @@ -0,0 +1,33 @@ +# 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 Verifier +# -------------------------------------------------------------------------- +failed.download.warning=UWAGA: Nie uda\u0142o si\u0119 sci\u0105gn\u0105\u0107 {0}. +remote.repository.disabled.warning=Korzystanie ze zdalnego repozytorium jest wy\u0142\u0105czone. +directory.nonexistant.warning=Katalog {0} nie istnieje. Pr\u00f3buj\u0119 utworzy\u0107. +not.directory.warning={0} nie jest katalogiem. +not.writable.warning=Nie mo\u017cesz zapisa\u0107 {0}. +cannot.create.directory.warning=Nie mo\u017cesz utworzy\u0107 katalogu {0}. +maven.repo.local.unset.warning=maven.repo.local nie jest zdefiniowane. +single.unsatisfied.dependency.error=Budownaie przerwane z powodu nast\u0119puj\u0105cej niespe\u0142nionej zale\u017cno\u015bci: +multiple.unsatisfied.dependency.error=Budownaie przerwane z powodu nast\u0119puj\u0105cych niespe\u0142nionych zale\u017cno\u015bci: +offline.snapshot.warning=Pracujesz w trybie offline, wi\u0119c budowanie b\u0119dzie kontunuowane, cho\u0107 {0} mo\u017ce by\u0107 nieaktualny! +download.message=Pr\u00f3buj\u0119 \u015bci\u0105gn\u0105\u0107 {0}. +plugin.loading.error=Nie uda\u0142o si\u0119 za\u0142adowa\u0107 pluginu {0}. +empty.descriptor.error=The {0} file you specified has zero length. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_zh_CN.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_zh_CN.properties new file mode 100644 index 00000000..93695186 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/messages/messages_zh_CN.properties @@ -0,0 +1,34 @@ +# 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. + +# -------------------------------------------------------------------------- +# \u9879\u76ee\u9a8c\u8bc1 +# -------------------------------------------------------------------------- +failed.download.warning=\u8b66\u544a\uff1a {0} \u4e0b\u8f7d\u5931\u8d25\u3002 +remote.repository.disabled.warning=\u7981\u6b62\u4f7f\u7528\u8fdc\u7a0b\u8d44\u6e90\u4ed3\u5e93\u3002 +directory.nonexistant.warning=\u76ee\u5f55 {0} \u4e0d\u5b58\u5728\u3002 \u5c1d\u8bd5\u65b0\u5efa\u4e2d\u2026\u2026 +not.directory.warning={0} \u4e0d\u662f\u76ee\u5f55\u3002 +not.writable.warning={0} \u53ea\u8bfb\u3002 +cannot.create.directory.warning=\u521b\u5efa\u76ee\u5f55 {0} \u5931\u8d25\u3002 +maven.repo.local.unset.warning=\u6ca1\u6709\u8bbe\u7f6e maven.repo.local \u5c5e\u6027\u3002 +single.unsatisfied.dependency.error=\u7531\u4e8e\u4ee5\u4e0b\u7684\u4f9d\u8d56\u7f3a\u5c11\uff0c\u521b\u5efa\u4e0d\u80fd\u8fdb\u884c\uff1a +multiple.unsatisfied.dependency.error=\u7531\u4e8e\u4ee5\u4e0b\u7684\u4f9d\u8d56\u7f3a\u5c11\uff0c\u521b\u5efa\u4e0d\u80fd\u8fdb\u884c\uff1a +offline.snapshot.warning=\u79bb\u7ebf\u65f6\u521b\u5efa\uff0c\u53ef\u80fd {0} \u8fc7\u671f\uff01 +download.message=\u5c1d\u8bd5\u4e0b\u8f7d {0}\u2026\u2026 +plugin.loading.error=\u88c5\u5165 plugin {0} \u5931\u8d25\u3002 +empty.descriptor.error=\u6587\u4ef6 {0} \u7684\u957f\u5ea6\u4e3a0\u3002 +checksum.verification.error=\u4ee5\u4e0b\u8d44\u6e90\u5df2\u88ab\u7834\u574f\uff1a{0}\u3002 diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/project/standalone.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/project/standalone.xml new file mode 100644 index 00000000..acb5be2d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/resources/org/apache/maven/project/standalone.xml @@ -0,0 +1,30 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven</groupId> + <artifactId>standalone-pom</artifactId> + <version>1</version> + <packaging>pom</packaging> + <name>Maven Stub Project (No POM)</name> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/artifact-handlers.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/artifact-handlers.apt new file mode 100644 index 00000000..916161bf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/artifact-handlers.apt @@ -0,0 +1,59 @@ +~~ 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. + + --- + Default Artifact Handlers Reference + --- + Hervé Boutemy + --- + 2013-08-02 + --- + +Default Artifact Handlers Reference + + Some artifact handlers (see {{{../maven-artifact/apidocs/org/apache/maven/artifact/handler/ArtifactHandler.html} API}}) + are configured by default in <<<META-INF/plexus/artifact-handlers.xml>>>: + +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +|| type || extension || packaging || classifier || language || added to classpath || includesDependencies || +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<pom>>> | <= type> | <= type> | | none | | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<jar>>> | <= type> | <= type> | | java | <<<true>>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<maven-plugin>>> | <<<jar>>> | <= type> | | java | <<<true>>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<ejb>>> | <<<jar>>> | <= type> | | java | <<<true>>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<ejb3>>> | <= type> | <= type> | | java | | <<<true>>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<war>>> | <= type> | <= type> | | java | | <<<true>>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<ear>>> | <= type> | <= type> | | java | | <<<true>>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<rar>>> | <= type> | <= type> | | java | | <<<true>>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<par>>> | <= type> | <= type> | | java | | <<<true>>> | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<java-source>>> | <<<jar>>> | <= type> | <<<sources>>> | java | | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<javadoc>>> | <<<jar>>> | <= type> | <<<javadoc>>> | java | <<<true>>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<ejb-client>>> | <<<jar>>> | <<<ejb>>> | <<<client>>> | java | <<<true>>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ +| <<<test-jar>>> | <<<jar>>> | <<<jar>>> | <<<tests>>> | java | <<<true>>> | | +*--------------------+------------+------------+---------------+-----------+---------------------+-----------------------+ diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/configuration-management.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/configuration-management.apt new file mode 100644 index 00000000..4af0f0b1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/configuration-management.apt @@ -0,0 +1,139 @@ +~~ 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. + + ----- + Maven configuration management + ----- + The Maven Team + ----- + +Configuration levels in maven + + In maven configuration control happens on four differ levels: the site level, the group level, + the project level, and the user level. On the site level you can configure maven for all users + utilizing the local installation, the group level allows configuration management for all the projects + that belong to the same group, the project level allows configuration management at + the project level, and the user level allows users to override settings on + the site level, group level and project level. + +* Site configuration + + At the site level all configuration is achieved by tweaking the the various files that + are available in the ${maven.home}/site-configuration directory + ++-----+ +${maven.home} + | + +--- maven.properties ++-----+ + +* Group configuration + + As far as properties go for an entire build the maven.properties could be placed at + the top of the group but I'm not really sure how this might work. There could probably + also be a directory for plugins.xml and maven.properties. + +* Project configuration + + At the project level all configuration is achieved by tweaking the POM. One of the differences between + maven 1.x and 2.x is that all project parameterization occurs in the POM and not from properties + files. + + For many of the more advanced features in Maven2 it is critical that POMs be available in the local repository. + Features like transitive dependencies and the new parent specification mechanism. The problem we run into is + that currently we have information about a project scattered across the project.xml and the + various properties files. What needs to be done is to encapsulate all of this in the POM. + + Typically users parameterize the use of plugins, or have custom values like ${user.name} + for use in elements like the <developerConnection/>. It would be idea if we + could encapsulate everything we need about the project in the POM including + plugin parameters and anything else. + + We once had a document that Vincent and I agreed upon and I was about to + implement it and then I disappeared for 8 months so it never came to pass. + + So I guess it's important to figure out what people are using propeties + files for and see if we can't incorporate it all into the POM. Or if we do + have properties file (something I would like to avoid) say they don't + contribute in any meaningful way to information in the POM. For example a + properties file could be used the specify $ so it can be interpolated in + <developerConnection/> but you couldn't use a properties file to specify the + version of your project say. Anyway, food for thought to begin with. + + - elements that are critical for pom dissemination + - those that are used locally by the user like <developerConnection/> + +* User configuration + + User configuration which is utilized site wide are controlled with the ${user.home}/.m2/maven.properties. + + User configuration which is utilized at the project level are controlled with the + ${project.home}/maven.properties file. + +Plugin configuration + + The configuration of plugins is of the same form as the maven {{{plugin-descriptors}plugin descriptors}} + themselves: + ++-----+ +<plugins> + <plugin> + <id>xdoc</id> + <version>1.0</version> + <parameters> + <parameter> + <name>theme</name> + <value>classic</value> + </parameter> + </parameters> + </plugin> +</plugins> ++-----+ + +Unified source directory + + Unified source directory structure that is analagous to the repository + itself. This way locations of intermediary artifacts of a build would be + in a known location. This would also help with developer setup i.e. getting + new developers up and running. They could run a maven command and have all + their source trees set up in the same way as their collegues. + + here's what I do currently in the netbeans part of the mevenide project to + find the relevant subprojects/sibling projects. I check if the user has + defined the maven.multiproject.includes property in any of his properties + files for the current project. if yes. then I'm able to find projects that + can be offered to be opened together with the current project. + problems with the current solution are: + 1. information is duplicate. once in POM's dependencies and once in the + maven.multiproject.includes property. + 2. it works without problems only for projects with relative paths, eg. from + one CVS repository.. for projects from multiple SCM repositories it's harder + to maintain the same relative links on all developer computers. + not sure the unified source directory structure addresses this issue. + + Properties + + maven.user.config.dir (system,default=${user.home}/.m2) + maven.home (system,user,default=${user.home}/m2) + maven.repo.local (system,user,default=${maven.user.config.dir}/repository) + + We need to define what happens in the when things are not setup correctly + + o ~/.m2 directory does not exist + o ~/.m2/maven.properties does not exist + o if they once existed but now to do not exist + o what the installer will take care of of what we can recover from diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/default-bindings.apt.vm b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/default-bindings.apt.vm new file mode 100644 index 00000000..02d6c4a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/default-bindings.apt.vm @@ -0,0 +1,67 @@ +~~ 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. + + --- + Plugin Bindings for Default Lifecycle Reference + --- + Hervé Boutemy + --- + 2013-08-02 + --- + +Plugin Bindings for <<<default>>> Lifecycle Reference + + The {{{./lifecycles.html}<<<default>>> lifecycle}} is defined without any plugin binding; plugin bindings are defined separately + in <<<META-INF/plexus/default-bindings.xml>>> because they are specific for each packaging: + +%{toc|fromDepth=2} + +* Plugin bindings for <<<pom>>> packaging + +%{snippet|id=pom-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<jar>>> packaging + +%{snippet|id=jar-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<ejb>>> packaging + +%{snippet|id=ejb-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<ejb3>>> packaging + +%{snippet|id=ejb3-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<maven-plugin>>> packaging + +%{snippet|id=maven-plugin-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<war>>> packaging + +%{snippet|id=war-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<ear>>> packaging + +%{snippet|id=ear-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<rar>>> packaging + +%{snippet|id=rar-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} + +* Plugin bindings for <<<par>>> packaging + +%{snippet|id=par-lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/default-bindings.xml} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/getting-to-container-configured-mojos.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/getting-to-container-configured-mojos.apt new file mode 100644 index 00000000..1c4a487d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/getting-to-container-configured-mojos.apt @@ -0,0 +1,102 @@ +~~ 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. + + --- + Getting to Plexus-configured Mojos + --- + John Casey + --- + 29-April-2005 + +Abstract + + We're moving toward integrating mojos as first-class plexus components, while + at the same time avoiding introducing required plexus dependencies into the + mojo development model. + + In order to really achieve this, we need mojo configurations (which are + provided both in terms of static expressions that are just looked up, and + in terms of user-provided configuration from system properties or the POM). + If these mojos are to be first-class components, the configuration from these + various sources must be consolidated and injected using the container. + + Currently, mojo configuration is done externally to the container, in the + DefaultPluginManager in the maven-core API. In order to get from here to + there, we need to do several things to add capability to the default + configuration of plexus. This document will detail those changes. + +Container Enhancements + +* ExpressionEvaluator + + Currently, the expression evaluator used to resolve configuration values + is the DefaultExpressionEvaluator, which is a local variable within the + implementation of the BasicComponentConfigurator. This ExpressionEvaluator + simply returns the expression itself as the resolved value, which adds + very little value to the container. Things like ${project.build.resources} + are not resolved, and result in a type mismatch for the member injection. + + We need a replacement for DefaultExpressionEvaluator that is capable of + traversing an object graph and extracting Object values, not just Strings. + +* ComponentConfigurator + + Currently, the container uses BasicComponentConfigurator, to configure + components. This wouldn't be a problem, except for the local instance of + DefaultExpressionEvaluator used within. See the above discussion for more + on why this evaluator is bad. We need to provide either an alternative + implementation under a different roleHint, or else replace the + BasicComponentConfigurator. + +* Other + + We may need to define a new lifecycle/phase to contextualize a mojo right + before it's used, and reset it's state afterward. Up to now, the approach + of most plexus components has been to avoid instance state like the plague. + With the current parameter passing model of mojos, this will not be possible, + particularly when we move mojos to a singleton instantiation model, and then + run a reactorized project...the successive calls may leave behind configuration + artifacts from invocation to invocation. + +Maven Modifications + +* DefaultPluginManager + + s/getMojoConfiguration()/getConfiguration()/g + + That should re-enable usage of mojo configuration. Ideally, we won't need any + of the code that references this method, since the container should provide + some way of recontextualizing the mojo, and all we would need to do is inject + POM configuration via the lookup method or something. + +* PluginDescriptorBuilder + + s/getMojoConfiguration()/getConfiguration()/g + + That should be all there is to it. + +* MojoDescriptor + + Remove set/getMojoConfiguration(..), as it will become obsolete. + +* MavenSession + + We may need to enable the context injection here, since this will be + instantiated per-project. If we always inject the same context parameters, + and are careful to inject nulls where things are missing, we should be + able to minimize reconfiguration artifacts injected from basic parameters. + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/index.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/index.apt new file mode 100644 index 00000000..f6c26fde --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/index.apt @@ -0,0 +1,77 @@ +~~ 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. + + ----- + Introduction + ----- + Hervé Boutemy + ----- + 2013-07-27 + ----- + +Maven Core + + Maven Core classes managing the whole build process. + +* Useful entry points + + * {{{./lifecycles.html}lifecycles}} and {{{./default-bindings.html}plugin bindings to <<<default>>> lifecycle}}, + + * {{{./artifact-handlers.html}default artifact handlers}}, + + * <<<Maven>>> component ({{{./apidocs/org/apache/maven/Maven.html}javadoc}}), + with its <<<DefaultMaven>>> implementation ({{{./xref/org/apache/maven/DefaultMaven.html}source}}), + + * <<<ProjectBuilder>>> component ({{{./apidocs/org/apache/maven/project/ProjectBuilder.html}javadoc}}), + with its <<<DefaultProjectBuilder>>> implementation + ({{{./xref/org/apache/maven/project/DefaultProjectBuilder.html}source}}), + + * <<<MavenPluginManager>>> component ({{{./apidocs/org/apache/maven/plugin/MavenPluginManager.html}javadoc}}), + with its <<<DefaultMavenPluginManager>>> implementation + ({{{./xref/org/apache/maven/plugin/internal/DefaultMavenPluginManager.html}source}}), + + * {{{./apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html}PluginParameterExpressionEvaluator}}, used to + evaluate plugin parameters values during Mojo configuration, + + * {{{/guides/mini/guide-maven-classloading.html}classloader hierarchy}} done by <<<ClassRealmManager>>> component + ({{{./apidocs/org/apache/maven/classrealm/ClassRealmManager.html}javadoc}}), + with its <<<DefaultClassRealmManager>>> implementation + ({{{./xref/org/apache/maven/classrealm/DefaultClassRealmManager.html}source}}), using + {{{http://plexus.codehaus.org/plexus-classworlds/}Plexus Classworlds}}, + + * {{{./extension.html}extension descriptor}}, + + * <<<ExceptionHandler>>> component ({{{./apidocs/org/apache/maven/exception/ExceptionHandler.html}javadoc}}), + with its <<<DefaultExceptionHandler>>> implementation + ({{{./xref/org/apache/maven/exception/DefaultExceptionHandler.html}source}}), use to transform exception into useful end-user messages. + +* Toolchains + + * {{{./toolchains.html}Toolchains descriptor reference}}, + + * public API for toolchains-aware plugins: <<<ToolchainManager>>> component ({{{./apidocs/org/apache/maven/toolchain/ToolchainManager.html}javadoc}}) + with its <<<DefaultToolchainManager>>> implementation ({{{./xref/org/apache/maven/toolchain/DefaultToolchainManager.html}source}}), + to get selected <<<Toolchain>>> ({{{./apidocs/org/apache/maven/toolchain/Toolchain.html}javadoc}}) instance, + + * internal <<<ToolchainManagerPrivate>>> component ({{{./apidocs/org/apache/maven/toolchain/ToolchainManagerPrivate.html}javadoc}}) + with its <<<DefaultToolchainManagerPrivate>>> implementation ({{{./xref/org/apache/maven/toolchain/DefaultToolchainManagerPrivate.html}source}}), + to manage toolchain selection, + + * internal JDK toolchain implementation: <<<JavaToolchain>>> interface ({{{./apidocs/org/apache/maven/toolchain/java/JavaToolchain.html}javadoc}}), + with its <<<JavaToolchainImpl>>> implementation + ({{{./xref/org/apache/maven/toolchain/java/JavaToolchainImpl.html}source}}) and <<<JavaToolchainFactory>>> + factory ({{{./xref/org/apache/maven/toolchain/java/JavaToolchainFactory.html}source}}). diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/inheritance.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/inheritance.apt new file mode 100644 index 00000000..dbf0e2c2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/inheritance.apt @@ -0,0 +1,100 @@ +~~ 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. + + ----- + Inheritance in Maven + ----- + The Maven Team + ----- + +Inheritance in Maven + + In order the understand how inheritance works in Maven there are a few notions that you must be familiar with: + + * The maven super model + + * how parent poms are processed + + * the order in which elements in the POM are overridden + + * minimum element-set for a valid project pom + + +Maven super model + + Inheritance is recursive in Maven but there is a special model which is the implicit super parent in the lineage + of models you may specify: + + all of the models that you specify are collected to produce a lineage and then the super model is place at + the top of that lineage to provide default values. + + The super model is where we place all the values which we believe to be standard, values that can be shared and + utilized across all your maven projects. + ++-----+ + m0 <- m1 <- m2 ++-----+ + + which is transformed into + ++-----+ + super model <- m0 <- m1 <- m2 ++-----+ + ++-----+ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId></groupId> + <artifactId></artifactId> + <version></version> + </parent> +</project> ++-----+ + +Extending the POM in the future + + In order to anticipate changes in the structure of the POM as new releases of + maven occur, the maven inheritance model must be pinned against a particular + modelVersion. This is required so that a change from modelVersion 4.0.0 to + 4.1.0 doesn't cause compatibility problems with users who have not upgraded + their projects. It also allows for a certain amount of legacy support into the + future. Therefore, we should rename this file from pom.xml in the maven-core + jarfile to pom-4.0.0.xml (and successive revisions to the base pom made to + accommodate changes in the model will be named accordingly - 4.0.1, 4.0.2, ...). + +Minimum Element-Set for a Project POM + + In order to furnish a basic set of information which we need to distinguish one + project from another, maven requires a minimum set of elements to be specified + in each project's pom.xml. + + - [modelVersion] tells maven which version of the object model this project + is compliant with (to support future legacy concerns) + + - [artifactId] tells maven what the artifact name is for this particular + project. Each project should have a distinct artifactId. + + - [version] tells maven what release of this artifact we're trying to produce. + The fact that a project has a distinct pom.xml should indicate a separate + release cycle that is also distinct to that project, so a concrete version + declaration is required. + + - [name] tells maven what the user-friendly name of this project is. The name + element is similar to artifactId in that it is a unique descriptor for + this and only this project, and therefore should be concretely defined. + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/lifecycles.apt.vm b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/lifecycles.apt.vm new file mode 100644 index 00000000..3e47bc90 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/lifecycles.apt.vm @@ -0,0 +1,49 @@ +~~ 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. + + ----- + Lifecycles Reference + ----- + Hervé Boutemy + ----- + 2013-08-02 + ----- + +Lifecycles Reference + + Maven defines 3 lifecycles in <<<META-INF/plexus/components.xml>>>: + +%{toc|fromDepth=2} + +* <<<default>>> Lifecycle + + <<<default>>> lifecycle is defined <<without>> any associated plugin. + Plugin bindings for this lifecycle are {{{./default-bindings.html}defined separately for every packaging}}: + +%{snippet|id=lifecycle|file=${project.basedir}/src/main/resources/META-INF/plexus/components.xml} + +* <<<clean>>> Lifecycle + + <<<clean>>> lifecycle is defined directly with its plugin bindings. + +%{snippet|id=clean|file=${project.basedir}/src/main/resources/META-INF/plexus/components.xml} + +* <<<site>>> Lifecycle + + <<<site>>> lifecycle is defined directly with its plugin bindings. + +%{snippet|id=site|file=${project.basedir}/src/main/resources/META-INF/plexus/components.xml} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/offline-mode.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/offline-mode.apt new file mode 100644 index 00000000..faec70fa --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/offline-mode.apt @@ -0,0 +1,269 @@ +~~ 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. + + --- + Offline Mode Design + --- + John Casey + --- + 08-April-2005 + --- + +Offline Mode Design + +* UPDATE: 18-April-2005 + + We cannot take the approach outlined below of detecting which remote + repositories are "really" offline, since offline mode is more of a behavior, + and this will lead to counter-intuitive results. A different feature may exist + unimplemented, which is to detect when the network is down and provide better + feedback for that case. However, when offline mode is declared, nothing + earmarked as remote should be accessed, regardless of whether it is actually + a physically local resource. + + NOTE: One side-effect of this design change is that all offline-mode code can + be isolated to maven-core, maven-plugin-descriptor, and [possibly] + maven-artifact. Usage of maven-wagon will be determined by an offline-aware + manager. + +* Assumptions: What is Offline? + + For the purposes of determining the areas sensitive to offline status, + it is definitely useful to define what the offline state really means. + + [[1]] This is obvious, but the network/internet is unavailable. + + [[2]] Localhost (127.0.0.1) may also be unavailable if the whole + network stack is offline. + + [[3]] "Remote" repositories referenced using the file:// protocol may + be available. However, if that file:// url references a + file-share, as in the case of an NFS or SMB mount, that will + be unavailable. + + So, offline mode has several implications, some of which may not be + altogether obvious: + + * Localhost may be unavailable. Therefore, even locally installed + server processes which work by conversing over a port may fail. + + * Not all "remote" repositories will fail. Specifically, if the remote + repo uses the file:// protocol, and it doesn't refer to a shared + filesystem, it will continue to be available. + + The question remaining is: Which level of offline mode will we support? It + seems reasonable to assume that users will be able to tell when localhost is + not active (in most cases, localhost should be available, even if the rest of + the network is not). Therefore, let's concentrate on the state where no + network <beyond localhost> exists, and leave the more extreme state to users + to diagnose and correct as necessary. + +* Why is Offline Mode Important? + + Offline mode is essential for breaking the requirement that m2 operate in a + network-connected environment. It means legitimizing a development environment + in which there is no network connection, and providing a robust m2 service + offering in such circumstances. Introduction of offline mode allows m2 to + anticipate the inevitable network failures that accompany being physically + disconnected from the network, and adjust it's behavior accordingly. + + It is more than simply understanding that m2 cannot go and check for the + latest version of some snapshot artifact. If m2 is offline, SCM operations + cannot succeed; no artifact downloads can take place, regardless of whether + they are snapshot versions; artifact deployment cannot take place; certain + types of tests cannot be setup, since the container used to run them cannot be + reached or started. + + All of these operations will produce their own unique errors in the absence of + a coordinated offline strategy. In addition, efforts to unite these failing + behaviors behind a consistent user interface is much, much more difficult if + the system can't tell whether it has access to the network required by these + operations. + + Offline mode really means anticipating a lack of network connectivity, and as + a result turning off certain services provided by m2 and providing a coherent + way of predicting and reporting when network-related failures will take place. + It means warning users that since the network is missing, certain features and + operations will be unavailable, rather than simply waiting for those + operations to fail, then trying to help users decipher the error messages they + get as a result. + +* Implications for Resolution + +** Dependency Resolution + + This one is obvious...we only have access to the repositories using + the file:// protocol and living on a truly local filesystem when + offline. + +** Plugin Resolution + + This is similar to dependency resolution. Plugin repositories not + using file:// or not residing on a local (not shared) filesystem will + be unavailable. + + +* Implications for Mojo Execution + +** Deployment mojos + + The concept of deployment is dependent on the availability of a some + remote repository. Just as above, if that repository is not using + file:// (which is highly likely to be the case), or the repository is + not on a local filesystem, deployment will fail when offline. + +** Testing mojos + + This can be a problem if the tests are more than simple unit tests; + that is, if they require configuration of a server process, and + subsequent testing in-container. + + Since we're only going to concern ourselves with states where localhost is + still active, we only need to worry about this case when the server container + is <<not>> installed on localhost. This allows the popular pattern of starting + a server container in-JVM, running tests against it, and shutting it down. + +** SCM mojos + + See below for discussion on SCM-related operations. Any mojo which + carries out some analysis or other interaction with a SCM system + will likely be unavailable when in offline mode. + + +* Implications for Subsystems + +** Maven-Wagon + + Parts of Wagon will continue to function normally. These include: + + * The file wagon, provided the referenced location is on a local + filesystem. + + It is not possible to determine whether a file-based location will + be available except on a case-by-case basis (or a root-url by + root-url basis). We may want to move the offline sensitivity entirely to + Maven-Artifact, below, so we can be smarter about testing filesystem-based + repositories, etc. + + * If not otherwise specified, all other wagons are assumed to be + remote-only, and are therefore sensitive to offline mode. + +** Maven-Artifact + + This is wholly dependent on Maven-Wagon, above. + + We could possibly use a flag on a particular Wagon to see whether it supports + offline mode, and then test to see if the file-based basedir for an aritfact + repository works...if it doesn't work, we can mark that repository offline... + + OTOH, all offline-mode checks can probably be run from Wagon-based APIs. + +** Maven-SCM + + In all but trivial examples, SCM operations cannot complete without + having access to the versioning server. Therefore, it is assumed that + any SCM-related activity will be unavailable when m2 is in offline + mode. + +** Maven-Core + + We'll examine the different parts of maven-core on a case-by-case + basis, below: + +*** DefaultLifecycleExecutor + + When binding goals to the project's configured lifecycle, each mojo + descriptor should declare whether it requires online/offline status. + This value should be a java.lang.Boolean, so it can implement 3VL + (three value logic: yes, no, don't-care). The requiresOnline + field in the mojo descriptor has the following semantics: + + [true] Online status is required for this mojo to function + correctly. + + [false] <<(Default)>> Either status is acceptable for the mojo to + execute. It doesn't care. + + The majority of mojos will leave the requiresOnline == false, + since online/offline status will be irrelevant, provided they have + access to their required artifacts and other classpath elements. In the case + of required artifacts and other classpath elemtents, this is assumed by the + mojo API to be in a correct state, and will be handled by the Wagon + modifications. + + +* Implementation Notes + +** Accessibility of offline status + + Offline status should be indicated in the MavenSettings instance, since it + can conceivably be set from either the settings.xml or the command-line. + + In the event the '-o' switch is the impetus for setting offline mode, this + should result in modification of the active profile in the MavenSettings + instance, just as definition of the active profile from the command-line + should result in similar modification. This object is not meant to be + static within the build process, but rather to be setup as an aggregation of + all settings-related information passed into the system. + +** Control over downloads + + Find the control point for m2 using maven-wagon. At this point, inject + a offline status parameter which is used when retrieving the specific Wagon. + + If <<<offline == true>>>: + + * If the wagon is not bound to "file://", then ignore the request and print + a debug message. + + * If the wagon is bound to "file://" then: + + Retrieve the file or base-url file to be "downloaded". + + * If the file (or more usefully, the base-url file) exists, proceed. + + * If the file (or base-url file) doesn't exist, assume that this location + is part of a file-share. Ignore the request and print a debug message + as above. + +** Control over mojos in the lifecycle + + When binding a mojo to the project's lifecycle instance, check the mojo + descriptor's requiredConnectivity field. + + * If <<<(offline == true) && (requiresOnline != true)>>>, bind + the mojo to the lifecycle. + + In this case, the client is <<offline>>, and the mojo does not require + online status. + + * If <<<(offline == false) && (requiresOnline == true)>>>, bind + the mojo to the lifecycle. + + In this case, the client is <<online>>, and the mojo either requires + <<online>> status, or else doesn't care. + + * Otherwise, don't bind the mojo. Log a debug message to indicate that it is + sensitive the the online state of the application, and that this state is + currently wrong for execution. + + <<NOTE:>> Do we want to fail when we cannot bind a mojo to the lifecycle + because of offline/online status? That would probably indicate that the user + was trying to do something they cannot succeed at for now...so we probably + should throw an exception in this case. + + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/plugin-execution-isolation.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/plugin-execution-isolation.apt new file mode 100644 index 00000000..983a9fde --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/plugin-execution-isolation.apt @@ -0,0 +1,57 @@ +~~ 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. + + ----- + Maven plugins + ----- + The Maven Team + ----- + +Maven plugin execution isolation + + Maven2 takes advantage of Plexus' ability to execute a component using a + ClassWorlds ClassRealm that is populated with the JAR containing the + component in question and all of its dependencies. Using ClassWorlds + notation for realms we have the following: + ++-----+ + [plexus.core] + ^ + | + [plexus.core.maven] + ^ ^ + | | +[plugin0] [plugin1] ++-----+ + + The <<<plexus.core>>> realm contains the resources required to run any + plexus application; The <<<plexus.core.maven>>> realm contains all of the + resources required to run Maven. Each subseqent plugin realm contains the + JAR plugin as well as its dependencies. The realms noted above are setup + in a hierachical structure where the resources in the parent realms are + available but the <<realm is searched first before a search is made in + the parent realm>>. + + Plugins are guaranteed to be provided the resources found in + <<<plexus.core>>> and <<<plexus.core.maven>>> realms at run-time if required. + Plugins can state compile-time dependencies on any of the resources found in + the core realms listed above and these dependencies will be included in the + plugin descriptor that is generated but when running within Maven these + resources will be filtered out. In other words these resources will not + be added the realm created for the plugins execution as they are provided + in the parent realms. + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/scripting-support/marmalade-support.apt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/scripting-support/marmalade-support.apt new file mode 100644 index 00000000..7a809662 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/apt/scripting-support/marmalade-support.apt @@ -0,0 +1,196 @@ +~~ 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. + + --- + Marmalade Mojo Support - Notes + --- + John Casey + --- + 07-Feb-2005 + --- + +Marmalade Support + +*Abstract + + This document will track the design and implementation issues involved in + adding support to m2 for marmalade-based mojos. + +*Design Notes + + [[1]] <<Marmalade mojo descriptor specification.>> + + As in all mojo specifications, it is ideal that the descriptor for + a marmalade-based mojo be inline with the source code. This centralizes + all maintenance related to a single mojo to a single point of maintenance. + + The following is what I'm thinking as of now: + + - a marmalade-based mojo should look something like: + ++---+ + <mojo xmlns="m2:mojo" xmlns:marmalade-control="marmalade:marmalade-control" marmalade-control:el="none"> + + <metadata> + <id>mmld</id> + <name>mmldCompile</name> + <lifecyclePhase>compile</lifecyclePhase> + <description>Used to compile marmalade scripts into java beans.</description> + + <requiresDependencyResolution/> + <instantiationStrategy/> + <executionStrategy/> + + <parameters> + + <parameter> + <name>classpath</name> + <description>The compilation classpath</description> + <type>java.util.List</type> + <expression>#pom.artifacts</expression> + + <required/> + <validator/> + <default/> + + </parameter> + + </parameters> + + </metadata> + + <execute> + <!-- Do some stuff. --> + </execute> + + </mojo> ++---+ +[NOTE] All empty elements above signify optional elements, usage specification. + + [[2]] <<Marmalade mojo packager.>> + + The marmalade mojo packager will: + + [[a]] Locate all *.mmld files within the scripts directory of the project. + + The scripts directory should be tied to the script language within + the POM. Until we have multiple language support in the POM, we'll + use something like: <<<xpath(build/marmaladeSourceDirectory)>>>. + + [[b]] For each script found: + + [[i]] Execute the script with "gatherMetadata=true" in the context. + + [[ii]] Retrieve the mojo descriptor from the resulting "metadata" + variable in the context. + + [[iii]] Cache the mojo descriptor in aggregator for subsequent + output to plugin descriptor file. + + [[c]] Copy all scripts to the target directory. Preserve relative paths. + + [[d]] <<Process Disjoint:>> <Allow other mojo-descriptor collectors to + run, aggregating their descriptors in similar fashion to [b.iii] + above.> + + [[e]] Use the project's dependencies and other info to form the plugin + descriptor's header (non-mojo-specific info). + + [[f]] Use the PluginGenerator from maven-plugin-tools to generate a + META-INF/plexus/plugin.xml to the target directory. + + [[g]] Continue with lifecycle. + + This may include compilation of java helper classes, etc. and + plugin-artifact packaging, presumably via 'jar:jar' or similar. + + [[3]] <<Marmalade mojo loader.>> + + The marmalade mojo loader will: + + [[a]] Retrieve the implementation spec (this is the path of the script, + relative to the root of the plugin filesystem...jar, etc.) to + $path. + + [[b]] Use the context classloader to retrieve a reader to $path. + + [[c]] Build the ScriptBuilder corresponding to the script. + + [[d]] Create a new MarmaladeMojo instance which adapts the mojo calling + semantics to the creation/execution of a marmalade script. + + Execution involves: + + [[i]] Creating a new MarmaladeScript instance. + + [[ii]] Creating an execution context which references all I/O + from the main Maven execution thread, and embeds: + + - #request == MavenExecutionRequest + + - #response == MavenExecutionResponse + + - Any globally configured environmental constraints, such + as a global preserve-whitespace setting + + [[iii]] Execution of the script using the execution context. + + [[iv]] Export of the resulting context, minus any surviving input + variables, to the MavenExecutionResponse's out-params. + +*Implementation Issues + + [[1]] How do we make Maven smart enough to switch loader implementations based + on some sub-type of maven-plugin? + + This is important, since the default mojo loader will not be smart + enough to do the job, and embedding this behavior in that loader is not + scalable or extensible enough to accommodate future expansion into the + realms of jython, groovy, etc... + + <<UPDATE:07-FEB-2005>> + + We'll plan on using some sort of language specification in the mojo + descriptor to determine which mojo loader to use, then we'll populate + the PluginLoader/PluginManager with a map of known languages->loaders. + + [[2]] How do we make the plugin:install process smart enough to switch + generator implementations based on some sub-type of maven-plugin? + + This is closely related to [1] above. + + <<UPDATE:07-FEB-2005>> + + See update in [3]. + + [[3]] Do we want to allow mixed-bag plugin implementations? + + These might include a mix of standard-java and marmalade mojos. It + strikes me that many marmalade-based mojos may use beans/tags that are + actually adapter classes for other third-party APIs (why they wouldn't + implement everything as java mojos in this cases is beyond me). If they + have java source inside the plugin source directory, we should probably + compile it and bundle it with the plugin scripts; but what if this source + also has mojo annotations? This will have implications for [1] and [2] + above. + + <<UPDATE:07-FEB-2005>> + + We will plan on allowing this sort of implementation, and simply start + by applying all known generators which have a source directory set in + the POM (or later, have a <language/> section, maybe). At any rate, + helper classes will be allowed for script-based mojos. diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor-class-diagram.png b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor-class-diagram.png Binary files differnew file mode 100755 index 00000000..37d666c3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor-class-diagram.png diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor-sequence-diagram.png b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor-sequence-diagram.png Binary files differnew file mode 100755 index 00000000..30f19553 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor-sequence-diagram.png diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor.graffle b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor.graffle new file mode 100755 index 00000000..722bc031 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/resources/design/2.1-lifecycle-refactor.graffle @@ -0,0 +1,4024 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CreationDate</key> + <string>2007-03-15 15:23:17 -0400</string> + <key>Creator</key> + <string>John.alt</string> + <key>GraphDocumentVersion</key> + <integer>5</integer> + <key>GuidesLocked</key> + <string>NO</string> + <key>GuidesVisible</key> + <string>YES</string> + <key>ImageCounter</key> + <integer>1</integer> + <key>LinksVisible</key> + <string>NO</string> + <key>MagnetsVisible</key> + <string>NO</string> + <key>MasterSheets</key> + <array> + <dict> + <key>ActiveLayerIndex</key> + <integer>0</integer> + <key>AutoAdjust</key> + <true/> + <key>CanvasColor</key> + <dict> + <key>w</key> + <string>1</string> + </dict> + <key>CanvasOrigin</key> + <string>{0, 0}</string> + <key>CanvasScale</key> + <real>1</real> + <key>ColumnAlign</key> + <integer>1</integer> + <key>ColumnSpacing</key> + <real>36</real> + <key>DisplayScale</key> + <string>1 in = 1 in</string> + <key>GraphicsList</key> + <array/> + <key>GridInfo</key> + <dict/> + <key>HPages</key> + <integer>1</integer> + <key>IsPalette</key> + <string>NO</string> + <key>KeepToScale</key> + <false/> + <key>Layers</key> + <array> + <dict> + <key>Lock</key> + <string>NO</string> + <key>Name</key> + <string>Layer 1</string> + <key>Print</key> + <string>YES</string> + <key>View</key> + <string>YES</string> + </dict> + </array> + <key>LayoutInfo</key> + <dict/> + <key>Orientation</key> + <integer>2</integer> + <key>OutlineStyle</key> + <string>Basic</string> + <key>RowAlign</key> + <integer>1</integer> + <key>RowSpacing</key> + <real>36</real> + <key>SheetTitle</key> + <string>Master 1</string> + <key>UniqueID</key> + <integer>1</integer> + <key>VPages</key> + <integer>1</integer> + </dict> + </array> + <key>ModificationDate</key> + <string>2007-03-15 16:57:24 -0400</string> + <key>Modifier</key> + <string>John.alt</string> + <key>NotesVisible</key> + <string>NO</string> + <key>OriginVisible</key> + <string>NO</string> + <key>PageBreaks</key> + <string>YES</string> + <key>PrintInfo</key> + <dict> + <key>NSBottomMargin</key> + <array> + <string>float</string> + <string>0</string> + </array> + <key>NSLeftMargin</key> + <array> + <string>float</string> + <string>0</string> + </array> + <key>NSOrientation</key> + <array> + <string>int</string> + <string>1</string> + </array> + <key>NSPaperSize</key> + <array> + <string>size</string> + <string>{792, 612}</string> + </array> + <key>NSRightMargin</key> + <array> + <string>float</string> + <string>0</string> + </array> + <key>NSTopMargin</key> + <array> + <string>float</string> + <string>0</string> + </array> + </dict> + <key>ReadOnly</key> + <string>NO</string> + <key>Sheets</key> + <array> + <dict> + <key>ActiveLayerIndex</key> + <integer>0</integer> + <key>AutoAdjust</key> + <true/> + <key>CanvasColor</key> + <dict> + <key>w</key> + <string>1</string> + </dict> + <key>CanvasOrigin</key> + <string>{0, 0}</string> + <key>CanvasScale</key> + <real>1</real> + <key>ColumnAlign</key> + <integer>1</integer> + <key>ColumnSpacing</key> + <real>36</real> + <key>DisplayScale</key> + <string>1 in = 1 in</string> + <key>GraphicsList</key> + <array> + <dict> + <key>Bounds</key> + <string>{{607.473, 151.036}, {112, 28}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>86</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>72</integer> + <key>Position</key> + <real>0.31921392679214478</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\i\fs24 \cf0 deprecated,\ +marked for refactor}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{584.742, 252.673}, {104, 28}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>85</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>84</integer> + <key>Position</key> + <real>0.45520344376564026</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Oblique;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\i\fs24 \cf0 if binding spec \ +uses plugin prefix}</string> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>39</integer> + </dict> + <key>ID</key> + <integer>84</integer> + <key>Points</key> + <array> + <string>{623.954, 304}</string> + <string>{652.046, 222}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>Pattern</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>51</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>51</integer> + </dict> + <key>ID</key> + <integer>83</integer> + <key>Points</key> + <array> + <string>{488, 317}</string> + <string>{555, 317}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>48</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>54</integer> + </dict> + <key>ID</key> + <integer>82</integer> + <key>Points</key> + <array> + <string>{453.532, 330}</string> + <string>{575.468, 366}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>48</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>42</integer> + </dict> + <key>ID</key> + <integer>81</integer> + <key>Points</key> + <array> + <string>{83.5916, 196}</string> + <string>{84, 138}</string> + <string>{256, 138}</string> + <string>{466, 138}</string> + <string>{656, 138}</string> + <string>{671.008, 99}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>33</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>39</integer> + </dict> + <key>ID</key> + <integer>80</integer> + <key>Points</key> + <array> + <string>{83.6857, 196}</string> + <string>{84, 174}</string> + <string>{256, 174}</string> + <string>{466, 174}</string> + <string>{598, 198.252}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>33</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>45</integer> + </dict> + <key>ID</key> + <integer>66</integer> + <key>Points</key> + <array> + <string>{142, 221.044}</string> + <string>{195, 231.956}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>33</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>48</integer> + </dict> + <key>ID</key> + <integer>79</integer> + <key>Points</key> + <array> + <string>{106.976, 222}</string> + <string>{237, 294}</string> + <string>{331, 306.533}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>33</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>39</integer> + </dict> + <key>ID</key> + <integer>78</integer> + <key>Points</key> + <array> + <string>{419.845, 304}</string> + <string>{466, 246}</string> + <string>{598, 220.362}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>48</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>39</integer> + </dict> + <key>ID</key> + <integer>77</integer> + <key>Points</key> + <array> + <string>{254.456, 231}</string> + <string>{256, 210}</string> + <string>{466, 210}</string> + <string>{598, 209.307}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>45</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>42</integer> + </dict> + <key>ID</key> + <integer>72</integer> + <key>Points</key> + <array> + <string>{658.562, 196}</string> + <string>{673.948, 99}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>LineType</key> + <integer>1</integer> + <key>Pattern</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>39</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>48</integer> + </dict> + <key>ID</key> + <integer>71</integer> + <key>Points</key> + <array> + <string>{281.281, 257}</string> + <string>{381.719, 304}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>LineType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>45</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>TableGroup</string> + <key>Graphics</key> + <array> + <dict> + <key>Bounds</key> + <string>{{524, 366}, {191, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>55</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 LegacyLifecycleMappingParser}</string> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{524, 380}, {191, 12}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>56</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + </array> + <key>GridH</key> + <array> + <integer>55</integer> + <integer>56</integer> + <array/> + </array> + <key>GroupConnect</key> + <string>YES</string> + <key>ID</key> + <integer>54</integer> + </dict> + <dict> + <key>Class</key> + <string>TableGroup</string> + <key>Graphics</key> + <array> + <dict> + <key>Bounds</key> + <string>{{555, 304}, {129, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>52</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 MojoBindingFactory}</string> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{555, 318}, {129, 12}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>53</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + </array> + <key>GridH</key> + <array> + <integer>52</integer> + <integer>53</integer> + <array/> + </array> + <key>GroupConnect</key> + <string>YES</string> + <key>ID</key> + <integer>51</integer> + </dict> + <dict> + <key>Class</key> + <string>TableGroup</string> + <key>Graphics</key> + <array> + <dict> + <key>Bounds</key> + <string>{{331, 304}, {157, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>49</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 LifecycleBindingManager}</string> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{331, 318}, {157, 12}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>50</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + </array> + <key>GridH</key> + <array> + <integer>49</integer> + <integer>50</integer> + <array/> + </array> + <key>GroupConnect</key> + <string>YES</string> + <key>ID</key> + <integer>48</integer> + </dict> + <dict> + <key>Class</key> + <string>TableGroup</string> + <key>Graphics</key> + <array> + <dict> + <key>Bounds</key> + <string>{{195, 231}, {117, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>46</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 BuildPlanner}</string> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{195, 245}, {117, 12}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>47</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + </array> + <key>GridH</key> + <array> + <integer>46</integer> + <integer>47</integer> + <array/> + </array> + <key>GroupConnect</key> + <string>YES</string> + <key>ID</key> + <integer>45</integer> + </dict> + <dict> + <key>Class</key> + <string>TableGroup</string> + <key>Graphics</key> + <array> + <dict> + <key>Bounds</key> + <string>{{617.51, 73}, {117, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>43</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 PluginManager}</string> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{617.51, 87}, {117, 12}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>44</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + </array> + <key>GridH</key> + <array> + <integer>43</integer> + <integer>44</integer> + <array/> + </array> + <key>GroupConnect</key> + <string>YES</string> + <key>ID</key> + <integer>42</integer> + </dict> + <dict> + <key>Class</key> + <string>TableGroup</string> + <key>Graphics</key> + <array> + <dict> + <key>Bounds</key> + <string>{{598, 196}, {117, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>40</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 PluginLoader}</string> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{598, 210}, {117, 12}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>41</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + </array> + <key>GridH</key> + <array> + <integer>40</integer> + <integer>41</integer> + <array/> + </array> + <key>GroupConnect</key> + <string>YES</string> + <key>ID</key> + <integer>39</integer> + </dict> + <dict> + <key>Class</key> + <string>TableGroup</string> + <key>Graphics</key> + <array> + <dict> + <key>Bounds</key> + <string>{{25, 196}, {117, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>34</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 LifecycleExecutor}</string> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{25, 210}, {117, 12}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>38</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>GradientAngle</key> + <real>304</real> + <key>GradientCenter</key> + <string>{-0.294118, -0.264706}</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + <key>TextPlacement</key> + <integer>0</integer> + </dict> + </array> + <key>GridH</key> + <array> + <integer>34</integer> + <integer>38</integer> + <array/> + </array> + <key>GroupConnect</key> + <string>YES</string> + <key>ID</key> + <integer>33</integer> + </dict> + </array> + <key>GridInfo</key> + <dict/> + <key>HPages</key> + <integer>1</integer> + <key>IsPalette</key> + <string>NO</string> + <key>KeepToScale</key> + <false/> + <key>Layers</key> + <array> + <dict> + <key>Lock</key> + <string>NO</string> + <key>Name</key> + <string>Layer 1</string> + <key>Print</key> + <string>YES</string> + <key>View</key> + <string>YES</string> + </dict> + </array> + <key>LayoutInfo</key> + <dict> + <key>ChildOrdering</key> + <integer>0</integer> + <key>HierarchicalOrientation</key> + <integer>0</integer> + </dict> + <key>MasterSheet</key> + <string>Master 1</string> + <key>Orientation</key> + <integer>2</integer> + <key>OutlineStyle</key> + <string>Basic</string> + <key>RowAlign</key> + <integer>1</integer> + <key>RowSpacing</key> + <real>36</real> + <key>SheetTitle</key> + <string>Canvas 1</string> + <key>UniqueID</key> + <integer>1</integer> + <key>VPages</key> + <integer>1</integer> + </dict> + <dict> + <key>ActiveLayerIndex</key> + <integer>0</integer> + <key>AutoAdjust</key> + <true/> + <key>CanvasColor</key> + <dict> + <key>w</key> + <string>1</string> + </dict> + <key>CanvasOrigin</key> + <string>{0, 0}</string> + <key>CanvasScale</key> + <real>1</real> + <key>ColumnAlign</key> + <integer>1</integer> + <key>ColumnSpacing</key> + <real>36</real> + <key>DisplayScale</key> + <string>1 in = 1 in</string> + <key>GraphicsList</key> + <array> + <dict> + <key>Bounds</key> + <string>{{521.5, 182.853}, {75, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>126</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 loadPlugin()}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Bounds</key> + <string>{{437, 221.123}, {92, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>125</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>124</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.55852556228637695</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 binding, project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>123</integer> + </dict> + <key>ID</key> + <integer>124</integer> + <key>Points</key> + <array> + <string>{398, 209.12}</string> + <string>{550.5, 210.592}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>79</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{550.5, 203.842}, {17, 27}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>123</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{521.5, 114.705}, {75, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>122</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 loadPlugin()}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Bounds</key> + <string>{{436.814, 155.115}, {92, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>121</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>120</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.55852556228637695</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 binding, project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>119</integer> + </dict> + <key>ID</key> + <integer>120</integer> + <key>Points</key> + <array> + <string>{397.5, 143.273}</string> + <string>{550.5, 144.455}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>73</integer> + <key>Info</key> + <integer>4</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{550.5, 137.705}, {17, 27}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>119</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{26, 636}, {131, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>118</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 foreach binding in plan}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>4</integer> + <key>Info</key> + <integer>5</integer> + </dict> + <key>ID</key> + <integer>117</integer> + <key>OrthogonalBarAutomatic</key> + <true/> + <key>OrthogonalBarPosition</key> + <real>19.371429443359375</real> + <key>Points</key> + <array> + <string>{75.5, 478}</string> + <string>{26, 482}</string> + <string>{26, 575}</string> + <string>{79.125, 616}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>0.86000001430511475</real> + <key>LineType</key> + <integer>2</integer> + <key>TailArrow</key> + <string>FilledArrow</string> + <key>TailScale</key> + <real>0.85714292526245117</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>4</integer> + <key>Info</key> + <integer>1</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{310.653, 581.444}, {179, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>116</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>115</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.52437615394592285</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 mojoExecution, project, session}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>113</integer> + <key>Info</key> + <integer>2</integer> + </dict> + <key>ID</key> + <integer>115</integer> + <key>Points</key> + <array> + <string>{90, 570}</string> + <string>{681.5, 570.5}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>4</integer> + <key>Info</key> + <integer>12</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{646.5, 539}, {87, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>114</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>111</integer> + <key>Position</key> + <real>0.8310316801071167</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 executeMojo()}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{681.5, 559}, {17, 46}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>113</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>Group</string> + <key>Graphics</key> + <array> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>ID</key> + <integer>111</integer> + <key>Points</key> + <array> + <string>{690, 34.5}</string> + <string>{690, 650}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>Pattern</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + <key>TailScale</key> + <real>0.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>112</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{636, 20}, {108, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>112</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 \ul \ulc0 PluginManager}</string> + </dict> + </dict> + </array> + <key>ID</key> + <integer>110</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{287.086, 525.522}, {92, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>109</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>108</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.52776741981506348</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 binding, project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>106</integer> + <key>Info</key> + <integer>2</integer> + </dict> + <key>ID</key> + <integer>108</integer> + <key>Points</key> + <array> + <string>{90, 515}</string> + <string>{550.5, 513.75}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>4</integer> + <key>Info</key> + <integer>3</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{521.5, 485}, {75, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>107</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 loadPlugin()}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Bounds</key> + <string>{{550.5, 507}, {17, 27}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>106</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{0.5, -0.25}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{130.5, 275}, {33, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>105</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 plan}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>4</integer> + </dict> + <key>ID</key> + <integer>66</integer> + <key>Points</key> + <array> + <string>{205.5, 270}</string> + <string>{86.375, 270}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HopLines</key> + <true/> + <key>HopType</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>19</integer> + <key>Info</key> + <integer>16</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{521.5, 302}, {75, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>104</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 loadPlugin()}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Bounds</key> + <string>{{349.413, 453.786}, {92, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>103</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>102</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.52776741981506348</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 binding, project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>101</integer> + </dict> + <key>ID</key> + <integer>102</integer> + <key>Points</key> + <array> + <string>{222, 443}</string> + <string>{550.5, 442.25}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>86</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{550.5, 422}, {17, 27}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>101</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{0.5, -0.25}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{521.5, 396.749}, {75, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>100</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>93</integer> + <key>Position</key> + <real>0.59991699457168579</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 loadPlugin()}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{349.564, 356.057}, {92, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>99</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>98</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.52776741981506348</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 binding, project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>95</integer> + </dict> + <key>ID</key> + <integer>98</integer> + <key>Points</key> + <array> + <string>{222.5, 344.456}</string> + <string>{550.5, 345.25}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>83</integer> + <key>Info</key> + <integer>9</integer> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>86</integer> + <key>Info</key> + <integer>3</integer> + </dict> + <key>ID</key> + <integer>97</integer> + <key>OrthogonalBarAutomatic</key> + <true/> + <key>OrthogonalBarPosition</key> + <real>-1</real> + <key>Points</key> + <array> + <string>{222.5, 254.5}</string> + <string>{309.5, 254}</string> + <string>{327, 344}</string> + <string>{222.5, 454.079}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>0.86000001430511475</real> + <key>LineType</key> + <integer>2</integer> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>0.85714292526245117</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>19</integer> + <key>Info</key> + <integer>15</integer> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>83</integer> + <key>Info</key> + <integer>3</integer> + </dict> + <key>ID</key> + <integer>96</integer> + <key>OrthogonalBarAutomatic</key> + <true/> + <key>OrthogonalBarPosition</key> + <real>-1</real> + <key>Points</key> + <array> + <string>{222, 237}</string> + <string>{295.5, 237}</string> + <string>{295.5, 337}</string> + <string>{222.5, 356.792}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>0.86000001430511475</real> + <key>LineType</key> + <integer>2</integer> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>0.85714292526245117</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>19</integer> + <key>Info</key> + <integer>14</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{550.5, 325}, {17, 27}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>95</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>Group</string> + <key>Graphics</key> + <array> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>ID</key> + <integer>93</integer> + <key>Points</key> + <array> + <string>{559, 34.5}</string> + <string>{559, 650}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>Pattern</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + <key>TailScale</key> + <real>0.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>94</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{505, 20}, {108, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>94</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 \ul \ulc0 PluginLoader}</string> + </dict> + </dict> + </array> + <key>ID</key> + <integer>92</integer> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>19</integer> + <key>Info</key> + <integer>13</integer> + </dict> + <key>ID</key> + <integer>91</integer> + <key>OrthogonalBarAutomatic</key> + <true/> + <key>OrthogonalBarPosition</key> + <real>-1</real> + <key>Points</key> + <array> + <string>{222.5, 426.798}</string> + <string>{321, 420}</string> + <string>{301, 249}</string> + <string>{222.5, 248.833}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>0.86000001430511475</real> + <key>LineType</key> + <integer>2</integer> + <key>TailArrow</key> + <string>FilledArrow</string> + <key>TailScale</key> + <real>0.85714292526245117</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>86</integer> + <key>Info</key> + <integer>4</integer> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>19</integer> + <key>Info</key> + <integer>12</integer> + </dict> + <key>ID</key> + <integer>10</integer> + <key>OrthogonalBarAutomatic</key> + <true/> + <key>OrthogonalBarPosition</key> + <real>-1</real> + <key>Points</key> + <array> + <string>{222.5, 330.264}</string> + <string>{288.5, 330}</string> + <string>{288.5, 230}</string> + <string>{222.5, 230}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>0.86000001430511475</real> + <key>LineType</key> + <integer>2</integer> + <key>TailArrow</key> + <string>FilledArrow</string> + <key>TailScale</key> + <real>0.85714292526245117</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>83</integer> + <key>Info</key> + <integer>4</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{132.5, 396.158}, {163, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>87</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 addReportingPlanModifiers()}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Bounds</key> + <string>{{205.5, 413.158}, {17, 54.5618}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>86</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + <string>{-0.529412, 0.0497093}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{139.5, 297.124}, {149, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>84</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>17</integer> + <key>Position</key> + <real>0.43805667757987976</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 addForkedPlanModifiers()}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{205.5, 317}, {17, 53.056}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>83</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + <string>{-0.529412, 0.0185184}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{305.436, 220.259}, {47, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>82</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>81</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.67475664615631104</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>79</integer> + <key>Info</key> + <integer>2</integer> + </dict> + <key>ID</key> + <integer>81</integer> + <key>Points</key> + <array> + <string>{222, 209}</string> + <string>{380.5, 209.115}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>19</integer> + <key>Info</key> + <integer>3</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{311.5, 120.556}, {155, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>80</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 getBindingsForPackaging()}</string> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Bounds</key> + <string>{{380.5, 203.842}, {17, 21.0909}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>79</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{260.247, 156.369}, {47, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>76</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>75</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.38291174173355103</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>ID</key> + <integer>75</integer> + <key>Points</key> + <array> + <string>{222.5, 145.7}</string> + <string>{382.054, 144.364}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>19</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{309, 182.853}, {160, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>74</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>69</integer> + <key>Position</key> + <real>0.25240078568458557</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 getProjectCustomBindings()}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{380.5, 138}, {17, 21.0909}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>73</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{259.56, 110.107}, {47, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>29</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>7</integer> + <key>Offset</key> + <real>18.181819915771484</real> + <key>Position</key> + <real>0.38198670744895935</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>Head</key> + <dict> + <key>ID</key> + <integer>71</integer> + </dict> + <key>ID</key> + <integer>7</integer> + <key>Points</key> + <array> + <string>{222.5, 99.6111}</string> + <string>{380.5, 97.8182}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>FilledArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>StickArrow</string> + <key>TailScale</key> + <real>1.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>19</integer> + <key>Info</key> + <integer>10</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{329.5, 75.973}, {119, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>72</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>69</integer> + <key>Position</key> + <real>0.078753873705863953</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 getDefaultBindings()}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{380.5, 92.5454}, {17, 21.0909}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>71</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-1, 0.5}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>Group</string> + <key>Graphics</key> + <array> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>ID</key> + <integer>69</integer> + <key>Points</key> + <array> + <string>{389, 34.5}</string> + <string>{389, 650}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>Pattern</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + <key>TailScale</key> + <real>0.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>70</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{313.5, 20}, {151, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>70</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 \ul \ulc0 LifecyleBindingManager}</string> + </dict> + </dict> + </array> + <key>ID</key> + <integer>68</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{108.828, 81.9091}, {81, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>ID</key> + <integer>30</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>6</integer> + <key>Offset</key> + <real>10.909090042114258</real> + <key>Position</key> + <real>0.52006888389587402</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\fs24 \cf0 tasks, project}</string> + </dict> + </dict> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>ID</key> + <integer>6</integer> + <key>Points</key> + <array> + <string>{89, 78}</string> + <string>{205, 78}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>StickArrow</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>TailArrow</key> + <string>0</string> + <key>TailScale</key> + <real>0.5</real> + </dict> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{155, 53.596}, {118, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>20</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>17</integer> + <key>Position</key> + <real>0.042397733777761459</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 constructBuildPlan()}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{205.5, 74}, {17, 208}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>19</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-0.470589, 0.149038}</string> + <string>{-0.5, -0.197115}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + <string>{-0.5, -0.155288}</string> + <string>{-0.5, -0.37687}</string> + <string>{-0.5, -0.155288}</string> + <string>{-0.5, 0.25}</string> + <string>{-0.529412, 0.360577}</string> + <string>{-0.470589, 0.283654}</string> + <string>{-0.529412, 0.389423}</string> + <string>{0.5, 0.442308}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>Group</string> + <key>Graphics</key> + <array> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>ID</key> + <integer>17</integer> + <key>Points</key> + <array> + <string>{214, 34.5002}</string> + <string>{214, 650}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>Pattern</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + <key>TailScale</key> + <real>0.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>18</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{160, 20.0002}, {108, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>18</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 \ul \ulc0 BuildPlanner}</string> + </dict> + </dict> + </array> + <key>ID</key> + <integer>16</integer> + </dict> + <dict> + <key>Bounds</key> + <string>{{53.5, 46.7192}, {61, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>FontInfo</key> + <dict> + <key>Color</key> + <dict> + <key>w</key> + <string>0</string> + </dict> + <key>Font</key> + <string>Helvetica</string> + <key>Size</key> + <real>12</real> + </dict> + <key>ID</key> + <integer>5</integer> + <key>Line</key> + <dict> + <key>ID</key> + <integer>2</integer> + <key>Position</key> + <real>0.031224979087710381</real> + <key>RotationType</key> + <integer>0</integer> + </dict> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 execute()}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{75.5, 64}, {14.5, 552}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>HFlip</key> + <string>YES</string> + <key>ID</key> + <integer>4</integer> + <key>Magnets</key> + <array> + <string>{1, 0.5}</string> + <string>{1, -0.5}</string> + <string>{-0.5, 0.317029}</string> + <string>{-1, -0.5}</string> + <string>{0.5, 1}</string> + <string>{-0.5, 1}</string> + <string>{0.5, -1}</string> + <string>{-0.5, -1}</string> + <string>{-0.25, -0.126812}</string> + <string>{-0.568965, 0.302536}</string> + <string>{-0.637931, 0.400362}</string> + <string>{-0.5, 0.416667}</string> + </array> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Align</key> + <integer>0</integer> + </dict> + </dict> + <dict> + <key>Class</key> + <string>Group</string> + <key>Graphics</key> + <array> + <dict> + <key>AllowLabelDrop</key> + <false/> + <key>Class</key> + <string>LineGraphic</string> + <key>ID</key> + <integer>2</integer> + <key>Points</key> + <array> + <string>{84, 34.5003}</string> + <string>{84, 650}</string> + </array> + <key>Style</key> + <dict> + <key>stroke</key> + <dict> + <key>HeadArrow</key> + <string>0</string> + <key>HeadScale</key> + <real>1.4285709857940674</real> + <key>Pattern</key> + <integer>1</integer> + <key>TailArrow</key> + <string>0</string> + <key>TailScale</key> + <real>0.5</real> + </dict> + </dict> + <key>Tail</key> + <dict> + <key>ID</key> + <integer>3</integer> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{26, 20.0002}, {116, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>Vertical</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>3</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\b\fs24 \cf0 \ul \ulc0 LifecycleExecutor}</string> + </dict> + </dict> + </array> + <key>ID</key> + <integer>1</integer> + </dict> + </array> + <key>GridInfo</key> + <dict/> + <key>HPages</key> + <integer>2</integer> + <key>IsPalette</key> + <string>NO</string> + <key>KeepToScale</key> + <false/> + <key>Layers</key> + <array> + <dict> + <key>Lock</key> + <string>NO</string> + <key>Name</key> + <string>Layer 1</string> + <key>Print</key> + <string>YES</string> + <key>View</key> + <string>YES</string> + </dict> + </array> + <key>LayoutInfo</key> + <dict> + <key>ChildOrdering</key> + <integer>0</integer> + <key>HierarchicalOrientation</key> + <integer>0</integer> + </dict> + <key>MasterSheet</key> + <string>Master 1</string> + <key>Orientation</key> + <integer>2</integer> + <key>OutlineStyle</key> + <string>Basic</string> + <key>RowAlign</key> + <integer>1</integer> + <key>RowSpacing</key> + <real>36</real> + <key>SheetTitle</key> + <string>Canvas 2</string> + <key>UniqueID</key> + <integer>2</integer> + <key>VPages</key> + <integer>2</integer> + </dict> + </array> + <key>SmartAlignmentGuidesActive</key> + <string>YES</string> + <key>SmartDistanceGuidesActive</key> + <string>YES</string> + <key>UseEntirePage</key> + <true/> + <key>WindowInfo</key> + <dict> + <key>CurrentSheet</key> + <string>0</string> + <key>DrawerOpen</key> + <false/> + <key>DrawerTab</key> + <string>Outline</string> + <key>DrawerWidth</key> + <real>209</real> + <key>FitInWindow</key> + <false/> + <key>Frame</key> + <string>{{6, 123}, {956, 590}}</string> + <key>ShowRuler</key> + <false/> + <key>ShowStatusBar</key> + <true/> + <key>VisibleRegion</key> + <string>{{-94, 0}, {941, 476}}</string> + <key>Zoom</key> + <string>1</string> + </dict> +</dict> +</plist> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/site.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/site.xml new file mode 100644 index 00000000..2c38d2a0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/site/site.xml @@ -0,0 +1,42 @@ +<?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/DECORATION/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"> + <body> + <menu name="Overview"> + <item name="Introduction" href="index.html"/> + <item name="JavaDocs" href="apidocs/index.html"/> + <item name="Source Xref" href="xref/index.html"/> + <!--item name="FAQ" href="faq.html"/--> + </menu> + + <menu name="Reference"> + <item name="Lifecycles" href="lifecycles.html"/> + <item name="Plugin Bindings to Default Lifecycle" href="default-bindings.html"/> + <item name="Artifact Handlers" href="artifact-handlers.html"/> + </menu> + + <menu ref="parent"/> + <menu ref="reports"/> + </body> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java new file mode 100644 index 00000000..57d374fd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java @@ -0,0 +1,360 @@ +package org.apache.maven; + +/* + * 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.File; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.InvalidRepositoryException; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.DefaultMavenExecutionResult; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Build; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Exclusion; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.Repository; +import org.apache.maven.model.RepositoryPolicy; +import org.apache.maven.project.DefaultProjectBuildingRequest; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.repository.RepositorySystem; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.codehaus.plexus.ContainerConfiguration; +import org.codehaus.plexus.PlexusConstants; +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.util.FileUtils; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; + +public abstract class AbstractCoreMavenComponentTestCase + extends PlexusTestCase +{ + @Requirement + protected RepositorySystem repositorySystem; + + @Requirement + protected org.apache.maven.project.ProjectBuilder projectBuilder; + + protected void setUp() + throws Exception + { + repositorySystem = lookup( RepositorySystem.class ); + projectBuilder = lookup( org.apache.maven.project.ProjectBuilder.class ); + } + + @Override + protected void tearDown() + throws Exception + { + repositorySystem = null; + projectBuilder = null; + super.tearDown(); + } + + abstract protected String getProjectsDirectory(); + + protected File getProject( String name ) + throws Exception + { + File source = new File( new File( getBasedir(), getProjectsDirectory() ), name ); + File target = new File( new File( getBasedir(), "target" ), name ); + FileUtils.copyDirectoryStructureIfModified( source, target ); + return new File( target, "pom.xml" ); + } + + /** + * We need to customize the standard Plexus container with the plugin discovery listener which + * is what looks for the META-INF/maven/plugin.xml resources that enter the system when a Maven + * plugin is loaded. + * + * We also need to customize the Plexus container with a standard plugin discovery listener + * which is the MavenPluginCollector. When a Maven plugin is discovered the MavenPluginCollector + * collects the plugin descriptors which are found. + */ + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + containerConfiguration.setAutoWiring( true ).setClassPathScanning( PlexusConstants.SCANNING_INDEX ); + } + + protected MavenExecutionRequest createMavenExecutionRequest( File pom ) + throws Exception + { + MavenExecutionRequest request = new DefaultMavenExecutionRequest() + .setPom( pom ) + .setProjectPresent( true ) + .setShowErrors( true ) + .setPluginGroups( Arrays.asList( "org.apache.maven.plugins" ) ) + .setLocalRepository( getLocalRepository() ) + .setRemoteRepositories( getRemoteRepositories() ) + .setPluginArtifactRepositories( getPluginArtifactRepositories() ) + .setGoals( Arrays.asList( "package" ) ); + + return request; + } + + // layer the creation of a project builder configuration with a request, but this will need to be + // a Maven subclass because we don't want to couple maven to the project builder which we need to + // separate. + protected MavenSession createMavenSession( File pom ) + throws Exception + { + return createMavenSession( pom, new Properties() ); + } + + protected MavenSession createMavenSession( File pom, Properties executionProperties ) + throws Exception + { + MavenExecutionRequest request = createMavenExecutionRequest( pom ); + + ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest() + .setLocalRepository( request.getLocalRepository() ) + .setRemoteRepositories( request.getRemoteRepositories() ) + .setPluginArtifactRepositories( request.getPluginArtifactRepositories() ) + .setSystemProperties( executionProperties ); + + MavenProject project = null; + + if ( pom != null ) + { + project = projectBuilder.build( pom, configuration ).getProject(); + } + else + { + project = createStubMavenProject(); + project.setRemoteArtifactRepositories( request.getRemoteRepositories() ); + project.setPluginArtifactRepositories( request.getPluginArtifactRepositories() ); + } + + initRepoSession( configuration ); + + MavenSession session = + new MavenSession( getContainer(), configuration.getRepositorySession(), request, + new DefaultMavenExecutionResult() ); + session.setProjects( Arrays.asList( project ) ); + + return session; + } + + protected void initRepoSession( ProjectBuildingRequest request ) + throws Exception + { + File localRepoDir = new File( request.getLocalRepository().getBasedir() ); + LocalRepository localRepo = new LocalRepository( localRepoDir ); + DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); + session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( session, localRepo ) ); + request.setRepositorySession( session ); + } + + protected MavenProject createStubMavenProject() + { + Model model = new Model(); + model.setGroupId( "org.apache.maven.test" ); + model.setArtifactId( "maven-test" ); + model.setVersion( "1.0" ); + return new MavenProject( model ); + } + + protected List<ArtifactRepository> getRemoteRepositories() + throws InvalidRepositoryException + { + File repoDir = new File( getBasedir(), "src/test/remote-repo" ).getAbsoluteFile(); + + RepositoryPolicy policy = new RepositoryPolicy(); + policy.setEnabled( true ); + policy.setChecksumPolicy( "ignore" ); + policy.setUpdatePolicy( "always" ); + + Repository repository = new Repository(); + repository.setId( RepositorySystem.DEFAULT_REMOTE_REPO_ID ); + repository.setUrl( "file://" + repoDir.toURI().getPath() ); + repository.setReleases( policy ); + repository.setSnapshots( policy ); + + return Arrays.asList( repositorySystem.buildArtifactRepository( repository ) ); + } + + protected List<ArtifactRepository> getPluginArtifactRepositories() + throws InvalidRepositoryException + { + return getRemoteRepositories(); + } + + protected ArtifactRepository getLocalRepository() + throws InvalidRepositoryException + { + File repoDir = new File( getBasedir(), "target/local-repo" ).getAbsoluteFile(); + + return repositorySystem.createLocalRepository( repoDir ); + } + + protected class ProjectBuilder + { + private MavenProject project; + + public ProjectBuilder( MavenProject project ) + { + this.project = project; + } + + public ProjectBuilder( String groupId, String artifactId, String version ) + { + Model model = new Model(); + model.setModelVersion( "4.0.0" ); + model.setGroupId( groupId ); + model.setArtifactId( artifactId ); + model.setVersion( version ); + model.setBuild( new Build() ); + project = new MavenProject( model ); + } + + public ProjectBuilder setGroupId( String groupId ) + { + project.setGroupId( groupId ); + return this; + } + + public ProjectBuilder setArtifactId( String artifactId ) + { + project.setArtifactId( artifactId ); + return this; + } + + public ProjectBuilder setVersion( String version ) + { + project.setVersion( version ); + return this; + } + + // Dependencies + // + public ProjectBuilder addDependency( String groupId, String artifactId, String version, String scope ) + { + return addDependency( groupId, artifactId, version, scope, (Exclusion)null ); + } + + public ProjectBuilder addDependency( String groupId, String artifactId, String version, String scope, Exclusion exclusion ) + { + return addDependency( groupId, artifactId, version, scope, null, exclusion ); + } + + public ProjectBuilder addDependency( String groupId, String artifactId, String version, String scope, String systemPath ) + { + return addDependency( groupId, artifactId, version, scope, systemPath, null ); + } + + public ProjectBuilder addDependency( String groupId, String artifactId, String version, String scope, String systemPath, Exclusion exclusion ) + { + Dependency d = new Dependency(); + d.setGroupId( groupId ); + d.setArtifactId( artifactId ); + d.setVersion( version ); + d.setScope( scope ); + + if ( systemPath != null && scope.equals( Artifact.SCOPE_SYSTEM ) ) + { + d.setSystemPath( systemPath ); + } + + if ( exclusion != null ) + { + d.addExclusion( exclusion ); + } + + project.getDependencies().add( d ); + + return this; + } + + // Plugins + // + public ProjectBuilder addPlugin( Plugin plugin ) + { + project.getBuildPlugins().add( plugin ); + return this; + } + + public MavenProject get() + { + return project; + } + } + + protected class PluginBuilder + { + private Plugin plugin; + + public PluginBuilder( String groupId, String artifactId, String version ) + { + plugin = new Plugin(); + plugin.setGroupId( groupId ); + plugin.setArtifactId( artifactId ); + plugin.setVersion( version ); + } + + // Dependencies + // + public PluginBuilder addDependency( String groupId, String artifactId, String version, String scope, Exclusion exclusion ) + { + return addDependency( groupId, artifactId, version, scope, exclusion ); + } + + public PluginBuilder addDependency( String groupId, String artifactId, String version, String scope, String systemPath ) + { + return addDependency( groupId, artifactId, version, scope, systemPath, null ); + } + + public PluginBuilder addDependency( String groupId, String artifactId, String version, String scope, String systemPath, Exclusion exclusion ) + { + Dependency d = new Dependency(); + d.setGroupId( groupId ); + d.setArtifactId( artifactId ); + d.setVersion( version ); + d.setScope( scope ); + + if ( systemPath != null && scope.equals( Artifact.SCOPE_SYSTEM ) ) + { + d.setSystemPath( systemPath ); + } + + if ( exclusion != null ) + { + d.addExclusion( exclusion ); + } + + plugin.getDependencies().add( d ); + + return this; + } + + public Plugin get() + { + return plugin; + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java new file mode 100644 index 00000000..ab073a63 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/DefaultMavenTest.java @@ -0,0 +1,45 @@ +package org.apache.maven; + +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionResult; + +import static java.util.Arrays.asList; + +/* + * 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 DefaultMavenTest extends AbstractCoreMavenComponentTestCase{ + + public void testThatErrorDuringProjectDependencyGraphCreationAreStored() + throws Exception + { + Maven maven = getContainer().lookup( Maven.class ); + MavenExecutionRequest request = createMavenExecutionRequest( getProject( "cyclic-reference" ) ).setGoals( asList("validate") ); + + MavenExecutionResult result = maven.execute( request ); + + assertEquals( ProjectCycleException.class, result.getExceptions().get( 0 ).getClass() ); + } + + @Override + protected String getProjectsDirectory() + { + return "src/test/projects/default-maven"; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java new file mode 100644 index 00000000..17aeab31 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java @@ -0,0 +1,173 @@ +package org.apache.maven; + +/* + * 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.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionResult; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Dependency; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.repository.ComponentDescriptor; + +public class MavenLifecycleParticipantTest + extends AbstractCoreMavenComponentTestCase +{ + + private static final String INJECTED_ARTIFACT_ID = "injected"; + + public static class InjectDependencyLifecycleListener + extends AbstractMavenLifecycleParticipant + { + + @Override + public void afterProjectsRead( MavenSession session ) + { + MavenProject project = session.getProjects().get( 0 ); + + Dependency dependency = new Dependency(); + dependency.setArtifactId( INJECTED_ARTIFACT_ID ); + dependency.setGroupId( "foo" ); + dependency.setVersion( "1.2.3" ); + dependency.setScope( "system" ); + try + { + dependency.setSystemPath( new File( + "src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/pom.xml" ).getCanonicalPath() ); + } + catch ( IOException e ) + { + throw new RuntimeException( e ); + } + + project.getModel().addDependency( dependency ); + } + + @Override + public void afterSessionStart( MavenSession session ) + { + session.getUserProperties().setProperty( "injected", "bar" ); + } + + } + + public static class InjectReactorDependency + extends AbstractMavenLifecycleParticipant + { + @Override + public void afterProjectsRead( MavenSession session ) + { + injectReactorDependency( session.getProjects(), "module-a", "module-b" ); + } + + private void injectReactorDependency( List<MavenProject> projects, String moduleFrom, String moduleTo ) + { + for ( MavenProject project : projects ) + { + if ( moduleFrom.equals( project.getArtifactId() ) ) + { + Dependency dependency = new Dependency(); + dependency.setArtifactId( moduleTo ); + dependency.setGroupId( project.getGroupId() ); + dependency.setVersion( project.getVersion() ); + + project.getModel().addDependency( dependency ); + } + } + } + } + + @Override + protected void setupContainer() + { + super.setupContainer(); + } + + @Override + protected String getProjectsDirectory() + { + return "src/test/projects/lifecycle-listener"; + } + + public void testDependencyInjection() + throws Exception + { + PlexusContainer container = getContainer(); + + ComponentDescriptor<? extends AbstractMavenLifecycleParticipant> cd = + new ComponentDescriptor<InjectDependencyLifecycleListener>( InjectDependencyLifecycleListener.class, + container.getContainerRealm() ); + cd.setRoleClass( AbstractMavenLifecycleParticipant.class ); + container.addComponentDescriptor( cd ); + + Maven maven = container.lookup( Maven.class ); + File pom = getProject( "lifecycle-listener-dependency-injection" ); + MavenExecutionRequest request = createMavenExecutionRequest( pom ); + request.setGoals( Arrays.asList( "validate" ) ); + MavenExecutionResult result = maven.execute( request ); + + assertFalse( result.getExceptions().toString(), result.hasExceptions() ); + + MavenProject project = result.getProject(); + + assertEquals( "bar", project.getProperties().getProperty( "foo" ) ); + + ArrayList<Artifact> artifacts = new ArrayList<Artifact>( project.getArtifacts() ); + + assertEquals( 1, artifacts.size() ); + assertEquals( INJECTED_ARTIFACT_ID, artifacts.get( 0 ).getArtifactId() ); + } + + public void testReactorDependencyInjection() + throws Exception + { + List<String> reactorOrder = + getReactorOrder( "lifecycle-participant-reactor-dependency-injection", InjectReactorDependency.class ); + assertEquals( Arrays.asList( "parent", "module-b", "module-a" ), reactorOrder ); + } + + private <T> List<String> getReactorOrder( String testProject, Class<T> participant ) + throws Exception + { + PlexusContainer container = getContainer(); + + ComponentDescriptor<T> cd = new ComponentDescriptor<T>( participant, container.getContainerRealm() ); + cd.setRoleClass( AbstractMavenLifecycleParticipant.class ); + container.addComponentDescriptor( cd ); + + Maven maven = container.lookup( Maven.class ); + File pom = getProject( testProject ); + MavenExecutionRequest request = createMavenExecutionRequest( pom ); + request.setGoals( Arrays.asList( "validate" ) ); + MavenExecutionResult result = maven.execute( request ); + + assertFalse( result.getExceptions().toString(), result.hasExceptions() ); + + List<String> order = new ArrayList<String>(); + for ( MavenProject project : result.getTopologicallySortedProjects() ) + { + order.add( project.getArtifactId() ); + } + return order; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/MavenTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/MavenTest.java new file mode 100644 index 00000000..3e248604 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/MavenTest.java @@ -0,0 +1,69 @@ +package org.apache.maven; + +/* + * 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.exception.ExceptionHandler; +import org.codehaus.plexus.component.annotations.Requirement; + +public class MavenTest + extends AbstractCoreMavenComponentTestCase +{ + @Requirement + private Maven maven; + + @Requirement + private ExceptionHandler exceptionHandler; + + protected void setUp() + throws Exception + { + super.setUp(); + maven = lookup( Maven.class ); + exceptionHandler = lookup( ExceptionHandler.class ); + } + + @Override + protected void tearDown() + throws Exception + { + maven = null; + exceptionHandler = null; + super.tearDown(); + } + + protected String getProjectsDirectory() + { + return "src/test/projects/lifecycle-executor"; + } + + public void testLifecycleExecutionUsingADefaultLifecyclePhase() + throws Exception + { + /* + File pom = getProject( "project-with-additional-lifecycle-elements" ); + MavenExecutionRequest request = createMavenExecutionRequest( pom ); + MavenExecutionResult result = maven.execute( request ); + if ( result.hasExceptions() ) + { + ExceptionSummary es = exceptionHandler.handleException( result.getExceptions().get( 0 ) ); + System.out.println( es.getMessage() ); + es.getException().printStackTrace(); + fail( "Maven did not execute correctly." ); + } + */ + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java new file mode 100644 index 00000000..ca75c3f1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java @@ -0,0 +1,114 @@ +package org.apache.maven; + +/* + * 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.File; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Requirement; + +public class ProjectDependenciesResolverTest + extends AbstractCoreMavenComponentTestCase +{ + @Requirement + private ProjectDependenciesResolver resolver; + + protected void setUp() + throws Exception + { + super.setUp(); + resolver = lookup( ProjectDependenciesResolver.class ); + } + + @Override + protected void tearDown() + throws Exception + { + resolver = null; + super.tearDown(); + } + + protected String getProjectsDirectory() + { + return "src/test/projects/project-dependencies-resolver"; + } + + /* + public void testExclusionsInDependencies() + throws Exception + { + MavenSession session = createMavenSession( null ); + MavenProject project = session.getCurrentProject(); + + Exclusion exclusion = new Exclusion(); + exclusion.setGroupId( "org.apache.maven.its" ); + exclusion.setArtifactId( "a" ); + + new ProjectBuilder( project ).addDependency( "org.apache.maven.its", "b", "0.1", Artifact.SCOPE_RUNTIME, + exclusion ); + + Set<Artifact> artifactDependencies = + resolver.resolve( project, Collections.singleton( Artifact.SCOPE_COMPILE ), session ); + assertEquals( 0, artifactDependencies.size() ); + + artifactDependencies = resolver.resolve( project, Collections.singleton( Artifact.SCOPE_RUNTIME ), session ); + assertEquals( 1, artifactDependencies.size() ); + assertEquals( "b", artifactDependencies.iterator().next().getArtifactId() ); + } + */ + + public void testSystemScopeDependencies() + throws Exception + { + MavenSession session = createMavenSession( null ); + MavenProject project = session.getCurrentProject(); + + new ProjectBuilder( project ) + .addDependency( "com.mycompany", "system-dependency", "1.0", Artifact.SCOPE_SYSTEM, new File( getBasedir(), "pom.xml" ).getAbsolutePath() ); + + Set<Artifact> artifactDependencies = + resolver.resolve( project, Collections.singleton( Artifact.SCOPE_COMPILE ), session ); + assertEquals( 1, artifactDependencies.size() ); + } + + public void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() + throws Exception + { + File pom = getProject( "it0063" ); + + Properties eps = new Properties(); + eps.setProperty( "jre.home", new File( pom.getParentFile(), "jdk/jre" ).getPath() ); + + MavenSession session = createMavenSession( pom, eps ); + MavenProject project = session.getCurrentProject(); + + project.setArtifacts( resolver.resolve( project, Collections.singleton( Artifact.SCOPE_COMPILE ), session ) ); + + List<String> elements = project.getCompileClasspathElements(); + assertEquals( 2, elements.size() ); + + @SuppressWarnings( "deprecation" ) + List<Artifact> artifacts = project.getCompileArtifacts(); + assertEquals( 1, artifacts.size() ); + assertTrue( artifacts.get( 0 ).getFile().getName().endsWith( "tools.jar" ) ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java new file mode 100644 index 00000000..ac02e106 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java @@ -0,0 +1,89 @@ +package org.apache.maven.artifact.handler; + +/* + * 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.File; +import java.util.List; + +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.util.FileUtils; + +public class ArtifactHandlerTest + extends PlexusTestCase +{ + public void testAptConsistency() + throws Exception + { + File apt = getTestFile( "src/site/apt/artifact-handlers.apt" ); + + @SuppressWarnings( "unchecked" ) + List<String> lines = FileUtils.loadFile( apt ); + + for ( String line : lines ) + { + if ( line.startsWith( "||" ) ) + { + String[] cols = line.split( "\\|\\|" ); + String[] expected = + new String[] { "", "type", "extension", "packaging", "classifier", "language", "added to classpath", + "includesDependencies", "" }; + + int i = 0; + for ( String col : cols ) + { + assertEquals( "Wrong column header", expected[i++], col.trim() ); + } + } + else if ( line.startsWith( "|" ) ) + { + String[] cols = line.split( "\\|" ); + + String type = trimApt( cols[1] ); + String extension = trimApt( cols[2], type ); + String packaging = trimApt( cols[3], type ); + String classifier = trimApt( cols[4] ); + String language = trimApt( cols[5] ); + String addedToClasspath = trimApt( cols[6] ); + String includesDependencies = trimApt( cols[7] ); + + ArtifactHandler handler = lookup( ArtifactHandler.class, type ); + assertEquals( type + " extension", handler.getExtension(), extension ); + assertEquals( type + " packaging", handler.getPackaging(), packaging ); + assertEquals( type + " classifier", handler.getClassifier(), classifier ); + assertEquals( type + " language", handler.getLanguage(), language ); + assertEquals( type + " addedToClasspath", handler.isAddedToClasspath() ? "true" : null, addedToClasspath ); + assertEquals( type + " includesDependencies", handler.isIncludesDependencies() ? "true" : null, includesDependencies ); + } + } + } + + private String trimApt( String content, String type ) + { + String value = trimApt( content ); + return "= type".equals( value ) ? type : value; + } + + private String trimApt( String content ) + { + content = content.replace( '<', ' ' ).replace( '>', ' ' ).trim(); + + return ( content.length() == 0 ) ? null : content; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java new file mode 100644 index 00000000..33673e3b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/configuration/DefaultBeanConfiguratorTest.java @@ -0,0 +1,148 @@ +package org.apache.maven.configuration; + +/* + * 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.File; +import java.io.IOException; +import java.io.StringReader; + +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.codehaus.plexus.util.xml.Xpp3DomBuilder; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +/** + * @author Benjamin Bentmann + */ +public class DefaultBeanConfiguratorTest + extends PlexusTestCase +{ + + private BeanConfigurator configurator; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + configurator = lookup( BeanConfigurator.class ); + } + + @Override + protected void tearDown() + throws Exception + { + configurator = null; + + super.tearDown(); + } + + private Xpp3Dom toConfig( String xml ) + { + try + { + return Xpp3DomBuilder.build( new StringReader( "<configuration>" + xml + "</configuration>" ) ); + } + catch ( XmlPullParserException e ) + { + throw new IllegalArgumentException( e ); + } + catch ( IOException e ) + { + throw new IllegalArgumentException( e ); + } + } + + public void testMinimal() + throws BeanConfigurationException + { + SomeBean bean = new SomeBean(); + + Xpp3Dom config = toConfig( "<file>test</file>" ); + + DefaultBeanConfigurationRequest request = new DefaultBeanConfigurationRequest(); + request.setBean( bean ).setConfiguration( config ); + + configurator.configureBean( request ); + + assertEquals( new File( "test" ), bean.file ); + } + + public void testPreAndPostProcessing() + throws BeanConfigurationException + { + SomeBean bean = new SomeBean(); + + Xpp3Dom config = toConfig( "<file>${test}</file>" ); + + BeanConfigurationValuePreprocessor preprocessor = new BeanConfigurationValuePreprocessor() + { + public Object preprocessValue( String value, Class<?> type ) + throws BeanConfigurationException + { + if ( value != null && value.startsWith( "${" ) && value.endsWith( "}" ) ) + { + return value.substring( 2, value.length() - 1 ); + } + return value; + } + }; + + BeanConfigurationPathTranslator translator = new BeanConfigurationPathTranslator() + { + public File translatePath( File path ) + { + return new File( "base", path.getPath() ).getAbsoluteFile(); + } + }; + + DefaultBeanConfigurationRequest request = new DefaultBeanConfigurationRequest(); + request.setBean( bean ).setConfiguration( config ); + request.setValuePreprocessor( preprocessor ).setPathTranslator( translator ); + + configurator.configureBean( request ); + + assertEquals( new File( "base/test" ).getAbsoluteFile(), bean.file ); + } + + public void testChildConfigurationElement() + throws BeanConfigurationException + { + SomeBean bean = new SomeBean(); + + Xpp3Dom config = toConfig( "<wrapper><file>test</file></wrapper>" ); + + DefaultBeanConfigurationRequest request = new DefaultBeanConfigurationRequest(); + request.setBean( bean ).setConfiguration( config, "wrapper" ); + + configurator.configureBean( request ); + + assertEquals( new File( "test" ), bean.file ); + } + + static class SomeBean + { + + File file; + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java new file mode 100644 index 00000000..9727bdf8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java @@ -0,0 +1,60 @@ +package org.apache.maven.exception; + +/* + * 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.net.ConnectException; + +import org.apache.maven.plugin.MojoExecutionException; + +import junit.framework.TestCase; + +/** + * @author <a href="mailto:baerrach@apache.org">Barrie Treloar</a> + */ +public class DefaultExceptionHandlerTest + extends TestCase +{ + /** + * Running Maven under JDK7 may cause connection issues because IPv6 is used by default. + * <p> + * e.g running mvn site:run will cause Jetty to fail. + * </p> + * <p> + * The resolution is to add -Djava.net.preferIPv4Stack=true to the command line as documented in + * http://cwiki.apache.org/confluence/display/MAVEN/ConnectException + * </p> + */ + public void testJdk7ipv6() + { + ConnectException connEx = new ConnectException( "Connection refused: connect" ); + IOException ioEx = new IOException( "Unable to establish loopback connection" ); + ioEx.initCause( connEx ); + MojoExecutionException mojoEx = + new MojoExecutionException( "Error executing Jetty: Unable to establish loopback connection", ioEx ); + + ExceptionHandler exceptionHandler = new DefaultExceptionHandler(); + ExceptionSummary exceptionSummary = exceptionHandler.handleException( mojoEx ); + + String expectedReference = "http://cwiki.apache.org/confluence/display/MAVEN/ConnectException"; + assertEquals( expectedReference, exceptionSummary.getReference() ); + + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java new file mode 100644 index 00000000..15a7a7b3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulatorTest.java @@ -0,0 +1,62 @@ +package org.apache.maven.execution; + +import java.util.List; + +import javax.inject.Inject; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.settings.Profile; +import org.apache.maven.settings.Repository; +import org.apache.maven.settings.Settings; +import org.eclipse.sisu.launch.InjectedTestCase; + +/* + * 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 DefaultMavenExecutionRequestPopulatorTest + extends InjectedTestCase +{ + @Inject + MavenExecutionRequestPopulator testee; + + public void testPluginRepositoryInjection() + throws Exception + { + MavenExecutionRequest request = new DefaultMavenExecutionRequest(); + + Repository r = new Repository(); + r.setId( "test" ); + r.setUrl( "file:///test" ); + + Profile p = new Profile(); + p.setId( "test" ); + p.addPluginRepository( r ); + + Settings settings = new Settings(); + settings.addProfile( p ); + settings.addActiveProfile( p.getId() ); + + testee.populateFromSettings( request, settings ); + + List<ArtifactRepository> repositories = request.getPluginArtifactRepositories(); + assertEquals( 1, repositories.size() ); + assertEquals( r.getId(), repositories.get( 0 ).getId() ); + assertEquals( r.getUrl(), repositories.get( 0 ).getUrl() ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionTest.java new file mode 100644 index 00000000..fbb8b900 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/DefaultMavenExecutionTest.java @@ -0,0 +1,52 @@ +package org.apache.maven.execution; + +/* + * 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.project.MavenProject; + +import java.util.List; + +import junit.framework.TestCase; + +/** + * @author Benjamin Bentmann + */ +public class DefaultMavenExecutionTest + extends TestCase +{ + + public void testCopyDefault() + { + MavenExecutionRequest original = new DefaultMavenExecutionRequest(); + MavenExecutionRequest copy = DefaultMavenExecutionRequest.copy( original ); + assertNotNull( copy ); + assertNotSame( copy, original ); + } + + public void testResultWithNullTopologicallySortedProjectsIsEmptyList() + { + MavenExecutionResult result = new DefaultMavenExecutionResult(); + result.setTopologicallySortedProjects( null ); + List<MavenProject> projects = result.getTopologicallySortedProjects(); + assertNotNull( projects ); + assertTrue( projects.isEmpty() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java new file mode 100644 index 00000000..a4eb354c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/execution/scope/internal/MojoExecutionScopeTest.java @@ -0,0 +1,122 @@ +/* + * 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. + */ +package org.apache.maven.execution.scope.internal; + +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.maven.execution.MojoExecutionEvent; +import org.apache.maven.execution.scope.WeakMojoExecutionListener; +import org.apache.maven.plugin.MojoExecutionException; + +import junit.framework.TestCase; + +import com.google.inject.Key; +import com.google.inject.Provider; + +public class MojoExecutionScopeTest + extends TestCase +{ + public void testNestedEnter() + throws Exception + { + MojoExecutionScope scope = new MojoExecutionScope(); + + scope.enter(); + + Object o1 = new Object(); + scope.seed( Object.class, o1 ); + assertSame( o1, scope.scope( Key.get( Object.class ), null ).get() ); + + scope.enter(); + Object o2 = new Object(); + scope.seed( Object.class, o2 ); + assertSame( o2, scope.scope( Key.get( Object.class ), null ).get() ); + + scope.exit(); + assertSame( o1, scope.scope( Key.get( Object.class ), null ).get() ); + + scope.exit(); + + try + { + scope.exit(); + fail(); + } + catch ( IllegalStateException expected ) + { + } + } + + public void testMultiKeyInstance() + throws Exception + { + MojoExecutionScope scope = new MojoExecutionScope(); + scope.enter(); + + final AtomicInteger beforeExecution = new AtomicInteger(); + final AtomicInteger afterExecutionSuccess = new AtomicInteger(); + final AtomicInteger afterExecutionFailure = new AtomicInteger(); + final WeakMojoExecutionListener instance = new WeakMojoExecutionListener() + { + @Override + public void beforeMojoExecution( MojoExecutionEvent event ) + throws MojoExecutionException + { + beforeExecution.incrementAndGet(); + } + + @Override + public void afterMojoExecutionSuccess( MojoExecutionEvent event ) + throws MojoExecutionException + { + afterExecutionSuccess.incrementAndGet(); + } + + @Override + public void afterExecutionFailure( MojoExecutionEvent event ) + { + afterExecutionFailure.incrementAndGet(); + } + }; + assertSame( instance, scope.scope( Key.get( Object.class ), new Provider<Object>() + { + @Override + public Object get() + { + return instance; + } + } ).get() ); + assertSame( instance, + scope.scope( Key.get( WeakMojoExecutionListener.class ), new Provider<WeakMojoExecutionListener>() + { + @Override + public WeakMojoExecutionListener get() + { + return instance; + } + } ).get() ); + + final MojoExecutionEvent event = new MojoExecutionEvent( null, null, null, null ); + scope.beforeMojoExecution( event ); + scope.afterMojoExecutionSuccess( event ); + scope.afterExecutionFailure( event ); + + assertEquals( 1, beforeExecution.get() ); + assertEquals( 1, afterExecutionSuccess.get() ); + assertEquals( 1, afterExecutionFailure.get() ); + + scope.exit(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/graph/DefaultProjectDependencyGraphTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/graph/DefaultProjectDependencyGraphTest.java new file mode 100644 index 00000000..e2caaeb1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/graph/DefaultProjectDependencyGraphTest.java @@ -0,0 +1,172 @@ +/* + * 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. + */ +package org.apache.maven.graph; + +import junit.framework.TestCase; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.model.Dependency; +import org.apache.maven.project.DuplicateProjectException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.dag.CycleDetectedException; + +import java.util.Arrays; +import java.util.List; + +/** + * @author Kristian Rosenvold + */ +public class DefaultProjectDependencyGraphTest + extends TestCase +{ + + private final MavenProject aProject = createA(); + + private final MavenProject depender1 = createProject( Arrays.asList( toDependency( aProject ) ), "depender1" ); + + private final MavenProject depender2 = createProject( Arrays.asList( toDependency( aProject ) ), "depender2" ); + + private final MavenProject depender3 = createProject( Arrays.asList( toDependency( aProject ) ), "depender3" ); + + private final MavenProject depender4 = + createProject( Arrays.asList( toDependency( aProject ), toDependency( depender3 ) ), "depender4" ); + + private final MavenProject transitiveOnly = + createProject( Arrays.asList( toDependency( depender3 ) ), "depender5" ); + + public void testGetSortedProjects() + throws DuplicateProjectException, CycleDetectedException + { + ProjectDependencyGraph graph = new DefaultProjectDependencyGraph( Arrays.asList( depender1, aProject ) ); + final List<MavenProject> sortedProjects = graph.getSortedProjects(); + assertEquals( aProject, sortedProjects.get( 0 ) ); + assertEquals( depender1, sortedProjects.get( 1 ) ); + } + + public void testVerifyExpectedParentStructure() + throws CycleDetectedException, DuplicateProjectException + { + // This test verifies the baseline structure used in susequent tests. If this fails, the rest will fail. + ProjectDependencyGraph graph = threeProjectsDependingOnASingle(); + final List<MavenProject> sortedProjects = graph.getSortedProjects(); + assertEquals( aProject, sortedProjects.get( 0 ) ); + assertEquals( depender1, sortedProjects.get( 1 ) ); + assertEquals( depender2, sortedProjects.get( 2 ) ); + assertEquals( depender3, sortedProjects.get( 3 ) ); + } + + public void testVerifyThatDownsteamProjectsComeInSortedOrder() + throws CycleDetectedException, DuplicateProjectException + { + final List<MavenProject> downstreamProjects = + threeProjectsDependingOnASingle().getDownstreamProjects( aProject, true ); + assertEquals( depender1, downstreamProjects.get( 0 ) ); + assertEquals( depender2, downstreamProjects.get( 1 ) ); + assertEquals( depender3, downstreamProjects.get( 2 ) ); + } + + public void testTransitivesInOrder() + throws CycleDetectedException, DuplicateProjectException + { + final ProjectDependencyGraph graph = + new DefaultProjectDependencyGraph( Arrays.asList( depender1, depender4, depender2, depender3, aProject ) ); + + final List<MavenProject> downstreamProjects = graph.getDownstreamProjects( aProject, true ); + assertEquals( depender1, downstreamProjects.get( 0 ) ); + assertEquals( depender3, downstreamProjects.get( 1 ) ); + assertEquals( depender4, downstreamProjects.get( 2 ) ); + assertEquals( depender2, downstreamProjects.get( 3 ) ); + } + + public void testNonTransitivesInOrder() + throws CycleDetectedException, DuplicateProjectException + { + final ProjectDependencyGraph graph = + new DefaultProjectDependencyGraph( Arrays.asList( depender1, depender4, depender2, depender3, aProject ) ); + + final List<MavenProject> downstreamProjects = graph.getDownstreamProjects( aProject, false ); + assertEquals( depender1, downstreamProjects.get( 0 ) ); + assertEquals( depender3, downstreamProjects.get( 1 ) ); + assertEquals( depender4, downstreamProjects.get( 2 ) ); + assertEquals( depender2, downstreamProjects.get( 3 ) ); + } + + public void testWithTranistiveOnly() + throws CycleDetectedException, DuplicateProjectException + { + final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph( + Arrays.asList( depender1, transitiveOnly, depender2, depender3, aProject ) ); + + final List<MavenProject> downstreamProjects = graph.getDownstreamProjects( aProject, true ); + assertEquals( depender1, downstreamProjects.get( 0 ) ); + assertEquals( depender3, downstreamProjects.get( 1 ) ); + assertEquals( transitiveOnly, downstreamProjects.get( 2 ) ); + assertEquals( depender2, downstreamProjects.get( 3 ) ); + } + + public void testWithMissingTranistiveOnly() + throws CycleDetectedException, DuplicateProjectException + { + final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph( + Arrays.asList( depender1, transitiveOnly, depender2, depender3, aProject ) ); + + final List<MavenProject> downstreamProjects = graph.getDownstreamProjects( aProject, false ); + assertEquals( depender1, downstreamProjects.get( 0 ) ); + assertEquals( depender3, downstreamProjects.get( 1 ) ); + assertEquals( depender2, downstreamProjects.get( 2 ) ); + } + + public void testGetUpstreamProjects() + throws CycleDetectedException, DuplicateProjectException + { + ProjectDependencyGraph graph = threeProjectsDependingOnASingle(); + final List<MavenProject> downstreamProjects = graph.getUpstreamProjects( depender1, true ); + assertEquals( aProject, downstreamProjects.get( 0 ) ); + } + + private ProjectDependencyGraph threeProjectsDependingOnASingle() + throws CycleDetectedException, DuplicateProjectException + { + return new DefaultProjectDependencyGraph( Arrays.asList( depender1, depender2, depender3, aProject ) ); + } + + private static MavenProject createA() + { + MavenProject result = new MavenProject(); + result.setGroupId( "org.apache" ); + result.setArtifactId( "A" ); + result.setVersion( "1.2" ); + return result; + } + + static Dependency toDependency( MavenProject mavenProject ) + { + final Dependency dependency = new Dependency(); + dependency.setArtifactId( mavenProject.getArtifactId() ); + dependency.setGroupId( mavenProject.getGroupId() ); + dependency.setVersion( mavenProject.getVersion() ); + return dependency; + } + + private static MavenProject createProject( List<Dependency> dependencies, String artifactId ) + { + MavenProject result = new MavenProject(); + result.setGroupId( "org.apache" ); + result.setArtifactId( artifactId ); + result.setVersion( "1.2" ); + result.setDependencies( dependencies ); + return result; + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java new file mode 100644 index 00000000..690532c7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DefaultLifecyclesTest.java @@ -0,0 +1,59 @@ +/* + * 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. + */ +package org.apache.maven.lifecycle; + +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.component.annotations.Requirement; + +import java.util.List; + +/** + * @author Kristian Rosenvold + */ + +public class DefaultLifecyclesTest + extends PlexusTestCase +{ + @Requirement + private DefaultLifecycles defaultLifeCycles; + + + protected void setUp() + throws Exception + { + super.setUp(); + defaultLifeCycles = lookup( DefaultLifecycles.class ); + } + + @Override + protected void tearDown() + throws Exception + { + defaultLifeCycles = null; + super.tearDown(); + } + + public void testLifecycle() + throws Exception + { + final List<Lifecycle> cycles = defaultLifeCycles.getLifeCycles(); + assertNotNull( cycles ); + final Lifecycle lifecycle = cycles.get( 0 ); + assertEquals( "default", lifecycle.getId() ); + assertEquals( 23, lifecycle.getPhases().size() ); + + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DelegatingMojoExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DelegatingMojoExecutionListener.java new file mode 100644 index 00000000..873cc7da --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DelegatingMojoExecutionListener.java @@ -0,0 +1,75 @@ +package org.apache.maven.lifecycle; + +/* + * 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.concurrent.CopyOnWriteArrayList; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.apache.maven.execution.MojoExecutionEvent; +import org.apache.maven.execution.MojoExecutionListener; +import org.apache.maven.plugin.MojoExecutionException; + +@Named +@Singleton +public class DelegatingMojoExecutionListener + implements MojoExecutionListener +{ + private final List<MojoExecutionListener> listeners = new CopyOnWriteArrayList<MojoExecutionListener>(); + + public void beforeMojoExecution( MojoExecutionEvent event ) + throws MojoExecutionException + { + for ( MojoExecutionListener listener : listeners ) + { + listener.beforeMojoExecution( event ); + } + } + + public void afterMojoExecutionSuccess( MojoExecutionEvent event ) + throws MojoExecutionException + { + for ( MojoExecutionListener listener : listeners ) + { + listener.afterMojoExecutionSuccess( event ); + } + } + + public void afterExecutionFailure( MojoExecutionEvent event ) + { + for ( MojoExecutionListener listener : listeners ) + { + listener.afterExecutionFailure( event ); + } + } + + public void addMojoExecutionListener( MojoExecutionListener listener ) + { + this.listeners.add( listener ); + } + + public void removeMojoExecutionListener( MojoExecutionListener listener ) + { + this.listeners.remove( listener ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DelegatingProjectExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DelegatingProjectExecutionListener.java new file mode 100644 index 00000000..233ae256 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/DelegatingProjectExecutionListener.java @@ -0,0 +1,82 @@ +package org.apache.maven.lifecycle; + +/* + * 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.concurrent.CopyOnWriteArrayList; + +import javax.inject.Named; +import javax.inject.Singleton; + +import org.apache.maven.execution.ProjectExecutionEvent; +import org.apache.maven.execution.ProjectExecutionListener; + +@Named +@Singleton +public class DelegatingProjectExecutionListener + implements ProjectExecutionListener +{ + private final List<ProjectExecutionListener> listeners = new CopyOnWriteArrayList<ProjectExecutionListener>(); + + public void beforeProjectExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.beforeProjectExecution( event ); + } + } + + public void beforeProjectLifecycleExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.beforeProjectLifecycleExecution( event ); + } + } + + public void afterProjectExecutionSuccess( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.afterProjectExecutionSuccess( event ); + } + } + + public void afterProjectExecutionFailure( ProjectExecutionEvent event ) + { + for ( ProjectExecutionListener listener : listeners ) + { + listener.afterProjectExecutionFailure( event ); + } + } + + public void addProjectExecutionListener( ProjectExecutionListener listener ) + { + this.listeners.add( listener ); + } + + public void removeProjectExecutionListener( ProjectExecutionListener listener ) + { + this.listeners.remove( listener ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java new file mode 100644 index 00000000..f9bbb2ba --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java @@ -0,0 +1,77 @@ +package org.apache.maven.lifecycle; + +/* + * 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.Collections; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; + +/** + * @author Benjamin Bentmann + */ +public class EmptyLifecyclePluginAnalyzer + implements LifeCyclePluginAnalyzer +{ + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) + { + Set<Plugin> plugins; + + // NOTE: The upper-case packaging name is intentional, that's a special hinting mode used for certain tests + if ( "JAR".equals( packaging ) ) + { + plugins = new LinkedHashSet<Plugin>(); + + plugins.add( newPlugin( "maven-compiler-plugin", "compile", "testCompile" ) ); + plugins.add( newPlugin( "maven-resources-plugin", "resources", "testResources" ) ); + plugins.add( newPlugin( "maven-surefire-plugin", "test" ) ); + plugins.add( newPlugin( "maven-jar-plugin", "jar" ) ); + plugins.add( newPlugin( "maven-install-plugin", "install" ) ); + plugins.add( newPlugin( "maven-deploy-plugin", "deploy" ) ); + } + else + { + plugins = Collections.emptySet(); + } + + return plugins; + } + + private Plugin newPlugin( String artifactId, String... goals ) + { + Plugin plugin = new Plugin(); + + plugin.setGroupId( "org.apache.maven.plugins" ); + plugin.setArtifactId( artifactId ); + + for ( String goal : goals ) + { + PluginExecution pluginExecution = new PluginExecution(); + pluginExecution.setId( "default-" + goal ); + pluginExecution.addGoal( goal ); + plugin.addExecution( pluginExecution ); + } + + return plugin; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java new file mode 100644 index 00000000..01ebeac0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorSubModulesTest.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + + +package org.apache.maven.lifecycle; + +import org.apache.maven.AbstractCoreMavenComponentTestCase; +import org.apache.maven.exception.ExceptionHandler; +import org.apache.maven.lifecycle.internal.LifecycleDependencyResolver; +import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator; +import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder; +import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator; +import org.apache.maven.lifecycle.internal.MojoExecutor; +import org.codehaus.plexus.component.annotations.Requirement; + +/** + * Just asserts that it's able to create those components. Handy when plexus gets a nervous breakdown. + * + * @author Kristian Rosenvold + */ + +public class LifecycleExecutorSubModulesTest + extends AbstractCoreMavenComponentTestCase +{ + @Requirement + private DefaultLifecycles defaultLifeCycles; + + @Requirement + private MojoExecutor mojoExecutor; + + @Requirement + private LifecycleModuleBuilder lifeCycleBuilder; + + @Requirement + private LifecycleDependencyResolver lifeCycleDependencyResolver; + + @Requirement + private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator; + + @Requirement + private LifeCyclePluginAnalyzer lifeCyclePluginAnalyzer; + + @Requirement + private LifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator; + + + protected void setUp() + throws Exception + { + super.setUp(); + defaultLifeCycles = lookup( DefaultLifecycles.class ); + mojoExecutor = lookup( MojoExecutor.class ); + lifeCycleBuilder = lookup( LifecycleModuleBuilder.class ); + lifeCycleDependencyResolver = lookup( LifecycleDependencyResolver.class ); + lifeCycleExecutionPlanCalculator = lookup( LifecycleExecutionPlanCalculator.class ); + lifeCyclePluginAnalyzer = lookup( LifeCyclePluginAnalyzer.class ); + lifeCycleTaskSegmentCalculator = lookup( LifecycleTaskSegmentCalculator.class ); + lookup( ExceptionHandler.class ); + } + + @Override + protected void tearDown() + throws Exception + { + defaultLifeCycles = null; + super.tearDown(); + } + + protected String getProjectsDirectory() + { + return "src/test/projects/lifecycle-executor"; + } + + public void testCrweation() + throws Exception + { + assertNotNull( defaultLifeCycles ); + assertNotNull( mojoExecutor ); + assertNotNull( lifeCycleBuilder ); + assertNotNull( lifeCycleDependencyResolver ); + assertNotNull( lifeCycleExecutionPlanCalculator ); + assertNotNull( lifeCyclePluginAnalyzer ); + assertNotNull( lifeCycleTaskSegmentCalculator ); + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java new file mode 100644 index 00000000..99b07e34 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/LifecycleExecutorTest.java @@ -0,0 +1,553 @@ +package org.apache.maven.lifecycle; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.apache.maven.AbstractCoreMavenComponentTestCase; +import org.apache.maven.exception.ExceptionHandler; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.execution.MojoExecutionEvent; +import org.apache.maven.execution.MojoExecutionListener; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.execution.ProjectExecutionEvent; +import org.apache.maven.execution.ProjectExecutionListener; +import org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator; +import org.apache.maven.lifecycle.internal.ExecutionPlanItem; +import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator; +import org.apache.maven.lifecycle.internal.LifecycleTask; +import org.apache.maven.lifecycle.internal.LifecycleTaskSegmentCalculator; +import org.apache.maven.lifecycle.internal.MojoDescriptorCreator; +import org.apache.maven.lifecycle.internal.TaskSegment; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +public class LifecycleExecutorTest + extends AbstractCoreMavenComponentTestCase +{ + @Requirement + private DefaultLifecycleExecutor lifecycleExecutor; + + @Requirement + private DefaultLifecycleTaskSegmentCalculator lifeCycleTaskSegmentCalculator; + + @Requirement + private LifecycleExecutionPlanCalculator lifeCycleExecutionPlanCalculator; + + @Requirement + private MojoDescriptorCreator mojoDescriptorCreator; + + + protected void setUp() + throws Exception + { + super.setUp(); + lifecycleExecutor = (DefaultLifecycleExecutor) lookup( LifecycleExecutor.class ); + lifeCycleTaskSegmentCalculator = + (DefaultLifecycleTaskSegmentCalculator) lookup( LifecycleTaskSegmentCalculator.class ); + lifeCycleExecutionPlanCalculator = lookup( LifecycleExecutionPlanCalculator.class ); + mojoDescriptorCreator = lookup( MojoDescriptorCreator.class ); + lookup( ExceptionHandler.class ); + } + + @Override + protected void tearDown() + throws Exception + { + lifecycleExecutor = null; + super.tearDown(); + } + + protected String getProjectsDirectory() + { + return "src/test/projects/lifecycle-executor"; + } + + // ----------------------------------------------------------------------------------------------- + // Tests which exercise the lifecycle executor when it is dealing with default lifecycle phases. + // ----------------------------------------------------------------------------------------------- + + public void testCalculationOfBuildPlanWithIndividualTaskWherePluginIsSpecifiedInThePom() + throws Exception + { + // We are doing something like "mvn resources:resources" where no version is specified but this + // project we are working on has the version specified in the POM so the version should come from there. + File pom = getProject( "project-basic" ); + MavenSession session = createMavenSession( pom ); + assertEquals( "project-basic", session.getCurrentProject().getArtifactId() ); + assertEquals( "1.0", session.getCurrentProject().getVersion() ); + List<MojoExecution> executionPlan = getExecutions( calculateExecutionPlan( session, "resources:resources" ) ); + assertEquals( 1, executionPlan.size() ); + MojoExecution mojoExecution = executionPlan.get( 0 ); + assertNotNull( mojoExecution ); + assertEquals( "org.apache.maven.plugins", + mojoExecution.getMojoDescriptor().getPluginDescriptor().getGroupId() ); + assertEquals( "maven-resources-plugin", + mojoExecution.getMojoDescriptor().getPluginDescriptor().getArtifactId() ); + assertEquals( "0.1", mojoExecution.getMojoDescriptor().getPluginDescriptor().getVersion() ); + } + + public void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanLifecycle() + throws Exception + { + // We are doing something like "mvn clean:clean" where no version is specified but this + // project we are working on has the version specified in the POM so the version should come from there. + File pom = getProject( "project-basic" ); + MavenSession session = createMavenSession( pom ); + assertEquals( "project-basic", session.getCurrentProject().getArtifactId() ); + assertEquals( "1.0", session.getCurrentProject().getVersion() ); + List<MojoExecution> executionPlan = getExecutions( calculateExecutionPlan( session, "clean" ) ); + assertEquals( 1, executionPlan.size() ); + MojoExecution mojoExecution = executionPlan.get( 0 ); + assertNotNull( mojoExecution ); + assertEquals( "org.apache.maven.plugins", + mojoExecution.getMojoDescriptor().getPluginDescriptor().getGroupId() ); + assertEquals( "maven-clean-plugin", mojoExecution.getMojoDescriptor().getPluginDescriptor().getArtifactId() ); + assertEquals( "0.1", mojoExecution.getMojoDescriptor().getPluginDescriptor().getVersion() ); + } + + public void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanCleanGoal() + throws Exception + { + // We are doing something like "mvn clean:clean" where no version is specified but this + // project we are working on has the version specified in the POM so the version should come from there. + File pom = getProject( "project-basic" ); + MavenSession session = createMavenSession( pom ); + assertEquals( "project-basic", session.getCurrentProject().getArtifactId() ); + assertEquals( "1.0", session.getCurrentProject().getVersion() ); + List<MojoExecution> executionPlan = getExecutions( calculateExecutionPlan( session, "clean:clean" ) ); + assertEquals( 1, executionPlan.size() ); + MojoExecution mojoExecution = executionPlan.get( 0 ); + assertNotNull( mojoExecution ); + assertEquals( "org.apache.maven.plugins", + mojoExecution.getMojoDescriptor().getPluginDescriptor().getGroupId() ); + assertEquals( "maven-clean-plugin", mojoExecution.getMojoDescriptor().getPluginDescriptor().getArtifactId() ); + assertEquals( "0.1", mojoExecution.getMojoDescriptor().getPluginDescriptor().getVersion() ); + } + + List<MojoExecution> getExecutions( MavenExecutionPlan mavenExecutionPlan ) + { + List<MojoExecution> result = new ArrayList<MojoExecution>(); + for ( ExecutionPlanItem executionPlanItem : mavenExecutionPlan ) + { + result.add( executionPlanItem.getMojoExecution() ); + } + return result; + } + + // We need to take in multiple lifecycles + public void testCalculationOfBuildPlanTasksOfTheCleanLifecycleAndTheInstallLifecycle() + throws Exception + { + File pom = getProject( "project-with-additional-lifecycle-elements" ); + MavenSession session = createMavenSession( pom ); + assertEquals( "project-with-additional-lifecycle-elements", session.getCurrentProject().getArtifactId() ); + assertEquals( "1.0", session.getCurrentProject().getVersion() ); + List<MojoExecution> executionPlan = getExecutions( calculateExecutionPlan( session, "clean", "install" ) ); + + //[01] clean:clean + //[02] resources:resources + //[03] compiler:compile + //[04] it:generate-metadata + //[05] resources:testResources + //[06] compiler:testCompile + //[07] it:generate-test-metadata + //[08] surefire:test + //[09] jar:jar + //[10] install:install + // + assertEquals( 10, executionPlan.size() ); + + assertEquals( "clean:clean", executionPlan.get( 0 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "resources:resources", executionPlan.get( 1 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "compiler:compile", executionPlan.get( 2 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:generate-metadata", executionPlan.get( 3 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "resources:testResources", executionPlan.get( 4 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "compiler:testCompile", executionPlan.get( 5 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:generate-test-metadata", executionPlan.get( 6 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "surefire:test", executionPlan.get( 7 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "jar:jar", executionPlan.get( 8 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "install:install", executionPlan.get( 9 ).getMojoDescriptor().getFullGoalName() ); + } + + // We need to take in multiple lifecycles + public void testCalculationOfBuildPlanWithMultipleExecutionsOfModello() + throws Exception + { + File pom = getProject( "project-with-multiple-executions" ); + MavenSession session = createMavenSession( pom ); + assertEquals( "project-with-multiple-executions", session.getCurrentProject().getArtifactId() ); + assertEquals( "1.0.1", session.getCurrentProject().getVersion() ); + + MavenExecutionPlan plan = calculateExecutionPlan( session, "clean", "install" ); + + List<MojoExecution> executions = getExecutions( plan ); + + //[01] clean:clean + //[02] modello:xpp3-writer + //[03] modello:java + //[04] modello:xpp3-reader + //[05] modello:xpp3-writer + //[06] modello:java + //[07] modello:xpp3-reader + //[08] plugin:descriptor + //[09] resources:resources + //[10] compiler:compile + //[11] resources:testResources + //[12] compiler:testCompile + //[13] surefire:test + //[14] jar:jar + //[15] plugin:addPluginArtifactMetadata + //[16] install:install + // + + assertEquals( 16, executions.size() ); + + assertEquals( "clean:clean", executions.get( 0 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:xpp3-writer", executions.get( 1 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:java", executions.get( 2 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:xpp3-reader", executions.get( 3 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:xpp3-writer", executions.get( 4 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:java", executions.get( 5 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:xpp3-reader", executions.get( 6 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "resources:resources", executions.get( 7 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "compiler:compile", executions.get( 8 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "plugin:descriptor", executions.get( 9 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "resources:testResources", executions.get( 10 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "compiler:testCompile", executions.get( 11 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "surefire:test", executions.get( 12 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "jar:jar", executions.get( 13 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "plugin:addPluginArtifactMetadata", executions.get( 14 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "install:install", executions.get( 15 ).getMojoDescriptor().getFullGoalName() ); + + assertEquals( "src/main/mdo/remote-resources.mdo", + new MojoExecutionXPathContainer( executions.get( 1 ) ).getValue( + "configuration/models[1]/model" ) ); + assertEquals( "src/main/mdo/supplemental-model.mdo", + new MojoExecutionXPathContainer( executions.get( 4 ) ).getValue( + "configuration/models[1]/model" ) ); + } + + public void testLifecycleQueryingUsingADefaultLifecyclePhase() + throws Exception + { + File pom = getProject( "project-with-additional-lifecycle-elements" ); + MavenSession session = createMavenSession( pom ); + assertEquals( "project-with-additional-lifecycle-elements", session.getCurrentProject().getArtifactId() ); + assertEquals( "1.0", session.getCurrentProject().getVersion() ); + List<MojoExecution> executionPlan = getExecutions( calculateExecutionPlan( session, "package" ) ); + + //[01] resources:resources + //[02] compiler:compile + //[03] it:generate-metadata + //[04] resources:testResources + //[05] compiler:testCompile + //[06] plexus-component-metadata:generate-test-metadata + //[07] surefire:test + //[08] jar:jar + // + assertEquals( 8, executionPlan.size() ); + + assertEquals( "resources:resources", executionPlan.get( 0 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "compiler:compile", executionPlan.get( 1 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:generate-metadata", executionPlan.get( 2 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "resources:testResources", executionPlan.get( 3 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "compiler:testCompile", executionPlan.get( 4 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "it:generate-test-metadata", executionPlan.get( 5 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "surefire:test", executionPlan.get( 6 ).getMojoDescriptor().getFullGoalName() ); + assertEquals( "jar:jar", executionPlan.get( 7 ).getMojoDescriptor().getFullGoalName() ); + } + + public void testLifecyclePluginsRetrievalForDefaultLifecycle() + throws Exception + { + List<Plugin> plugins = + new ArrayList<Plugin>( lifecycleExecutor.getPluginsBoundByDefaultToAllLifecycles( "jar" ) ); + + assertEquals( 8, plugins.size() ); + } + + public void testPluginConfigurationCreation() + throws Exception + { + File pom = getProject( "project-with-additional-lifecycle-elements" ); + MavenSession session = createMavenSession( pom ); + MojoDescriptor mojoDescriptor = + mojoDescriptorCreator.getMojoDescriptor( "org.apache.maven.its.plugins:maven-it-plugin:0.1:java", session, + session.getCurrentProject() ); + Xpp3Dom dom = MojoDescriptorCreator.convert( mojoDescriptor ); + System.out.println( dom ); + } + + MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks ) + throws Exception + { + List<TaskSegment> taskSegments = + lifeCycleTaskSegmentCalculator.calculateTaskSegments( session, Arrays.asList( tasks ) ); + + TaskSegment mergedSegment = new TaskSegment( false ); + + for ( TaskSegment taskSegment : taskSegments ) + { + mergedSegment.getTasks().addAll( taskSegment.getTasks() ); + } + + return lifeCycleExecutionPlanCalculator.calculateExecutionPlan( session, session.getCurrentProject(), + mergedSegment.getTasks() ); + } + + public void testInvalidGoalName() + throws Exception + { + File pom = getProject( "project-basic" ); + MavenSession session = createMavenSession( pom ); + try + { + getExecutions( calculateExecutionPlan( session, "resources:" ) ); + fail( "expected a MojoNotFoundException" ); + } + catch ( MojoNotFoundException e ) + { + assertEquals( "", e.getGoal() ); + } + + try + { + getExecutions( calculateExecutionPlan( session, "org.apache.maven.plugins:maven-resources-plugin:0.1:resources:toomany" ) ); + fail( "expected a MojoNotFoundException" ); + } + catch ( MojoNotFoundException e ) + { + assertEquals( "resources:toomany", e.getGoal() ); + } + } + + + public void testPluginPrefixRetrieval() + throws Exception + { + File pom = getProject( "project-basic" ); + MavenSession session = createMavenSession( pom ); + Plugin plugin = mojoDescriptorCreator.findPluginForPrefix( "resources", session ); + assertEquals( "org.apache.maven.plugins", plugin.getGroupId() ); + assertEquals( "maven-resources-plugin", plugin.getArtifactId() ); + } + + // Prefixes + + public void testFindingPluginPrefixforCleanClean() + throws Exception + { + File pom = getProject( "project-basic" ); + MavenSession session = createMavenSession( pom ); + Plugin plugin = mojoDescriptorCreator.findPluginForPrefix( "clean", session ); + assertNotNull( plugin ); + } + + public void testSetupMojoExecution() + throws Exception + { + File pom = getProject( "mojo-configuration" ); + + MavenSession session = createMavenSession( pom ); + + LifecycleTask task = new LifecycleTask( "generate-sources" ); + MavenExecutionPlan executionPlan = + lifeCycleExecutionPlanCalculator.calculateExecutionPlan( session, session.getCurrentProject(), + Arrays.asList( (Object) task ), false ); + + MojoExecution execution = executionPlan.getMojoExecutions().get(0); + assertEquals(execution.toString(), "maven-it-plugin", execution.getArtifactId()); + assertNull(execution.getConfiguration()); + + lifeCycleExecutionPlanCalculator.setupMojoExecution( session, session.getCurrentProject(), execution ); + assertNotNull(execution.getConfiguration()); + assertEquals("1.0", execution.getConfiguration().getChild( "version" ).getAttribute( "default-value" )); + } + + public void testExecutionListeners() + throws Exception + { + final File pom = getProject( "project-basic" ); + final MavenSession session = createMavenSession( pom ); + session.setProjectDependencyGraph( new ProjectDependencyGraph() + { + public List<MavenProject> getUpstreamProjects( MavenProject project, boolean transitive ) + { + return Collections.emptyList(); + } + + public List<MavenProject> getSortedProjects() + { + return Collections.singletonList( session.getCurrentProject() ); + } + + public List<MavenProject> getDownstreamProjects( MavenProject project, boolean transitive ) + { + return Collections.emptyList(); + } + + public java.util.List<MavenProject> getAllSortedProjects() + { + return Collections.emptyList(); + } + } ); + + final List<String> log = new ArrayList<String>(); + + MojoExecutionListener mojoListener = new MojoExecutionListener() + { + public void beforeMojoExecution( MojoExecutionEvent event ) + throws MojoExecutionException + { + assertNotNull( event.getSession() ); + assertNotNull( event.getProject() ); + assertNotNull( event.getExecution() ); + assertNotNull( event.getMojo() ); + assertNull( event.getCause() ); + + log.add( "beforeMojoExecution " + event.getProject().getArtifactId() + ":" + + event.getExecution().getExecutionId() ); + } + + public void afterMojoExecutionSuccess( MojoExecutionEvent event ) + throws MojoExecutionException + { + assertNotNull( event.getSession() ); + assertNotNull( event.getProject() ); + assertNotNull( event.getExecution() ); + assertNotNull( event.getMojo() ); + assertNull( event.getCause() ); + + log.add( "afterMojoExecutionSuccess " + event.getProject().getArtifactId() + ":" + + event.getExecution().getExecutionId() ); + } + + public void afterExecutionFailure( MojoExecutionEvent event ) + { + assertNotNull( event.getSession() ); + assertNotNull( event.getProject() ); + assertNotNull( event.getExecution() ); + assertNotNull( event.getMojo() ); + assertNotNull( event.getCause() ); + + log.add( "afterExecutionFailure " + event.getProject().getArtifactId() + ":" + + event.getExecution().getExecutionId() ); + } + }; + ProjectExecutionListener projectListener = new ProjectExecutionListener() + { + public void beforeProjectExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + assertNotNull( event.getSession() ); + assertNotNull( event.getProject() ); + assertNull( event.getExecutionPlan() ); + assertNull( event.getCause() ); + + log.add( "beforeProjectExecution " + event.getProject().getArtifactId() ); + } + + public void beforeProjectLifecycleExecution( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + assertNotNull( event.getSession() ); + assertNotNull( event.getProject() ); + assertNotNull( event.getExecutionPlan() ); + assertNull( event.getCause() ); + + log.add( "beforeProjectLifecycleExecution " + event.getProject().getArtifactId() ); + } + + public void afterProjectExecutionSuccess( ProjectExecutionEvent event ) + throws LifecycleExecutionException + { + assertNotNull( event.getSession() ); + assertNotNull( event.getProject() ); + assertNotNull( event.getExecutionPlan() ); + assertNull( event.getCause() ); + + log.add( "afterProjectExecutionSuccess " + event.getProject().getArtifactId() ); + } + + public void afterProjectExecutionFailure( ProjectExecutionEvent event ) + { + assertNotNull( event.getSession() ); + assertNotNull( event.getProject() ); + assertNull( event.getExecutionPlan() ); + assertNotNull( event.getCause() ); + + log.add( "afterProjectExecutionFailure " + event.getProject().getArtifactId() ); + } + }; + lookup( DelegatingProjectExecutionListener.class ).addProjectExecutionListener( projectListener ); + lookup( DelegatingMojoExecutionListener.class ).addMojoExecutionListener( mojoListener ); + + try + { + lifecycleExecutor.execute( session ); + } + finally + { + lookup( DelegatingProjectExecutionListener.class ).removeProjectExecutionListener( projectListener ); + lookup( DelegatingMojoExecutionListener.class ).removeMojoExecutionListener( mojoListener ); + } + + List<String> expectedLog = Arrays.asList( "beforeProjectExecution project-basic", // + "beforeProjectLifecycleExecution project-basic", // + "beforeMojoExecution project-basic:default-resources", // + "afterMojoExecutionSuccess project-basic:default-resources", // + "beforeMojoExecution project-basic:default-compile", // + "afterMojoExecutionSuccess project-basic:default-compile", // + "beforeMojoExecution project-basic:default-testResources", // + "afterMojoExecutionSuccess project-basic:default-testResources", // + "beforeMojoExecution project-basic:default-testCompile", // + "afterMojoExecutionSuccess project-basic:default-testCompile", // + "beforeMojoExecution project-basic:default-test", // + "afterMojoExecutionSuccess project-basic:default-test", // + "beforeMojoExecution project-basic:default-jar", // + "afterMojoExecutionSuccess project-basic:default-jar", // + "afterProjectExecutionSuccess project-basic" // + ); + + assertEventLog( expectedLog, log ); + } + + private static void assertEventLog( List<String> expectedList, List<String> actualList ) + { + assertEquals( toString( expectedList ), toString( actualList ) ); + } + + private static String toString( List<String> lines ) + { + StringBuilder sb = new StringBuilder(); + for ( String line : lines ) + { + sb.append( line ).append( '\n' ); + } + return sb.toString(); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java new file mode 100644 index 00000000..4901a65d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/MavenExecutionPlanTest.java @@ -0,0 +1,77 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle; + +import junit.framework.TestCase; + +import org.apache.maven.lifecycle.internal.ExecutionPlanItem; +import org.apache.maven.lifecycle.internal.stub.DefaultLifecyclesStub; +import org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub; +import org.apache.maven.model.Plugin; + +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +/** + * @author Kristian Rosenvold + */ +public class MavenExecutionPlanTest + extends TestCase +{ + + public void testFindLastInPhase() + throws Exception + { + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + + ExecutionPlanItem expected = plan.findLastInPhase( "package" ); + ExecutionPlanItem beerPhase = plan.findLastInPhase( "BEER" ); // Beer comes straight after package in stub + assertEquals( expected, beerPhase ); + assertNotNull( expected ); + } + + public void testThreadSafeMojos() + throws Exception + { + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + final Set<Plugin> unSafePlugins = plan.getNonThreadSafePlugins(); + // There is only a single threadsafe plugin here... + assertEquals( plan.size() - 1, unSafePlugins.size() ); + + } + + + public void testFindLastWhenFirst() + throws Exception + { + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + + ExecutionPlanItem beerPhase = plan.findLastInPhase( + LifecycleExecutionPlanCalculatorStub.VALIDATE.getPhase() ); // Beer comes straight after package in stub + assertNull( beerPhase ); + } + + public void testFindLastInPhaseMisc() + throws Exception + { + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + + assertNull( plan.findLastInPhase( "pacXkage" ) ); + // Beer comes straight after package in stub, much like real life. + assertNotNull( plan.findLastInPhase( LifecycleExecutionPlanCalculatorStub.INITIALIZE.getPhase() ) ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/MojoExecutionXPathContainer.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/MojoExecutionXPathContainer.java new file mode 100644 index 00000000..6244cc91 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/MojoExecutionXPathContainer.java @@ -0,0 +1,72 @@ +package org.apache.maven.lifecycle; + +/* + * 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.util.Iterator; + +import org.apache.commons.jxpath.JXPathContext; +import org.apache.commons.jxpath.JXPathNotFoundException; +import org.apache.commons.jxpath.ri.JXPathContextReferenceImpl; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.project.harness.Xpp3DomPointerFactory; + +public class MojoExecutionXPathContainer +{ + private JXPathContext context; + + static + { + JXPathContextReferenceImpl.addNodePointerFactory( new Xpp3DomPointerFactory() ); + } + + public MojoExecutionXPathContainer( MojoExecution mojoExecution ) + throws IOException + { + context = JXPathContext.newContext( mojoExecution ); + } + + public Iterator<?> getIteratorForXPathExpression( String expression ) + { + return context.iterate( expression ); + } + + public boolean containsXPathExpression( String expression ) + { + return context.getValue( expression ) != null; + } + + public Object getValue( String expression ) + { + try + { + return context.getValue( expression ); + } + catch ( JXPathNotFoundException e ) + { + return null; + } + } + + public boolean xPathExpressionEqualsValue( String expression, String value ) + { + return context.getValue( expression ) != null && context.getValue( expression ).equals( value ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuildListCalculatorTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuildListCalculatorTest.java new file mode 100644 index 00000000..a0039832 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuildListCalculatorTest.java @@ -0,0 +1,49 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 junit.framework.TestCase; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.internal.stub.LifecycleTaskSegmentCalculatorStub; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; + +import java.util.List; + +public class BuildListCalculatorTest + extends TestCase +{ + + public void testCalculateProjectBuilds() + throws Exception + { + LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator(); + BuildListCalculator buildListCalculator = new BuildListCalculator(); + final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); + List<TaskSegment> taskSegments = lifecycleTaskSegmentCalculator.calculateTaskSegments( session ); + final ProjectBuildList buildList = buildListCalculator.calculateProjectBuilds( session, taskSegments ); + final ProjectBuildList segments = buildList.getByTaskSegment( taskSegments.get( 0 ) ); + assertEquals( "Stub data contains 3 segments", 3, taskSegments.size() ); + assertEquals( "Stub data contains 6 items", 6, segments.size() ); + final ProjectSegment build = segments.get( 0 ); + assertNotNull( build ); + } + + private static LifecycleTaskSegmentCalculator getTaskSegmentCalculator() + { + return new LifecycleTaskSegmentCalculatorStub(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java new file mode 100644 index 00000000..6f896d85 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/BuilderCommonTest.java @@ -0,0 +1,76 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 junit.framework.TestCase; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.internal.builder.BuilderCommon; +import org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub; +import org.apache.maven.lifecycle.internal.stub.LoggerStub; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; + +import java.util.HashSet; + +/** + * @author Kristian Rosenvold + */ +public class BuilderCommonTest + extends TestCase +{ + public void testResolveBuildPlan() + throws Exception + { + MavenSession original = ProjectDependencyGraphStub.getMavenSession(); + + final TaskSegment taskSegment1 = new TaskSegment( false ); + final MavenSession session1 = original.clone(); + session1.setCurrentProject( ProjectDependencyGraphStub.A ); + + final BuilderCommon builderCommon = getBuilderCommon(); + final MavenExecutionPlan plan = + builderCommon.resolveBuildPlan( session1, ProjectDependencyGraphStub.A, taskSegment1, + new HashSet<Artifact>() ); + assertEquals( LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan().size(), plan.size() ); + + } + + + public void testHandleBuildError() + throws Exception + { + } + + public void testAttachToThread() + throws Exception + { + } + + public void testGetKey() + throws Exception + { + } + + public static BuilderCommon getBuilderCommon() + { + final LifecycleDebugLogger logger = new LifecycleDebugLogger( new LoggerStub() ); + return new BuilderCommon( logger, new LifecycleExecutionPlanCalculatorStub(), + new LoggerStub() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ConcurrencyDependencyGraphTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ConcurrencyDependencyGraphTest.java new file mode 100644 index 00000000..9ab06011 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ConcurrencyDependencyGraphTest.java @@ -0,0 +1,94 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.execution.MavenSession; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.lifecycle.internal.builder.multithreaded.ConcurrencyDependencyGraph; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; + +import java.util.List; + +import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.*; + +/** + * @author Kristian Rosenvold + */ +public class ConcurrencyDependencyGraphTest + extends junit.framework.TestCase +{ + public void testConcurrencyGraphPrimaryVersion() + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + ProjectDependencyGraph dependencyGraph = new ProjectDependencyGraphStub(); + final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); + + ConcurrencyDependencyGraph graph = + new ConcurrencyDependencyGraph( getProjectBuildList( session ), dependencyGraph ); + + final List<MavenProject> projectBuilds = graph.getRootSchedulableBuilds(); + assertEquals( 1, projectBuilds.size() ); + assertEquals( A, projectBuilds.get( 0 ) ); + + final List<MavenProject> subsequent = graph.markAsFinished( A ); + assertEquals( 2, subsequent.size() ); + assertEquals( ProjectDependencyGraphStub.B, subsequent.get( 0 ) ); + assertEquals( C, subsequent.get( 1 ) ); + + final List<MavenProject> bDescendants = graph.markAsFinished( B ); + assertEquals( 1, bDescendants.size() ); + assertEquals( Y, bDescendants.get( 0 ) ); + + final List<MavenProject> cDescendants = graph.markAsFinished( C ); + assertEquals( 2, cDescendants.size() ); + assertEquals( X, cDescendants.get( 0 ) ); + assertEquals( Z, cDescendants.get( 1 ) ); + } + + public void testConcurrencyGraphDifferentCompletionOrder() + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + ProjectDependencyGraph dependencyGraph = new ProjectDependencyGraphStub(); + final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); + ConcurrencyDependencyGraph graph = + new ConcurrencyDependencyGraph( getProjectBuildList( session ), dependencyGraph ); + + graph.markAsFinished( A ); + final List<MavenProject> cDescendants = graph.markAsFinished( C ); + assertEquals( 1, cDescendants.size() ); + assertEquals( Z, cDescendants.get( 0 ) ); + + final List<MavenProject> bDescendants = graph.markAsFinished( B ); + assertEquals( 2, bDescendants.size() ); + assertEquals( X, bDescendants.get( 0 ) ); + assertEquals( Y, bDescendants.get( 1 ) ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java new file mode 100644 index 00000000..a9af5668 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java @@ -0,0 +1,82 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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.AbstractCoreMavenComponentTestCase; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.internal.stub.BuildPluginManagerStub; +import org.apache.maven.lifecycle.internal.stub.DefaultLifecyclesStub; +import org.apache.maven.lifecycle.internal.stub.PluginPrefixResolverStub; +import org.apache.maven.lifecycle.internal.stub.PluginVersionResolverStub; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; + +/** + * @author Kristian Rosenvold> + */ +public class LifecycleExecutionPlanCalculatorTest + extends AbstractCoreMavenComponentTestCase +{ + + public void testCalculateExecutionPlanWithGoalTasks() + throws Exception + { + MojoDescriptorCreator mojoDescriptorCreator = createMojoDescriptorCreator(); + LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator = + createExecutionPlaceCalculator( mojoDescriptorCreator ); + + final GoalTask goalTask1 = new GoalTask( "compiler:compile" ); + final GoalTask goalTask2 = new GoalTask( "surefire:test" ); + final TaskSegment taskSegment1 = new TaskSegment( false, goalTask1, goalTask2 ); + final MavenSession session1 = ProjectDependencyGraphStub.getMavenSession( ProjectDependencyGraphStub.A ); + + MavenExecutionPlan executionPlan = + lifecycleExecutionPlanCalculator.calculateExecutionPlan( session1, ProjectDependencyGraphStub.A, + taskSegment1.getTasks() ); + assertEquals( 2, executionPlan.size() ); + + final GoalTask goalTask3 = new GoalTask( "surefire:test" ); + final TaskSegment taskSegment2 = new TaskSegment( false, goalTask1, goalTask2, goalTask3 ); + MavenExecutionPlan executionPlan2 = + lifecycleExecutionPlanCalculator.calculateExecutionPlan( session1, ProjectDependencyGraphStub.A, + taskSegment2.getTasks() ); + assertEquals( 3, executionPlan2.size() ); + } + + // Maybe also make one with LifeCycleTasks + + public static LifecycleExecutionPlanCalculator createExecutionPlaceCalculator( MojoDescriptorCreator mojoDescriptorCreator ) + { + LifecyclePluginResolver lifecyclePluginResolver = new LifecyclePluginResolver( new PluginVersionResolverStub() ); + return new DefaultLifecycleExecutionPlanCalculator( new BuildPluginManagerStub(), + DefaultLifecyclesStub.createDefaultLifecycles(), + mojoDescriptorCreator, lifecyclePluginResolver ); + } + + public static MojoDescriptorCreator createMojoDescriptorCreator() + { + return new MojoDescriptorCreator( new PluginVersionResolverStub(), new BuildPluginManagerStub(), + new PluginPrefixResolverStub(), + new LifecyclePluginResolver( new PluginVersionResolverStub() ) ); + } + + @Override + protected String getProjectsDirectory() + { + return "src/test/projects/lifecycle-executor"; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculatorImplTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculatorImplTest.java new file mode 100644 index 00000000..5db316f8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleTaskSegmentCalculatorImplTest.java @@ -0,0 +1,57 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 junit.framework.TestCase; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.internal.stub.LifecycleTaskSegmentCalculatorStub; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; + +import java.util.List; + +/** + * @author Kristian Rosenvold + */ +public class LifecycleTaskSegmentCalculatorImplTest + extends TestCase +{ + public void testCalculateProjectBuilds() + throws Exception + { + LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator(); + BuildListCalculator buildListCalculator = new BuildListCalculator(); + final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); + List<TaskSegment> taskSegments = lifecycleTaskSegmentCalculator.calculateTaskSegments( session ); + + final ProjectBuildList buildList = buildListCalculator.calculateProjectBuilds( session, taskSegments ); + final ProjectBuildList segments = buildList.getByTaskSegment( taskSegments.get( 0 ) ); + assertEquals( "Stub data contains 3 segments", 3, taskSegments.size() ); + assertEquals( "Stub data contains 6 items", 6, segments.size() ); + final ProjectSegment build = segments.get( 0 ); + assertNotNull( build ); + } + + private static LifecycleTaskSegmentCalculator getTaskSegmentCalculator() + { + return new LifecycleTaskSegmentCalculatorStub(); + } + + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java new file mode 100644 index 00000000..f3d6422c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/PhaseRecorderTest.java @@ -0,0 +1,49 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 junit.framework.TestCase; + +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; +import org.apache.maven.plugin.MojoExecution; + +import java.util.List; + +/** + * @author Kristian Rosenvold + */ +public class PhaseRecorderTest extends TestCase +{ + public void testObserveExecution() throws Exception { + PhaseRecorder phaseRecorder = new PhaseRecorder( ProjectDependencyGraphStub.A); + MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExceutionPlan(); + final List<MojoExecution> executions = plan.getMojoExecutions(); + + final MojoExecution mojoExecution1 = executions.get( 0 ); + final MojoExecution mojoExecution2 = executions.get( 1 ); + phaseRecorder.observeExecution( mojoExecution1 ); + + assertTrue( ProjectDependencyGraphStub.A.hasLifecyclePhase( mojoExecution1.getLifecyclePhase() )); + assertFalse( ProjectDependencyGraphStub.A.hasLifecyclePhase( mojoExecution2.getLifecyclePhase() )); + + assertFalse( phaseRecorder.isDifferentPhase( mojoExecution1)); + assertTrue( phaseRecorder.isDifferentPhase( mojoExecution2)); + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java new file mode 100644 index 00000000..047ef9fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/ProjectBuildListTest.java @@ -0,0 +1,42 @@ +package org.apache.maven.lifecycle.internal; + +/* + * 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 junit.framework.TestCase; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; + +/** + * @author Kristian Rosenvold + */ +public class ProjectBuildListTest + extends TestCase +{ + + public void testGetByTaskSegment() + throws Exception + { + final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); + ProjectBuildList projectBuildList = ProjectDependencyGraphStub.getProjectBuildList( session ); + TaskSegment taskSegment = projectBuildList.get( 0 ).getTaskSegment(); + assertTrue( "This test assumes there are at least 6 elements in projectBuilds", projectBuildList.size() >= 6 ); + + final ProjectBuildList byTaskSegment = projectBuildList.getByTaskSegment( taskSegment ); + assertEquals( projectBuildList.size(), + byTaskSegment.size() ); // Todo: Make multiple segments on projectBuildList + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java new file mode 100644 index 00000000..dc75a947 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java @@ -0,0 +1,167 @@ +package org.apache.maven.lifecycle.internal.builder.multithreaded; + +/* + * 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 junit.framework.TestCase; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; +import org.apache.maven.lifecycle.internal.builder.multithreaded.ThreadOutputMuxer; +import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionService; +import java.util.concurrent.ExecutorCompletionService; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +/** + * @author Kristian Rosenvold + */ +public class ThreadOutputMuxerTest + extends TestCase +{ + + final String paid = "Paid"; + + final String in = "In"; + + final String full = "Full"; + + public void testSingleThreaded() + throws Exception + { + ProjectBuildList src = getProjectBuildList(); + ProjectBuildList projectBuildList = + new ProjectBuildList( Arrays.asList( src.get( 0 ), src.get( 1 ), src.get( 2 ) ) ); + + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + PrintStream systemOut = new PrintStream( byteArrayOutputStream ); + ThreadOutputMuxer threadOutputMuxer = new ThreadOutputMuxer( projectBuildList, systemOut ); + + threadOutputMuxer.associateThreadWithProjectSegment( projectBuildList.get( 0 ) ); + System.out.print( paid ); // No, this does not print to system.out. It's part of the test + assertEquals( paid.length(), byteArrayOutputStream.size() ); + threadOutputMuxer.associateThreadWithProjectSegment( projectBuildList.get( 1 ) ); + System.out.print( in ); // No, this does not print to system.out. It's part of the test + assertEquals( paid.length(), byteArrayOutputStream.size() ); + threadOutputMuxer.associateThreadWithProjectSegment( projectBuildList.get( 2 ) ); + System.out.print( full ); // No, this does not print to system.out. It's part of the test + assertEquals( paid.length(), byteArrayOutputStream.size() ); + + threadOutputMuxer.setThisModuleComplete( projectBuildList.get( 0 ) ); + threadOutputMuxer.setThisModuleComplete( projectBuildList.get( 1 ) ); + threadOutputMuxer.setThisModuleComplete( projectBuildList.get( 2 ) ); + threadOutputMuxer.close(); + assertEquals( ( paid + in + full ).length(), byteArrayOutputStream.size() ); + } + + public void testMultiThreaded() + throws Exception + { + ProjectBuildList projectBuildList = getProjectBuildList(); + + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + PrintStream systemOut = new PrintStream( byteArrayOutputStream ); + final ThreadOutputMuxer threadOutputMuxer = new ThreadOutputMuxer( projectBuildList, systemOut ); + + final List<String> stringList = + Arrays.asList( "Thinkin", "of", "a", "master", "plan", "Cuz", "ain’t", "nuthin", "but", "sweat", "inside", + "my", "hand" ); + Iterator<String> lyrics = stringList.iterator(); + + ExecutorService executor = Executors.newFixedThreadPool( 10 ); + CompletionService<ProjectSegment> service = new ExecutorCompletionService<ProjectSegment>( executor ); + + List<Future<ProjectSegment>> futures = new ArrayList<Future<ProjectSegment>>(); + for ( ProjectSegment projectBuild : projectBuildList ) + { + final Future<ProjectSegment> buildFuture = + service.submit( new Outputter( threadOutputMuxer, projectBuild, lyrics.next() ) ); + futures.add( buildFuture ); + } + + for ( Future<ProjectSegment> future : futures ) + { + future.get(); + } + int expectedLength = 0; + for ( int i = 0; i < projectBuildList.size(); i++ ) + { + expectedLength += stringList.get( i ).length(); + } + + threadOutputMuxer.close(); + final byte[] bytes = byteArrayOutputStream.toByteArray(); + String result = new String( bytes ); + assertEquals( result, expectedLength, bytes.length ); + + + } + + class Outputter + implements Callable<ProjectSegment> + { + private final ThreadOutputMuxer threadOutputMuxer; + + private final ProjectSegment item; + + private final String response; + + Outputter( ThreadOutputMuxer threadOutputMuxer, ProjectSegment item, String response ) + { + this.threadOutputMuxer = threadOutputMuxer; + this.item = item; + this.response = response; + } + + public ProjectSegment call() + throws Exception + { + threadOutputMuxer.associateThreadWithProjectSegment( item ); + System.out.print( response ); + threadOutputMuxer.setThisModuleComplete( item ); + return item; + } + } + + + private ProjectBuildList getProjectBuildList() + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + final MavenSession session = ProjectDependencyGraphStub.getMavenSession(); + return ProjectDependencyGraphStub.getProjectBuildList( session ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/AboutTheStubs.html b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/AboutTheStubs.html new file mode 100644 index 00000000..8ad74b96 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/AboutTheStubs.html @@ -0,0 +1,55 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<!-- +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. +--> + +<html> +<head> + <title>About these stubs</title> +</head> +<body> +<h2>Design</h2> +These stubs can be thought of as hand-coded mock obects. They allow unit tests to test only specific +aspects of a component while ignoring others. + +These stubs form an internally consistent data-set that is not expected to change. They are +used to test the individual components in the lifecycle with data that has expected characteristics +and can be asserted as desired. + +You can change/extend these stubs, and tests should not be breaking too much, since most tests +assert using expected values from the stubs. Normally, when you try to use data from the stubs that +have not been properly populated, you'll get a nullpointer in your test and you then have to +identify which stub creates that specific piece of data. + +The most important stubs are: +LifecycleExecutionPlanCalculatorStub +ProjectDependencyGraphStub + +Since they define the primary structure of the project/build. + +The stubs define three top-level targets that are defined in LifecycleTaskSegmentCalculatorStub; +clean, aggr and install. "aggr" is an aggregating task while clean and install are lifecyclephases. +There will be three items in the task list for this dataset. + +The stubs also exist at different "levels", where one test might wire stubs into a specific live implementation. +In the next test that same "live implementation" will be used in a stub version instead. + +Not all live services have stubs, but can be added as needed. +</body> +</html>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java new file mode 100644 index 00000000..133bcb3a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java @@ -0,0 +1,56 @@ +package org.apache.maven.lifecycle.internal.stub; + +/* + * 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.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * @author Kristian Rosenvold + */ +public class BuildPluginManagerStub + implements BuildPluginManager +{ + + public PluginDescriptor loadPlugin( Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session ) + { + return null; + } + + public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, List<RemoteRepository> repositories, + RepositorySystemSession session ) + { + return MojoExecutorStub.createMojoDescriptor( plugin.getKey() ); + } + + public ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor ) + { + return null; + } + + public void executeMojo( MavenSession session, MojoExecution execution ) + { + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/CompletionServiceStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/CompletionServiceStub.java new file mode 100644 index 00000000..10a113e9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/CompletionServiceStub.java @@ -0,0 +1,89 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.lifecycle.internal.ProjectSegment; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionService; +import java.util.concurrent.Future; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; + +/** + * @author Kristian Rosenvold + */ +public class CompletionServiceStub + implements CompletionService<ProjectSegment> +{ + List<FutureTask<ProjectSegment>> projectBuildFutureTasks = + Collections.synchronizedList( new ArrayList<FutureTask<ProjectSegment>>() ); + + final boolean finishImmediately; + + + public int size() + { + return projectBuildFutureTasks.size(); + } + + public CompletionServiceStub( boolean finishImmediately ) + { + this.finishImmediately = finishImmediately; + } + + public Future<ProjectSegment> submit( Callable<ProjectSegment> task ) + { + FutureTask<ProjectSegment> projectBuildFutureTask = new FutureTask<ProjectSegment>( task ); + projectBuildFutureTasks.add( projectBuildFutureTask ); + if ( finishImmediately ) + { + projectBuildFutureTask.run(); + } + return projectBuildFutureTask; + } + + public Future<ProjectSegment> submit( Runnable task, ProjectSegment result ) + { + FutureTask<ProjectSegment> projectBuildFutureTask = new FutureTask<ProjectSegment>( task, result ); + projectBuildFutureTasks.add( projectBuildFutureTask ); + if ( finishImmediately ) + { + projectBuildFutureTask.run(); + } + return projectBuildFutureTask; + } + + public Future<ProjectSegment> take() + throws InterruptedException + { + return null; + } + + public Future<ProjectSegment> poll() + { + return null; + } + + public Future<ProjectSegment> poll( long timeout, TimeUnit unit ) + throws InterruptedException + { + return null; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java new file mode 100644 index 00000000..b366953a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java @@ -0,0 +1,63 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.lifecycle.DefaultLifecycles; +import org.apache.maven.lifecycle.Lifecycle; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.*; + +/** + * @author Kristian Rosenvold + */ + +public class DefaultLifecyclesStub +{ + public static DefaultLifecycles createDefaultLifecycles() + { + + List<String> stubDefaultCycle = + Arrays.asList( VALIDATE.getPhase(), INITIALIZE.getPhase(), PROCESS_RESOURCES.getPhase(), COMPILE.getPhase(), + TEST.getPhase(), PROCESS_TEST_RESOURCES.getPhase(), PACKAGE.getPhase(), "BEER", + INSTALL.getPhase() ); + + // The two phases below are really for future expansion, some would say they lack a drink + // The point being that they do not really have to match the "real" stuff, + List<String> stubCleanCycle = Arrays.asList( PRE_CLEAN.getPhase(), CLEAN.getPhase(), POST_CLEAN.getPhase() ); + + List<String> stubSiteCycle = + Arrays.asList( PRE_SITE.getPhase(), SITE.getPhase(), POST_SITE.getPhase(), SITE_DEPLOY.getPhase() ); + + @SuppressWarnings( "unchecked" ) + Iterator<List<String>> lcs = Arrays.asList( stubDefaultCycle, stubCleanCycle, stubSiteCycle ).iterator(); + + Map<String, Lifecycle> lifeCycles = new HashMap<String, Lifecycle>(); + for ( String s : DefaultLifecycles.STANDARD_LIFECYCLES ) + { + final Lifecycle lifecycle = new Lifecycle( s, lcs.next(), null ); + lifeCycles.put( s, lifecycle ); + + } + return new DefaultLifecycles( lifeCycles, new LoggerStub() ); + } + +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ExecutionEventCatapultStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ExecutionEventCatapultStub.java new file mode 100644 index 00000000..e47ec611 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ExecutionEventCatapultStub.java @@ -0,0 +1,42 @@ +package org.apache.maven.lifecycle.internal.stub; + +/* + * 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.execution.MavenSession; +import org.apache.maven.execution.ExecutionEvent.Type; +import org.apache.maven.lifecycle.internal.ExecutionEventCatapult; +import org.apache.maven.plugin.MojoExecution; + +/** + * @author Benjamin Bentmann + */ +public class ExecutionEventCatapultStub + implements ExecutionEventCatapult +{ + + public void fire( Type eventType, MavenSession session, MojoExecution mojoExecution ) + { + } + + public void fire( Type eventType, MavenSession session, MojoExecution mojoExecution, Exception exception ) + { + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java new file mode 100644 index 00000000..930f5e93 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java @@ -0,0 +1,74 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; + +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; + +/** + * @author Kristian Rosenvold + */ +public class LifeCyclePluginAnalyzerStub + implements LifeCyclePluginAnalyzer +{ + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) + { + Set<Plugin> plugins; + + // NOTE: The upper-case packaging name is intentional, that's a special hinting mode used for certain tests + if ( "JAR".equals( packaging ) ) + { + plugins = new LinkedHashSet<Plugin>(); + + plugins.add( newPlugin( "maven-compiler-plugin", "compile", "testCompile" ) ); + plugins.add( newPlugin( "maven-resources-plugin", "resources", "testResources" ) ); + plugins.add( newPlugin( "maven-surefire-plugin", "test" ) ); + plugins.add( newPlugin( "maven-jar-plugin", "jar" ) ); + plugins.add( newPlugin( "maven-install-plugin", "install" ) ); + plugins.add( newPlugin( "maven-deploy-plugin", "deploy" ) ); + } + else + { + plugins = Collections.emptySet(); + } + + return plugins; + } + + private Plugin newPlugin( String artifactId, String... goals ) + { + Plugin plugin = new Plugin(); + + plugin.setGroupId( "org.apache.maven.plugins" ); + plugin.setArtifactId( artifactId ); + + for ( String goal : goals ) + { + PluginExecution pluginExecution = new PluginExecution(); + pluginExecution.setId( "default-" + goal ); + pluginExecution.addGoal( goal ); + plugin.addExecution( pluginExecution ); + } + + return plugin; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java new file mode 100644 index 00000000..cd33a353 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java @@ -0,0 +1,231 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.lifecycle.internal.ExecutionPlanItem; +import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author Kristian Rosenvold + */ +public class LifecycleExecutionPlanCalculatorStub + implements LifecycleExecutionPlanCalculator +{ + // clean + + public final static MojoDescriptor PRE_CLEAN = createMojoDescriptor( "pre-clean" ); + + public final static MojoDescriptor CLEAN = createMojoDescriptor( "clean" ); + + public final static MojoDescriptor POST_CLEAN = createMojoDescriptor( "post-clean" ); + + // default (or at least some of them) + + public final static MojoDescriptor VALIDATE = createMojoDescriptor( "validate" ); + + public final static MojoDescriptor INITIALIZE = createMojoDescriptor( "initialize" ); + + public final static MojoDescriptor TEST_COMPILE = createMojoDescriptor( "test-compile" ); + + public final static MojoDescriptor PROCESS_TEST_RESOURCES = createMojoDescriptor( "process-test-resources" ); + + public final static MojoDescriptor PROCESS_RESOURCES = createMojoDescriptor( "process-resources" ); + + public final static MojoDescriptor COMPILE = createMojoDescriptor( "compile", true ); + + public final static MojoDescriptor TEST = createMojoDescriptor( "test" ); + + public final static MojoDescriptor PACKAGE = createMojoDescriptor( "package" ); + + public final static MojoDescriptor INSTALL = createMojoDescriptor( "install" ); + + // site + + public final static MojoDescriptor PRE_SITE = createMojoDescriptor( "pre-site" ); + + public final static MojoDescriptor SITE = createMojoDescriptor( "site" ); + + public final static MojoDescriptor POST_SITE = createMojoDescriptor( "post-site" ); + + public final static MojoDescriptor SITE_DEPLOY = createMojoDescriptor( "site-deploy" ); + + + public int getNumberOfExceutions( ProjectBuildList projectBuildList ) + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + int result = 0; + for ( ProjectSegment projectBuild : projectBuildList ) + { + MavenExecutionPlan plan = calculateExecutionPlan( projectBuild.getSession(), projectBuild.getProject(), + projectBuild.getTaskSegment().getTasks() ); + result += plan.size(); + } + return result; + } + + public void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + // Maybe do something ? + } + + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks, + boolean setup ) + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException + { + if ( project.equals( ProjectDependencyGraphStub.A ) ) + { + return getProjectAExceutionPlan(); + } + if ( project.equals( ProjectDependencyGraphStub.B ) ) + { + return getProjectBExecutionPlan(); + } + // The remaining are basically "for future expansion" + List<MojoExecution> me = new ArrayList<MojoExecution>(); + me.add( createMojoExecution( "resources", "default-resources", PROCESS_RESOURCES ) ); + me.add( createMojoExecution( "compile", "default-compile", COMPILE ) ); + return createExecutionPlan( project, me ); + } + + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, MavenProject project, List<Object> tasks ) + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException + { + return calculateExecutionPlan( session, project, tasks, true ); + } + + public void setupMojoExecution( MavenSession session, MavenProject project, MojoExecution mojoExecution ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException + { + } + + public static MavenExecutionPlan getProjectAExceutionPlan() + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException + { + List<MojoExecution> me = new ArrayList<MojoExecution>(); + me.add( createMojoExecution( "initialize", "default-initialize", INITIALIZE ) ); + me.add( createMojoExecution( "resources", "default-resources", PROCESS_RESOURCES ) ); + me.add( createMojoExecution( "compile", "default-compile", COMPILE ) ); + me.add( createMojoExecution( "testResources", "default-testResources", PROCESS_TEST_RESOURCES ) ); + me.add( createMojoExecution( "testCompile", "default-testCompile", TEST_COMPILE ) ); + me.add( createMojoExecution( "test", "default-test", TEST ) ); + me.add( createMojoExecution( "war", "default-war", PACKAGE ) ); + me.add( createMojoExecution( "install", "default-install", INSTALL ) ); + return createExecutionPlan( ProjectDependencyGraphStub.A.getExecutionProject(), me ); + } + + public static MavenExecutionPlan getProjectBExecutionPlan() + throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, + PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, + NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException + { + List<MojoExecution> me = new ArrayList<MojoExecution>(); + me.add( createMojoExecution( "enforce", "enforce-versions", VALIDATE ) ); + me.add( createMojoExecution( "resources", "default-resources", PROCESS_RESOURCES ) ); + me.add( createMojoExecution( "compile", "default-compile", COMPILE ) ); + me.add( createMojoExecution( "testResources", "default-testResources", PROCESS_TEST_RESOURCES ) ); + me.add( createMojoExecution( "testCompile", "default-testCompile", TEST_COMPILE ) ); + me.add( createMojoExecution( "test", "default-test", TEST ) ); + return createExecutionPlan( ProjectDependencyGraphStub.B.getExecutionProject(), me ); + } + + + private static MavenExecutionPlan createExecutionPlan( MavenProject project, List<MojoExecution> mojoExecutions ) + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + final List<ExecutionPlanItem> planItemList = + ExecutionPlanItem.createExecutionPlanItems( project, mojoExecutions ); + return new MavenExecutionPlan( planItemList, DefaultLifecyclesStub.createDefaultLifecycles() ); + } + + private static MojoExecution createMojoExecution( String goal, String executionId, MojoDescriptor mojoDescriptor ) + { + final Plugin plugin = mojoDescriptor.getPluginDescriptor().getPlugin(); + MojoExecution result = new MojoExecution( plugin, goal, executionId ); + result.setConfiguration( new Xpp3Dom( executionId + "-" + goal ) ); + result.setMojoDescriptor( mojoDescriptor ); + result.setLifecyclePhase( mojoDescriptor.getPhase() ); + + return result; + + } + + public static MojoDescriptor createMojoDescriptor( String phaseName ) + { + return createMojoDescriptor( phaseName, false ); + } + + public static MojoDescriptor createMojoDescriptor( String phaseName, boolean threadSafe ) + { + final MojoDescriptor mojoDescriptor = new MojoDescriptor(); + mojoDescriptor.setPhase( phaseName ); + final PluginDescriptor descriptor = new PluginDescriptor(); + Plugin plugin = new Plugin(); + plugin.setArtifactId( "org.apache.maven.test.MavenExecutionPlan" ); + plugin.setGroupId( "stub-plugin-" + phaseName ); + descriptor.setPlugin( plugin ); + descriptor.setArtifactId( "artifact." + phaseName ); + mojoDescriptor.setPluginDescriptor( descriptor ); + mojoDescriptor.setThreadSafe( threadSafe ); + return mojoDescriptor; + } + + + public static Set<String> getScopes() + { + return new HashSet<String>( Arrays.asList( "compile" ) ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java new file mode 100644 index 00000000..695d66dd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleTaskSegmentCalculatorStub.java @@ -0,0 +1,89 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.internal.GoalTask; +import org.apache.maven.lifecycle.internal.LifecycleTask; +import org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator; +import org.apache.maven.lifecycle.internal.TaskSegment; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Kristian Rosenvold + */ +public class LifecycleTaskSegmentCalculatorStub + extends DefaultLifecycleTaskSegmentCalculator +{ + public static final String clean = "clean"; + + public static final String aggr = "aggr"; + + public static final String install = "install"; + + + public List<TaskSegment> calculateTaskSegments( MavenSession session, List<String> tasks ) + throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, + MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, + PluginVersionResolutionException + { + List<TaskSegment> taskSegments = new ArrayList<TaskSegment>( tasks.size() ); + + TaskSegment currentSegment = null; + + for ( String task : tasks ) + { + if ( aggr.equals( task ) ) + { + boolean aggregating = true; + + if ( currentSegment == null || currentSegment.isAggregating() != aggregating ) + { + currentSegment = new TaskSegment( aggregating ); + taskSegments.add( currentSegment ); + } + + currentSegment.getTasks().add( new GoalTask( task ) ); + } + else + { + // lifecycle phase + if ( currentSegment == null || currentSegment.isAggregating() ) + { + currentSegment = new TaskSegment( false ); + taskSegments.add( currentSegment ); + } + currentSegment.getTasks().add( new LifecycleTask( task ) ); + } + } + + return taskSegments; + } + + public boolean requiresProject( MavenSession session ) + { + return true; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java new file mode 100644 index 00000000..00bb3cfa --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LoggerStub.java @@ -0,0 +1,110 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.codehaus.plexus.logging.Logger; + +/** + * @author Kristian Rosenvold + */ +public class LoggerStub + implements Logger +{ + public void debug( String s ) + { + } + + public void debug( String s, Throwable throwable ) + { + } + + public boolean isDebugEnabled() + { + return true; + } + + public void info( String s ) + { + } + + public void info( String s, Throwable throwable ) + { + } + + public boolean isInfoEnabled() + { + return true; + } + + public void warn( String s ) + { + } + + public void warn( String s, Throwable throwable ) + { + } + + public boolean isWarnEnabled() + { + return true; + } + + public void error( String s ) + { + } + + public void error( String s, Throwable throwable ) + { + } + + public boolean isErrorEnabled() + { + return true; + } + + public void fatalError( String s ) + { + } + + public void fatalError( String s, Throwable throwable ) + { + } + + public boolean isFatalErrorEnabled() + { + return true; + } + + public Logger getChildLogger( String s ) + { + return null; + } + + public int getThreshold() + { + return 0; + } + + public void setThreshold( int i ) + { + + } + + public String getName() + { + return "StubLogger"; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java new file mode 100644 index 00000000..a8572ffc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java @@ -0,0 +1,70 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleExecutionException; +import org.apache.maven.lifecycle.internal.DependencyContext; +import org.apache.maven.lifecycle.internal.MojoExecutor; +import org.apache.maven.lifecycle.internal.PhaseRecorder; +import org.apache.maven.lifecycle.internal.ProjectIndex; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * @author Kristian Rosenvold + */ +public class MojoExecutorStub + extends MojoExecutor +{ // This is being lazy instead of making interface + + public List<MojoExecution> executions = Collections.synchronizedList( new ArrayList<MojoExecution>() ); + + @Override + public void execute( MavenSession session, MojoExecution mojoExecution, ProjectIndex projectIndex, + DependencyContext dependencyContext, PhaseRecorder phaseRecorder ) + throws LifecycleExecutionException + { + executions.add( mojoExecution ); + } + + @Override + public void execute( MavenSession session, List<MojoExecution> mojoExecutions, ProjectIndex projectIndex ) + throws LifecycleExecutionException + { + for ( MojoExecution mojoExecution : mojoExecutions ) + { + executions.add( mojoExecution ); + } + } + + + public static MojoDescriptor createMojoDescriptor( String mojoDescription ) + { + final PluginDescriptor descriptor = new PluginDescriptor(); + descriptor.setArtifactId( mojoDescription ); + final MojoDescriptor mojoDescriptor = new MojoDescriptor(); + mojoDescriptor.setDescription( mojoDescription ); + mojoDescriptor.setPluginDescriptor( descriptor ); + return mojoDescriptor; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java new file mode 100644 index 00000000..a4b54e98 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginPrefixResolverStub.java @@ -0,0 +1,52 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.prefix.PluginPrefixRequest; +import org.apache.maven.plugin.prefix.PluginPrefixResolver; +import org.apache.maven.plugin.prefix.PluginPrefixResult; +import org.eclipse.aether.repository.ArtifactRepository; + +/** + * @author Kristian Rosenvold + */ + +public class PluginPrefixResolverStub + implements PluginPrefixResolver +{ + public PluginPrefixResult resolve( PluginPrefixRequest request ) + throws NoPluginFoundForPrefixException + { + return new PluginPrefixResult() + { + public String getGroupId() + { + return "com.foobar"; + } + + public String getArtifactId() + { + return "bazbaz"; + } + + public ArtifactRepository getRepository() + { + return null; + } + }; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java new file mode 100644 index 00000000..c79658e8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/PluginVersionResolverStub.java @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.plugin.version.PluginVersionRequest; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugin.version.PluginVersionResolver; +import org.apache.maven.plugin.version.PluginVersionResult; +import org.eclipse.aether.repository.ArtifactRepository; + +/** + * @author Kristian Rosenvold + */ + +public class PluginVersionResolverStub + implements PluginVersionResolver +{ + + public PluginVersionResult resolve( PluginVersionRequest request ) + throws PluginVersionResolutionException + { + return new PluginVersionResult() + { + public String getVersion() + { + return "0.42"; + } + + public ArtifactRepository getRepository() + { + return null; + } + }; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java new file mode 100644 index 00000000..4147b36c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependenciesResolverStub.java @@ -0,0 +1,109 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.ProjectDependenciesResolver; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.project.DependencyResolutionException; +import org.apache.maven.project.DependencyResolutionRequest; +import org.apache.maven.project.DependencyResolutionResult; +import org.apache.maven.project.MavenProject; +import org.eclipse.aether.graph.DefaultDependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author Kristian Rosenvold + */ +public class ProjectDependenciesResolverStub + implements ProjectDependenciesResolver, org.apache.maven.project.ProjectDependenciesResolver +{ + public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToResolve, MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return new HashSet<Artifact>(); + } + + public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return new HashSet<Artifact>(); + } + + public Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes, + MavenSession session ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return new HashSet<Artifact>(); + } + + public Set<Artifact> resolve( MavenProject project, Collection<String> scopesToCollect, + Collection<String> scopesToResolve, MavenSession session, + Set<Artifact> ignoreableArtifacts ) + throws ArtifactResolutionException, ArtifactNotFoundException + { + return new HashSet<Artifact>(); + } + + public DependencyResolutionResult resolve( DependencyResolutionRequest request ) + throws DependencyResolutionException + { + return new DependencyResolutionResult() + { + + public List<Dependency> getUnresolvedDependencies() + { + return Collections.emptyList(); + } + + public List<Dependency> getResolvedDependencies() + { + return Collections.emptyList(); + } + + public List<Exception> getResolutionErrors( Dependency dependency ) + { + return Collections.emptyList(); + } + + public DependencyNode getDependencyGraph() + { + return new DefaultDependencyNode( (Dependency) null ); + } + + public List<Dependency> getDependencies() + { + return Collections.emptyList(); + } + + public List<Exception> getCollectionErrors() + { + return Collections.emptyList(); + } + }; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java new file mode 100644 index 00000000..38e9fcad --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStub.java @@ -0,0 +1,227 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import org.apache.maven.execution.AbstractExecutionListener; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.DefaultMavenExecutionResult; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.execution.ProjectDependencyGraph; +import org.apache.maven.lifecycle.LifecycleNotFoundException; +import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; +import org.apache.maven.lifecycle.internal.GoalTask; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; +import org.apache.maven.lifecycle.internal.TaskSegment; +import org.apache.maven.plugin.InvalidPluginDescriptorException; +import org.apache.maven.plugin.MojoNotFoundException; +import org.apache.maven.plugin.PluginDescriptorParsingException; +import org.apache.maven.plugin.PluginNotFoundException; +import org.apache.maven.plugin.PluginResolutionException; +import org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException; +import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.project.MavenProject; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * A stub dependency graph that is custom made for testing concurrent build graph evaluations. + * <p/> + * Implements a graph as follows: + * A has no dependencies + * B depends on A + * C depends on A + * X depends on B & C + * Y depends on B + * Z depends on C + * + * @author Kristian Rosenvold + */ +public class ProjectDependencyGraphStub + implements ProjectDependencyGraph +{ + public static final MavenProject A = new MavenProject(); + + public static final MavenProject B = new MavenProject(); + + public static final MavenProject C = new MavenProject(); + + public static final MavenProject X = new MavenProject(); + + public static final MavenProject Y = new MavenProject(); + + public static final MavenProject Z = new MavenProject(); + + public static final MavenProject UNKNOWN = new MavenProject(); + + static + { + A.setArtifactId( "A" ); + B.setArtifactId( "B" ); + C.setArtifactId( "C" ); + X.setArtifactId( "X" ); + Y.setArtifactId( "Y" ); + Z.setArtifactId( "Z" ); + } + + // This should probably be moved to a separate stub + + public static ProjectBuildList getProjectBuildList( MavenSession session ) + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + final List<ProjectSegment> list = getProjectBuilds( session ); + return new ProjectBuildList( list ); + + } + + public static List<ProjectSegment> getProjectBuilds( MavenSession session ) + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, PluginNotFoundException, MojoNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + List<ProjectSegment> projectBuilds = new ArrayList<ProjectSegment>(); + + TaskSegment segment = createTaskSegment(); + projectBuilds.add( createProjectBuild( A, session, segment ) ); + projectBuilds.add( createProjectBuild( B, session, segment ) ); + projectBuilds.add( createProjectBuild( C, session, segment ) ); + projectBuilds.add( createProjectBuild( X, session, segment ) ); + projectBuilds.add( createProjectBuild( Y, session, segment ) ); + projectBuilds.add( createProjectBuild( Z, session, segment ) ); + return projectBuilds; + } + + private static ProjectSegment createProjectBuild( MavenProject project, MavenSession session, + TaskSegment taskSegment ) + throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException, + NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, + LifecyclePhaseNotFoundException, LifecycleNotFoundException + { + final MavenSession session1 = session.clone(); + return new ProjectSegment( project, taskSegment, session1 ); + } + + + private static TaskSegment createTaskSegment() + { + TaskSegment result = new TaskSegment( false ); + result.getTasks().add( new GoalTask( "t1" ) ); + result.getTasks().add( new GoalTask( "t2" ) ); + return result; + } + + class Dependency + { + MavenProject dependant; + + MavenProject dependency; + + Dependency( MavenProject dependant, MavenProject dependency ) + { + this.dependant = dependant; + this.dependency = dependency; + } + + void addIfDownstream( MavenProject mavenProject, List<MavenProject> result ) + { + if ( dependency == mavenProject ) + { + result.add( dependant ); + } + } + + void addIfUpstreamOf( MavenProject mavenProject, List<MavenProject> result ) + { + if ( dependant == mavenProject ) + { + result.add( dependency ); // All projects are the statics from this class + } + } + } + + private List<Dependency> getDependencies() + { + List<Dependency> dependencies = new ArrayList<Dependency>(); + dependencies.add( new Dependency( B, A ) ); + dependencies.add( new Dependency( C, A ) ); + dependencies.add( new Dependency( X, B ) ); + dependencies.add( new Dependency( X, C ) ); + dependencies.add( new Dependency( Y, B ) ); + dependencies.add( new Dependency( Z, C ) ); + return dependencies; + } + + public List<MavenProject> getSortedProjects() + { + return Arrays.asList( A, B, C, X, Y, Z ); // I'm not entirely sure about the order but this shold do... + } + + public List<MavenProject> getDownstreamProjects( MavenProject project, boolean transitive ) + { + if ( transitive ) + { + throw new RuntimeException( "Not implemented yet" ); + } + List<MavenProject> result = new ArrayList<MavenProject>(); + for ( Dependency dependency : getDependencies() ) + { + dependency.addIfDownstream( project, result ); + } + return result; + } + + public List<MavenProject> getUpstreamProjects( MavenProject project, boolean transitive ) + { + /* if ( transitive ) + { + throw new RuntimeException( "Not implemented yet" ); + }*/ + List<MavenProject> result = new ArrayList<MavenProject>(); + final List<Dependency> dependencies = getDependencies(); + for ( Dependency dependency : dependencies ) + { + dependency.addIfUpstreamOf( project, result ); + } + return result; + } + + public static MavenSession getMavenSession( MavenProject mavenProject ) + { + final MavenSession session = getMavenSession(); + session.setCurrentProject( mavenProject ); + return session; + } + + public static MavenSession getMavenSession() + { + final DefaultMavenExecutionResult defaultMavenExecutionResult = new DefaultMavenExecutionResult(); + MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest(); + mavenExecutionRequest.setExecutionListener( new AbstractExecutionListener() ); + mavenExecutionRequest.setGoals( Arrays.asList( "clean", "aggr", "install" ) ); + mavenExecutionRequest.setDegreeOfConcurrency( 1 ); + final MavenSession session = new MavenSession( null, null, mavenExecutionRequest, defaultMavenExecutionResult ); + final ProjectDependencyGraphStub dependencyGraphStub = new ProjectDependencyGraphStub(); + session.setProjectDependencyGraph( dependencyGraphStub ); + session.setProjects( dependencyGraphStub.getSortedProjects() ); + return session; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java new file mode 100644 index 00000000..8c605723 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/ProjectDependencyGraphStubTest.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +package org.apache.maven.lifecycle.internal.stub; + +import junit.framework.TestCase; +import org.apache.maven.project.MavenProject; + +import java.util.List; + + +/** + * Tests the stub. Yeah, I know. + * + * @author Kristian Rosenvold + */ + +public class ProjectDependencyGraphStubTest + extends TestCase +{ + public void testADependencies() + { + ProjectDependencyGraphStub stub = new ProjectDependencyGraphStub(); + final List<MavenProject> mavenProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.A, false ); + assertEquals( 0, mavenProjects.size() ); + } + + public void testBDepenencies( ProjectDependencyGraphStub stub ) + { + final List<MavenProject> bProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.B, false ); + assertEquals( 1, bProjects.size() ); + assertTrue( bProjects.contains( ProjectDependencyGraphStub.A ) ); + } + + public void testCDepenencies( ProjectDependencyGraphStub stub ) + { + final List<MavenProject> cProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.C, false ); + assertEquals( 1, cProjects.size() ); + assertTrue( cProjects.contains( ProjectDependencyGraphStub.C ) ); + } + + public void testXDepenencies( ProjectDependencyGraphStub stub ) + { + final List<MavenProject> cProjects = stub.getUpstreamProjects( ProjectDependencyGraphStub.X, false ); + assertEquals( 2, cProjects.size() ); + assertTrue( cProjects.contains( ProjectDependencyGraphStub.C ) ); + assertTrue( cProjects.contains( ProjectDependencyGraphStub.B ) ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java new file mode 100644 index 00000000..025e7725 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginManagerTest.java @@ -0,0 +1,342 @@ +package org.apache.maven.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 java.util.List; + +import org.apache.maven.AbstractCoreMavenComponentTestCase; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.DefaultRepositoryRequest; +import org.apache.maven.artifact.repository.RepositoryRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Plugin; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.classworlds.realm.ClassRealm; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.component.repository.ComponentDescriptor; + +public class PluginManagerTest + extends AbstractCoreMavenComponentTestCase +{ + @Requirement + private DefaultBuildPluginManager pluginManager; + + protected void setUp() + throws Exception + { + super.setUp(); + pluginManager = (DefaultBuildPluginManager) lookup( BuildPluginManager.class ); + } + + @Override + protected void tearDown() + throws Exception + { + pluginManager = null; + super.tearDown(); + } + + protected String getProjectsDirectory() + { + return "src/test/projects/plugin-manager"; + } + + public void testPluginLoading() + throws Exception + { + MavenSession session = createMavenSession( null ); + Plugin plugin = new Plugin(); + plugin.setGroupId( "org.apache.maven.its.plugins" ); + plugin.setArtifactId( "maven-it-plugin" ); + plugin.setVersion( "0.1" ); + PluginDescriptor pluginDescriptor = + pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + assertNotNull( pluginDescriptor ); + } + + public void testMojoDescriptorRetrieval() + throws Exception + { + MavenSession session = createMavenSession( null ); + String goal = "it"; + Plugin plugin = new Plugin(); + plugin.setGroupId( "org.apache.maven.its.plugins" ); + plugin.setArtifactId( "maven-it-plugin" ); + plugin.setVersion( "0.1" ); + + MojoDescriptor mojoDescriptor = + pluginManager.getMojoDescriptor( plugin, goal, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + assertNotNull( mojoDescriptor ); + assertEquals( goal, mojoDescriptor.getGoal() ); + // igorf: plugin realm comes later + // assertNotNull( mojoDescriptor.getRealm() ); + + PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor(); + assertNotNull( pluginDescriptor ); + assertEquals( "org.apache.maven.its.plugins", pluginDescriptor.getGroupId() ); + assertEquals( "maven-it-plugin", pluginDescriptor.getArtifactId() ); + assertEquals( "0.1", pluginDescriptor.getVersion() ); + } + + // ----------------------------------------------------------------------------------------------- + // Tests which exercise the lifecycle executor when it is dealing with individual goals. + // ----------------------------------------------------------------------------------------------- + + //TODO: These two tests display a lack of symmetry with respect to the input which is a free form string and the + // mojo descriptor which comes back. All the free form parsing needs to be done somewhere else, this is + // really the function of the CLI, and then the pre-processing of that output still needs to be fed into + // a hinting process which helps flesh out the full specification of the plugin. The plugin manager should + // only deal in concrete terms -- all version finding mumbo jumbo is a customization to base functionality + // the plugin manager provides. + + public void testRemoteResourcesPlugin() + throws Exception + { + //TODO: turn an equivalent back on when the RR plugin is released. + + /* + + This will not work until the RR plugin is released to get rid of the binding to the reporting exception which is a mistake. + + This happpens after removing the reporting API from the core: + + java.lang.NoClassDefFoundError: org/apache/maven/reporting/MavenReportException + + MavenSession session = createMavenSession( getProject( "project-with-inheritance" ) ); + String goal = "process"; + + Plugin plugin = new Plugin(); + plugin.setGroupId( "org.apache.maven.plugins" ); + plugin.setArtifactId( "maven-remote-resources-plugin" ); + plugin.setVersion( "1.0-beta-2" ); + + MojoDescriptor mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, session.getCurrentProject(), session.getLocalRepository() ); + assertPluginDescriptor( mojoDescriptor, "org.apache.maven.plugins", "maven-remote-resources-plugin", "1.0-beta-2" ); + MojoExecution mojoExecution = new MojoExecution( mojoDescriptor ); + pluginManager.executeMojo( session, mojoExecution ); + */ + } + + //TODO: this will be the basis of the customizable lifecycle execution so need to figure this out quickly. + public void testSurefirePlugin() + throws Exception + { + /* + MavenSession session = createMavenSession( getProject( "project-with-inheritance" ) ); + String goal = "test"; + + Plugin plugin = new Plugin(); + plugin.setGroupId( "org.apache.maven.plugins" ); + plugin.setArtifactId( "maven-surefire-plugin" ); + plugin.setVersion( "2.4.2" ); + + // The project has already been fully interpolated so getting the raw mojoDescriptor is not going to have the processes configuration. + MojoDescriptor mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, session.getLocalRepository(), session.getCurrentProject().getPluginArtifactRepositories() ); + assertPluginDescriptor( mojoDescriptor, "org.apache.maven.plugins", "maven-surefire-plugin", "2.4.2" ); + + System.out.println( session.getCurrentProject().getBuild().getPluginsAsMap() ); + + Xpp3Dom configuration = (Xpp3Dom) session.getCurrentProject().getBuild().getPluginsAsMap().get( plugin.getKey() ).getExecutions().get( 0 ).getConfiguration(); + MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, configuration ); + pluginManager.executeMojo( session, mojoExecution ); + */ + } + + public void testMojoConfigurationIsMergedCorrectly() + throws Exception + { + } + + /** + * The case where the user wants to specify an alternate version of the underlying tool. Common case + * is in the Antlr plugin which comes bundled with a version of Antlr but the user often times needs + * to use a specific version. We need to make sure the version that they specify takes precedence. + */ + public void testMojoWhereInternallyStatedDependencyIsOverriddenByProject() + throws Exception + { + } + + /** + * The case where you have a plugin in the current build that you want to be used on projects in + * the current build. + */ + public void testMojoThatIsPresentInTheCurrentBuild() + throws Exception + { + } + + /** + * This is the case where the Mojo wants to execute on every project and then do something at the end + * with the results of each project. + */ + public void testAggregatorMojo() + throws Exception + { + } + + /** + * This is the case where a Mojo needs the lifecycle run to a certain phase before it can do + * anything useful. + */ + public void testMojoThatRequiresExecutionToAGivenPhaseBeforeExecutingItself() + throws Exception + { + } + + // test that mojo which does not require dependency resolution trigger no downloading of dependencies + + // test interpolation of basedir values in mojo configuration + + // test a build where projects use different versions of the same plugin + + public void testThatPluginDependencyThatHasSystemScopeIsResolved() + throws Exception + { + /* + File systemPath = new File( getBasedir(), "pom.xml" ); + + Plugin plugin = new PluginBuilder( "org.apache.maven", "project-test", "1.0" ) + .addDependency( "org.apache.maven", "system-dependency", "1.0", Artifact.SCOPE_SYSTEM, systemPath.getAbsolutePath() ) + .get(); + + MavenProject pluginProject = new ProjectBuilder( "org.apache.maven", "project-test", "1.0" ) + .addPlugin( plugin ) + .addDependency( "junit", "junit", "3.8.1", Artifact.SCOPE_COMPILE ) + .get(); + + // i'm making this artifact which is assumed to come from a pom in the metadata processor, then it tries to create a POM artifact + // and parse it for the dependencies and it blows up. + // + // we need to pass this through as is so it doesn't get parsed again. + Artifact pluginArtifact = new ProjectArtifact( pluginProject ); + + Set<Artifact> artifacts = pluginManager.getPluginArtifacts( pluginArtifact, plugin, getLocalRepository(), getPluginArtifactRepositories() ); + System.out.println( artifacts ); + */ + + MavenSession session = createMavenSession( getProject( "project-contributing-system-scope-plugin-dep" ) ); + MavenProject project = session.getCurrentProject(); + Plugin plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" ); + + RepositoryRequest repositoryRequest = new DefaultRepositoryRequest(); + repositoryRequest.setLocalRepository( getLocalRepository() ); + repositoryRequest.setRemoteRepositories( getPluginArtifactRepositories() ); + + PluginDescriptor pluginDescriptor = + pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + pluginManager.getPluginRealm( session, pluginDescriptor ); + List<Artifact> artifacts = pluginDescriptor.getArtifacts(); + + for ( Artifact a : artifacts ) + { + if ( a.getGroupId().equals( "org.apache.maven.its.mng3586" ) && a.getArtifactId().equals( "tools" ) ) + { + // The system scoped dependencies will be present in the classloader for the plugin + return; + } + } + + fail( "Can't find the system scoped dependency in the plugin artifacts." ); + } + + // ----------------------------------------------------------------------------------------------- + // Testing help + // ----------------------------------------------------------------------------------------------- + + protected void assertPluginDescriptor( MojoDescriptor mojoDescriptor, String groupId, String artifactId, String version ) + { + assertNotNull( mojoDescriptor ); + PluginDescriptor pd = mojoDescriptor.getPluginDescriptor(); + assertNotNull( pd ); + assertEquals( groupId, pd.getGroupId() ); + assertEquals( artifactId, pd.getArtifactId() ); + assertEquals( version, pd.getVersion() ); + } + + public void testPluginRealmCache() + throws Exception + { + RepositoryRequest repositoryRequest = new DefaultRepositoryRequest(); + repositoryRequest.setLocalRepository( getLocalRepository() ); + repositoryRequest.setRemoteRepositories( getPluginArtifactRepositories() ); + + // prime realm cache + MavenSession session = createMavenSession( getProject( "project-contributing-system-scope-plugin-dep" ) ); + MavenProject project = session.getCurrentProject(); + Plugin plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" ); + + PluginDescriptor pluginDescriptor = + pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + pluginManager.getPluginRealm( session, pluginDescriptor ); + + assertEquals( 1, pluginDescriptor.getDependencies().size() ); + + for ( ComponentDescriptor<?> descriptor : pluginDescriptor.getComponents() ) + { + assertNotNull( descriptor.getRealm() ); + assertNotNull( descriptor.getImplementationClass() ); + } + + // reload plugin realm from cache + session = createMavenSession( getProject( "project-contributing-system-scope-plugin-dep" ) ); + project = session.getCurrentProject(); + plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" ); + + pluginDescriptor = + pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + pluginManager.getPluginRealm( session, pluginDescriptor ); + + assertEquals( 1, pluginDescriptor.getDependencies().size() ); + + for ( ComponentDescriptor<?> descriptor : pluginDescriptor.getComponents() ) + { + assertNotNull( descriptor.getRealm() ); + assertNotNull( descriptor.getImplementationClass() ); + } + } + + public void testBuildExtensionsPluginLoading() + throws Exception + { + RepositoryRequest repositoryRequest = new DefaultRepositoryRequest(); + repositoryRequest.setLocalRepository( getLocalRepository() ); + repositoryRequest.setRemoteRepositories( getPluginArtifactRepositories() ); + + // prime realm cache + MavenSession session = createMavenSession( getProject( "project-with-build-extensions-plugin" ) ); + MavenProject project = session.getCurrentProject(); + Plugin plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" ); + + PluginDescriptor pluginDescriptor = + pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(), + session.getRepositorySession() ); + ClassRealm pluginRealm = pluginManager.getPluginRealm( session, pluginDescriptor ); + + assertEquals(pluginRealm, pluginDescriptor.getComponents().get(0).getRealm()); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExceptionTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExceptionTest.java new file mode 100644 index 00000000..ead7ae2e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExceptionTest.java @@ -0,0 +1,164 @@ +package org.apache.maven.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 java.util.Collections; + +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.Parameter; +import org.apache.maven.plugin.descriptor.PluginDescriptor; + +import junit.framework.TestCase; + +/** + * MNG-3131 + * + * @author Robert Scholte + * + */ +public class PluginParameterExceptionTest + extends TestCase +{ + + public void testMissingRequiredStringArrayTypeParameter() + { + MojoDescriptor mojoDescriptor = new MojoDescriptor(); + mojoDescriptor.setGoal( "goal" ); + PluginDescriptor pluginDescriptor = new PluginDescriptor(); + pluginDescriptor.setGoalPrefix( "goalPrefix" ); + pluginDescriptor.setArtifactId( "artifactId" ); + mojoDescriptor.setPluginDescriptor( pluginDescriptor ); + + Parameter parameter = new Parameter(); + parameter.setType( "java.lang.String[]" ); + parameter.setName( "toAddresses" ); + + parameter.setRequired( true ); + + PluginParameterException exception = + new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); + + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + + "\n" + + "[0] Inside the definition for plugin 'artifactId', specify the following:\n" + + "\n" + + "<configuration>\n" + + " ...\n" + + " <toAddresses>\n" + + " <item>VALUE</item>\n" + + " </toAddresses>\n" + + "</configuration>.\n", exception.buildDiagnosticMessage() ); + } + + public void testMissingRequiredCollectionTypeParameter() + { + MojoDescriptor mojoDescriptor = new MojoDescriptor(); + mojoDescriptor.setGoal( "goal" ); + PluginDescriptor pluginDescriptor = new PluginDescriptor(); + pluginDescriptor.setGoalPrefix( "goalPrefix" ); + pluginDescriptor.setArtifactId( "artifactId" ); + mojoDescriptor.setPluginDescriptor( pluginDescriptor ); + + Parameter parameter = new Parameter(); + parameter.setType( "java.util.List" ); + parameter.setName( "toAddresses" ); + + parameter.setRequired( true ); + + PluginParameterException exception = + new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); + + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + + "\n" + + "[0] Inside the definition for plugin 'artifactId', specify the following:\n" + + "\n" + + "<configuration>\n" + + " ...\n" + + " <toAddresses>\n" + + " <item>VALUE</item>\n" + + " </toAddresses>\n" + + "</configuration>.\n", exception.buildDiagnosticMessage() ); + } + + public void testMissingRequiredMapTypeParameter() + { + MojoDescriptor mojoDescriptor = new MojoDescriptor(); + mojoDescriptor.setGoal( "goal" ); + PluginDescriptor pluginDescriptor = new PluginDescriptor(); + pluginDescriptor.setGoalPrefix( "goalPrefix" ); + pluginDescriptor.setArtifactId( "artifactId" ); + mojoDescriptor.setPluginDescriptor( pluginDescriptor ); + + Parameter parameter = new Parameter(); + parameter.setType( "java.util.Map" ); + parameter.setName( "toAddresses" ); + + parameter.setRequired( true ); + + PluginParameterException exception = + new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); + + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + + "\n" + + "[0] Inside the definition for plugin 'artifactId', specify the following:\n" + + "\n" + + "<configuration>\n" + + " ...\n" + + " <toAddresses>\n" + + " <KEY>VALUE</KEY>\n" + + " </toAddresses>\n" + + "</configuration>.\n", exception.buildDiagnosticMessage() ); + } + + public void testMissingRequiredPropertiesTypeParameter() + { + MojoDescriptor mojoDescriptor = new MojoDescriptor(); + mojoDescriptor.setGoal( "goal" ); + PluginDescriptor pluginDescriptor = new PluginDescriptor(); + pluginDescriptor.setGoalPrefix( "goalPrefix" ); + pluginDescriptor.setArtifactId( "artifactId" ); + mojoDescriptor.setPluginDescriptor( pluginDescriptor ); + + Parameter parameter = new Parameter(); + parameter.setType( "java.util.Properties" ); + parameter.setName( "toAddresses" ); + + parameter.setRequired( true ); + + PluginParameterException exception = + new PluginParameterException( mojoDescriptor, Collections.singletonList( parameter ) ); + + assertEquals( "One or more required plugin parameters are invalid/missing for 'goalPrefix:goal'\n" + + "\n" + + "[0] Inside the definition for plugin 'artifactId', specify the following:\n" + + "\n" + + "<configuration>\n" + + " ...\n" + + " <toAddresses>\n" + + " <property>\n" + + " <name>KEY</name>\n" + + " <value>VALUE</value>\n" + + " </property>\n" + + " </toAddresses>\n" + + "</configuration>.\n", exception.buildDiagnosticMessage() ); + } + + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java new file mode 100644 index 00000000..5f6744c9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java @@ -0,0 +1,447 @@ +package org.apache.maven.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 java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.maven.AbstractCoreMavenComponentTestCase; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.DefaultMavenExecutionResult; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Build; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Model; +import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugin.descriptor.PluginDescriptor; +import org.apache.maven.project.DuplicateProjectException; +import org.apache.maven.project.MavenProject; +import org.apache.maven.repository.RepositorySystem; +import org.codehaus.plexus.MutablePlexusContainer; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; +import org.codehaus.plexus.util.dag.CycleDetectedException; + +/** + * @author Jason van Zyl + */ +public class PluginParameterExpressionEvaluatorTest + extends AbstractCoreMavenComponentTestCase +{ + private static final String FS = System.getProperty( "file.separator" ); + + private RepositorySystem factory; + + public void setUp() + throws Exception + { + super.setUp(); + factory = lookup( RepositorySystem.class ); + } + + @Override + protected void tearDown() + throws Exception + { + factory = null; + super.tearDown(); + } + + public void testPluginDescriptorExpressionReference() + throws Exception + { + MojoExecution exec = newMojoExecution(); + + MavenSession session = newMavenSession(); + + Object result = new PluginParameterExpressionEvaluator( session, exec ).evaluate( "${plugin}" ); + + System.out.println( "Result: " + result ); + + assertSame( "${plugin} expression does not return plugin descriptor.", + exec.getMojoDescriptor().getPluginDescriptor(), + result ); + } + + public void testPluginArtifactsExpressionReference() + throws Exception + { + MojoExecution exec = newMojoExecution(); + + Artifact depArtifact = createArtifact( "group", "artifact", "1" ); + + List<Artifact> deps = new ArrayList<Artifact>(); + deps.add( depArtifact ); + + exec.getMojoDescriptor().getPluginDescriptor().setArtifacts( deps ); + + MavenSession session = newMavenSession(); + + @SuppressWarnings( "unchecked" ) + List<Artifact> depResults = + (List<Artifact>) new PluginParameterExpressionEvaluator( session, exec ).evaluate( "${plugin.artifacts}" ); + + System.out.println( "Result: " + depResults ); + + assertNotNull( depResults ); + assertEquals( 1, depResults.size() ); + assertSame( "dependency artifact is wrong.", depArtifact, depResults.get( 0 ) ); + } + + public void testPluginArtifactMapExpressionReference() + throws Exception + { + MojoExecution exec = newMojoExecution(); + + Artifact depArtifact = createArtifact( "group", "artifact", "1" ); + + List<Artifact> deps = new ArrayList<Artifact>(); + deps.add( depArtifact ); + + exec.getMojoDescriptor().getPluginDescriptor().setArtifacts( deps ); + + MavenSession session = newMavenSession(); + + @SuppressWarnings( "unchecked" ) + Map<String, Artifact> depResults = + (Map<String, Artifact>) new PluginParameterExpressionEvaluator( session, exec ).evaluate( "${plugin.artifactMap}" ); + + System.out.println( "Result: " + depResults ); + + assertNotNull( depResults ); + assertEquals( 1, depResults.size() ); + assertSame( "dependency artifact is wrong.", + depArtifact, + depResults.get( ArtifactUtils.versionlessKey( depArtifact ) ) ); + } + + public void testPluginArtifactIdExpressionReference() + throws Exception + { + MojoExecution exec = newMojoExecution(); + + MavenSession session = newMavenSession(); + + Object result = new PluginParameterExpressionEvaluator( session, exec ).evaluate( "${plugin.artifactId}" ); + + System.out.println( "Result: " + result ); + + assertSame( "${plugin.artifactId} expression does not return plugin descriptor's artifactId.", + exec.getMojoDescriptor().getPluginDescriptor().getArtifactId(), + result ); + } + + public void testValueExtractionWithAPomValueContainingAPath() + throws Exception + { + String expected = getTestFile( "target/test-classes/target/classes" ).getCanonicalPath(); + + Build build = new Build(); + build.setDirectory( expected.substring( 0, expected.length() - "/classes".length() ) ); + + Model model = new Model(); + model.setBuild( build ); + + MavenProject project = new MavenProject( model ); + project.setFile( new File( "pom.xml" ).getCanonicalFile() ); + + ExpressionEvaluator expressionEvaluator = createExpressionEvaluator( project, null, new Properties() ); + + Object value = expressionEvaluator.evaluate( "${project.build.directory}/classes" ); + String actual = new File( value.toString() ).getCanonicalPath(); + + assertEquals( expected, actual ); + } + + public void testEscapedVariablePassthrough() + throws Exception + { + String var = "${var}"; + + Model model = new Model(); + model.setVersion( "1" ); + + MavenProject project = new MavenProject( model ); + + ExpressionEvaluator ee = createExpressionEvaluator( project, null, new Properties() ); + + Object value = ee.evaluate( "$" + var ); + + assertEquals( var, value ); + } + + public void testEscapedVariablePassthroughInLargerExpression() + throws Exception + { + String var = "${var}"; + String key = var + " with version: ${project.version}"; + + Model model = new Model(); + model.setVersion( "1" ); + + MavenProject project = new MavenProject( model ); + + ExpressionEvaluator ee = createExpressionEvaluator( project, null, new Properties() ); + + Object value = ee.evaluate( "$" + key ); + + assertEquals( "${var} with version: 1", value ); + } + + public void testMultipleSubExpressionsInLargerExpression() + throws Exception + { + String key = "${project.artifactId} with version: ${project.version}"; + + Model model = new Model(); + model.setArtifactId( "test" ); + model.setVersion( "1" ); + + MavenProject project = new MavenProject( model ); + + ExpressionEvaluator ee = createExpressionEvaluator( project, null, new Properties() ); + + Object value = ee.evaluate( key ); + + assertEquals( "test with version: 1", value ); + } + + public void testMissingPOMPropertyRefInLargerExpression() + throws Exception + { + String expr = "/path/to/someproject-${baseVersion}"; + + MavenProject project = new MavenProject( new Model() ); + + ExpressionEvaluator ee = createExpressionEvaluator( project, null, new Properties() ); + + Object value = ee.evaluate( expr ); + + assertEquals( expr, value ); + } + + public void testPOMPropertyExtractionWithMissingProject_WithDotNotation() + throws Exception + { + String key = "m2.name"; + String checkValue = "value"; + + Properties properties = new Properties(); + properties.setProperty( key, checkValue ); + + Model model = new Model(); + model.setProperties( properties ); + + MavenProject project = new MavenProject( model ); + + ExpressionEvaluator ee = createExpressionEvaluator( project, null, new Properties() ); + + Object value = ee.evaluate( "${" + key + "}" ); + + assertEquals( checkValue, value ); + } + + public void testBasedirExtractionWithMissingProject() + throws Exception + { + ExpressionEvaluator ee = createExpressionEvaluator( null, null, new Properties() ); + + Object value = ee.evaluate( "${basedir}" ); + + assertEquals( System.getProperty( "user.dir" ), value ); + } + + public void testValueExtractionFromSystemPropertiesWithMissingProject() + throws Exception + { + String sysprop = "PPEET_sysprop1"; + + Properties executionProperties = new Properties(); + + if ( executionProperties.getProperty( sysprop ) == null ) + { + executionProperties.setProperty( sysprop, "value" ); + } + + ExpressionEvaluator ee = createExpressionEvaluator( null, null, executionProperties ); + + Object value = ee.evaluate( "${" + sysprop + "}" ); + + assertEquals( "value", value ); + } + + public void testValueExtractionFromSystemPropertiesWithMissingProject_WithDotNotation() + throws Exception + { + String sysprop = "PPEET.sysprop2"; + + Properties executionProperties = new Properties(); + + if ( executionProperties.getProperty( sysprop ) == null ) + { + executionProperties.setProperty( sysprop, "value" ); + } + + ExpressionEvaluator ee = createExpressionEvaluator( null, null, executionProperties ); + + Object value = ee.evaluate( "${" + sysprop + "}" ); + + assertEquals( "value", value ); + } + + @SuppressWarnings( "deprecation" ) + private static MavenSession createSession( PlexusContainer container, ArtifactRepository repo, Properties properties ) + throws CycleDetectedException, DuplicateProjectException + { + MavenExecutionRequest request = new DefaultMavenExecutionRequest() + .setSystemProperties( properties ) + .setGoals( Collections.<String>emptyList() ) + .setBaseDirectory( new File( "" ) ) + .setLocalRepository( repo ); + + return new MavenSession( container, request, new DefaultMavenExecutionResult(), Collections.<MavenProject>emptyList() ); + } + + public void testLocalRepositoryExtraction() + throws Exception + { + ExpressionEvaluator expressionEvaluator = + createExpressionEvaluator( createDefaultProject(), null, new Properties() ); + Object value = expressionEvaluator.evaluate( "${localRepository}" ); + + assertEquals( "local", ( (ArtifactRepository) value ).getId() ); + } + + public void testTwoExpressions() + throws Exception + { + Build build = new Build(); + build.setDirectory( "expected-directory" ); + build.setFinalName( "expected-finalName" ); + + Model model = new Model(); + model.setBuild( build ); + + ExpressionEvaluator expressionEvaluator = + createExpressionEvaluator( new MavenProject( model ), null, new Properties() ); + + Object value = expressionEvaluator.evaluate( "${project.build.directory}" + FS + "${project.build.finalName}" ); + + assertEquals( "expected-directory" + File.separatorChar + "expected-finalName", value ); + } + + public void testShouldExtractPluginArtifacts() + throws Exception + { + PluginDescriptor pd = new PluginDescriptor(); + + Artifact artifact = createArtifact( "testGroup", "testArtifact", "1.0" ); + + pd.setArtifacts( Collections.singletonList( artifact ) ); + + ExpressionEvaluator ee = createExpressionEvaluator( createDefaultProject(), pd, new Properties() ); + + Object value = ee.evaluate( "${plugin.artifacts}" ); + + assertTrue( value instanceof List ); + + @SuppressWarnings( "unchecked" ) + List<Artifact> artifacts = (List<Artifact>) value; + + assertEquals( 1, artifacts.size() ); + + Artifact result = artifacts.get( 0 ); + + assertEquals( "testGroup", result.getGroupId() ); + } + + private MavenProject createDefaultProject() + { + return new MavenProject( new Model() ); + } + + private ExpressionEvaluator createExpressionEvaluator( MavenProject project, PluginDescriptor pluginDescriptor, Properties executionProperties ) + throws Exception + { + ArtifactRepository repo = factory.createDefaultLocalRepository(); + + MutablePlexusContainer container = (MutablePlexusContainer) getContainer(); + MavenSession session = createSession( container, repo, executionProperties ); + session.setCurrentProject( project ); + + MojoDescriptor mojo = new MojoDescriptor(); + mojo.setPluginDescriptor( pluginDescriptor ); + mojo.setGoal( "goal" ); + + MojoExecution mojoExecution = new MojoExecution( mojo ); + + return new PluginParameterExpressionEvaluator( session, mojoExecution ); + } + + protected Artifact createArtifact( String groupId, String artifactId, String version ) + throws Exception + { + Dependency dependency = new Dependency(); + dependency.setGroupId( groupId ); + dependency.setArtifactId( artifactId ); + dependency.setVersion( version ); + dependency.setType( "jar" ); + dependency.setScope( "compile" ); + + return factory.createDependencyArtifact( dependency ); + } + + private MojoExecution newMojoExecution() + { + PluginDescriptor pd = new PluginDescriptor(); + pd.setArtifactId( "my-plugin" ); + pd.setGroupId( "org.myco.plugins" ); + pd.setVersion( "1" ); + + MojoDescriptor md = new MojoDescriptor(); + md.setPluginDescriptor( pd ); + + pd.addComponentDescriptor( md ); + + return new MojoExecution( md ); + } + + private MavenSession newMavenSession() + throws Exception + { + return createMavenSession( null ); + } + + @Override + protected String getProjectsDirectory() + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java new file mode 100644 index 00000000..d350770c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java @@ -0,0 +1,74 @@ +package org.apache.maven.plugin.internal; +/* + * 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 junit.framework.TestCase; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; + +import java.util.concurrent.CountDownLatch; + +/** + * @author Kristian Rosenvold + */ +public class DefaultLegacySupportTest extends TestCase { + final CountDownLatch latch = new CountDownLatch(1); + final DefaultLegacySupport defaultLegacySupport = new DefaultLegacySupport(); + + public void testSetSession() throws Exception { + + MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest(); + MavenSession m1 = new MavenSession(null, null, mavenExecutionRequest, null); + defaultLegacySupport.setSession(m1); + + MyRunnable myRunnable = new MyRunnable(); + Thread thread = new Thread(myRunnable); + thread.start(); + + MavenSession m2 = new MavenSession(null, null, mavenExecutionRequest, null); + defaultLegacySupport.setSession(m2); + latch.countDown(); + thread.join(); + assertNull( myRunnable.getSession()); + } + + + class MyRunnable implements Runnable { + + private volatile MavenSession session; + + public void run() { + try + { + latch.await(); + } + catch (InterruptedException ingore) + { + // Test may fail if we get interrupted + } + session = defaultLegacySupport.getSession(); + } + + public MavenSession getSession() { + return session; + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java new file mode 100644 index 00000000..73bdbcae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java @@ -0,0 +1,189 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.io.FileNotFoundException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Arrays; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.model.building.ModelBuildingException; +import org.apache.maven.model.building.ModelProblem; +import org.apache.maven.repository.RepositorySystem; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.codehaus.plexus.ContainerConfiguration; +import org.codehaus.plexus.PlexusConstants; +import org.codehaus.plexus.PlexusTestCase; +import org.eclipse.aether.DefaultRepositorySystemSession; + +/** + * @author Jason van Zyl + */ +public abstract class AbstractMavenProjectTestCase + extends PlexusTestCase +{ + protected ProjectBuilder projectBuilder; + + protected RepositorySystem repositorySystem; + + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX ); + } + + protected void setUp() + throws Exception + { + super.setUp(); + + if ( getContainer().hasComponent( ProjectBuilder.class, "test" ) ) + { + projectBuilder = lookup( ProjectBuilder.class, "test" ); + } + else + { + // default over to the main project builder... + projectBuilder = lookup( ProjectBuilder.class ); + } + + repositorySystem = lookup( RepositorySystem.class ); + } + + @Override + protected void tearDown() + throws Exception + { + projectBuilder = null; + + super.tearDown(); + } + + protected ProjectBuilder getProjectBuilder() + { + return projectBuilder; + } + + @Override + protected String getCustomConfigurationName() + { + String name = AbstractMavenProjectTestCase.class.getName().replace( '.', '/' ) + ".xml"; + System.out.println( name ); + return name; + } + + // ---------------------------------------------------------------------- + // Local repository + // ---------------------------------------------------------------------- + + protected File getLocalRepositoryPath() + throws FileNotFoundException, URISyntaxException + { + File markerFile = getFileForClasspathResource( "local-repo/marker.txt" ); + + return markerFile.getAbsoluteFile().getParentFile(); + } + + protected static File getFileForClasspathResource( String resource ) + throws FileNotFoundException + { + ClassLoader cloader = Thread.currentThread().getContextClassLoader(); + + URL resourceUrl = cloader.getResource( resource ); + + if ( resourceUrl == null ) + { + throw new FileNotFoundException( "Unable to find: " + resource ); + } + + return new File( URI.create( resourceUrl.toString().replaceAll( " ", "%20" ) ) ); + } + + protected ArtifactRepository getLocalRepository() + throws Exception + { + ArtifactRepositoryLayout repoLayout = lookup( ArtifactRepositoryLayout.class, "legacy" ); + + ArtifactRepository r = repositorySystem.createArtifactRepository( "local", "file://" + getLocalRepositoryPath().getAbsolutePath(), repoLayout, null, null ); + + return r; + } + + // ---------------------------------------------------------------------- + // Project building + // ---------------------------------------------------------------------- + + protected MavenProject getProjectWithDependencies( File pom ) + throws Exception + { + ProjectBuildingRequest configuration = newBuildingRequest(); + configuration.setRemoteRepositories( Arrays.asList( new ArtifactRepository[] {} ) ); + configuration.setProcessPlugins( false ); + configuration.setResolveDependencies( true ); + + try + { + return projectBuilder.build( pom, configuration ).getProject(); + } + catch ( Exception e ) + { + Throwable cause = e.getCause(); + if ( cause instanceof ModelBuildingException ) + { + String message = "In: " + pom + "\n\n"; + for ( ModelProblem problem : ( (ModelBuildingException) cause ).getProblems() ) + { + message += problem + "\n"; + } + System.out.println( message ); + } + + throw e; + } + } + + protected MavenProject getProject( File pom ) + throws Exception + { + ProjectBuildingRequest configuration = newBuildingRequest(); + + return projectBuilder.build( pom, configuration ).getProject(); + } + + protected ProjectBuildingRequest newBuildingRequest() + throws Exception + { + ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); + configuration.setLocalRepository( getLocalRepository() ); + initRepoSession( configuration ); + return configuration; + } + + protected void initRepoSession( ProjectBuildingRequest request ) + { + File localRepo = new File( request.getLocalRepository().getBasedir() ); + DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession(); + repoSession.setLocalRepositoryManager( new LegacyLocalRepositoryManager( localRepo ) ); + request.setRepositorySession( repoSession ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java new file mode 100644 index 00000000..13c32abb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/DefaultMavenProjectBuilderTest.java @@ -0,0 +1,193 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.codehaus.plexus.util.FileUtils; + +public class DefaultMavenProjectBuilderTest + extends AbstractMavenProjectTestCase +{ + + private List<File> filesToDelete = new ArrayList<File>(); + + private File localRepoDir; + + @Override + public void setUp() + throws Exception + { + super.setUp(); + + projectBuilder = lookup( ProjectBuilder.class ); + + localRepoDir = new File( System.getProperty( "java.io.tmpdir" ), "local-repo." + System.currentTimeMillis() ); + localRepoDir.mkdirs(); + + filesToDelete.add( localRepoDir ); + } + + @Override + public void tearDown() + throws Exception + { + super.tearDown(); + + if ( !filesToDelete.isEmpty() ) + { + for ( File file : filesToDelete ) + { + if ( file.exists() ) + { + if ( file.isDirectory() ) + { + FileUtils.deleteDirectory( file ); + } + else + { + file.delete(); + } + } + } + } + } + + protected MavenProject getProject( Artifact pom, boolean allowStub ) + throws Exception + { + ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); + configuration.setLocalRepository( getLocalRepository() ); + initRepoSession( configuration ); + + return projectBuilder.build( pom, allowStub, configuration ).getProject(); + } + + /** + * Check that we can build ok from the middle pom of a (parent,child,grandchild) heirarchy + * @throws Exception + */ + public void testBuildFromMiddlePom() throws Exception + { + File f1 = getTestFile( "src/test/resources/projects/grandchild-check/child/pom.xml"); + File f2 = getTestFile( "src/test/resources/projects/grandchild-check/child/grandchild/pom.xml"); + + getProject( f1 ); + + // it's the building of the grandchild project, having already cached the child project + // (but not the parent project), which causes the problem. + getProject( f2 ); + } + + public void testDuplicatePluginDefinitionsMerged() + throws Exception + { + File f1 = getTestFile( "src/test/resources/projects/duplicate-plugins-merged-pom.xml" ); + + MavenProject project = getProject( f1 ); + assertEquals( 2, project.getBuildPlugins().get( 0 ).getDependencies().size() ); + assertEquals( 2, project.getBuildPlugins().get( 0 ).getExecutions().size() ); + assertEquals( "first", project.getBuildPlugins().get( 0 ).getExecutions().get( 0 ).getId() ); + } + + public void testBuildStubModelForMissingRemotePom() + throws Exception + { + Artifact pom = repositorySystem.createProjectArtifact( "org.apache.maven.its", "missing", "0.1" ); + MavenProject project = getProject( pom, true ); + + assertNotNull( project.getArtifactId() ); + + assertNotNull( project.getRemoteArtifactRepositories() ); + assertFalse( project.getRemoteArtifactRepositories().isEmpty() ); + + assertNotNull( project.getPluginArtifactRepositories() ); + assertFalse( project.getPluginArtifactRepositories().isEmpty() ); + + assertNull( project.getParent() ); + assertNull( project.getParentArtifact() ); + + assertFalse( project.isExecutionRoot() ); + } + + @Override + protected ArtifactRepository getLocalRepository() + throws Exception + { + ArtifactRepositoryLayout repoLayout = lookup( ArtifactRepositoryLayout.class, "default" ); + ArtifactRepository r = + repositorySystem.createArtifactRepository( "local", "file://" + localRepoDir.getAbsolutePath(), repoLayout, + null, null ); + return r; + } + + public void xtestLoop() + throws Exception + { + while ( true ) + { + File f1 = getTestFile( "src/test/resources/projects/duplicate-plugins-merged-pom.xml" ); + getProject( f1 ); + } + } + + public void testPartialResultUponBadDependencyDeclaration() + throws Exception + { + File pomFile = getTestFile( "src/test/resources/projects/bad-dependency.xml" ); + + try + { + ProjectBuildingRequest request = newBuildingRequest(); + request.setProcessPlugins( false ); + request.setResolveDependencies( true ); + projectBuilder.build( pomFile, request ); + fail( "Project building did not fail despite invalid POM" ); + } + catch ( ProjectBuildingException e ) + { + List<ProjectBuildingResult> results = e.getResults(); + assertNotNull( results ); + assertEquals( 1, results.size() ); + ProjectBuildingResult result = results.get( 0 ); + assertNotNull( result ); + assertNotNull( result.getProject() ); + assertEquals( 1, result.getProblems().size() ); + assertEquals( 1, result.getProject().getArtifacts().size() ); + assertNotNull( result.getDependencyResolutionResult() ); + } + } + + public void testImportScopePomResolvesFromPropertyBasedRepository() + throws Exception + { + File pomFile = getTestFile( "src/test/resources/projects/import-scope-pom-resolves-from-property-based-repository.xml" ); + ProjectBuildingRequest request = newBuildingRequest(); + request.setProcessPlugins( false ); + request.setResolveDependencies( true ); + projectBuilder.build( pomFile, request ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java new file mode 100644 index 00000000..8ff912fb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/EmptyLifecycleExecutor.java @@ -0,0 +1,109 @@ +package org.apache.maven.project; + +/* + * 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.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.lifecycle.LifecycleExecutor; +import org.apache.maven.lifecycle.MavenExecutionPlan; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.plugin.MojoExecution; + +/** + * A stub implementation that assumes an empty lifecycle to bypass interaction with the plugin manager and to avoid + * plugin artifact resolution from repositories. + * + * @author Benjamin Bentmann + */ +public class EmptyLifecycleExecutor + implements LifecycleExecutor +{ + + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks ) + { + return new MavenExecutionPlan( null, null ); + } + + public MavenExecutionPlan calculateExecutionPlan( MavenSession session, boolean setup, String... tasks ) + { + return new MavenExecutionPlan( null, null ); + } + + public void execute( MavenSession session ) + { + } + + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) + { + Set<Plugin> plugins; + + // NOTE: The upper-case packaging name is intentional, that's a special hinting mode used for certain tests + if ( "JAR".equals( packaging ) ) + { + plugins = new LinkedHashSet<Plugin>(); + + plugins.add( newPlugin( "maven-compiler-plugin", "compile", "testCompile" ) ); + plugins.add( newPlugin( "maven-resources-plugin", "resources", "testResources" ) ); + plugins.add( newPlugin( "maven-surefire-plugin", "test" ) ); + plugins.add( newPlugin( "maven-jar-plugin", "jar" ) ); + plugins.add( newPlugin( "maven-install-plugin", "install" ) ); + plugins.add( newPlugin( "maven-deploy-plugin", "deploy" ) ); + } + else + { + plugins = Collections.emptySet(); + } + + return plugins; + } + + private Plugin newPlugin( String artifactId, String... goals ) + { + Plugin plugin = new Plugin(); + + plugin.setGroupId( "org.apache.maven.plugins" ); + plugin.setArtifactId( artifactId ); + + for ( String goal : goals ) + { + PluginExecution pluginExecution = new PluginExecution(); + pluginExecution.setId( "default-" + goal ); + pluginExecution.addGoal( goal ); + plugin.addExecution( pluginExecution ); + } + + return plugin; + } + + public void calculateForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + { + } + + public List<MavenProject> executeForkedExecutions( MojoExecution mojoExecution, MavenSession session ) + { + return Collections.emptyList(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/EmptyProjectBuildingHelper.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/EmptyProjectBuildingHelper.java new file mode 100644 index 00000000..21e37f1f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/EmptyProjectBuildingHelper.java @@ -0,0 +1,62 @@ +package org.apache.maven.project; + +/* + * 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.ArrayList; +import java.util.List; + +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.model.Model; +import org.apache.maven.model.Repository; + +/** + * A stub implementation to bypass artifact resolution from repositories. + * + * @author Benjamin Bentmann + */ +public class EmptyProjectBuildingHelper + implements ProjectBuildingHelper +{ + + public List<ArtifactRepository> createArtifactRepositories( List<Repository> pomRepositories, + List<ArtifactRepository> externalRepositories, + ProjectBuildingRequest request ) + { + if ( externalRepositories != null ) + { + return externalRepositories; + } + else + { + return new ArrayList<ArtifactRepository>(); + } + } + + public ProjectRealmCache.CacheRecord createProjectRealm( MavenProject proejct, + Model model, ProjectBuildingRequest request ) + { + return new ProjectRealmCache.CacheRecord( null, null ); + } + + public void selectProjectRealm( MavenProject project ) + { + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java new file mode 100644 index 00000000..68727013 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ExtensionDescriptorBuilderTest.java @@ -0,0 +1,101 @@ +package org.apache.maven.project; + +/* + * 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.ByteArrayInputStream; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.util.Arrays; + +import junit.framework.TestCase; + +/** + * Tests {@link ExtensionDescriptorBuilder}. + * + * @author Benjamin Bentmann + */ +public class ExtensionDescriptorBuilderTest + extends TestCase +{ + + private ExtensionDescriptorBuilder builder; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + builder = new ExtensionDescriptorBuilder(); + } + + @Override + protected void tearDown() + throws Exception + { + builder = null; + + super.tearDown(); + } + + private InputStream toStream( String xml ) + { + try + { + return new ByteArrayInputStream( xml.getBytes( "UTF-8" ) ); + } + catch ( UnsupportedEncodingException e ) + { + throw new IllegalStateException( e ); + } + } + + public void testEmptyDescriptor() + throws Exception + { + String xml = "<extension></extension>"; + + ExtensionDescriptor ed = builder.build( toStream( xml ) ); + + assertNotNull( ed ); + assertNotNull( ed.getExportedPackages() ); + assertTrue( ed.getExportedPackages().isEmpty() ); + assertNotNull( ed.getExportedArtifacts() ); + assertTrue( ed.getExportedArtifacts().isEmpty() ); + } + + public void testCompleteDescriptor() + throws Exception + { + String xml = + "<?xml version='1.0' encoding='UTF-8'?>" + "<extension>" + "<exportedPackages>" + + "<exportedPackage>a</exportedPackage>" + "<exportedPackage>b</exportedPackage>" + + "<exportedPackage>c</exportedPackage>" + "</exportedPackages>" + "<exportedArtifacts>" + + "<exportedArtifact>x</exportedArtifact>" + "<exportedArtifact>y</exportedArtifact>" + + "<exportedArtifact> z </exportedArtifact>" + "</exportedArtifacts>" + "</extension>"; + + ExtensionDescriptor ed = builder.build( toStream( xml ) ); + + assertNotNull( ed ); + assertEquals( Arrays.asList( "a", "b", "c" ), ed.getExportedPackages() ); + assertEquals( Arrays.asList( "x", "y", "z" ), ed.getExportedArtifacts() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java new file mode 100644 index 00000000..52fdd804 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java @@ -0,0 +1,192 @@ +package org.apache.maven.project; + +/* + * 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.File; + +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.metadata.Metadata; +import org.eclipse.aether.repository.LocalArtifactRegistration; +import org.eclipse.aether.repository.LocalArtifactRequest; +import org.eclipse.aether.repository.LocalArtifactResult; +import org.eclipse.aether.repository.LocalMetadataRegistration; +import org.eclipse.aether.repository.LocalMetadataRequest; +import org.eclipse.aether.repository.LocalMetadataResult; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.repository.LocalRepositoryManager; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * @author Benjamin Bentmann + */ +public class LegacyLocalRepositoryManager + implements LocalRepositoryManager +{ + + private final LocalRepository repository; + + public LegacyLocalRepositoryManager( File basedir ) + { + this.repository = new LocalRepository( basedir.getAbsoluteFile(), "legacy" ); + } + + public LocalRepository getRepository() + { + return repository; + } + + public String getPathForLocalArtifact( Artifact artifact ) + { + StringBuilder path = new StringBuilder( 128 ); + + path.append( artifact.getGroupId() ).append( '/' ); + + path.append( artifact.getExtension() ).append( 's' ).append( '/' ); + + path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() ); + + if ( artifact.getClassifier().length() > 0 ) + { + path.append( '-' ).append( artifact.getClassifier() ); + } + + path.append( '.' ).append( artifact.getExtension() ); + + return path.toString(); + } + + public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) + { + return getPathForLocalArtifact( artifact ); + } + + public String getPathForLocalMetadata( Metadata metadata ) + { + return getPath( metadata, "local" ); + } + + public String getPathForRemoteMetadata( Metadata metadata, RemoteRepository repository, String context ) + { + return getPath( metadata, getRepositoryKey( repository, context ) ); + } + + String getRepositoryKey( RemoteRepository repository, String context ) + { + return repository.getId(); + } + + private String getPath( Metadata metadata, String repositoryKey ) + { + StringBuilder path = new StringBuilder( 128 ); + + if ( metadata.getGroupId().length() > 0 ) + { + path.append( metadata.getGroupId().replace( '.', '/' ) ).append( '/' ); + + if ( metadata.getArtifactId().length() > 0 ) + { + path.append( metadata.getArtifactId() ).append( '/' ); + + if ( metadata.getVersion().length() > 0 ) + { + path.append( metadata.getVersion() ).append( '/' ); + } + } + } + + path.append( insertRepositoryKey( metadata.getType(), repositoryKey ) ); + + return path.toString(); + } + + private String insertRepositoryKey( String filename, String repositoryKey ) + { + String result; + int idx = filename.indexOf( '.' ); + if ( idx < 0 ) + { + result = filename + '-' + repositoryKey; + } + else + { + result = filename.substring( 0, idx ) + '-' + repositoryKey + filename.substring( idx ); + } + return result; + } + + public LocalArtifactResult find( RepositorySystemSession session, LocalArtifactRequest request ) + { + String path = getPathForLocalArtifact( request.getArtifact() ); + File file = new File( getRepository().getBasedir(), path ); + + LocalArtifactResult result = new LocalArtifactResult( request ); + if ( file.isFile() ) + { + result.setFile( file ); + result.setAvailable( true ); + } + + return result; + } + + public void add( RepositorySystemSession session, LocalArtifactRegistration request ) + { + // noop + } + + public LocalMetadataResult find( RepositorySystemSession session, LocalMetadataRequest request ) + { + LocalMetadataResult result = new LocalMetadataResult( request ); + + String path; + + Metadata metadata = request.getMetadata(); + String context = request.getContext(); + RemoteRepository remote = request.getRepository(); + + if ( remote != null ) + { + path = getPathForRemoteMetadata( metadata, remote, context ); + } + else + { + path = getPathForLocalMetadata( metadata ); + } + + File file = new File( getRepository().getBasedir(), path ); + if ( file.isFile() ) + { + result.setFile( file ); + } + + return result; + } + + public void add( RepositorySystemSession session, LocalMetadataRegistration request ) + { + // noop + } + + public String toString() + { + return String.valueOf( getRepository() ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java new file mode 100644 index 00000000..0c5cd07d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java @@ -0,0 +1,197 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.maven.lifecycle.internal.stub.LoggerStub; +import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Model; +import org.apache.maven.model.Parent; +import org.apache.maven.model.Profile; + +public class MavenProjectTest + extends AbstractMavenProjectTestCase +{ + + public void testShouldInterpretChildPathAdjustmentBasedOnModulePaths() + throws IOException + { + Model parentModel = new Model(); + parentModel.addModule( "../child" ); + + MavenProject parentProject = new MavenProject( parentModel ); + + Model childModel = new Model(); + childModel.setArtifactId( "artifact" ); + + MavenProject childProject = new MavenProject( childModel ); + + File childFile = + new File( System.getProperty( "java.io.tmpdir" ), "maven-project-tests" + System.currentTimeMillis() + + "/child/pom.xml" ); + + childProject.setFile( childFile ); + + String adjustment = parentProject.getModulePathAdjustment( childProject ); + + assertNotNull( adjustment ); + + assertEquals( "..", adjustment ); + } + + public void testIdentityProtoInheritance() + { + Parent parent = new Parent(); + + parent.setGroupId( "test-group" ); + parent.setVersion( "1000" ); + parent.setArtifactId( "test-artifact" ); + + Model model = new Model(); + + model.setParent( parent ); + model.setArtifactId( "real-artifact" ); + + MavenProject project = new MavenProject( model ); + + assertEquals( "groupId proto-inheritance failed.", "test-group", project.getGroupId() ); + assertEquals( "artifactId is masked.", "real-artifact", project.getArtifactId() ); + assertEquals( "version proto-inheritance failed.", "1000", project.getVersion() ); + + // draw the NPE. + project.getId(); + } + + public void testEmptyConstructor() + { + MavenProject project = new MavenProject(); + + assertEquals( MavenProject.EMPTY_PROJECT_GROUP_ID + ":" + MavenProject.EMPTY_PROJECT_ARTIFACT_ID + ":jar:" + + MavenProject.EMPTY_PROJECT_VERSION, project.getId() ); + } + + public void testClone() + throws Exception + { + File f = getFileForClasspathResource( "canonical-pom.xml" ); + MavenProject projectToClone = getProject( f ); + + MavenProject clonedProject = projectToClone.clone(); + assertEquals( "maven-core", clonedProject.getArtifactId() ); + Map<?, ?> clonedMap = clonedProject.getManagedVersionMap(); + assertNotNull( "ManagedVersionMap not copied", clonedMap ); + assertTrue( "ManagedVersionMap is not empty", clonedMap.isEmpty() ); + } + + public void testCloneWithDependencyManagement() + throws Exception + { + File f = getFileForClasspathResource( "dependencyManagement-pom.xml" ); + MavenProject projectToClone = getProjectWithDependencies( f ); + DependencyManagement dep = projectToClone.getDependencyManagement(); + assertNotNull( "No dependencyManagement", dep ); + List<?> list = dep.getDependencies(); + assertNotNull( "No dependencies", list ); + assertTrue( "Empty dependency list", !list.isEmpty() ); + + Map<?, ?> map = projectToClone.getManagedVersionMap(); + assertNotNull( "No ManagedVersionMap", map ); + assertTrue( "ManagedVersionMap is empty", !map.isEmpty() ); + + MavenProject clonedProject = projectToClone.clone(); + assertEquals( "maven-core", clonedProject.getArtifactId() ); + Map<?, ?> clonedMap = clonedProject.getManagedVersionMap(); + assertNotNull( "ManagedVersionMap not copied", clonedMap ); + assertTrue( "ManagedVersionMap is empty", !clonedMap.isEmpty() ); + assertTrue( "ManagedVersionMap does not contain test key", + clonedMap.containsKey( "maven-test:maven-test-b:jar" ) ); + } + + public void testGetModulePathAdjustment() + throws IOException + { + Model moduleModel = new Model(); + + MavenProject module = new MavenProject( moduleModel ); + module.setFile( new File( "module-dir/pom.xml" ) ); + + Model parentModel = new Model(); + parentModel.addModule( "../module-dir" ); + + MavenProject parent = new MavenProject( parentModel ); + parent.setFile( new File( "parent-dir/pom.xml" ) ); + + String pathAdjustment = parent.getModulePathAdjustment( module ); + + assertEquals( "..", pathAdjustment ); + } + + public void testCloneWithDistributionManagement() + throws Exception + { + + File f = getFileForClasspathResource( "distributionManagement-pom.xml" ); + MavenProject projectToClone = getProject( f ); + + MavenProject clonedProject = projectToClone.clone(); + assertNotNull( "clonedProject - distributionManagement", clonedProject.getDistributionManagementArtifactRepository() ); + } + + public void testCloneWithActiveProfile() + throws Exception + { + + File f = getFileForClasspathResource( "withActiveByDefaultProfile-pom.xml" ); + MavenProject projectToClone = getProject( f ); + List<Profile> activeProfilesOrig = projectToClone.getActiveProfiles(); + + assertEquals( "Expecting 1 active profile", 1, activeProfilesOrig.size() ); + + MavenProject clonedProject = projectToClone.clone(); + + List<Profile> activeProfilesClone = clonedProject.getActiveProfiles(); + + assertEquals( "Expecting 1 active profile", 1, activeProfilesClone.size() ); + + assertNotSame( "The list of active profiles should have been cloned too but is same", activeProfilesOrig, + activeProfilesClone ); + } + + public void testUndefinedOutputDirectory() + throws Exception + { + MavenProject p = new MavenProject(); + assertNoNulls( p.getCompileClasspathElements() ); + assertNoNulls( p.getSystemClasspathElements() ); + assertNoNulls( p.getRuntimeClasspathElements() ); + assertNoNulls( p.getTestClasspathElements() ); + } + + private void assertNoNulls( List<String> elements ) + { + assertFalse( elements.contains( null ) ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java new file mode 100644 index 00000000..f17539b1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java @@ -0,0 +1,1878 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.model.building.ModelBuildingRequest; +import org.apache.maven.project.harness.PomTestWrapper; +import org.apache.maven.repository.RepositorySystem; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.codehaus.plexus.ContainerConfiguration; +import org.codehaus.plexus.PlexusConstants; +import org.codehaus.plexus.PlexusTestCase; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; + +public class PomConstructionTest + extends PlexusTestCase +{ + private static String BASE_DIR = "src/test"; + + private static String BASE_POM_DIR = BASE_DIR + "/resources-project-builder"; + + private static String BASE_MIXIN_DIR = BASE_DIR + "/resources-mixins"; + + private DefaultProjectBuilder projectBuilder; + + private RepositorySystem repositorySystem; + + private File testDirectory; + + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX ); + } + + protected void setUp() + throws Exception + { + testDirectory = new File( getBasedir(), BASE_POM_DIR ); + new File( getBasedir(), BASE_MIXIN_DIR ); + projectBuilder = (DefaultProjectBuilder) lookup( ProjectBuilder.class ); + repositorySystem = lookup( RepositorySystem.class ); + } + + @Override + protected void tearDown() + throws Exception + { + projectBuilder = null; + + super.tearDown(); + } + + /** + * Will throw exception if url is empty. MNG-4050 + * + * @throws Exception + */ + + public void testEmptyUrl() + throws Exception + { + buildPom( "empty-distMng-repo-url" ); + } + + /** + * Tests that modules is not overriden by profile + * + * @throws Exception + */ + /* MNG-786*/ + public void testProfileModules() + throws Exception + { + PomTestWrapper pom = buildPom( "profile-module", "a" ); + assertEquals( "test-prop", pom.getValue( "properties[1]/b" ) );// verifies profile applied + assertEquals( 4, ( (List<?>) pom.getValue( "modules" ) ).size() ); + assertEquals( "module-2", pom.getValue( "modules[1]" ) ); + assertEquals( "module-1", pom.getValue( "modules[2]" ) ); + assertEquals( "module-3", pom.getValue( "modules[3]" ) ); + assertEquals( "module-4", pom.getValue( "modules[4]" ) ); + } + + /** + * Will throw exception if doesn't find parent(s) in build + * + * @throws Exception + */ + public void testParentInheritance() + throws Exception + { + buildPom( "parent-inheritance/sub" ); + } + + /*MNG-3995*/ + public void testExecutionConfigurationJoin() + throws Exception + { + PomTestWrapper pom = buildPom( "execution-configuration-join" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/fileset[1]" ) ).size() ); + } + + /*MNG-3803*/ + public void testPluginConfigProperties() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-properties" ); + assertEquals( "my.property", pom.getValue( "build/plugins[1]/configuration[1]/systemProperties[1]/property[1]/name" ) ); + } + + /*MNG-3900*/ + public void testProfilePropertiesInterpolation() + throws Exception + { + PomTestWrapper pom = buildPom( "profile-properties-interpolation", "interpolation-profile" ); + assertEquals( "PASSED", pom.getValue( "properties[1]/test" ) ); + assertEquals( "PASSED", pom.getValue( "properties[1]/property" ) ); + } + + + // Some better conventions for the test poms needs to be created and each of these tests + // that represent a verification of a specification item needs to be a couple lines at most. + // The expressions help a lot, but we need a clean to pick up a directory of POMs, automatically load + // them into a resolver, create the expression to extract the data to validate the Model, and the URI + // to validate the properties. We also need a way to navigate from the Tex specification documents to + // the test in question and vice versa. A little Eclipse plugin would do the trick. + public void testThatExecutionsWithoutIdsAreMergedAndTheChildWins() + throws Exception + { + PomTestWrapper tester = buildPom( "micromailer" ); + assertModelEquals( tester, "child-descriptor", "build/plugins[1]/executions[1]/goals[1]" ); + } + + /*MNG- + public void testDependencyScope() + throws Exception + { + PomTestWrapper pom = buildPom( "dependency-scope/sub" ); + + } + + /*MNG- 4010*/ + public void testDuplicateExclusionsDependency() + throws Exception + { + PomTestWrapper pom = buildPom( "duplicate-exclusions-dependency/sub" ); + assertEquals( 1, ( (List<?>) pom.getValue( "dependencies[1]/exclusions" ) ).size() ); + + } + + /*MNG- 4008*/ + public void testMultipleFilters() + throws Exception + { + PomTestWrapper pom = buildPom( "multiple-filters" ); + assertEquals( 4, ( (List<?>) pom.getValue( "build/filters" ) ).size() ); + + } + + /** MNG-4005: postponed to 3.1 + public void testValidationErrorUponNonUniqueDependencyKey() + throws Exception + { + try + { + buildPom( "unique-dependency-key/deps" ); + fail( "Non-unique dependency keys did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + public void testValidationErrorUponNonUniqueDependencyManagementKey() + throws Exception + { + try + { + buildPom( "unique-dependency-key/dep-mngt" ); + fail( "Non-unique dependency keys did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + public void testValidationErrorUponNonUniqueDependencyKeyInProfile() + throws Exception + { + try + { + buildPom( "unique-dependency-key/deps-in-profile" ); + fail( "Non-unique dependency keys did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + public void testValidationErrorUponNonUniqueDependencyManagementKeyInProfile() + throws Exception + { + try + { + buildPom( "unique-dependency-key/dep-mngt-in-profile" ); + fail( "Non-unique dependency keys did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + */ + + public void testDuplicateDependenciesCauseLastDeclarationToBePickedInLenientMode() + throws Exception + { + PomTestWrapper pom = buildPom( "unique-dependency-key/deps", true, null ); + assertEquals( 1, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + assertEquals( "0.2", pom.getValue( "dependencies[1]/version" ) ); + } + + /* MNG-3567*/ + public void testParentInterpolation() + throws Exception + { + PomTestWrapper pom = buildPom( "parent-interpolation/sub" ); + pom = new PomTestWrapper( pom.getMavenProject().getParent() ); + assertEquals( "1.3.0-SNAPSHOT", pom.getValue( "build/plugins[1]/version" ) ); + } + +/* + public void testMaven() + throws Exception + { + PomTestWrapper pom = buildPomFromMavenProject( "maven-build/sub/pom.xml", null ); + + for( String s: pom.getMavenProject().getTestClasspathElements() ) + { + System.out.println( s ); + } + + } + */ + + /* MNG-3567*/ + public void testPluginManagementInherited() + throws Exception + { + PomTestWrapper pom = buildPom( "pluginmanagement-inherited/sub" ); + assertEquals( "1.0-alpha-21", pom.getValue( "build/plugins[1]/version" ) ); + } + + /* MNG-2174*/ + public void testPluginManagementDependencies() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-management-dependencies/sub", "test" ); + assertEquals( "1.0-alpha-21", pom.getValue( "build/plugins[1]/version" ) ); + assertEquals( "1.0", pom.getValue( "build/plugins[1]/dependencies[1]/version" ) ); + } + + + /* MNG-3877*/ + public void testReportingInterpolation() + throws Exception + { + PomTestWrapper pom = buildPom( "reporting-interpolation" ); + assertEquals( createPath( Arrays.asList( System.getProperty( "user.dir" ), "src", "test", + "resources-project-builder", "reporting-interpolation", "target", + "site" ) ), pom.getValue( "reporting/outputDirectory" ) ); + } + + + public void testPluginOrder() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-order" ); + assertEquals( "plexus-component-metadata", pom.getValue( "build/plugins[1]/artifactId" ) ); + assertEquals( "maven-surefire-plugin", pom.getValue( "build/plugins[2]/artifactId" ) ); + } + + public void testErroneousJoiningOfDifferentPluginsWithEqualDependencies() + throws Exception + { + PomTestWrapper pom = buildPom( "equal-plugin-deps" ); + assertEquals( "maven-it-plugin-a", pom.getValue( "build/plugins[1]/artifactId" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() ); + assertEquals( "maven-it-plugin-b", pom.getValue( "build/plugins[2]/artifactId" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() ); + } + + /** MNG-3821 */ + public void testErroneousJoiningOfDifferentPluginsWithEqualExecutionIds() + throws Exception + { + PomTestWrapper pom = buildPom( "equal-plugin-exec-ids" ); + assertEquals( "maven-it-plugin-a", pom.getValue( "build/plugins[1]/artifactId" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "maven-it-plugin-b", pom.getValue( "build/plugins[2]/artifactId" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "maven-it-plugin-a", pom.getValue( "reporting/plugins[1]/artifactId" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins[1]/reportSets" ) ).size() ); + assertEquals( "maven-it-plugin-b", pom.getValue( "reporting/plugins[2]/artifactId" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins[1]/reportSets" ) ).size() ); + } + + /** MNG-3998 */ + public void testExecutionConfiguration() + throws Exception + { + PomTestWrapper pom = buildPom( "execution-configuration" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "src/main/mdo/nexus.xml", + ( pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/model" ) ) ); + assertEquals( "src/main/mdo/security.xml", + ( pom.getValue( "build/plugins[1]/executions[2]/configuration[1]/model" ) ) ); + } + + /* + public void testPluginConfigDuplicate() + throws Exception +{ + PomTestWrapper pom = buildPom( "plugin-config-duplicate/dup" ); +} +*/ + + + public void testSingleConfigurationInheritance() + throws Exception + { + PomTestWrapper pom = buildPom( "single-configuration-inheritance" ); + + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules" ) ).size() ); + assertEquals( "2.0.6", + pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules[1]/requireMavenVersion[1]/version" ) ); + assertEquals( "[1.4,)", + pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules[1]/requireJavaVersion[1]/version" ) ); + } + + public void testConfigWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "config-with-plugin-mng" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "src/main/mdo/security.xml", pom.getValue( "build/plugins[1]/executions[2]/configuration[1]/model" ) ); + assertEquals( "1.0.8", pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/version" ) ); + } + + /** MNG-3965 */ + public void testExecutionConfigurationSubcollections() + throws Exception + { + PomTestWrapper pom = buildPom( "execution-configuration-subcollections" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules[1]/bannedDependencies" ) ).size() ); + } + + /** MNG-3985 */ + public void testMultipleRepositories() + throws Exception + { + PomTestWrapper pom = buildPom( "multiple-repos/sub" ); + assertEquals( 3, ( (List<?>) pom.getValue( "repositories" ) ).size() ); + } + + /** MNG-3965 */ + public void testMultipleExecutionIds() + throws Exception + { + PomTestWrapper pom = buildPom( "dual-execution-ids/sub" ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + } + + /** MNG-3997 */ + public void testConsecutiveEmptyElements() + throws Exception + { + buildPom( "consecutive_empty_elements" ); + } + + public void testOrderOfGoalsFromPluginExecutionWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-goals-order/wo-plugin-mngt" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() ); + assertEquals( "b", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "a", pom.getValue( "build/plugins[1]/executions[1]/goals[2]" ) ); + assertEquals( "d", pom.getValue( "build/plugins[1]/executions[1]/goals[3]" ) ); + assertEquals( "c", pom.getValue( "build/plugins[1]/executions[1]/goals[4]" ) ); + assertEquals( "e", pom.getValue( "build/plugins[1]/executions[1]/goals[5]" ) ); + } + + /* MNG-3886*/ + public void testOrderOfGoalsFromPluginExecutionWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-goals-order/w-plugin-mngt" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() ); + assertEquals( "b", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "a", pom.getValue( "build/plugins[1]/executions[1]/goals[2]" ) ); + assertEquals( "d", pom.getValue( "build/plugins[1]/executions[1]/goals[3]" ) ); + assertEquals( "c", pom.getValue( "build/plugins[1]/executions[1]/goals[4]" ) ); + assertEquals( "e", pom.getValue( "build/plugins[1]/executions[1]/goals[5]" ) ); + } + + public void testOrderOfPluginExecutionsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-order/wo-plugin-mngt" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "b", pom.getValue( "build/plugins[1]/executions[1]/id" ) ); + assertEquals( "a", pom.getValue( "build/plugins[1]/executions[2]/id" ) ); + assertEquals( "d", pom.getValue( "build/plugins[1]/executions[3]/id" ) ); + assertEquals( "c", pom.getValue( "build/plugins[1]/executions[4]/id" ) ); + assertEquals( "e", pom.getValue( "build/plugins[1]/executions[5]/id" ) ); + } + + /* MNG-3887 */ + public void testOrderOfPluginExecutionsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-order/w-plugin-mngt" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "b", pom.getValue( "build/plugins[1]/executions[1]/id" ) ); + assertEquals( "a", pom.getValue( "build/plugins[1]/executions[2]/id" ) ); + assertEquals( "d", pom.getValue( "build/plugins[1]/executions[3]/id" ) ); + assertEquals( "c", pom.getValue( "build/plugins[1]/executions[4]/id" ) ); + assertEquals( "e", pom.getValue( "build/plugins[1]/executions[5]/id" ) ); + } + + public void testMergeOfPluginExecutionsWhenChildInheritsPluginVersion() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-merging-wo-version/sub" ); + assertEquals( 4, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + } + + /* MNG-3943*/ + public void testMergeOfPluginExecutionsWhenChildAndParentUseDifferentPluginVersions() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-merging-version-insensitive/sub" ); + assertEquals( 4, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + } + + + public void testInterpolationWithXmlMarkup() + throws Exception + { + PomTestWrapper pom = buildPom( "xml-markup-interpolation" ); + assertEquals( "<?xml version='1.0'?>Tom&Jerry", pom.getValue( "properties/xmlTest" ) ); + } + + /* MNG-3925 */ + public void testOrderOfMergedPluginExecutionsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-exec-order/wo-plugin-mngt/sub" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "parent-1", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "parent-2", pom.getValue( "build/plugins[1]/executions[2]/goals[1]" ) ); + assertEquals( "child-default", pom.getValue( "build/plugins[1]/executions[3]/goals[1]" ) ); + assertEquals( "child-1", pom.getValue( "build/plugins[1]/executions[4]/goals[1]" ) ); + assertEquals( "child-2", pom.getValue( "build/plugins[1]/executions[5]/goals[1]" ) ); + } + + public void testOrderOfMergedPluginExecutionsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-exec-order/w-plugin-mngt/sub" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "parent-1", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "parent-2", pom.getValue( "build/plugins[1]/executions[2]/goals[1]" ) ); + assertEquals( "child-default", pom.getValue( "build/plugins[1]/executions[3]/goals[1]" ) ); + assertEquals( "child-1", pom.getValue( "build/plugins[1]/executions[4]/goals[1]" ) ); + assertEquals( "child-2", pom.getValue( "build/plugins[1]/executions[5]/goals[1]" ) ); + } + + /* MNG-3984*/ + public void testDifferentContainersWithSameId() + throws Exception + { + PomTestWrapper pom = buildPom( "join-different-containers-same-id" ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/pluginManagement/plugins[@artifactId='maven-it-plugin-b']/executions[1]/goals" ) ).size() ); + } + + /* MNG-3937*/ + public void testOrderOfMergedPluginExecutionGoalsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-exec-goals-order/wo-plugin-mngt/sub" ); + + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() ); + assertEquals( "child-a", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "merged", pom.getValue( "build/plugins[1]/executions[1]/goals[2]" ) ); + assertEquals( "child-b", pom.getValue( "build/plugins[1]/executions[1]/goals[3]" ) ); + assertEquals( "parent-b", pom.getValue( "build/plugins[1]/executions[1]/goals[4]" ) ); + assertEquals( "parent-a", pom.getValue( "build/plugins[1]/executions[1]/goals[5]" ) ); + } + + public void testOrderOfMergedPluginExecutionGoalsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-exec-goals-order/w-plugin-mngt/sub" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() ); + assertEquals( "child-a", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "merged", pom.getValue( "build/plugins[1]/executions[1]/goals[2]" ) ); + assertEquals( "child-b", pom.getValue( "build/plugins[1]/executions[1]/goals[3]" ) ); + assertEquals( "parent-b", pom.getValue( "build/plugins[1]/executions[1]/goals[4]" ) ); + assertEquals( "parent-a", pom.getValue( "build/plugins[1]/executions[1]/goals[5]" ) ); + } + + /*MNG-3938*/ + public void testOverridingOfInheritedPluginExecutionsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-merging/wo-plugin-mngt/sub" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "child-default", pom.getValue( "build/plugins[1]/executions[@id='default']/phase" ) ); + assertEquals( "child-non-default", pom.getValue( "build/plugins[1]/executions[@id='non-default']/phase" ) ); + } + + /* MNG-3938 */ + public void testOverridingOfInheritedPluginExecutionsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-merging/w-plugin-mngt/sub" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "child-default", pom.getValue( "build/plugins[1]/executions[@id='default']/phase" ) ); + assertEquals( "child-non-default", pom.getValue( "build/plugins[1]/executions[@id='non-default']/phase" ) ); + } + + + /* MNG-3906*/ + public void testOrderOfMergedPluginDependenciesWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-class-path-order/wo-plugin-mngt/sub" ); + + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() ); + assertNotNull( pom.getValue( "build/plugins[1]/dependencies[1]" ) ); + assertEquals( "c", pom.getValue( "build/plugins[1]/dependencies[1]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[1]/version" ) ); + assertEquals( "a", pom.getValue( "build/plugins[1]/dependencies[2]/artifactId" ) ); + assertEquals( "2", pom.getValue( "build/plugins[1]/dependencies[2]/version" ) ); + assertEquals( "b", pom.getValue( "build/plugins[1]/dependencies[3]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[3]/version" ) ); + assertEquals( "e", pom.getValue( "build/plugins[1]/dependencies[4]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[4]/version" ) ); + assertEquals( "d", pom.getValue( "build/plugins[1]/dependencies[5]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[5]/version" ) ); + } + + public void testOrderOfMergedPluginDependenciesWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-plugin-class-path-order/w-plugin-mngt/sub" ); + assertEquals( 5, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() ); + assertEquals( "c", pom.getValue( "build/plugins[1]/dependencies[1]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[1]/version" ) ); + assertEquals( "a", pom.getValue( "build/plugins[1]/dependencies[2]/artifactId" ) ); + assertEquals( "2", pom.getValue( "build/plugins[1]/dependencies[2]/version" ) ); + assertEquals( "b", pom.getValue( "build/plugins[1]/dependencies[3]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[3]/version" ) ); + assertEquals( "e", pom.getValue( "build/plugins[1]/dependencies[4]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[4]/version" ) ); + assertEquals( "d", pom.getValue( "build/plugins[1]/dependencies[5]/artifactId" ) ); + assertEquals( "1", pom.getValue( "build/plugins[1]/dependencies[5]/version" ) ); + } + + public void testInterpolationOfNestedBuildDirectories() + throws Exception + { + PomTestWrapper pom = buildPom( "nested-build-dir-interpolation" ); + assertEquals( new File( pom.getBasedir(), "target/classes/dir0" ), + new File( (String) pom.getValue( "properties/dir0" ) ) ); + assertEquals( new File( pom.getBasedir(), "src/test/dir1" ), + new File( (String) pom.getValue( "properties/dir1" ) ) ); + assertEquals( new File( pom.getBasedir(), "target/site/dir2" ), + new File( (String) pom.getValue( "properties/dir2" ) ) ); + } + + public void testAppendArtifactIdOfChildToInheritedUrls() + throws Exception + { + PomTestWrapper pom = buildPom( "url-inheritance/sub" ); + assertEquals( "http://parent.url/child", pom.getValue( "url" ) ); + assertEquals( "http://parent.url/org", pom.getValue( "organization/url" ) ); + assertEquals( "http://parent.url/license.txt", pom.getValue( "licenses[1]/url" ) ); + assertEquals( "http://parent.url/viewvc/child", pom.getValue( "scm/url" ) ); + assertEquals( "http://parent.url/scm/child", pom.getValue( "scm/connection" ) ); + assertEquals( "https://parent.url/scm/child", pom.getValue( "scm/developerConnection" ) ); + assertEquals( "http://parent.url/issues", pom.getValue( "issueManagement/url" ) ); + assertEquals( "http://parent.url/ci", pom.getValue( "ciManagement/url" ) ); + assertEquals( "http://parent.url/dist", pom.getValue( "distributionManagement/repository/url" ) ); + assertEquals( "http://parent.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) ); + assertEquals( "http://parent.url/site/child", pom.getValue( "distributionManagement/site/url" ) ); + assertEquals( "http://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) ); + } + + /* MNG-3846*/ + public void testAppendArtifactIdOfParentAndChildToInheritedUrls() + throws Exception + { + PomTestWrapper pom = buildPom( "url-inheritance/another-parent/sub" ); + assertEquals( "http://parent.url/ap/child", pom.getValue( "url" ) ); + assertEquals( "http://parent.url/org", pom.getValue( "organization/url" ) ); + assertEquals( "http://parent.url/license.txt", pom.getValue( "licenses[1]/url" ) ); + assertEquals( "http://parent.url/viewvc/ap/child", pom.getValue( "scm/url" ) ); + assertEquals( "http://parent.url/scm/ap/child", pom.getValue( "scm/connection" ) ); + assertEquals( "https://parent.url/scm/ap/child", pom.getValue( "scm/developerConnection" ) ); + assertEquals( "http://parent.url/issues", pom.getValue( "issueManagement/url" ) ); + assertEquals( "http://parent.url/ci", pom.getValue( "ciManagement/url" ) ); + assertEquals( "http://parent.url/dist", pom.getValue( "distributionManagement/repository/url" ) ); + assertEquals( "http://parent.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) ); + assertEquals( "http://parent.url/site/ap/child", pom.getValue( "distributionManagement/site/url" ) ); + assertEquals( "http://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) ); + } + //*/ + + public void testNonInheritedElementsInSubtreesOverriddenByChild() + throws Exception + { + PomTestWrapper pom = buildPom( "limited-inheritance/child" ); + assertEquals( null, pom.getValue( "organization/url" ) ); + assertEquals( null, pom.getValue( "issueManagement/system" ) ); + assertEquals( 0, ( (List<?>) pom.getValue( "ciManagement/notifiers" ) ).size() ); + assertEquals( "child-distros", pom.getValue( "distributionManagement/repository/id" ) ); + assertEquals( "ssh://child.url/distros", pom.getValue( "distributionManagement/repository/url" ) ); + assertEquals( null, pom.getValue( "distributionManagement/repository/name" ) ); + assertEquals( true, pom.getValue( "distributionManagement/repository/uniqueVersion" ) ); + assertEquals( "default", pom.getValue( "distributionManagement/repository/layout" ) ); + assertEquals( "child-snaps", pom.getValue( "distributionManagement/snapshotRepository/id" ) ); + assertEquals( "ssh://child.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) ); + assertEquals( null, pom.getValue( "distributionManagement/snapshotRepository/name" ) ); + assertEquals( true, pom.getValue( "distributionManagement/snapshotRepository/uniqueVersion" ) ); + assertEquals( "default", pom.getValue( "distributionManagement/snapshotRepository/layout" ) ); + assertEquals( "child-site", pom.getValue( "distributionManagement/site/id" ) ); + assertEquals( "scp://child.url/site", pom.getValue( "distributionManagement/site/url" ) ); + assertEquals( null, pom.getValue( "distributionManagement/site/name" ) ); + } + + public void testXmlTextCoalescing() + throws Exception + { + PomTestWrapper pom = buildPom( "xml-coalesce-text" ); + assertEquals( "A Test Project Property", pom.getValue( "properties/prop0" ) ); + assertEquals( "That's a test!", pom.getValue( "properties/prop1" ) ); + assertEquals( 32 * 1024, + pom.getValue( "properties/prop2" ).toString().trim().replaceAll( "[\n\r]", "" ).length() ); + } + + public void testFullInterpolationOfNestedExpressions() + throws Exception + { + PomTestWrapper pom = buildPom( "full-interpolation" ); + for ( int i = 0; i < 24; i++ ) + { + String index = ( ( i < 10 ) ? "0" : "" ) + i; + assertEquals( "PASSED", pom.getValue( "properties/property" + index ) ); + } + } + + public void testInterpolationOfLegacyExpressionsThatDontIncludeTheProjectPrefix() + throws Exception + { + PomTestWrapper pom = buildPom( "unprefixed-expression-interpolation/child" ); + + assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/projectDir" ).toString() ) ); + + assertEquals( "org.apache.maven.its.mng3831.child", pom.getValue( "properties/projectGroupId" ) ); + assertEquals( "child", pom.getValue( "properties/projectArtifactId" ) ); + assertEquals( "2.0-alpha-1", pom.getValue( "properties/projectVersion" ) ); + assertEquals( "jar", pom.getValue( "properties/projectPackaging" ) ); + + assertEquals( "child-name", pom.getValue( "properties/projectName" ) ); + assertEquals( "child-desc", pom.getValue( "properties/projectDesc" ) ); + assertEquals( "http://child.org/", pom.getValue( "properties/projectUrl" ) ); + assertEquals( "2008", pom.getValue( "properties/projectYear" ) ); + assertEquals( "child-org-name", pom.getValue( "properties/projectOrgName" ) ); + + assertEquals( "2.0.0", pom.getValue( "properties/projectPrereqMvn" ) ); + assertEquals( "http://scm.org/", pom.getValue( "properties/projectScmUrl" ) ); + assertEquals( "http://issue.org/", pom.getValue( "properties/projectIssueUrl" ) ); + assertEquals( "http://ci.org/", pom.getValue( "properties/projectCiUrl" ) ); + assertEquals( "child-dist-repo", pom.getValue( "properties/projectDistRepoName" ) ); + assertEquals( "http://dist.org/", pom.getValue( "properties/projectDistRepoUrl" ) ); + assertEquals( "http://site.org/", pom.getValue( "properties/projectDistSiteUrl" ) ); + + assertEquals( "org.apache.maven.its.mng3831", pom.getValue( "properties/parentGroupId" ) ); + assertEquals( "parent", pom.getValue( "properties/parentArtifactId" ) ); + assertEquals( "1.0", pom.getValue( "properties/parentVersion" ) ); + + assertTrue( pom.getValue( "properties/projectBuildOut" ).toString().endsWith( "bin" ) ); + assertTrue( pom.getValue( "properties/projectSiteOut" ).toString().endsWith( "doc" ) ); + } + + public void testInterpolationWithBasedirAlignedDirectories() + throws Exception + { + PomTestWrapper pom = buildPom( "basedir-aligned-interpolation" ); + assertEquals( new File( pom.getBasedir(), "src/main/java" ), + new File( pom.getValue( "properties/buildMainSrc" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "src/test/java" ), + new File( pom.getValue( "properties/buildTestSrc" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "src/main/scripts" ), + new File( pom.getValue( "properties/buildScriptSrc" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target" ), + new File( pom.getValue( "properties/buildOut" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target/classes" ), + new File( pom.getValue( "properties/buildMainOut" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target/test-classes" ), + new File( pom.getValue( "properties/buildTestOut" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target/site" ), + new File( pom.getValue( "properties/siteOut" ).toString() ) ); + } + + /* MNG-3944*/ + public void testInterpolationOfBasedirInPomWithUnusualName() + throws Exception + { + PomTestWrapper pom = buildPom( "basedir-interpolation/pom-with-unusual-name.xml" ); + assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/prop0" ).toString() ) ); + assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/prop1" ).toString() ) ); + } + + /* MNG-3979 */ + public void testJoiningOfContainersWhenChildHasEmptyElements() + throws Exception + { + PomTestWrapper pom = buildPom( "id-container-joining-with-empty-elements/sub" ); + assertNotNull( pom ); + } + + public void testOrderOfPluginConfigurationElementsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-order/wo-plugin-mngt" ); + assertEquals( "one", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[1]" ) ); + assertEquals( "two", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[2]" ) ); + assertEquals( "three", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[3]" ) ); + assertEquals( "four", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[4]" ) ); + } + + /* MNG-3827*/ + public void testOrderOfPluginConfigurationElementsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-order/w-plugin-mngt" ); + assertEquals( "one", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[1]" ) ); + assertEquals( "two", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[2]" ) ); + assertEquals( "three", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[3]" ) ); + assertEquals( "four", pom.getValue( "build/plugins[1]/configuration/stringParams/stringParam[4]" ) ); + } + + public void testOrderOfPluginExecutionConfigurationElementsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-config-order/wo-plugin-mngt" ); + String prefix = "build/plugins[1]/executions[1]/configuration/"; + assertEquals( "one", pom.getValue( prefix + "stringParams/stringParam[1]" ) ); + assertEquals( "two", pom.getValue( prefix + "stringParams/stringParam[2]" ) ); + assertEquals( "three", pom.getValue( prefix + "stringParams/stringParam[3]" ) ); + assertEquals( "four", pom.getValue( prefix + "stringParams/stringParam[4]" ) ); + assertEquals( "key1", pom.getValue( prefix + "propertiesParam/property[1]/name" ) ); + assertEquals( "key2", pom.getValue( prefix + "propertiesParam/property[2]/name" ) ); + } + + /* MNG-3864*/ + public void testOrderOfPluginExecutionConfigurationElementsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-config-order/w-plugin-mngt" ); + String prefix = "build/plugins[1]/executions[1]/configuration/"; + assertEquals( "one", pom.getValue( prefix + "stringParams/stringParam[1]" ) ); + assertEquals( "two", pom.getValue( prefix + "stringParams/stringParam[2]" ) ); + assertEquals( "three", pom.getValue( prefix + "stringParams/stringParam[3]" ) ); + assertEquals( "four", pom.getValue( prefix + "stringParams/stringParam[4]" ) ); + assertEquals( "key1", pom.getValue( prefix + "propertiesParam/property[1]/name" ) ); + assertEquals( "key2", pom.getValue( prefix + "propertiesParam/property[2]/name" ) ); + } + + /* MNG-3836*/ + public void testMergeOfInheritedPluginConfiguration() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-merging/child" ); + + String prefix = "build/plugins[1]/configuration/"; + assertEquals( "PASSED", pom.getValue( prefix + "propertiesFile" ) ); + assertEquals( "PASSED", pom.getValue( prefix + "parent" ) ); + assertEquals( "PASSED-1", pom.getValue( prefix + "stringParams/stringParam[1]" ) ); + assertEquals( "PASSED-3", pom.getValue( prefix + "stringParams/stringParam[2]" ) ); + assertEquals( "PASSED-2", pom.getValue( prefix + "stringParams/stringParam[3]" ) ); + assertEquals( "PASSED-4", pom.getValue( prefix + "stringParams/stringParam[4]" ) ); + assertEquals( "PASSED-1", pom.getValue( prefix + "listParam/listParam[1]" ) ); + assertEquals( "PASSED-3", pom.getValue( prefix + "listParam/listParam[2]" ) ); + assertEquals( "PASSED-2", pom.getValue( prefix + "listParam/listParam[3]" ) ); + assertEquals( "PASSED-4", pom.getValue( prefix + "listParam/listParam[4]" ) ); + } + + /* MNG-2591 */ + public void testAppendOfInheritedPluginConfigurationWithNoProfile() + throws Exception + { + testAppendOfInheritedPluginConfiguration( "no-profile" ); + } + + /* MNG-2591*/ + public void testAppendOfInheritedPluginConfigurationWithActiveProfile() + throws Exception + { + testAppendOfInheritedPluginConfiguration( "with-profile" ); + } + + private void testAppendOfInheritedPluginConfiguration( String test ) + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-append/" + test + "/subproject" ); + String prefix = "build/plugins[1]/configuration/"; + assertEquals( "PARENT-1", pom.getValue( prefix + "stringParams/stringParam[1]" ) ); + assertEquals( "PARENT-3", pom.getValue( prefix + "stringParams/stringParam[2]" ) ); + assertEquals( "PARENT-2", pom.getValue( prefix + "stringParams/stringParam[3]" ) ); + assertEquals( "PARENT-4", pom.getValue( prefix + "stringParams/stringParam[4]" ) ); + assertEquals( "CHILD-1", pom.getValue( prefix + "stringParams/stringParam[5]" ) ); + assertEquals( "CHILD-3", pom.getValue( prefix + "stringParams/stringParam[6]" ) ); + assertEquals( "CHILD-2", pom.getValue( prefix + "stringParams/stringParam[7]" ) ); + assertEquals( "CHILD-4", pom.getValue( prefix + "stringParams/stringParam[8]" ) ); + assertEquals( null, pom.getValue( prefix + "stringParams/stringParam[9]" ) ); + assertEquals( "PARENT-1", pom.getValue( prefix + "listParam/listParam[1]" ) ); + assertEquals( "PARENT-3", pom.getValue( prefix + "listParam/listParam[2]" ) ); + assertEquals( "PARENT-2", pom.getValue( prefix + "listParam/listParam[3]" ) ); + assertEquals( "PARENT-4", pom.getValue( prefix + "listParam/listParam[4]" ) ); + assertEquals( "CHILD-1", pom.getValue( prefix + "listParam/listParam[5]" ) ); + assertEquals( "CHILD-3", pom.getValue( prefix + "listParam/listParam[6]" ) ); + assertEquals( "CHILD-2", pom.getValue( prefix + "listParam/listParam[7]" ) ); + assertEquals( "CHILD-4", pom.getValue( prefix + "listParam/listParam[8]" ) ); + assertEquals( null, pom.getValue( prefix + "listParam/listParam[9]" ) ); + } + + /* MNG-4000 */ + public void testMultiplePluginExecutionsWithAndWithoutIdsWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-w-and-wo-id/wo-plugin-mngt" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "log-string", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "log-string", pom.getValue( "build/plugins[1]/executions[2]/goals[1]" ) ); + } + + public void testMultiplePluginExecutionsWithAndWithoutIdsWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-w-and-wo-id/w-plugin-mngt" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "log-string", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( "log-string", pom.getValue( "build/plugins[1]/executions[2]/goals[1]" ) ); + } + + public void testDependencyOrderWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "dependency-order/wo-plugin-mngt" ); + assertEquals( 4, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + assertEquals( "a", pom.getValue( "dependencies[1]/artifactId" ) ); + assertEquals( "c", pom.getValue( "dependencies[2]/artifactId" ) ); + assertEquals( "b", pom.getValue( "dependencies[3]/artifactId" ) ); + assertEquals( "d", pom.getValue( "dependencies[4]/artifactId" ) ); + } + + public void testDependencyOrderWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "dependency-order/w-plugin-mngt" ); + assertEquals( 4, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + assertEquals( "a", pom.getValue( "dependencies[1]/artifactId" ) ); + assertEquals( "c", pom.getValue( "dependencies[2]/artifactId" ) ); + assertEquals( "b", pom.getValue( "dependencies[3]/artifactId" ) ); + assertEquals( "d", pom.getValue( "dependencies[4]/artifactId" ) ); + } + + public void testBuildDirectoriesUsePlatformSpecificFileSeparator() + throws Exception + { + PomTestWrapper pom = buildPom( "platform-file-separator" ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/directory" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/outputDirectory" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/testOutputDirectory" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/sourceDirectory" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/testSourceDirectory" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/resources[1]/directory" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/testResources[1]/directory" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "build/filters[1]" ) ); + assertPathWithNormalizedFileSeparators( pom.getValue( "reporting/outputDirectory" ) ); + } + + /* MNG-4008 */ + public void testMergedFilterOrder() + throws Exception + { + PomTestWrapper pom = buildPom( "merged-filter-order/sub" ); + + assertEquals( 7, ( (List<?>) pom.getValue( "build/filters" ) ).size() ); + assertTrue( pom.getValue( "build/filters[1]" ).toString().endsWith( "child-a.properties" ) ); + assertTrue( pom.getValue( "build/filters[2]" ).toString().endsWith( "child-c.properties" ) ); + assertTrue( pom.getValue( "build/filters[3]" ).toString().endsWith( "child-b.properties" ) ); + assertTrue( pom.getValue( "build/filters[4]" ).toString().endsWith( "child-d.properties" ) ); + assertTrue( pom.getValue( "build/filters[5]" ).toString().endsWith( "parent-c.properties" ) ); + assertTrue( pom.getValue( "build/filters[6]" ).toString().endsWith( "parent-b.properties" ) ); + assertTrue( pom.getValue( "build/filters[7]" ).toString().endsWith( "parent-d.properties" ) ); + } + + /** MNG-4027*/ + public void testProfileInjectedDependencies() + throws Exception + { + PomTestWrapper pom = buildPom( "profile-injected-dependencies" ); + assertEquals( 4, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + assertEquals( "a", pom.getValue( "dependencies[1]/artifactId" ) ); + assertEquals( "c", pom.getValue( "dependencies[2]/artifactId" ) ); + assertEquals( "b", pom.getValue( "dependencies[3]/artifactId" ) ); + assertEquals( "d", pom.getValue( "dependencies[4]/artifactId" ) ); + } + + /** IT-0021*/ + public void testProfileDependenciesMultipleProfiles() + throws Exception + { + PomTestWrapper pom = buildPom( "profile-dependencies-multiple-profiles", "profile-1", "profile-2" ); + assertEquals(2, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + } + + public void testDependencyInheritance() + throws Exception + { + PomTestWrapper pom = buildPom( "dependency-inheritance/sub" ); + assertEquals( 1, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + assertEquals( "4.4", pom.getValue( "dependencies[1]/version" ) ); + } + + /** MNG-4034 */ + public void testManagedProfileDependency() + throws Exception + { + PomTestWrapper pom = this.buildPom( "managed-profile-dependency/sub", "maven-core-it" ); + assertEquals( 1, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + assertEquals( "org.apache.maven.its", pom.getValue( "dependencies[1]/groupId" ) ); + assertEquals( "maven-core-it-support", pom.getValue( "dependencies[1]/artifactId" ) ); + assertEquals( "1.3", pom.getValue( "dependencies[1]/version" ) ); + assertEquals( "runtime", pom.getValue( "dependencies[1]/scope" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "dependencies[1]/exclusions" ) ).size() ); + assertEquals( "commons-lang", pom.getValue( "dependencies[1]/exclusions[1]/groupId" ) ); + } + + /** MNG-4040 */ + public void testProfileModuleInheritance() + throws Exception + { + PomTestWrapper pom = this.buildPom( "profile-module-inheritance/sub", "dist" ); + assertEquals( 0, ( (List<?>) pom.getValue( "modules" ) ).size() ); + } + + /** MNG-3621 */ + public void testUncPath() + throws Exception + { + PomTestWrapper pom = this.buildPom( "unc-path/sub" ); + assertEquals( "file:////host/site/test-child", pom.getValue( "distributionManagement/site/url" ) ); + } + + /** MNG-2006 */ + public void testUrlAppendWithChildPathAdjustment() + throws Exception + { + PomTestWrapper pom = this.buildPom( "url-append/child" ); + assertEquals( "http://project.url/child", pom.getValue( "url" ) ); + assertEquals( "http://viewvc.project.url/child", pom.getValue( "scm/url" ) ); + assertEquals( "http://scm.project.url/child", pom.getValue( "scm/connection" ) ); + assertEquals( "https://scm.project.url/child", pom.getValue( "scm/developerConnection" ) ); + assertEquals( "http://site.project.url/child", pom.getValue( "distributionManagement/site/url" ) ); + } + + /** MNG-0479 */ + public void testRepoInheritance() + throws Exception + { + PomTestWrapper pom = this.buildPom( "repo-inheritance" ); + assertEquals( 1, ( (List<?>) pom.getValue( "repositories" ) ).size() ); + assertEquals( "it0043", pom.getValue( "repositories[1]/name" ) ); + } + + public void testEmptyScm() + throws Exception + { + PomTestWrapper pom = this.buildPom( "empty-scm" ); + assertNull( pom.getValue( "scm" ) ); + } + + public void testPluginConfigurationUsingAttributesWithoutPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-attributes/wo-plugin-mngt" ); + assertEquals( "src", pom.getValue( "build/plugins[1]/configuration/domParam/copy/@todir" ) ); + assertEquals( "true", pom.getValue( "build/plugins[1]/configuration/domParam/copy/@overwrite" ) ); + assertEquals( "target", pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@dir" ) ); + assertEquals( null, pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@todir" ) ); + assertEquals( null, pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@overwrite" ) ); + } + + /** MNG-4053*/ + public void testPluginConfigurationUsingAttributesWithPluginManagement() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-attributes/w-plugin-mngt" ); + assertEquals( "src", pom.getValue( "build/plugins[1]/configuration/domParam/copy/@todir" ) ); + assertEquals( "true", pom.getValue( "build/plugins[1]/configuration/domParam/copy/@overwrite" ) ); + assertEquals( "target", pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@dir" ) ); + assertEquals( null, pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@todir" ) ); + assertEquals( null, pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@overwrite" ) ); + } + + public void testPluginConfigurationUsingAttributesWithPluginManagementAndProfile() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-config-attributes/w-profile", "maven-core-it" ); + assertEquals( "src", pom.getValue( "build/plugins[1]/configuration/domParam/copy/@todir" ) ); + assertEquals( "true", pom.getValue( "build/plugins[1]/configuration/domParam/copy/@overwrite" ) ); + assertEquals( "target", pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@dir" ) ); + assertEquals( null, pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@todir" ) ); + assertEquals( null, pom.getValue( "build/plugins[1]/configuration/domParam/copy/fileset/@overwrite" ) ); + } + + public void testPomEncoding() + throws Exception + { + PomTestWrapper pom = buildPom( "pom-encoding/utf-8" ); + assertEquals( "TEST-CHARS: \u00DF\u0131\u03A3\u042F\u05D0\u20AC", pom.getValue( "description" ) ); + pom = buildPom( "pom-encoding/latin-1" ); + assertEquals( "TEST-CHARS: \u00C4\u00D6\u00DC\u00E4\u00F6\u00FC\u00DF", pom.getValue( "description" ) ); + } + + /* MNG-4070 */ + public void testXmlWhitespaceHandling() + throws Exception + { + PomTestWrapper pom = buildPom( "xml-whitespace/sub" ); + assertEquals( "org.apache.maven.its.mng4070", pom.getValue( "groupId" ) ); + } + + /* MNG-3760*/ + public void testInterpolationOfBaseUrl() + throws Exception + { + PomTestWrapper pom = buildPom( "baseurl-interpolation/pom.xml" ); + assertEquals( pom.getBasedir().toURI().toString(), pom.getValue( "properties/prop1" ).toString() ); + } + + /* MNG-3811*/ + public void testReportingPluginConfig() + throws Exception + { + PomTestWrapper pom = buildPom( "reporting-plugin-config/sub" ); + + assertEquals( 3, ( (List<?>) pom.getValue( "reporting/plugins[1]/configuration/stringParams" ) ).size() ); + assertEquals( "parentParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[1]" ) ); + assertEquals( "childParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[2]" ) ); + assertEquals( " preserve space ", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[3]" ) ); + assertEquals( "true", pom.getValue( "reporting/plugins[1]/configuration/booleanParam" ) ); + } + + public void testPropertiesNoDuplication() + throws Exception + { + PomTestWrapper pom = buildPom( "properties-no-duplication/sub" ); + assertEquals( 1, ( (Properties) pom.getValue( "properties" ) ).size() ); + assertEquals( "child", pom.getValue( "properties/pomProfile" ) ); + } + + public void testPomInheritance() + throws Exception + { + PomTestWrapper pom = buildPom( "pom-inheritance/sub" ); + assertEquals( "parent-description", pom.getValue( "description" ) ); + assertEquals( "jar", pom.getValue( "packaging" ) ); + } + + public void testCompleteModelWithoutParent() + throws Exception + { + PomTestWrapper pom = buildPom( "complete-model/wo-parent" ); + + testCompleteModel( pom ); + } + + public void testCompleteModelWithParent() + throws Exception + { + PomTestWrapper pom = buildPom( "complete-model/w-parent/sub" ); + + testCompleteModel( pom ); + } + + private void testCompleteModel( PomTestWrapper pom ) + throws Exception + { + assertEquals( "4.0.0", pom.getValue( "modelVersion" ) ); + + assertEquals( "org.apache.maven.its.mng", pom.getValue( "groupId" ) ); + assertEquals( "test", pom.getValue( "artifactId" ) ); + assertEquals( "0.2", pom.getValue( "version" ) ); + assertEquals( "pom", pom.getValue( "packaging" ) ); + + assertEquals( "project-name", pom.getValue( "name" ) ); + assertEquals( "project-description", pom.getValue( "description" ) ); + assertEquals( "http://project.url/", pom.getValue( "url" ) ); + assertEquals( "2009", pom.getValue( "inceptionYear" ) ); + + assertEquals( "project-org", pom.getValue( "organization/name" ) ); + assertEquals( "http://project-org.url/", pom.getValue( "organization/url" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "licenses" ) ).size() ); + assertEquals( "project-license", pom.getValue( "licenses[1]/name" ) ); + assertEquals( "http://project.url/license", pom.getValue( "licenses[1]/url" ) ); + assertEquals( "repo", pom.getValue( "licenses[1]/distribution" ) ); + assertEquals( "free", pom.getValue( "licenses[1]/comments" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "developers" ) ).size() ); + assertEquals( "dev", pom.getValue( "developers[1]/id" ) ); + assertEquals( "project-developer", pom.getValue( "developers[1]/name" ) ); + assertEquals( "developer@", pom.getValue( "developers[1]/email" ) ); + assertEquals( "http://developer", pom.getValue( "developers[1]/url" ) ); + assertEquals( "developer", pom.getValue( "developers[1]/organization" ) ); + assertEquals( "http://devel.org", pom.getValue( "developers[1]/organizationUrl" ) ); + assertEquals( "-1", pom.getValue( "developers[1]/timezone" ) ); + assertEquals( "yes", pom.getValue( "developers[1]/properties/developer" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "developers[1]/roles" ) ).size() ); + assertEquals( "devel", pom.getValue( "developers[1]/roles[1]" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "contributors" ) ).size() ); + assertEquals( "project-contributor", pom.getValue( "contributors[1]/name" ) ); + assertEquals( "contributor@", pom.getValue( "contributors[1]/email" ) ); + assertEquals( "http://contributor", pom.getValue( "contributors[1]/url" ) ); + assertEquals( "contributor", pom.getValue( "contributors[1]/organization" ) ); + assertEquals( "http://contrib.org", pom.getValue( "contributors[1]/organizationUrl" ) ); + assertEquals( "+1", pom.getValue( "contributors[1]/timezone" ) ); + assertEquals( "yes", pom.getValue( "contributors[1]/properties/contributor" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "contributors[1]/roles" ) ).size() ); + assertEquals( "contrib", pom.getValue( "contributors[1]/roles[1]" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "mailingLists" ) ).size() ); + assertEquals( "project-mailing-list", pom.getValue( "mailingLists[1]/name" ) ); + assertEquals( "subscribe@", pom.getValue( "mailingLists[1]/subscribe" ) ); + assertEquals( "unsubscribe@", pom.getValue( "mailingLists[1]/unsubscribe" ) ); + assertEquals( "post@", pom.getValue( "mailingLists[1]/post" ) ); + assertEquals( "mail-archive", pom.getValue( "mailingLists[1]/archive" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "mailingLists[1]/otherArchives" ) ).size() ); + assertEquals( "other-archive", pom.getValue( "mailingLists[1]/otherArchives[1]" ) ); + + assertEquals( "2.0.1", pom.getValue( "prerequisites/maven" ) ); + + assertEquals( "http://project.url/trunk", pom.getValue( "scm/url" ) ); + assertEquals( "http://project.url/scm", pom.getValue( "scm/connection" ) ); + assertEquals( "https://project.url/scm", pom.getValue( "scm/developerConnection" ) ); + assertEquals( "TAG", pom.getValue( "scm/tag" ) ); + + assertEquals( "issues", pom.getValue( "issueManagement/system" ) ); + assertEquals( "http://project.url/issues", pom.getValue( "issueManagement/url" ) ); + + assertEquals( "ci", pom.getValue( "ciManagement/system" ) ); + assertEquals( "http://project.url/ci", pom.getValue( "ciManagement/url" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "ciManagement/notifiers" ) ).size() ); + assertEquals( "irc", pom.getValue( "ciManagement/notifiers[1]/type" ) ); + assertEquals( "ci@", pom.getValue( "ciManagement/notifiers[1]/address" ) ); + assertEquals( Boolean.TRUE, pom.getValue( "ciManagement/notifiers[1]/sendOnError" ) ); + assertEquals( Boolean.FALSE, pom.getValue( "ciManagement/notifiers[1]/sendOnFailure" ) ); + assertEquals( Boolean.FALSE, pom.getValue( "ciManagement/notifiers[1]/sendOnWarning" ) ); + assertEquals( Boolean.FALSE, pom.getValue( "ciManagement/notifiers[1]/sendOnSuccess" ) ); + assertEquals( "ci", pom.getValue( "ciManagement/notifiers[1]/configuration/ciProp" ) ); + + assertEquals( "project.distros", pom.getValue( "distributionManagement/repository/id" ) ); + assertEquals( "distros", pom.getValue( "distributionManagement/repository/name" ) ); + assertEquals( "http://project.url/dist", pom.getValue( "distributionManagement/repository/url" ) ); + assertEquals( Boolean.TRUE, pom.getValue( "distributionManagement/repository/uniqueVersion" ) ); + + assertEquals( "project.snaps", pom.getValue( "distributionManagement/snapshotRepository/id" ) ); + assertEquals( "snaps", pom.getValue( "distributionManagement/snapshotRepository/name" ) ); + assertEquals( "http://project.url/snaps", pom.getValue( "distributionManagement/snapshotRepository/url" ) ); + assertEquals( Boolean.FALSE, pom.getValue( "distributionManagement/snapshotRepository/uniqueVersion" ) ); + + assertEquals( "project.site", pom.getValue( "distributionManagement/site/id" ) ); + assertEquals( "docs", pom.getValue( "distributionManagement/site/name" ) ); + assertEquals( "http://project.url/site", pom.getValue( "distributionManagement/site/url" ) ); + + assertEquals( "http://project.url/download", pom.getValue( "distributionManagement/downloadUrl" ) ); + assertEquals( "reloc-gid", pom.getValue( "distributionManagement/relocation/groupId" ) ); + assertEquals( "reloc-aid", pom.getValue( "distributionManagement/relocation/artifactId" ) ); + assertEquals( "reloc-version", pom.getValue( "distributionManagement/relocation/version" ) ); + assertEquals( "project-reloc-msg", pom.getValue( "distributionManagement/relocation/message" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "modules" ) ).size() ); + assertEquals( "sub", pom.getValue( "modules[1]" ) ); + + assertEquals( 1, ( (Map<?, ?>) pom.getValue( "properties" ) ).size() ); + assertEquals( "project-property", pom.getValue( "properties[1]/itProperty" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "dependencyManagement/dependencies" ) ).size() ); + assertEquals( "org.apache.maven.its", pom.getValue( "dependencyManagement/dependencies[1]/groupId" ) ); + assertEquals( "managed-dep", pom.getValue( "dependencyManagement/dependencies[1]/artifactId" ) ); + assertEquals( "0.1", pom.getValue( "dependencyManagement/dependencies[1]/version" ) ); + assertEquals( "war", pom.getValue( "dependencyManagement/dependencies[1]/type" ) ); + assertEquals( "runtime", pom.getValue( "dependencyManagement/dependencies[1]/scope" ) ); + assertEquals( Boolean.FALSE, pom.getValue( "dependencyManagement/dependencies[1]/optional" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "dependencyManagement/dependencies[1]/exclusions" ) ).size() ); + assertEquals( "org.apache.maven.its", + pom.getValue( "dependencyManagement/dependencies[1]/exclusions[1]/groupId" ) ); + assertEquals( "excluded-managed-dep", + pom.getValue( "dependencyManagement/dependencies[1]/exclusions[1]/artifactId" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "dependencies" ) ).size() ); + assertEquals( "org.apache.maven.its", pom.getValue( "dependencies[1]/groupId" ) ); + assertEquals( "dep", pom.getValue( "dependencies[1]/artifactId" ) ); + assertEquals( "0.2", pom.getValue( "dependencies[1]/version" ) ); + assertEquals( "ejb", pom.getValue( "dependencies[1]/type" ) ); + assertEquals( "test", pom.getValue( "dependencies[1]/scope" ) ); + assertEquals( Boolean.TRUE, pom.getValue( "dependencies[1]/optional" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "dependencies[1]/exclusions" ) ).size() ); + assertEquals( "org.apache.maven.its", pom.getValue( "dependencies[1]/exclusions[1]/groupId" ) ); + assertEquals( "excluded-dep", pom.getValue( "dependencies[1]/exclusions[1]/artifactId" ) ); + + assertEquals( 2, ( (List<?>) pom.getValue( "repositories" ) ).size() ); + assertEquals( "project-remote-repo", pom.getValue( "repositories[1]/id" ) ); + assertEquals( "http://project.url/remote", pom.getValue( "repositories[1]/url" ) ); + assertEquals( "repo", pom.getValue( "repositories[1]/name" ) ); + assertEquals( RepositorySystem.DEFAULT_REMOTE_REPO_ID, pom.getValue( "repositories[2]/id" ) ); + assertEquals( RepositorySystem.DEFAULT_REMOTE_REPO_URL, pom.getValue( "repositories[2]/url" ) ); + + assertEquals( "test", pom.getValue( "build/defaultGoal" ) ); + assertEquals( "coreit", pom.getValue( "build/finalName" ) ); + + assertPathSuffixEquals( "build", pom.getValue( "build/directory" ) ); + assertPathSuffixEquals( "build/main", pom.getValue( "build/outputDirectory" ) ); + assertPathSuffixEquals( "build/test", pom.getValue( "build/testOutputDirectory" ) ); + assertPathSuffixEquals( "sources/main", pom.getValue( "build/sourceDirectory" ) ); + assertPathSuffixEquals( "sources/test", pom.getValue( "build/testSourceDirectory" ) ); + assertPathSuffixEquals( "sources/scripts", pom.getValue( "build/scriptSourceDirectory" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "build/filters" ) ).size() ); + assertPathSuffixEquals( "src/main/filter/it.properties", pom.getValue( "build/filters[1]" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "build/resources" ) ).size() ); + assertPathSuffixEquals( "res/main", pom.getValue( "build/resources[1]/directory" ) ); + assertPathSuffixEquals( "main", pom.getValue( "build/resources[1]/targetPath" ) ); + assertEquals( Boolean.TRUE, pom.getValue( "build/resources[1]/filtering" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/resources[1]/includes" ) ).size() ); + assertPathSuffixEquals( "main.included", pom.getValue( "build/resources[1]/includes[1]" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/resources[1]/excludes" ) ).size() ); + assertPathSuffixEquals( "main.excluded", pom.getValue( "build/resources[1]/excludes[1]" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "build/testResources" ) ).size() ); + assertPathSuffixEquals( "res/test", pom.getValue( "build/testResources[1]/directory" ) ); + assertPathSuffixEquals( "test", pom.getValue( "build/testResources[1]/targetPath" ) ); + assertEquals( Boolean.TRUE, pom.getValue( "build/testResources[1]/filtering" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/testResources[1]/includes" ) ).size() ); + assertPathSuffixEquals( "test.included", pom.getValue( "build/testResources[1]/includes[1]" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/testResources[1]/excludes" ) ).size() ); + assertPathSuffixEquals( "test.excluded", pom.getValue( "build/testResources[1]/excludes[1]" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "build/extensions" ) ).size() ); + assertEquals( "org.apache.maven.its.ext", pom.getValue( "build/extensions[1]/groupId" ) ); + assertEquals( "ext", pom.getValue( "build/extensions[1]/artifactId" ) ); + assertEquals( "3.0", pom.getValue( "build/extensions[1]/version" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins" ) ).size() ); + assertEquals( "org.apache.maven.its.plugins", pom.getValue( "build/plugins[1]/groupId" ) ); + assertEquals( "maven-it-plugin-build", pom.getValue( "build/plugins[1]/artifactId" ) ); + assertEquals( "2.1-SNAPSHOT", pom.getValue( "build/plugins[1]/version" ) ); + assertEquals( "test.properties", pom.getValue( "build/plugins[1]/configuration/outputFile" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() ); + assertEquals( "test", pom.getValue( "build/plugins[1]/executions[1]/id" ) ); + assertEquals( "validate", pom.getValue( "build/plugins[1]/executions[1]/phase" ) ); + assertEquals( "pom.properties", pom.getValue( "build/plugins[1]/executions[1]/configuration/outputFile" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/goals" ) ).size() ); + assertEquals( "eval", pom.getValue( "build/plugins[1]/executions[1]/goals[1]" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() ); + assertEquals( "org.apache.maven.its", pom.getValue( "build/plugins[1]/dependencies[1]/groupId" ) ); + assertEquals( "build-plugin-dep", pom.getValue( "build/plugins[1]/dependencies[1]/artifactId" ) ); + assertEquals( "0.3", pom.getValue( "build/plugins[1]/dependencies[1]/version" ) ); + assertEquals( "zip", pom.getValue( "build/plugins[1]/dependencies[1]/type" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies[1]/exclusions" ) ).size() ); + assertEquals( "org.apache.maven.its", pom.getValue( "build/plugins[1]/dependencies[1]/exclusions[1]/groupId" ) ); + assertEquals( "excluded-build-plugin-dep", + pom.getValue( "build/plugins[1]/dependencies[1]/exclusions[1]/artifactId" ) ); + + assertEquals( Boolean.TRUE, pom.getValue( "reporting/excludeDefaults" ) ); + assertPathSuffixEquals( "docs", pom.getValue( "reporting/outputDirectory" ) ); + + assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins" ) ).size() ); + assertEquals( "org.apache.maven.its.plugins", pom.getValue( "reporting/plugins[1]/groupId" ) ); + assertEquals( "maven-it-plugin-reporting", pom.getValue( "reporting/plugins[1]/artifactId" ) ); + assertEquals( "2.0-SNAPSHOT", pom.getValue( "reporting/plugins[1]/version" ) ); + assertEquals( "test.html", pom.getValue( "reporting/plugins[1]/configuration/outputFile" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins[1]/reportSets" ) ).size() ); + assertEquals( "it", pom.getValue( "reporting/plugins[1]/reportSets[1]/id" ) ); + assertEquals( "index.html", pom.getValue( "reporting/plugins[1]/reportSets[1]/configuration/outputFile" ) ); + assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins[1]/reportSets[1]/reports" ) ).size() ); + assertEquals( "run", pom.getValue( "reporting/plugins[1]/reportSets[1]/reports[1]" ) ); + } + + /* MNG-2309*/ + + public void testProfileInjectionOrder() + throws Exception + { + PomTestWrapper pom = + buildPom( "profile-injection-order", "pom-a", "pom-b", "pom-e", "pom-c", "pom-d" ); + assertEquals( "e", pom.getValue( "properties[1]/pomProperty" ) ); + } + + public void testPropertiesInheritance() + throws Exception + { + PomTestWrapper pom = buildPom( "properties-inheritance/sub" ); + assertEquals( "parent-property", pom.getValue( "properties/parentProperty" ) ); + assertEquals( "child-property", pom.getValue( "properties/childProperty" ) ); + assertEquals( "child-override", pom.getValue( "properties/overriddenProperty" ) ); + } + + /* MNG-4102*/ + public void testInheritedPropertiesInterpolatedWithValuesFromChildWithoutProfiles() + throws Exception + { + PomTestWrapper pom = buildPom( "inherited-properties-interpolation/no-profile/sub" ); + + assertEquals( "CHILD", pom.getValue( "properties/overridden" ) ); + assertEquals( "CHILD", pom.getValue( "properties/interpolated" ) ); + } + + /* MNG-4102 */ + public void testInheritedPropertiesInterpolatedWithValuesFromChildWithActiveProfiles() + throws Exception + { + PomTestWrapper pom = buildPom( "inherited-properties-interpolation/active-profile/sub" ); + + assertEquals( 1, pom.getMavenProject().getModel().getProfiles().size() ); + + buildPom( "inherited-properties-interpolation/active-profile/sub", "it-parent", "it-child" ); + assertEquals( "CHILD", pom.getValue( "properties/overridden" ) ); + assertEquals( "CHILD", pom.getValue( "properties/interpolated" ) ); + } + + /* MNG-3545 */ + public void testProfileDefaultActivation() + throws Exception + { + PomTestWrapper pom = buildPom( "profile-default-deactivation", "profile4" ); + assertEquals( 1, pom.getMavenProject().getActiveProfiles().size() ); + assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins" ) ).size() ); + assertEquals( "2.1", pom.getValue( "build/plugins[1]/version" ) ); + } + + /* MNG-1995 */ + public void testBooleanInterpolation() + throws Exception + { + PomTestWrapper pom = buildPom( "boolean-interpolation" ); + assertTrue ((Boolean) pom.getValue( "repositories[1]/releases/enabled" ) ); + assertTrue((Boolean) pom.getValue( "build/resources[1]/filtering" ) ); + } + + + /* MNG-3899 */ + public void testBuildExtensionInheritance() + throws Exception + { + PomTestWrapper pom = buildPom( "build-extension-inheritance/sub" ); + assertEquals( 3, ( (List<?>) pom.getValue( "build/extensions" ) ).size() ); + assertEquals( "b", pom.getValue( "build/extensions[1]/artifactId" ) ); + assertEquals( "a", pom.getValue( "build/extensions[2]/artifactId" ) ); + assertEquals( "0.2", pom.getValue( "build/extensions[2]/version" ) ); + assertEquals( "c", pom.getValue( "build/extensions[3]/artifactId" ) ); + } + + /*MNG-1957*/ + public void testJdkActivation() + throws Exception + { + Properties props = new Properties(); + props.put( "java.version", "1.5.0_15" ); + + PomTestWrapper pom = buildPom( "jdk-activation", props ); + assertEquals( 3, pom.getMavenProject().getActiveProfiles().size() ); + assertEquals( "PASSED", pom.getValue( "properties/jdkProperty3" ) ); + assertEquals( "PASSED", pom.getValue( "properties/jdkProperty2" ) ); + assertEquals( "PASSED", pom.getValue( "properties/jdkProperty1" ) ); + } + + /* MNG-2174 */ + public void testProfilePluginMngDependencies() + throws Exception + { + PomTestWrapper pom = buildPom( "profile-plugin-mng-dependencies/sub", "maven-core-it" ); + assertEquals( "a", pom.getValue( "build/plugins[1]/dependencies[1]/artifactId" ) ); + } + + /** MNG-4116 */ + public void testPercentEncodedUrlsMustNotBeDecoded() + throws Exception + { + PomTestWrapper pom = this.buildPom( "url-no-decoding" ); + assertEquals( "http://maven.apache.org/spacy%20path", pom.getValue( "url" ) ); + assertEquals( "http://svn.apache.org/viewvc/spacy%20path", pom.getValue( "scm/url" ) ); + assertEquals( "scm:svn:svn+ssh://svn.apache.org/spacy%20path", pom.getValue( "scm/connection" ) ); + assertEquals( "scm:svn:svn+ssh://svn.apache.org/spacy%20path", pom.getValue( "scm/developerConnection" ) ); + assertEquals( "http://issues.apache.org/spacy%20path", pom.getValue( "issueManagement/url" ) ); + assertEquals( "http://ci.apache.org/spacy%20path", pom.getValue( "ciManagement/url" ) ); + assertEquals( "scm:svn:svn+ssh://dist.apache.org/spacy%20path", + pom.getValue( "distributionManagement/repository/url" ) ); + assertEquals( "scm:svn:svn+ssh://snap.apache.org/spacy%20path", + pom.getValue( "distributionManagement/snapshotRepository/url" ) ); + assertEquals( "scm:svn:svn+ssh://site.apache.org/spacy%20path", + pom.getValue( "distributionManagement/site/url" ) ); + } + + public void testPluginManagementInheritance() + throws Exception + { + PomTestWrapper pom = this.buildPom( "plugin-management-inheritance" ); + assertEquals( "0.1-stub-SNAPSHOT", + pom.getValue( "build/pluginManagement/plugins[@artifactId='maven-compiler-plugin']/version" ) ); + } + + public void testProfilePlugins() + throws Exception + { + PomTestWrapper pom = this.buildPom( "profile-plugins", "standard" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins" ) ).size() ); + assertEquals( "maven-assembly2-plugin", pom.getValue( "build/plugins[2]/artifactId" ) ); + } + + public void testPluginInheritanceSimple() + throws Exception + { + PomTestWrapper pom = this.buildPom( "plugin-inheritance-simple/sub" ); + assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins" ) ).size() ); + } + + public void testPluginManagementDuplicate() + throws Exception + { + PomTestWrapper pom = this.buildPom( "plugin-management-duplicate/sub" ); + assertEquals( 12, ( (List<?>) pom.getValue( "build/pluginManagement/plugins" ) ).size() ); + } + + public void testDistributionManagement() + throws Exception + { + PomTestWrapper pom = this.buildPom( "distribution-management" ); + assertEquals( "legacy", pom.getValue( "distributionManagement/repository/layout" ) ); + } + + public void testDependencyScopeInheritance() + throws Exception + { + PomTestWrapper pom = buildPom( "dependency-scope-inheritance/sub" ); + String scope = (String) pom.getValue( "dependencies[1]/scope" ); + assertEquals( "compile", scope ); + } + + public void testDependencyScope() + throws Exception + { + buildPom( "dependency-scope/sub" ); + } + + //This will fail on a validation error if incorrect + public void testDependencyManagementWithInterpolation() + throws Exception + { + buildPom( "dependency-management-with-interpolation/sub" ); + } + + public void testInterpolationWithSystemProperty() + throws Exception + { + Properties sysProps = new Properties(); + sysProps.setProperty( "system.property", "PASSED" ); + PomTestWrapper pom = buildPom( "sytem-property-interpolation", sysProps ); + assertEquals( "PASSED", pom.getValue( "name" ) ); + } + + /* MNG-4129 */ + public void testPluginExecutionInheritanceWhenChildDoesNotDeclarePlugin() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-inheritance/wo-merge" ); + @SuppressWarnings( "unchecked" ) + List<PluginExecution> executions = + (List<PluginExecution>) pom.getValue( "build/pluginsAsMap[@name='org.apache.maven.its.plugins:maven-it-plugin-log-file']/executions" ); + assertEquals( 1, executions.size() ); + assertEquals( "inherited-execution", executions.get( 0 ).getId() ); + } + + public void testPluginExecutionInheritanceWhenChildDoesDeclarePluginAsWell() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-inheritance/w-merge" ); + @SuppressWarnings( "unchecked" ) + List<PluginExecution> executions = + (List<PluginExecution>) pom.getValue( "build/pluginsAsMap[@name='org.apache.maven.its.plugins:maven-it-plugin-log-file']/executions" ); + assertEquals( 1, executions.size() ); + assertEquals( "inherited-execution", executions.get( 0 ).getId() ); + } + + /* MNG-4193 */ + public void testValidationErrorUponNonUniqueArtifactRepositoryId() + throws Exception + { + try + { + buildPom( "unique-repo-id/artifact-repo" ); + fail( "Non-unique repository ids did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + /* MNG-4193 */ + public void testValidationErrorUponNonUniquePluginRepositoryId() + throws Exception + { + try + { + buildPom( "unique-repo-id/plugin-repo" ); + fail( "Non-unique repository ids did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + /* MNG-4193 */ + public void testValidationErrorUponNonUniqueArtifactRepositoryIdInProfile() + throws Exception + { + try + { + buildPom( "unique-repo-id/artifact-repo-in-profile" ); + fail( "Non-unique repository ids did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + /* MNG-4193 */ + public void testValidationErrorUponNonUniquePluginRepositoryIdInProfile() + throws Exception + { + try + { + buildPom( "unique-repo-id/plugin-repo-in-profile" ); + fail( "Non-unique repository ids did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + /** MNG-3843 */ + public void testPrerequisitesAreNotInherited() + throws Exception + { + PomTestWrapper pom = buildPom( "prerequisites-inheritance/child" ); + assertSame( null, pom.getValue( "prerequisites" ) ); + } + + public void testLicensesAreInheritedButNotAggregated() + throws Exception + { + PomTestWrapper pom = buildPom( "licenses-inheritance/child-2" ); + assertEquals( 1, ( (List<?>) pom.getValue( "licenses" ) ).size() ); + assertEquals( "child-license", pom.getValue( "licenses[1]/name" ) ); + assertEquals( "http://child.url/license", pom.getValue( "licenses[1]/url" ) ); + } + + public void testDevelopersAreInheritedButNotAggregated() + throws Exception + { + PomTestWrapper pom = buildPom( "developers-inheritance/child-2" ); + assertEquals( 1, ( (List<?>) pom.getValue( "developers" ) ).size() ); + assertEquals( "child-developer", pom.getValue( "developers[1]/name" ) ); + } + + public void testContributorsAreInheritedButNotAggregated() + throws Exception + { + PomTestWrapper pom = buildPom( "contributors-inheritance/child-2" ); + assertEquals( 1, ( (List<?>) pom.getValue( "contributors" ) ).size() ); + assertEquals( "child-contributor", pom.getValue( "contributors[1]/name" ) ); + } + + public void testMailingListsAreInheritedButNotAggregated() + throws Exception + { + PomTestWrapper pom = buildPom( "mailing-lists-inheritance/child-2" ); + assertEquals( 1, ( (List<?>) pom.getValue( "mailingLists" ) ).size() ); + assertEquals( "child-mailing-list", pom.getValue( "mailingLists[1]/name" ) ); + } + + public void testPluginInheritanceOrder() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-inheritance-order/child" ); + + assertEquals( "maven-it-plugin-log-file", pom.getValue( "build/plugins[1]/artifactId" ) ); + assertEquals( "maven-it-plugin-expression", pom.getValue( "build/plugins[2]/artifactId" ) ); + assertEquals( "maven-it-plugin-configuration", pom.getValue( "build/plugins[3]/artifactId" ) ); + + assertEquals( "maven-it-plugin-log-file", pom.getValue( "reporting/plugins[1]/artifactId" ) ); + assertEquals( "maven-it-plugin-expression", pom.getValue( "reporting/plugins[2]/artifactId" ) ); + assertEquals( "maven-it-plugin-configuration", pom.getValue( "reporting/plugins[3]/artifactId" ) ); + } + + public void testCliPropsDominateProjectPropsDuringInterpolation() + throws Exception + { + Properties props = new Properties(); + props.setProperty( "testProperty", "PASSED" ); + PomTestWrapper pom = buildPom( "interpolation-cli-wins", props ); + + assertEquals( "PASSED", pom.getValue( "properties/interpolatedProperty" ) ); + } + + public void testParentPomPackagingMustBePom() + throws Exception + { + try + { + buildPom( "parent-pom-packaging/sub" ); + fail( "Wrong packaging of parent POM was not rejected" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + /** MNG-522, MNG-3018 */ + public void testManagedPluginConfigurationAppliesToImplicitPluginsIntroducedByPackaging() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-management-for-implicit-plugin/child" ); + assertEquals( "passed.txt", + pom.getValue( "build/plugins[@artifactId='maven-resources-plugin']/configuration/pathname" ) ); + assertEquals( "passed.txt", + pom.getValue( "build/plugins[@artifactId='maven-it-plugin-log-file']/configuration/logFile" ) ); + } + + public void testDefaultPluginsExecutionContributedByPackagingExecuteBeforeUserDefinedExecutions() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-order-and-default-exec" ); + @SuppressWarnings( "unchecked" ) + List<PluginExecution> executions = + (List<PluginExecution>) pom.getValue( "build/plugins[@artifactId='maven-resources-plugin']/executions" ); + assertNotNull( executions ); + assertEquals( 4, executions.size() ); + assertEquals( "default-resources", executions.get( 0 ).getId() ); + assertEquals( "default-testResources", executions.get( 1 ).getId() ); + assertEquals( "test-1", executions.get( 2 ).getId() ); + assertEquals( "test-2", executions.get( 3 ).getId() ); + } + + public void testPluginDeclarationsRetainPomOrderAfterInjectionOfDefaultPlugins() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-exec-order-with-lifecycle" ); + @SuppressWarnings( "unchecked" ) + List<Plugin> plugins = (List<Plugin>) pom.getValue( "build/plugins" ); + int resourcesPlugin = -1; + int customPlugin = -1; + for ( int i = 0; i < plugins.size(); i++ ) + { + Plugin plugin = plugins.get( i ); + if ( "maven-resources-plugin".equals( plugin.getArtifactId() ) ) + { + assertTrue( resourcesPlugin < 0 ); + resourcesPlugin = i; + } + else if ( "maven-it-plugin-log-file".equals( plugin.getArtifactId() ) ) + { + assertTrue( customPlugin < 0 ); + customPlugin = i; + } + } + assertTrue( plugins.toString(), customPlugin == resourcesPlugin - 1 ); + } + + /** MNG-4415 */ + public void testPluginOrderAfterMergingWithInheritedPlugins() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-inheritance-merge-order/sub" ); + + List<String> expected = new ArrayList<String>(); + expected.add( "maven-it-plugin-error" ); + expected.add( "maven-it-plugin-configuration" ); + expected.add( "maven-it-plugin-dependency-resolution" ); + expected.add( "maven-it-plugin-packaging" ); + expected.add( "maven-it-plugin-log-file" ); + expected.add( "maven-it-plugin-expression" ); + expected.add( "maven-it-plugin-fork" ); + expected.add( "maven-it-plugin-touch" ); + + List<String> actual = new ArrayList<String>(); + @SuppressWarnings( "unchecked" ) + List<Plugin> plugins = (List<Plugin>) pom.getValue( "build/plugins" ); + for ( Plugin plugin : plugins ) + { + actual.add( plugin.getArtifactId() ); + } + + actual.retainAll( expected ); + + assertEquals( actual, expected ); + } + + /** MNG-4416 */ + public void testPluginOrderAfterMergingWithInjectedPlugins() + throws Exception + { + PomTestWrapper pom = buildPom( "plugin-injection-merge-order" ); + + List<String> expected = new ArrayList<String>(); + expected.add( "maven-it-plugin-error" ); + expected.add( "maven-it-plugin-configuration" ); + expected.add( "maven-it-plugin-dependency-resolution" ); + expected.add( "maven-it-plugin-packaging" ); + expected.add( "maven-it-plugin-log-file" ); + expected.add( "maven-it-plugin-expression" ); + expected.add( "maven-it-plugin-fork" ); + expected.add( "maven-it-plugin-touch" ); + + List<String> actual = new ArrayList<String>(); + @SuppressWarnings( "unchecked" ) + List<Plugin> plugins = (List<Plugin>) pom.getValue( "build/plugins" ); + for ( Plugin plugin : plugins ) + { + actual.add( plugin.getArtifactId() ); + } + + actual.retainAll( expected ); + + assertEquals( actual, expected ); + } + + public void testProjectArtifactIdIsNotInheritedButMandatory() + throws Exception + { + try + { + buildPom( "artifact-id-inheritance/child" ); + fail( "Missing artifactId did not cause validation error" ); + } + catch ( ProjectBuildingException e ) + { + // expected + } + } + + private void assertPathSuffixEquals( String expected, Object actual ) + { + String a = actual.toString(); + a = a.substring( a.length() - expected.length() ).replace( '\\', '/' ); + assertEquals( expected, a ); + } + + private void assertPathWithNormalizedFileSeparators( Object value ) + { + assertEquals( new File( value.toString() ).getPath(), value.toString() ); + } + + private PomTestWrapper buildPom( String pomPath, String... profileIds ) + throws Exception + { + return buildPom( pomPath, null, profileIds ); + } + + private PomTestWrapper buildPom( String pomPath, Properties executionProperties, String... profileIds ) + throws Exception + { + return buildPom( pomPath, false, executionProperties, profileIds ); + } + + private PomTestWrapper buildPom( String pomPath, boolean lenientValidation, Properties executionProperties, + String... profileIds ) + throws Exception + { + File pomFile = new File( testDirectory, pomPath ); + if ( pomFile.isDirectory() ) + { + pomFile = new File( pomFile, "pom.xml" ); + } + + ProjectBuildingRequest config = new DefaultProjectBuildingRequest(); + + String localRepoUrl = + System.getProperty( "maven.repo.local", System.getProperty( "user.home" ) + "/.m2/repository" ); + localRepoUrl = "file://" + localRepoUrl; + config.setLocalRepository( repositorySystem.createArtifactRepository( "local", localRepoUrl, new DefaultRepositoryLayout(), null, null ) ); + config.setActiveProfileIds( Arrays.asList( profileIds ) ); + config.setSystemProperties( executionProperties ); + config.setUserProperties( executionProperties ); + config.setValidationLevel( lenientValidation ? ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 + : ModelBuildingRequest.VALIDATION_LEVEL_STRICT ); + + DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession(); + LocalRepository localRepo = new LocalRepository( config.getLocalRepository().getBasedir() ); + repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repoSession, localRepo ) ); + config.setRepositorySession( repoSession ); + + return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() ); + } + + protected void assertModelEquals( PomTestWrapper pom, Object expected, String expression ) + { + assertEquals( expected, pom.getValue( expression ) ); + } + + private static String createPath( List<String> elements ) + { + StringBuilder buffer = new StringBuilder( 256 ); + for ( String s : elements ) + { + buffer.append( s ).append( File.separator ); + } + return buffer.toString().substring( 0, buffer.toString().length() - 1 ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java new file mode 100644 index 00000000..5511cb1a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java @@ -0,0 +1,87 @@ +package org.apache.maven.project; + +/* + * 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.File; +import java.util.Properties; + +import org.apache.maven.AbstractCoreMavenComponentTestCase; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.building.FileModelSource; +import org.apache.maven.model.building.ModelSource; + +public class ProjectBuilderTest + extends AbstractCoreMavenComponentTestCase +{ + protected String getProjectsDirectory() + { + return "src/test/projects/project-builder"; + } + + public void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() + throws Exception + { + File pom = getProject( "it0063" ); + + Properties eps = new Properties(); + eps.setProperty( "jre.home", new File( pom.getParentFile(), "jdk/jre" ).getPath() ); + + MavenSession session = createMavenSession( pom, eps ); + MavenProject project = session.getCurrentProject(); + + // Here we will actually not have any artifacts because the ProjectDependenciesResolver is not involved here. So + // right now it's not valid to ask for artifacts unless plugins require the artifacts. + + project.getCompileClasspathElements(); + } + + public void testBuildFromModelSource() + throws Exception + { + File pomFile = new File( "src/test/resources/projects/modelsource/module01/pom.xml" ); + MavenSession mavenSession = createMavenSession( pomFile ); + ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); + configuration.setRepositorySession( mavenSession.getRepositorySession() ); + ModelSource modelSource = new FileModelSource( pomFile ); + ProjectBuildingResult result = + lookup( org.apache.maven.project.ProjectBuilder.class ).build( modelSource, configuration ); + + assertNotNull( result.getProject().getParentFile() ); + } + + public void testVersionlessManagedDependency() + throws Exception + { + File pomFile = new File( "src/test/resources/projects/versionless-managed-dependency.xml" ); + MavenSession mavenSession = createMavenSession( null ); + ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); + configuration.setRepositorySession( mavenSession.getRepositorySession() ); + + try + { + lookup( org.apache.maven.project.ProjectBuilder.class ).build( pomFile, configuration ); + fail(); + } + catch ( ProjectBuildingException e ) + { + // this is expected + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java new file mode 100644 index 00000000..5cb45279 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/ProjectSorterTest.java @@ -0,0 +1,363 @@ +package org.apache.maven.project; + +/* + * 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.ArrayList; +import java.util.Collections; +import java.util.List; + +import junit.framework.TestCase; + +import org.apache.maven.model.Build; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Extension; +import org.apache.maven.model.Model; +import org.apache.maven.model.Parent; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginManagement; +import org.codehaus.plexus.util.dag.CycleDetectedException; + +/** + * Test sorting projects by dependencies. + * + * @author <a href="mailto:brett@apache.org">Brett Porter</a> + */ +public class ProjectSorterTest + extends TestCase +{ + + private Parent createParent( MavenProject project ) + { + return createParent( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + } + + private Parent createParent( String groupId, String artifactId, String version ) + { + Parent plugin = new Parent(); + plugin.setGroupId( groupId ); + plugin.setArtifactId( artifactId ); + plugin.setVersion( version ); + return plugin; + } + + private Dependency createDependency( MavenProject project ) + { + return createDependency( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + } + + private Dependency createDependency( String groupId, String artifactId, String version ) + { + Dependency depdendency = new Dependency(); + depdendency.setGroupId( groupId ); + depdendency.setArtifactId( artifactId ); + depdendency.setVersion( version ); + return depdendency; + } + + private Plugin createPlugin( MavenProject project ) + { + return createPlugin( project.getGroupId(), project.getArtifactId(), project.getVersion() ); + } + + private Plugin createPlugin( String groupId, String artifactId, String version ) + { + Plugin plugin = new Plugin(); + plugin.setGroupId( groupId ); + plugin.setArtifactId( artifactId ); + plugin.setVersion( version ); + return plugin; + } + + private Extension createExtension( String groupId, String artifactId, String version ) + { + Extension extension = new Extension(); + extension.setGroupId( groupId ); + extension.setArtifactId( artifactId ); + extension.setVersion( version ); + return extension; + } + + private static MavenProject createProject( String groupId, String artifactId, String version ) + { + Model model = new Model(); + model.setGroupId( groupId ); + model.setArtifactId( artifactId ); + model.setVersion( version ); + model.setBuild( new Build() ); + return new MavenProject( model ); + } + + public void testShouldNotFailWhenPluginDepReferencesCurrentProject() + throws CycleDetectedException, DuplicateProjectException + { + MavenProject project = createProject( "group", "artifact", "1.0" ); + + Build build = project.getModel().getBuild(); + + Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" ); + + Dependency dep = createDependency( "group", "artifact", "1.0" ); + + plugin.addDependency( dep ); + + build.addPlugin( plugin ); + + new ProjectSorter( Collections.singletonList( project ) ); + } + + public void testShouldNotFailWhenManagedPluginDepReferencesCurrentProject() + throws CycleDetectedException, DuplicateProjectException + { + MavenProject project = createProject( "group", "artifact", "1.0" ); + + Build build = project.getModel().getBuild(); + + PluginManagement pMgmt = new PluginManagement(); + + Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" ); + + Dependency dep = createDependency( "group", "artifact", "1.0" ); + + plugin.addDependency( dep ); + + pMgmt.addPlugin( plugin ); + + build.setPluginManagement( pMgmt ); + + new ProjectSorter( Collections.singletonList( project ) ); + } + + public void testShouldNotFailWhenProjectReferencesNonExistentProject() + throws CycleDetectedException, DuplicateProjectException + { + MavenProject project = createProject( "group", "artifact", "1.0" ); + + Build build = project.getModel().getBuild(); + + Extension extension = createExtension( "other.group", "other-artifact", "1.0" ); + + build.addExtension( extension ); + + new ProjectSorter( Collections.singletonList( project ) ); + } + + public void testMatchingArtifactIdsDifferentGroupIds() + throws CycleDetectedException, DuplicateProjectException + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + MavenProject project1 = createProject( "groupId1", "artifactId", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId2", "artifactId", "1.0" ); + projects.add( project2 ); + project1.getDependencies().add( createDependency( project2 ) ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + + assertEquals( project2, projects.get( 0 ) ); + assertEquals( project1, projects.get( 1 ) ); + } + + public void testMatchingGroupIdsDifferentArtifactIds() + throws CycleDetectedException, DuplicateProjectException + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + MavenProject project1 = createProject( "groupId", "artifactId1", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId", "artifactId2", "1.0" ); + projects.add( project2 ); + project1.getDependencies().add( createDependency( project2 ) ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + + assertEquals( project2, projects.get( 0 ) ); + assertEquals( project1, projects.get( 1 ) ); + } + + public void testMatchingIdsAndVersions() + throws CycleDetectedException + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + MavenProject project1 = createProject( "groupId", "artifactId", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId", "artifactId", "1.0" ); + projects.add( project2 ); + + try + { + projects = new ProjectSorter( projects ).getSortedProjects(); + fail( "Duplicate projects should fail" ); + } + catch ( DuplicateProjectException e ) + { + // expected + assertTrue( true ); + } + } + + public void testMatchingIdsAndDifferentVersions() + throws CycleDetectedException, DuplicateProjectException + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + MavenProject project1 = createProject( "groupId", "artifactId", "1.0" ); + projects.add( project1 ); + MavenProject project2 = createProject( "groupId", "artifactId", "2.0" ); + projects.add( project2 ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + assertEquals( project1, projects.get( 0 ) ); + assertEquals( project2, projects.get( 1 ) ); + } + + public void testPluginDependenciesInfluenceSorting() + throws Exception + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + + MavenProject parentProject = createProject( "groupId", "parent", "1.0" ); + projects.add( parentProject ); + + MavenProject declaringProject = createProject( "groupId", "declarer", "1.0" ); + declaringProject.setParent( parentProject ); + declaringProject.getModel().setParent( createParent( parentProject ) ); + projects.add( declaringProject ); + + MavenProject pluginLevelDepProject = createProject( "groupId", "plugin-level-dep", "1.0" ); + pluginLevelDepProject.setParent( parentProject ); + pluginLevelDepProject.getModel().setParent( createParent( parentProject ) ); + projects.add( pluginLevelDepProject ); + + MavenProject pluginProject = createProject( "groupId", "plugin", "1.0" ); + pluginProject.setParent( parentProject ); + pluginProject.getModel().setParent( createParent( parentProject ) ); + projects.add( pluginProject ); + + Plugin plugin = createPlugin( pluginProject ); + + plugin.addDependency( createDependency( pluginLevelDepProject ) ); + + Build build = declaringProject.getModel().getBuild(); + + build.addPlugin( plugin ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + + assertEquals( parentProject, projects.get( 0 ) ); + + // the order of these two is non-deterministic, based on when they're added to the reactor. + assertTrue( projects.contains( pluginProject ) ); + assertTrue( projects.contains( pluginLevelDepProject ) ); + + // the declaring project MUST be listed after the plugin and its plugin-level dep, though. + assertEquals( declaringProject, projects.get( 3 ) ); + } + + public void testPluginDependenciesInfluenceSorting_DeclarationInParent() + throws Exception + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + + MavenProject parentProject = createProject( "groupId", "parent-declarer", "1.0" ); + projects.add( parentProject ); + + MavenProject pluginProject = createProject( "groupId", "plugin", "1.0" ); + pluginProject.setParent( parentProject ); + pluginProject.getModel().setParent( createParent( parentProject ) ); + projects.add( pluginProject ); + + MavenProject pluginLevelDepProject = createProject( "groupId", "plugin-level-dep", "1.0" ); + pluginLevelDepProject.setParent( parentProject ); + pluginLevelDepProject.getModel().setParent( createParent( parentProject ) ); + projects.add( pluginLevelDepProject ); + + Plugin plugin = createPlugin( pluginProject ); + + plugin.addDependency( createDependency( pluginLevelDepProject ) ); + + Build build = parentProject.getModel().getBuild(); + + build.addPlugin( plugin ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + + System.out.println( projects ); + + assertEquals( parentProject, projects.get( 0 ) ); + + // the order of these two is non-deterministic, based on when they're added to the reactor. + assertTrue( projects.contains( pluginProject ) ); + assertTrue( projects.contains( pluginLevelDepProject ) ); + } + + public void testPluginVersionsAreConsidered() + throws Exception + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + + MavenProject pluginProjectA = createProject( "group", "plugin-a", "2.0-SNAPSHOT" ); + projects.add( pluginProjectA ); + pluginProjectA.getModel().getBuild().addPlugin( createPlugin( "group", "plugin-b", "1.0" ) ); + + MavenProject pluginProjectB = createProject( "group", "plugin-b", "2.0-SNAPSHOT" ); + projects.add( pluginProjectB ); + pluginProjectB.getModel().getBuild().addPlugin( createPlugin( "group", "plugin-a", "1.0" ) ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + + assertTrue( projects.contains( pluginProjectA ) ); + assertTrue( projects.contains( pluginProjectB ) ); + } + + public void testDependencyPrecedesProjectThatUsesSpecificDependencyVersion() + throws Exception + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + + MavenProject usingProject = createProject( "group", "project", "1.0" ); + projects.add( usingProject ); + usingProject.getModel().addDependency( createDependency( "group", "dependency", "1.0" ) ); + + MavenProject pluginProject = createProject( "group", "dependency", "1.0" ); + projects.add( pluginProject ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + + assertEquals( pluginProject, projects.get( 0 ) ); + assertEquals( usingProject, projects.get( 1 ) ); + } + + public void testDependencyPrecedesProjectThatUsesUnresolvedDependencyVersion() + throws Exception + { + List<MavenProject> projects = new ArrayList<MavenProject>(); + + MavenProject usingProject = createProject( "group", "project", "1.0" ); + projects.add( usingProject ); + usingProject.getModel().addDependency( createDependency( "group", "dependency", "[1.0,)" ) ); + + MavenProject pluginProject = createProject( "group", "dependency", "1.0" ); + projects.add( pluginProject ); + + projects = new ProjectSorter( projects ).getSortedProjects(); + + assertEquals( pluginProject, projects.get( 0 ) ); + assertEquals( usingProject, projects.get( 1 ) ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/TestMetadataSource.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/TestMetadataSource.java new file mode 100644 index 00000000..67c0037b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/TestMetadataSource.java @@ -0,0 +1,51 @@ +package org.apache.maven.project; + +/* + * 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.artifact.Artifact; +import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.artifact.metadata.ResolutionGroup; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.project.artifact.MavenMetadataSource; +import org.codehaus.plexus.component.annotations.Component; + +@SuppressWarnings( "deprecation" ) +@Component( role = ArtifactMetadataSource.class, hint = "classpath" ) +public class TestMetadataSource + extends MavenMetadataSource +{ + @Override + public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, + List<ArtifactRepository> remoteRepositories ) + throws ArtifactMetadataRetrievalException + { + ResolutionGroup rg = super.retrieve( artifact, localRepository, remoteRepositories ); + + for ( Artifact a : rg.getArtifacts() ) + { + a.setResolved( true ); + } + + return rg; + } +}
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java new file mode 100644 index 00000000..6b103b2c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java @@ -0,0 +1,81 @@ +package org.apache.maven.project.artifact; + +/* + * 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.Collections; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; +import org.apache.maven.project.artifact.DefaultMavenMetadataCache.CacheKey; +import org.apache.maven.repository.DelegatingLocalArtifactRepository; +import org.apache.maven.repository.RepositorySystem; +import org.codehaus.plexus.PlexusTestCase; + +/** + * @author Igor Fedorenko + */ +public class DefaultMavenMetadataCacheTest + extends PlexusTestCase +{ + private RepositorySystem repositorySystem; + + protected void setUp() + throws Exception + { + super.setUp(); + repositorySystem = lookup( RepositorySystem.class ); + } + + @Override + protected void tearDown() + throws Exception + { + repositorySystem = null; + super.tearDown(); + } + + public void testCacheKey() + throws Exception + { + Artifact a1 = repositorySystem.createArtifact( "testGroup", "testArtifact", "1.2.3", "jar" ); + @SuppressWarnings( "deprecation" ) + ArtifactRepository lr1 = new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() ); + ArtifactRepository rr1 = repositorySystem.createDefaultRemoteRepository(); + a1.setDependencyFilter( new ExcludesArtifactFilter( Arrays.asList( "foo" ) ) ); + + Artifact a2 = repositorySystem.createArtifact( "testGroup", "testArtifact", "1.2.3", "jar" ); + @SuppressWarnings( "deprecation" ) + ArtifactRepository lr2 = new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() ); + ArtifactRepository rr2 = repositorySystem.createDefaultRemoteRepository(); + a2.setDependencyFilter( new ExcludesArtifactFilter( Arrays.asList( "foo" ) ) ); + + // sanity checks + assertNotSame( a1, a2 ); + assertNotSame( lr1, lr2 ); + assertNotSame( rr1, rr2 ); + + CacheKey k1 = new CacheKey( a1, false, lr1, Collections.singletonList( rr1 ) ); + CacheKey k2 = new CacheKey( a2, false, lr2, Collections.singletonList( rr2 ) ); + + assertEquals(k1.hashCode(), k2.hashCode()); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java new file mode 100644 index 00000000..9c770da9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java @@ -0,0 +1,183 @@ +package org.apache.maven.project.artifact; + +/* + * 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.repository.RepositorySystem; +import org.codehaus.plexus.PlexusTestCase; + +public class MavenMetadataSourceTest + extends PlexusTestCase +{ + private RepositorySystem repositorySystem; + + protected void setUp() + throws Exception + { + super.setUp(); + repositorySystem = lookup( RepositorySystem.class ); + } + + @Override + protected void tearDown() + throws Exception + { + repositorySystem = null; + super.tearDown(); + } + + public void testShouldNotCarryExclusionsOverFromDependencyToDependency() + throws Exception + { + /* + Dependency dep1 = new Dependency(); + dep1.setGroupId( "test" ); + dep1.setArtifactId( "test-artifact" ); + dep1.setVersion( "1" ); + dep1.setType( "jar" ); + + Exclusion exc = new Exclusion(); + exc.setGroupId( "test" ); + exc.setArtifactId( "test-artifact3" ); + + dep1.addExclusion( exc ); + + Dependency dep2 = new Dependency(); + dep2.setGroupId( "test" ); + dep2.setArtifactId( "test-artifact2" ); + dep2.setVersion( "1" ); + dep2.setType( "jar" ); + + List deps = new ArrayList(); + deps.add( dep1 ); + deps.add( dep2 ); + + ArtifactFactory factory = lookup( ArtifactFactory.class ); + + ArtifactFilter dependencyFilter = new ScopeArtifactFilter( Artifact.SCOPE_COMPILE ); + + MavenProject project = new MavenProject( new Model() ); + + Set result = project.createArtifacts( dependencyFilter ); + + for ( Iterator it = result.iterator(); it.hasNext(); ) + { + Artifact artifact = ( Artifact ) it.next(); + + if ( "test-artifact2".equals( artifact.getArtifactId() ) ) + { + ArtifactFilter filter = artifact.getDependencyFilter(); + + assertSame( dependencyFilter, filter ); + } + } + */ + } + + //TODO: restore these if it makes sense + /* + public void testShouldUseCompileScopeIfDependencyScopeEmpty() + throws Exception + { + String groupId = "org.apache.maven"; + String artifactId = "maven-model"; + + Dependency dep = new Dependency(); + + dep.setGroupId( groupId ); + dep.setArtifactId( artifactId ); + dep.setVersion( "2.0-alpha-3" ); + + Model model = new Model(); + + model.addDependency( dep ); + + MavenProject project = new MavenProject( model, repositorySystem ); + + project.setArtifacts( project.createArtifacts( null ) ); + + String key = ArtifactUtils.versionlessKey( groupId, artifactId ); + + Map artifactMap = project.getArtifactMap(); + + assertNotNull( "artifact-map should not be null.", artifactMap ); + assertEquals( "artifact-map should contain 1 element.", 1, artifactMap.size() ); + + Artifact artifact = (Artifact) artifactMap.get( key ); + + assertNotNull( "dependency artifact not found in map.", artifact ); + assertEquals( "dependency artifact has wrong scope.", Artifact.SCOPE_COMPILE, artifact.getScope() ); + + //check for back-propagation of default scope. + assertEquals( "default scope NOT back-propagated to dependency.", Artifact.SCOPE_COMPILE, dep.getScope() ); + } + + public void testShouldUseInjectedTestScopeFromDependencyManagement() + throws Exception + { + String groupId = "org.apache.maven"; + String artifactId = "maven-model"; + + Dependency dep = new Dependency(); + + dep.setGroupId( groupId ); + dep.setArtifactId( artifactId ); + dep.setVersion( "2.0-alpha-3" ); + + Model model = new Model(); + + model.addDependency( dep ); + + Dependency mgd = new Dependency(); + mgd.setGroupId( groupId ); + mgd.setArtifactId( artifactId ); + mgd.setScope( Artifact.SCOPE_TEST ); + + DependencyManagement depMgmt = new DependencyManagement(); + + depMgmt.addDependency( mgd ); + + model.setDependencyManagement( depMgmt ); + + MavenProject project = new MavenProject( model, repositorySystem ); + + TestModelDefaultsInjector injector = new TestModelDefaultsInjector(); + + injector.injectDefaults( model ); + + project.setArtifacts( project.createArtifacts( null ) ); + + String key = ArtifactUtils.versionlessKey( groupId, artifactId ); + + Map artifactMap = project.getArtifactMap(); + + assertNotNull( "artifact-map should not be null.", artifactMap ); + assertEquals( "artifact-map should contain 1 element.", 1, artifactMap.size() ); + + Artifact artifact = (Artifact) artifactMap.get( key ); + + assertNotNull( "dependency artifact not found in map.", artifact ); + assertEquals( "dependency artifact has wrong scope.", Artifact.SCOPE_TEST, artifact.getScope() ); + + //check for back-propagation of default scope. + assertEquals( "default scope NOT back-propagated to dependency.", Artifact.SCOPE_TEST, dep.getScope() ); + } + */ + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java new file mode 100644 index 00000000..8b6454da --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java @@ -0,0 +1,101 @@ +package org.apache.maven.project.canonical; + +/* + * 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.File; +import java.util.List; + +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; +import org.apache.maven.project.AbstractMavenProjectTestCase; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * @author Jason van Zyl + */ +public class CanonicalProjectBuilderTest + extends AbstractMavenProjectTestCase +{ + public void testProjectBuilder() + throws Exception + { + File f = getFileForClasspathResource( "canonical-pom.xml" ); + + MavenProject project = getProject( f ); + + // ---------------------------------------------------------------------- + // Top-level elements + // ---------------------------------------------------------------------- + + assertEquals( "4.0.0", project.getModelVersion() ); + + // ---------------------------------------------------------------------- + // Plugins + // ---------------------------------------------------------------------- + + List<Plugin> plugins = project.getBuildPlugins(); + + // Plugin0 [plexus] + + String key = "org.apache.maven.plugins:maven-plexus-plugin"; + + Plugin plugin = null; + for ( Plugin check : plugins ) + { + if ( key.equals( check.getKey() ) ) + { + plugin = check; + break; + } + } + + assertNotNull( plugin ); + + assertEquals( "1.0", plugin.getVersion() ); + + Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration(); + + assertEquals( "src/conf/plexus.conf", configuration.getChild( "plexusConfiguration" ).getValue() ); + + assertEquals( "src/conf/plexus.properties", + configuration.getChild( "plexusConfigurationPropertiesFile" ).getValue() ); + + assertEquals( "Continuum", configuration.getChild( "plexusApplicationName" ).getValue() ); + + // ---------------------------------------------------------------------- + // Goal specific configuration + // ---------------------------------------------------------------------- + + List<PluginExecution> executions = plugin.getExecutions(); + + PluginExecution execution = executions.get( 0 ); + + String g0 = execution.getGoals().get( 0 ); + + assertEquals( "plexus:runtime", g0 ); + + configuration = (Xpp3Dom) execution.getConfiguration(); + + assertEquals( "ContinuumPro", configuration.getChild( "plexusApplicationName" ).getValue() ); + + // Plugin1 [antlr] + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/PomTestWrapper.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/PomTestWrapper.java new file mode 100644 index 00000000..c204140a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/PomTestWrapper.java @@ -0,0 +1,121 @@ +package org.apache.maven.project.harness; + +/* + * 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.File; +import java.util.Iterator; + +import org.apache.commons.jxpath.JXPathContext; +import org.apache.commons.jxpath.JXPathNotFoundException; +import org.apache.commons.jxpath.ri.JXPathContextReferenceImpl; +import org.apache.maven.project.MavenProject; + +public class PomTestWrapper +{ + + private File pomFile; + + private JXPathContext context; + + private MavenProject mavenProject; + + static + { + JXPathContextReferenceImpl.addNodePointerFactory( new Xpp3DomPointerFactory() ); + } + + public PomTestWrapper( File pomFile, MavenProject mavenProject ) + { + if ( mavenProject == null ) + { + throw new IllegalArgumentException( "mavenProject: null" ); + } + this.mavenProject = mavenProject; + this.pomFile = pomFile; + context = JXPathContext.newContext( mavenProject.getModel() ); + } + + public PomTestWrapper( MavenProject mavenProject ) + { + if ( mavenProject == null ) + { + throw new IllegalArgumentException( "mavenProject: null" ); + } + this.mavenProject = mavenProject; + context = JXPathContext.newContext( mavenProject.getModel() ); + } + + public MavenProject getMavenProject() + { + return mavenProject; + } + + public File getBasedir() + { + return ( pomFile != null ) ? pomFile.getParentFile() : null; + } + + public void setValueOnModel( String expression, Object value ) + { + context.setValue( expression, value ); + } + + /* + public int containerCountForUri( String uri ) + throws IOException + { + if ( uri == null || uri.trim().equals( "" ) ) + { + throw new IllegalArgumentException( "uri: null or empty" ); + } + ModelDataSource source = new DefaultModelDataSource(); + source.init( domainModel.getModelProperties(), null ); + return source.queryFor( uri ).size(); + } + */ + + public Iterator<?> getIteratorForXPathExpression( String expression ) + { + return context.iterate( expression ); + } + + public boolean containsXPathExpression( String expression ) + { + return context.getValue( expression ) != null; + } + + public Object getValue( String expression ) + { + try + { + return context.getValue( expression ); + } + catch ( JXPathNotFoundException e ) + { + return null; + } + } + + public boolean xPathExpressionEqualsValue( String expression, String value ) + { + return context.getValue( expression ) != null && context.getValue( expression ).equals( value ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomAttributeIterator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomAttributeIterator.java new file mode 100644 index 00000000..2811a848 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomAttributeIterator.java @@ -0,0 +1,89 @@ +package org.apache.maven.project.harness; + +/* + * 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.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.jxpath.ri.QName; +import org.apache.commons.jxpath.ri.model.NodeIterator; +import org.apache.commons.jxpath.ri.model.NodePointer; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * An attribute iterator for JXPath to support <code>Xpp3Dom</code>. + * + * @author Benjamin Bentmann + */ +class Xpp3DomAttributeIterator + implements NodeIterator +{ + + private NodePointer parent; + + private Xpp3Dom node; + + private List<Map.Entry<String, String>> attributes; + + private Map.Entry<String, String> attribute; + + private int position; + + public Xpp3DomAttributeIterator( NodePointer parent, QName qname ) + { + this.parent = parent; + this.node = (Xpp3Dom) parent.getNode(); + + Map<String, String> map = new LinkedHashMap<String, String>(); + for ( String name : this.node.getAttributeNames() ) + { + if ( name.equals( qname.getName() ) || "*".equals( qname.getName() ) ) + { + String value = this.node.getAttribute( name ); + map.put( name, value ); + } + } + this.attributes = new ArrayList<Map.Entry<String, String>>( map.entrySet() ); + } + + public NodePointer getNodePointer() + { + if ( position == 0 ) + { + setPosition( 1 ); + } + return ( attribute == null ) ? null : new Xpp3DomAttributePointer( parent, attribute ); + } + + public int getPosition() + { + return position; + } + + public boolean setPosition( int position ) + { + this.position = position; + attribute = ( position > 0 && position <= attributes.size() ) ? attributes.get( position - 1 ) : null; + return attribute != null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomAttributePointer.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomAttributePointer.java new file mode 100644 index 00000000..04514b18 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomAttributePointer.java @@ -0,0 +1,105 @@ +package org.apache.maven.project.harness; + +/* + * 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.Map; + +import org.apache.commons.jxpath.ri.QName; +import org.apache.commons.jxpath.ri.model.NodePointer; + +/** + * An attribute pointer for JXPath to support <code>Xpp3Dom</code>. + * + * @author Benjamin Bentmann + */ +class Xpp3DomAttributePointer + extends NodePointer +{ + + private Map.Entry<String, String> attrib; + + public Xpp3DomAttributePointer( NodePointer parent, Map.Entry<String, String> attrib ) + { + super( parent ); + this.attrib = attrib; + } + + @Override + public int compareChildNodePointers( NodePointer pointer1, NodePointer pointer2 ) + { + // should never happen because attributes have no children + return 0; + } + + @Override + public Object getValue() + { + return attrib.getValue(); + } + + @Override + public Object getBaseValue() + { + return attrib; + } + + @Override + public Object getImmediateNode() + { + return attrib; + } + + @Override + public int getLength() + { + return 1; + } + + @Override + public QName getName() + { + return new QName( null, attrib.getKey() ); + } + + @Override + public boolean isActual() + { + return true; + } + + @Override + public boolean isCollection() + { + return false; + } + + @Override + public boolean isLeaf() + { + return true; + } + + @Override + public void setValue( Object value ) + { + throw new UnsupportedOperationException(); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodeIterator.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodeIterator.java new file mode 100644 index 00000000..796a5ca0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodeIterator.java @@ -0,0 +1,161 @@ +package org.apache.maven.project.harness; + +/* + * 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.ArrayList; +import java.util.List; + +import org.apache.commons.jxpath.ri.Compiler; +import org.apache.commons.jxpath.ri.compiler.NodeNameTest; +import org.apache.commons.jxpath.ri.compiler.NodeTest; +import org.apache.commons.jxpath.ri.compiler.NodeTypeTest; +import org.apache.commons.jxpath.ri.model.NodeIterator; +import org.apache.commons.jxpath.ri.model.NodePointer; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * A node iterator for JXPath to support <code>Xpp3Dom</code>. + * + * @author Benjamin Bentmann + */ +class Xpp3DomNodeIterator + implements NodeIterator +{ + + private NodePointer parent; + + private NodeTest test; + + private Xpp3Dom node; + + private Xpp3Dom[] children; + + private List<Xpp3Dom> filteredChildren = new ArrayList<Xpp3Dom>(); + + private int filteredIndex; + + private Xpp3Dom child; + + private int position; + + public Xpp3DomNodeIterator( NodePointer parent, NodeTest test, boolean reverse, NodePointer startWith ) + { + this.parent = parent; + this.node = (Xpp3Dom) parent.getNode(); + this.children = this.node.getChildren(); + if ( startWith != null ) + { + Xpp3Dom startWithNode = (Xpp3Dom) startWith.getNode(); + for ( ; filteredIndex < children.length; filteredIndex++ ) + { + if ( startWithNode.equals( children[filteredIndex] ) ) + { + filteredIndex++; + break; + } + } + } + this.test = test; + if ( reverse ) + { + throw new UnsupportedOperationException(); + } + } + + public NodePointer getNodePointer() + { + if ( position == 0 ) + { + setPosition( 1 ); + } + return ( child == null ) ? null : new Xpp3DomNodePointer( parent, child ); + } + + public int getPosition() + { + return position; + } + + public boolean setPosition( int position ) + { + this.position = position; + filterChildren( position ); + child = ( position > 0 && position <= filteredChildren.size() ) ? filteredChildren.get( position - 1 ) : null; + return child != null; + } + + private void filterChildren( int position ) + { + for ( ; position > filteredChildren.size() && filteredIndex < children.length; filteredIndex++ ) + { + Xpp3Dom child = children[filteredIndex]; + if ( testNode( child ) ) + { + filteredChildren.add( child ); + } + } + } + + private boolean testNode( Xpp3Dom node ) + { + if ( test == null ) + { + return true; + } + if ( test instanceof NodeNameTest ) + { + String nodeName = node.getName(); + if ( StringUtils.isEmpty( nodeName ) ) + { + return false; + } + + NodeNameTest nodeNameTest = (NodeNameTest) test; + String namespaceURI = nodeNameTest.getNamespaceURI(); + boolean wildcard = nodeNameTest.isWildcard(); + String testName = nodeNameTest.getNodeName().getName(); + String testPrefix = nodeNameTest.getNodeName().getPrefix(); + if ( wildcard && testPrefix == null ) + { + return true; + } + if ( wildcard || testName.equals( nodeName ) ) + { + return StringUtils.isEmpty( namespaceURI ) || StringUtils.isEmpty( testPrefix ); + } + return false; + } + if ( test instanceof NodeTypeTest ) + { + switch ( ( (NodeTypeTest) test ).getNodeType() ) + { + case Compiler.NODE_TYPE_NODE: + return true; + case Compiler.NODE_TYPE_TEXT: + return node.getValue() != null; + default: + return false; + } + } + return false; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodePointer.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodePointer.java new file mode 100644 index 00000000..f93bd892 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodePointer.java @@ -0,0 +1,155 @@ +package org.apache.maven.project.harness; + +/* + * 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.ArrayList; +import java.util.List; + +import org.apache.commons.jxpath.ri.QName; +import org.apache.commons.jxpath.ri.compiler.NodeTest; +import org.apache.commons.jxpath.ri.model.NodeIterator; +import org.apache.commons.jxpath.ri.model.NodePointer; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * A node pointer for JXPath to support <code>Xpp3Dom</code>. + * + * @author Benjamin Bentmann + */ +class Xpp3DomNodePointer + extends NodePointer +{ + + private Xpp3Dom node; + + public Xpp3DomNodePointer( Xpp3Dom node ) + { + super( null ); + this.node = node; + } + + public Xpp3DomNodePointer( NodePointer parent, Xpp3Dom node ) + { + super( parent ); + this.node = node; + } + + @Override + public int compareChildNodePointers( NodePointer pointer1, NodePointer pointer2 ) + { + Xpp3Dom node1 = (Xpp3Dom) pointer1.getBaseValue(); + Xpp3Dom node2 = (Xpp3Dom) pointer2.getBaseValue(); + if ( node1 == node2 ) + { + return 0; + } + for ( int i = 0; i < node.getChildCount(); i++ ) + { + Xpp3Dom child = node.getChild( i ); + if ( child == node1 ) + { + return -1; + } + if ( child == node2 ) + { + return 1; + } + } + return 0; + } + + @Override + public Object getValue() + { + return getValue( node ); + } + + private static Object getValue( Xpp3Dom node ) + { + if ( node.getValue() != null ) + { + return node.getValue(); + } + else + { + List<Object> children = new ArrayList<Object>(); + for ( int i = 0; i < node.getChildCount(); i++ ) + { + children.add( getValue( node.getChild( i ) ) ); + } + return children; + } + } + + @Override + public Object getBaseValue() + { + return node; + } + + @Override + public Object getImmediateNode() + { + return node; + } + + @Override + public int getLength() + { + return 1; + } + + @Override + public QName getName() + { + return new QName( null, node.getName() ); + } + + @Override + public boolean isCollection() + { + return false; + } + + @Override + public boolean isLeaf() + { + return node.getChildCount() <= 0; + } + + @Override + public void setValue( Object value ) + { + throw new UnsupportedOperationException(); + } + + @Override + public NodeIterator childIterator( NodeTest test, boolean reverse, NodePointer startWith ) + { + return new Xpp3DomNodeIterator( this, test, reverse, startWith ); + } + + @Override + public NodeIterator attributeIterator( QName qname ) + { + return new Xpp3DomAttributeIterator( this, qname ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomPointerFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomPointerFactory.java new file mode 100644 index 00000000..28c0f8ff --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomPointerFactory.java @@ -0,0 +1,61 @@ +package org.apache.maven.project.harness; + +/* + * 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.Locale; + +import org.apache.commons.jxpath.ri.QName; +import org.apache.commons.jxpath.ri.model.NodePointer; +import org.apache.commons.jxpath.ri.model.NodePointerFactory; +import org.codehaus.plexus.util.xml.Xpp3Dom; + +/** + * A node pointer factory for JXPath to support <code>Xpp3Dom</code>. + * + * @author Benjamin Bentmann + */ +public class Xpp3DomPointerFactory + implements NodePointerFactory +{ + + public int getOrder() + { + return 200; + } + + public NodePointer createNodePointer( QName name, Object object, Locale locale ) + { + if ( object instanceof Xpp3Dom ) + { + return new Xpp3DomNodePointer( (Xpp3Dom) object ); + } + return null; + } + + public NodePointer createNodePointer( NodePointer parent, QName name, Object object ) + { + if ( object instanceof Xpp3Dom ) + { + return new Xpp3DomNodePointer( parent, (Xpp3Dom) object ); + } + return null; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java new file mode 100644 index 00000000..77a6baef --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/LegacyRepositoryLayout.java @@ -0,0 +1,89 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.codehaus.plexus.component.annotations.Component; + +/** + * @author jdcasey + */ +@Component(role=ArtifactRepositoryLayout.class, hint="legacy") +public class LegacyRepositoryLayout + implements ArtifactRepositoryLayout +{ + private static final String PATH_SEPARATOR = "/"; + + public String getId() + { + return "legacy"; + } + + public String pathOf( Artifact artifact ) + { + ArtifactHandler artifactHandler = artifact.getArtifactHandler(); + + StringBuilder path = new StringBuilder( 128 ); + + path.append( artifact.getGroupId() ).append( '/' ); + path.append( artifactHandler.getDirectory() ).append( '/' ); + path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() ); + + if ( artifact.hasClassifier() ) + { + path.append( '-' ).append( artifact.getClassifier() ); + } + + if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 ) + { + path.append( '.' ).append( artifactHandler.getExtension() ); + } + + return path.toString(); + } + + public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, + ArtifactRepository repository ) + { + return pathOfRepositoryMetadata( metadata, metadata.getLocalFilename( repository ) ); + } + + private String pathOfRepositoryMetadata( ArtifactMetadata metadata, + String filename ) + { + StringBuilder path = new StringBuilder( 128 ); + + path.append( metadata.getGroupId() ).append( PATH_SEPARATOR ).append( "poms" ).append( PATH_SEPARATOR ); + + path.append( filename ); + + return path.toString(); + } + + public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata ) + { + return pathOfRepositoryMetadata( metadata, metadata.getRemoteFilename() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestArtifactHandler.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestArtifactHandler.java new file mode 100644 index 00000000..db1fecb5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestArtifactHandler.java @@ -0,0 +1,83 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java new file mode 100644 index 00000000..91ace4f1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java @@ -0,0 +1,123 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Collection; + +import org.codehaus.plexus.util.FileUtils; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.spi.connector.ArtifactDownload; +import org.eclipse.aether.spi.connector.ArtifactUpload; +import org.eclipse.aether.spi.connector.MetadataDownload; +import org.eclipse.aether.spi.connector.MetadataUpload; +import org.eclipse.aether.spi.connector.RepositoryConnector; +import org.eclipse.aether.transfer.ArtifactNotFoundException; +import org.eclipse.aether.transfer.ArtifactTransferException; + +/** + * @author Benjamin Bentmann + */ +public class TestRepositoryConnector + implements RepositoryConnector +{ + + private RemoteRepository repository; + + private File basedir; + + public TestRepositoryConnector( RemoteRepository repository ) + { + this.repository = repository; + try + { + basedir = FileUtils.toFile( new URL( repository.getUrl() ) ); + } + catch ( MalformedURLException e ) + { + throw new IllegalStateException( e ); + } + } + + public void close() + { + } + + public void get( Collection<? extends ArtifactDownload> artifactDownloads, + Collection<? extends MetadataDownload> metadataDownloads ) + { + if ( artifactDownloads != null ) + { + for ( ArtifactDownload download : artifactDownloads ) + { + File remoteFile = new File( basedir, path( download.getArtifact() ) ); + try + { + FileUtils.copyFile( remoteFile, download.getFile() ); + } + catch ( IOException e ) + { + if ( !remoteFile.exists() ) + { + download.setException( new ArtifactNotFoundException( download.getArtifact(), repository ) ); + } + else + { + download.setException( new ArtifactTransferException( download.getArtifact(), repository, e ) ); + } + } + } + } + } + + private String path( Artifact artifact ) + { + StringBuilder path = new StringBuilder( 128 ); + + path.append( artifact.getGroupId().replace( '.', '/' ) ).append( '/' ); + + path.append( artifact.getArtifactId() ).append( '/' ); + + path.append( artifact.getBaseVersion() ).append( '/' ); + + path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() ); + + if ( artifact.getClassifier().length() > 0 ) + { + path.append( '-' ).append( artifact.getClassifier() ); + } + + path.append( '.' ).append( artifact.getExtension() ); + + return path.toString(); + } + + public void put( Collection<? extends ArtifactUpload> artifactUploads, + Collection<? extends MetadataUpload> metadataUploads ) + { + // TODO Auto-generated method stub + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java new file mode 100644 index 00000000..17fd43f9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnectorFactory.java @@ -0,0 +1,48 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.codehaus.plexus.component.annotations.Component; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.spi.connector.RepositoryConnector; +import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; +import org.eclipse.aether.transfer.NoRepositoryConnectorException; + +/** + * @author Benjamin Bentmann + */ +@Component( role = RepositoryConnectorFactory.class, hint = "test" ) +public class TestRepositoryConnectorFactory + implements RepositoryConnectorFactory +{ + + public RepositoryConnector newInstance( RepositorySystemSession session, RemoteRepository repository ) + throws NoRepositoryConnectorException + { + return new TestRepositoryConnector( repository ); + } + + public float getPriority() + { + return 0; + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java new file mode 100644 index 00000000..c4afc7a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java @@ -0,0 +1,329 @@ +package org.apache.maven.repository; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +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.settings.Mirror; +import org.apache.maven.settings.Proxy; +import org.apache.maven.settings.Server; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.StringUtils; +import org.eclipse.aether.RepositorySystemSession; + +/** + * @author Benjamin Bentmann + */ +@Component( role = RepositorySystem.class ) +public class TestRepositorySystem + implements RepositorySystem +{ + + @Requirement + private ModelReader modelReader; + + @Requirement + private 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" ).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<String, Artifact>(); + + if ( request.getArtifactDependencies() != null ) + { + for ( Artifact artifact : request.getArtifactDependencies() ) + { + artifacts.put( artifact.getDependencyConflictId(), artifact ); + } + } + + List<Dependency> dependencies = new ArrayList<Dependency>(); + 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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java new file mode 100644 index 00000000..71be9284 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformationTest.java @@ -0,0 +1,81 @@ +package org.apache.maven.rtinfo.internal; + +/* + * 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.rtinfo.RuntimeInformation; +import org.codehaus.plexus.PlexusTestCase; + +public class DefaultRuntimeInformationTest + extends PlexusTestCase +{ + + public void testGetMavenVersion() + throws Exception + { + RuntimeInformation rtInfo = lookup( RuntimeInformation.class ); + + String mavenVersion = rtInfo.getMavenVersion(); + assertNotNull( mavenVersion ); + assertTrue( mavenVersion.length() > 0 ); + } + + public void testIsMavenVersion() + throws Exception + { + RuntimeInformation rtInfo = lookup( RuntimeInformation.class ); + + assertTrue( rtInfo.isMavenVersion( "2.0" ) ); + assertFalse( rtInfo.isMavenVersion( "9.9" ) ); + + assertTrue( rtInfo.isMavenVersion( "[2.0.11,2.1.0),[3.0,)" ) ); + assertFalse( rtInfo.isMavenVersion( "[9.0,)" ) ); + + try + { + rtInfo.isMavenVersion( "[3.0," ); + fail( "Bad version range wasn't rejected" ); + } + catch ( IllegalArgumentException e ) + { + assertTrue( true ); + } + + try + { + rtInfo.isMavenVersion( "" ); + fail( "Bad version range wasn't rejected" ); + } + catch ( IllegalArgumentException e ) + { + assertTrue( true ); + } + + try + { + rtInfo.isMavenVersion( null ); + fail( "Bad version range wasn't rejected" ); + } + catch ( IllegalArgumentException e ) + { + assertTrue( true ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java new file mode 100644 index 00000000..5c166868 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/settings/PomConstructionWithSettingsTest.java @@ -0,0 +1,159 @@ +package org.apache.maven.settings; + +/* + * 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.File; +import java.io.IOException; +import java.io.Reader; + +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; +import org.apache.maven.model.Profile; +import org.apache.maven.project.DefaultProjectBuilder; +import org.apache.maven.project.DefaultProjectBuildingRequest; +import org.apache.maven.project.ProjectBuilder; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.project.harness.PomTestWrapper; +import org.apache.maven.repository.RepositorySystem; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; +import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader; +import org.codehaus.plexus.ContainerConfiguration; +import org.codehaus.plexus.PlexusConstants; +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.ReaderFactory; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; + +public class PomConstructionWithSettingsTest + extends PlexusTestCase +{ + private static final String BASE_DIR = "src/test"; + + private static final String BASE_POM_DIR = BASE_DIR + "/resources-settings"; + + private DefaultProjectBuilder projectBuilder; + + private RepositorySystem repositorySystem; + + private File testDirectory; + + @Override + protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) + { + super.customizeContainerConfiguration( containerConfiguration ); + containerConfiguration.setAutoWiring( true ); + containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_INDEX ); + } + + protected void setUp() + throws Exception + { + testDirectory = new File( getBasedir(), BASE_POM_DIR ); + projectBuilder = (DefaultProjectBuilder) lookup( ProjectBuilder.class ); + repositorySystem = lookup( RepositorySystem.class ); + } + + @Override + protected void tearDown() + throws Exception + { + projectBuilder = null; + + super.tearDown(); + } + + public void testSettingsNoPom() throws Exception + { + PomTestWrapper pom = buildPom( "settings-no-pom" ); + assertEquals( "local-profile-prop-value", pom.getValue( "properties/local-profile-prop" ) ); + } + + /**MNG-4107 */ + public void testPomAndSettingsInterpolation() throws Exception + { + PomTestWrapper pom = buildPom( "test-pom-and-settings-interpolation" ); + assertEquals( "applied", pom.getValue( "properties/settingsProfile" ) ); + assertEquals( "applied", pom.getValue( "properties/pomProfile" ) ); + assertEquals( "settings", pom.getValue( "properties/pomVsSettings" ) ); + assertEquals( "settings", pom.getValue( "properties/pomVsSettingsInterpolated" ) ); + } + + /**MNG-4107 */ + public void testRepositories() throws Exception + { + PomTestWrapper pom = buildPom( "repositories" ); + assertEquals( "maven-core-it-0", pom.getValue( "repositories[1]/id" ) ); + } + + private PomTestWrapper buildPom( String pomPath ) + throws Exception + { + File pomFile = new File( testDirectory + File.separator + pomPath, "pom.xml" ); + File settingsFile = new File( testDirectory + File.separator + pomPath, "settings.xml" ); + Settings settings = readSettingsFile( settingsFile ); + + ProjectBuildingRequest config = new DefaultProjectBuildingRequest(); + + for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() ) + { + Profile profile = SettingsUtils.convertFromSettingsProfile( rawProfile ); + config.addProfile( profile ); + } + + String localRepoUrl = + System.getProperty( "maven.repo.local", System.getProperty( "user.home" ) + "/.m2/repository" ); + localRepoUrl = "file://" + localRepoUrl; + config.setLocalRepository( repositorySystem.createArtifactRepository( "local", localRepoUrl, + new DefaultRepositoryLayout(), null, null ) ); + config.setActiveProfileIds( settings.getActiveProfiles() ); + + DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession(); + LocalRepository localRepo = new LocalRepository( config.getLocalRepository().getBasedir() ); + repoSession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repoSession, localRepo ) ); + config.setRepositorySession( repoSession ); + + return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() ); + } + + private static Settings readSettingsFile( File settingsFile ) + throws IOException, XmlPullParserException + { + Settings settings = null; + + Reader reader = null; + + try + { + reader = ReaderFactory.newXmlReader( settingsFile ); + + SettingsXpp3Reader modelReader = new SettingsXpp3Reader(); + + settings = modelReader.read( reader ); + } + finally + { + IOUtil.close( reader ); + } + + return settings; + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/settings/SettingsUtilsTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/settings/SettingsUtilsTest.java new file mode 100644 index 00000000..f2231b3f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/settings/SettingsUtilsTest.java @@ -0,0 +1,126 @@ +package org.apache.maven.settings; + +/* + * 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 junit.framework.TestCase; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import java.util.Random; + +public class SettingsUtilsTest + extends TestCase +{ + + public void testShouldAppendRecessivePluginGroupIds() + { + Settings dominant = new Settings(); + dominant.addPluginGroup( "org.apache.maven.plugins" ); + dominant.addPluginGroup( "org.codehaus.modello" ); + + Settings recessive = new Settings(); + recessive.addPluginGroup( "org.codehaus.plexus" ); + + SettingsUtils.merge( dominant, recessive, Settings.GLOBAL_LEVEL ); + + List<String> pluginGroups = dominant.getPluginGroups(); + + assertNotNull( pluginGroups ); + assertEquals( 3, pluginGroups.size() ); + assertEquals( "org.apache.maven.plugins", pluginGroups.get( 0 ) ); + assertEquals( "org.codehaus.modello", pluginGroups.get( 1 ) ); + assertEquals( "org.codehaus.plexus", pluginGroups.get( 2 ) ); + } + + public void testRoundTripProfiles() + { + Random entropy = new Random(); + Profile p = new Profile(); + p.setId( "id" + Long.toHexString( entropy.nextLong() ) ); + Activation a = new Activation(); + a.setActiveByDefault( entropy.nextBoolean() ); + a.setJdk( "jdk" + Long.toHexString( entropy.nextLong() ) ); + ActivationFile af = new ActivationFile(); + af.setExists( "exists" + Long.toHexString( entropy.nextLong() ) ); + af.setMissing( "missing" + Long.toHexString( entropy.nextLong() ) ); + a.setFile( af ); + ActivationProperty ap = new ActivationProperty(); + ap.setName( "name" + Long.toHexString( entropy.nextLong() ) ); + ap.setValue( "value" + Long.toHexString( entropy.nextLong() ) ); + a.setProperty( ap ); + ActivationOS ao = new ActivationOS(); + ao.setArch( "arch" + Long.toHexString( entropy.nextLong() ) ); + ao.setFamily( "family" + Long.toHexString( entropy.nextLong() ) ); + ao.setName( "name" + Long.toHexString( entropy.nextLong() ) ); + ao.setVersion( "version" + Long.toHexString( entropy.nextLong() ) ); + a.setOs( ao ); + p.setActivation( a ); + Properties props = new Properties(); + int count = entropy.nextInt( 10 ); + for ( int i = 0; i < count; i++ ) + { + props.setProperty( "name" + Long.toHexString( entropy.nextLong() ), + "value" + Long.toHexString( entropy.nextLong() ) ); + } + p.setProperties( props ); + count = entropy.nextInt( 3 ); + List<Repository> repos = new ArrayList<Repository>(); + for ( int i = 0; i < count; i++ ) + { + Repository r = new Repository(); + r.setId( "id" + Long.toHexString( entropy.nextLong() ) ); + r.setName( "name" + Long.toHexString( entropy.nextLong() ) ); + r.setUrl( "url" + Long.toHexString( entropy.nextLong() ) ); + repos.add( r ); + } + p.setRepositories( repos ); + count = entropy.nextInt( 3 ); + repos = new ArrayList<Repository>(); + for ( int i = 0; i < count; i++ ) + { + Repository r = new Repository(); + r.setId( "id" + Long.toHexString( entropy.nextLong() ) ); + r.setName( "name" + Long.toHexString( entropy.nextLong() ) ); + r.setUrl( "url" + Long.toHexString( entropy.nextLong() ) ); + repos.add( r ); + } + p.setPluginRepositories( repos ); + + Profile clone = SettingsUtils.convertToSettingsProfile( SettingsUtils.convertFromSettingsProfile( p ) ); + + assertEquals( p.getId(), clone.getId() ); + assertEquals( p.getActivation().getJdk(), clone.getActivation().getJdk() ); + assertEquals( p.getActivation().getFile().getExists(), clone.getActivation().getFile().getExists() ); + assertEquals( p.getActivation().getFile().getMissing(), clone.getActivation().getFile().getMissing() ); + assertEquals( p.getActivation().getProperty().getName(), clone.getActivation().getProperty().getName() ); + assertEquals( p.getActivation().getProperty().getValue(), clone.getActivation().getProperty().getValue() ); + assertEquals( p.getActivation().getOs().getArch(), clone.getActivation().getOs().getArch() ); + assertEquals( p.getActivation().getOs().getFamily(), clone.getActivation().getOs().getFamily() ); + assertEquals( p.getActivation().getOs().getName(), clone.getActivation().getOs().getName() ); + assertEquals( p.getActivation().getOs().getVersion(), clone.getActivation().getOs().getVersion() ); + assertEquals( p.getProperties(), clone.getProperties() ); + assertEquals( p.getRepositories().size(), clone.getRepositories().size() ); + // TODO deep compare the lists + assertEquals( p.getPluginRepositories().size(), clone.getPluginRepositories().size() ); + // TODO deep compare the lists + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java new file mode 100644 index 00000000..28a13bb2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerPrivateTest.java @@ -0,0 +1,166 @@ +package org.apache.maven.toolchain; + +/* + * 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 static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.logging.Logger; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class DefaultToolchainManagerPrivateTest +{ + // Mocks to inject into toolchainManager + @Mock + private Logger logger; + + @InjectMocks + private DefaultToolchainManagerPrivate toolchainManager; + + @Mock + private ToolchainFactory toolchainFactory_basicType; + + @Mock + private ToolchainFactory toolchainFactory_rareType; + + @Before + public void setUp() + { + toolchainManager = new DefaultToolchainManagerPrivate(); + + MockitoAnnotations.initMocks( this ); + + toolchainManager.factories = new HashMap<String, ToolchainFactory>(); + toolchainManager.factories.put( "basic", toolchainFactory_basicType ); + toolchainManager.factories.put( "rare", toolchainFactory_rareType ); + } + + @Test + public void testToolchainsForAvailableType() + throws Exception + { + // prepare + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest req = new DefaultMavenExecutionRequest(); + when( session.getRequest() ).thenReturn( req ); + + ToolchainPrivate basicToolchain = mock( ToolchainPrivate.class ); + when( toolchainFactory_basicType.createDefaultToolchain() ).thenReturn( basicToolchain ); + ToolchainPrivate rareToolchain = mock( ToolchainPrivate.class ); + when( toolchainFactory_rareType.createDefaultToolchain() ).thenReturn( rareToolchain ); + + // execute + ToolchainPrivate[] toolchains = toolchainManager.getToolchainsForType( "basic", session ); + + // verify + verify( logger, never() ).error( anyString() ); + assertEquals( 1, toolchains.length ); + } + + @Test + public void testToolchainsForUnknownType() + throws Exception + { + // prepare + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest req = new DefaultMavenExecutionRequest(); + when( session.getRequest() ).thenReturn( req ); + + ToolchainPrivate basicToolchain = mock( ToolchainPrivate.class ); + when( toolchainFactory_basicType.createDefaultToolchain() ).thenReturn( basicToolchain ); + ToolchainPrivate rareToolchain = mock( ToolchainPrivate.class ); + when( toolchainFactory_rareType.createDefaultToolchain() ).thenReturn( rareToolchain ); + + // execute + ToolchainPrivate[] toolchains = toolchainManager.getToolchainsForType( "unknown", session ); + + // verify + verify( logger ).error( "Missing toolchain factory for type: unknown. Possibly caused by misconfigured project." ); + assertEquals( 0, toolchains.length ); + } + + @Test + public void testToolchainsForConfiguredType() + throws Exception + { + // prepare + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest req = new DefaultMavenExecutionRequest(); + when( session.getRequest() ).thenReturn( req ); + Map<String, List<ToolchainModel>> groupedToolchains = new HashMap<String, List<ToolchainModel>>(); + req.setToolchains( groupedToolchains ); + + List<ToolchainModel> basicToolchains = new ArrayList<ToolchainModel>(); + ToolchainModel basicToolchainModel = new ToolchainModel(); + basicToolchainModel.setType( "basic" ); + basicToolchains.add( basicToolchainModel ); + basicToolchains.add( basicToolchainModel ); + groupedToolchains.put( "basic", basicToolchains ); + + List<ToolchainModel> rareToolchains = new ArrayList<ToolchainModel>(); + ToolchainModel rareToolchainModel = new ToolchainModel(); + rareToolchainModel.setType( "rare" ); + rareToolchains.add( rareToolchainModel ); + groupedToolchains.put( "rare", rareToolchains ); + + // execute + ToolchainPrivate[] toolchains = toolchainManager.getToolchainsForType( "basic", session ); + + // verify + verify( logger, never() ).error( anyString() ); + assertEquals( 2, toolchains.length ); + } + + @SuppressWarnings( "unchecked" ) + @Test( expected = MisconfiguredToolchainException.class ) + public void testMisconfiguredToolchain() + throws Exception + { + // prepare + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest req = new DefaultMavenExecutionRequest(); + when( session.getRequest() ).thenReturn( req ); + when(toolchainFactory_basicType.createDefaultToolchain()).thenThrow( MisconfiguredToolchainException.class ); + + // execute + toolchainManager.getToolchainsForType( "basic", session ); + + // verify + fail( "Should exit with a MisconfiguredToolchainException" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java new file mode 100644 index 00000000..d464502f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainManagerTest.java @@ -0,0 +1,153 @@ +package org.apache.maven.toolchain; + +/* + * 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 static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.anyMap; +import static org.mockito.Matchers.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.codehaus.plexus.logging.Logger; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class DefaultToolchainManagerTest +{ + // Mocks to inject into toolchainManager + @Mock + private Logger logger; + + @InjectMocks + private DefaultToolchainManager toolchainManager; + + @Mock + private ToolchainFactory toolchainFactory_basicType; + + @Mock + private ToolchainFactory toolchainFactory_rareType; + + @Before + public void onSetup() throws Exception + { + toolchainManager = new DefaultToolchainManager(); + + MockitoAnnotations.initMocks( this ); + + toolchainManager.factories = new HashMap<String, ToolchainFactory>(); + toolchainManager.factories.put( "basic", toolchainFactory_basicType ); + toolchainManager.factories.put( "rare", toolchainFactory_rareType ); + } + + @Test + public void testNoModels() + { + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); + when( session.getRequest() ).thenReturn( executionRequest ); + + List<Toolchain> toolchains = toolchainManager.getToolchains( session, "unknown", null ); + + assertEquals( 0, toolchains.size() ); + } + + @Test + public void testModelNoFactory() + { + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); + Map<String, List<ToolchainModel>> toolchainModels = new HashMap<String, List<ToolchainModel>>(); + toolchainModels.put( "unknown", Collections.singletonList( new ToolchainModel() ) ); + executionRequest.setToolchains( toolchainModels ); + when( session.getRequest() ).thenReturn( executionRequest ); + + List<Toolchain> toolchains = toolchainManager.getToolchains( session, "unknown", null ); + + assertEquals( 0, toolchains.size() ); + verify( logger ).error( "Missing toolchain factory for type: unknown. Possibly caused by misconfigured project." ); + } + + @Test + public void testModelAndFactory() + { + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); + Map<String, List<ToolchainModel>> toolchainModels = new HashMap<String, List<ToolchainModel>>(); + toolchainModels.put( "basic", Arrays.asList( new ToolchainModel(), new ToolchainModel() ) ); + toolchainModels.put( "rare", Collections.singletonList( new ToolchainModel() ) ); + executionRequest.setToolchains( toolchainModels ); + when( session.getRequest() ).thenReturn( executionRequest ); + + List<Toolchain> toolchains = toolchainManager.getToolchains( session, "rare", null ); + + assertEquals( 1, toolchains.size() ); + } + + @Test + public void testModelsAndFactory() + { + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); + Map<String, List<ToolchainModel>> toolchainModels = new HashMap<String, List<ToolchainModel>>(); + toolchainModels.put( "basic", Arrays.asList( new ToolchainModel(), new ToolchainModel() ) ); + toolchainModels.put( "rare", Collections.singletonList( new ToolchainModel() ) ); + executionRequest.setToolchains( toolchainModels ); + when( session.getRequest() ).thenReturn( executionRequest ); + + List<Toolchain> toolchains = toolchainManager.getToolchains( session, "basic", null ); + + assertEquals( 2, toolchains.size() ); + } + + @Test + public void testRequirements() + throws Exception + { + MavenSession session = mock( MavenSession.class ); + MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest(); + Map<String, List<ToolchainModel>> toolchainModels = new HashMap<String, List<ToolchainModel>>(); + toolchainModels.put( "basic", Arrays.asList( new ToolchainModel(), new ToolchainModel() ) ); + toolchainModels.put( "rare", Collections.singletonList( new ToolchainModel() ) ); + executionRequest.setToolchains( toolchainModels ); + when( session.getRequest() ).thenReturn( executionRequest ); + ToolchainPrivate basicPrivate = mock( ToolchainPrivate.class ); + when( basicPrivate.matchesRequirements( anyMap() ) ).thenReturn( false ).thenReturn( true ); + when( toolchainFactory_basicType.createToolchain( isA( ToolchainModel.class ) ) ).thenReturn( basicPrivate ); + + List<Toolchain> toolchains = + toolchainManager.getToolchains( session, "basic", Collections.singletonMap( "key", "value" ) ); + + assertEquals( 1, toolchains.size() ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java new file mode 100644 index 00000000..3bba8177 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/DefaultToolchainTest.java @@ -0,0 +1,158 @@ +package org.apache.maven.toolchain; + +/* + * 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 static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.verify; + +import java.io.InputStream; +import java.util.Collections; + +import org.apache.maven.toolchain.java.DefaultJavaToolChain; +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.IOUtil; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class DefaultToolchainTest +{ + @Mock + private Logger logger; + + private MavenToolchainsXpp3Reader reader = new MavenToolchainsXpp3Reader(); + + @Before + public void setUp() throws Exception + { + MockitoAnnotations.initMocks( this ); + } + + private DefaultToolchain newDefaultToolchain( ToolchainModel model ) + { + return new DefaultToolchain( model, logger ) + { + @Override + public String findTool( String toolName ) + { + return null; + } + }; + } + + private DefaultToolchain newDefaultToolchain( ToolchainModel model, String type ) + { + return new DefaultToolchain( model, type, logger ) + { + @Override + public String findTool( String toolName ) + { + return null; + } + }; + } + + @Test + public void testGetModel() + { + ToolchainModel model = new ToolchainModel(); + DefaultToolchain toolchain = newDefaultToolchain( model ); + assertEquals( model, toolchain.getModel() ); + } + + @Test + public void testGetType() + { + ToolchainModel model = new ToolchainModel(); + DefaultToolchain toolchain = newDefaultToolchain( model, "TYPE" ); + assertEquals( "TYPE", toolchain.getType() ); + + model.setType( "MODEL_TYPE" ); + toolchain = newDefaultToolchain( model ); + assertEquals( "MODEL_TYPE", toolchain.getType() ); + } + + @Test + public void testGetLogger() + { + ToolchainModel model = new ToolchainModel(); + DefaultToolchain toolchain = newDefaultToolchain( model ); + assertEquals( logger, toolchain.getLog() ); + } + + @Test + public void testMissingRequirementProperty() + { + ToolchainModel model = new ToolchainModel(); + model.setType( "TYPE" ); + DefaultToolchain toolchain = newDefaultToolchain( model ); + + assertFalse( toolchain.matchesRequirements( Collections.singletonMap( "name", "John Doe" ) ) ); + verify( logger ).debug( "Toolchain type:TYPE{} is missing required property: name" ); + } + + + @Test + public void testNonMatchingRequirementProperty() + { + ToolchainModel model = new ToolchainModel(); + model.setType( "TYPE" ); + DefaultToolchain toolchain = newDefaultToolchain( model ); + toolchain.addProvideToken( "name", RequirementMatcherFactory.createExactMatcher( "Jane Doe" ) ); + + assertFalse( toolchain.matchesRequirements( Collections.singletonMap( "name", "John Doe" ) ) ); + verify( logger ).debug( "Toolchain type:TYPE{name = Jane Doe} doesn't match required property: name" ); + } + + + @Test + public void testEquals() throws Exception + { + InputStream jdksIS = null; + InputStream jdksExtraIS = null; + try + { + jdksIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); + jdksExtraIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks-extra.xml" ); + + PersistedToolchains jdks = reader.read( jdksIS ); + PersistedToolchains jdksExtra = reader.read( jdksExtraIS ); + + DefaultToolchain tc1 = new DefaultJavaToolChain( jdks.getToolchains().get( 0 ), null ); + DefaultToolchain tc2 = new DefaultJavaToolChain( jdksExtra.getToolchains().get( 0 ), null ); + + assertTrue( tc1.equals( tc1 ) ); + assertFalse( tc1.equals( tc2 ) ); + assertFalse( tc2.equals( tc1 ) ); + assertTrue( tc2.equals( tc2 ) ); + } + finally + { + IOUtil.close( jdksIS ); + IOUtil.close( jdksExtraIS ); + } + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/RequirementMatcherFactoryTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/RequirementMatcherFactoryTest.java new file mode 100644 index 00000000..c102b11f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/RequirementMatcherFactoryTest.java @@ -0,0 +1,72 @@ +/* + * 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. + */ + +package org.apache.maven.toolchain; + +import junit.framework.TestCase; + +/** + * + * @author mkleint + */ +public class RequirementMatcherFactoryTest + extends TestCase +{ + + public RequirementMatcherFactoryTest( String testName ) + { + super( testName ); + } + + /** + * Test of createExactMatcher method, of class RequirementMatcherFactory. + */ + public void testCreateExactMatcher() + { + RequirementMatcher matcher; + matcher = RequirementMatcherFactory.createExactMatcher( "foo" ); + assertFalse( matcher.matches( "bar" ) ); + assertFalse( matcher.matches( "foobar" ) ); + assertFalse( matcher.matches( "foob" ) ); + assertTrue( matcher.matches( "foo" ) ); + } + + /** + * Test of createVersionMatcher method, of class RequirementMatcherFactory. + */ + public void testCreateVersionMatcher() + { + RequirementMatcher matcher; + matcher = RequirementMatcherFactory.createVersionMatcher( "1.5.2" ); + assertFalse( matcher.matches( "1.5" ) ); + assertTrue( matcher.matches( "1.5.2" ) ); + assertFalse( matcher.matches( "[1.4,1.5)" ) ); + assertFalse( matcher.matches( "[1.5,1.5.2)" ) ); + assertFalse( matcher.matches( "(1.5.2,1.6)" ) ); + assertTrue( matcher.matches( "(1.4,1.5.2]" ) ); + assertTrue( matcher.matches( "(1.5,)" ) ); + assertEquals( "1.5.2", matcher.toString() ); + + // Ensure it is not printed as 1.5.0 + matcher = RequirementMatcherFactory.createVersionMatcher( "1.5" ); + assertEquals( "1.5", matcher.toString() ); + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java new file mode 100644 index 00000000..80fca094 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java @@ -0,0 +1,185 @@ +package org.apache.maven.toolchain.building; + +/* + * 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 static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyMap; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.maven.building.StringSource; +import org.apache.maven.toolchain.io.ToolchainsParseException; +import org.apache.maven.toolchain.io.ToolchainsReader; +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class DefaultToolchainsBuilderTest +{ + private static final String LS = System.getProperty( "line.separator" ); + + @Mock + private ToolchainsReader toolchainsReader; + + @InjectMocks + private DefaultToolchainsBuilder toolchainBuilder = new DefaultToolchainsBuilder(); + + @Before + public void onSetup() + { + MockitoAnnotations.initMocks( this ); + } + + @Test + public void testBuildEmptyRequest() + throws Exception + { + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + ToolchainsBuildingResult result = toolchainBuilder.build( request ); + assertNotNull( result.getEffectiveToolchains() ); + assertNotNull( result.getProblems() ); + assertEquals( 0, result.getProblems().size() ); + } + + @Test + public void testBuildRequestWithUserToolchains() + throws Exception + { + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + request.setUserToolchainsSource( new StringSource( "" ) ); + + PersistedToolchains userResult = new PersistedToolchains(); + ToolchainModel toolchain = new ToolchainModel(); + toolchain.setType( "TYPE" ); + toolchain.addProvide( "key", "user_value" ); + userResult.addToolchain( toolchain ); + when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenReturn( userResult ); + + ToolchainsBuildingResult result = toolchainBuilder.build( request ); + assertNotNull( result.getEffectiveToolchains() ); + assertEquals( 1, result.getEffectiveToolchains().getToolchains().size() ); + assertEquals( "TYPE", result.getEffectiveToolchains().getToolchains().get(0).getType() ); + assertEquals( "user_value", result.getEffectiveToolchains().getToolchains().get(0).getProvides().getProperty( "key" ) ); + assertNotNull( result.getProblems() ); + assertEquals( 0, result.getProblems().size() ); + } + + @Test + public void testBuildRequestWithGlobalToolchains() + throws Exception + { + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + request.setGlobalToolchainsSource( new StringSource( "" ) ); + + PersistedToolchains globalResult = new PersistedToolchains(); + ToolchainModel toolchain = new ToolchainModel(); + toolchain.setType( "TYPE" ); + toolchain.addProvide( "key", "global_value" ); + globalResult.addToolchain( toolchain ); + when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenReturn( globalResult ); + + ToolchainsBuildingResult result = toolchainBuilder.build( request ); + assertNotNull( result.getEffectiveToolchains() ); + assertEquals( 1, result.getEffectiveToolchains().getToolchains().size() ); + assertEquals( "TYPE", result.getEffectiveToolchains().getToolchains().get(0).getType() ); + assertEquals( "global_value", result.getEffectiveToolchains().getToolchains().get(0).getProvides().getProperty( "key" ) ); + assertNotNull( result.getProblems() ); + assertEquals( 0, result.getProblems().size() ); + } + + @Test + public void testBuildRequestWithBothToolchains() + throws Exception + { + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + request.setGlobalToolchainsSource( new StringSource( "" ) ); + request.setUserToolchainsSource( new StringSource( "" ) ); + + PersistedToolchains userResult = new PersistedToolchains(); + ToolchainModel userToolchain = new ToolchainModel(); + userToolchain.setType( "TYPE" ); + userToolchain.addProvide( "key", "user_value" ); + userResult.addToolchain( userToolchain ); + + PersistedToolchains globalResult = new PersistedToolchains(); + ToolchainModel globalToolchain = new ToolchainModel(); + globalToolchain.setType( "TYPE" ); + globalToolchain.addProvide( "key", "global_value" ); + globalResult.addToolchain( globalToolchain ); + when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenReturn( globalResult ).thenReturn( userResult ); + + ToolchainsBuildingResult result = toolchainBuilder.build( request ); + assertNotNull( result.getEffectiveToolchains() ); + assertEquals( 2, result.getEffectiveToolchains().getToolchains().size() ); + assertEquals( "TYPE", result.getEffectiveToolchains().getToolchains().get(0).getType() ); + assertEquals( "user_value", result.getEffectiveToolchains().getToolchains().get(0).getProvides().getProperty( "key" ) ); + assertEquals( "TYPE", result.getEffectiveToolchains().getToolchains().get(1).getType() ); + assertEquals( "global_value", result.getEffectiveToolchains().getToolchains().get(1).getProvides().getProperty( "key" ) ); + assertNotNull( result.getProblems() ); + assertEquals( 0, result.getProblems().size() ); + } + + @Test + public void testStrictToolchainsParseException() throws Exception + { + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + request.setGlobalToolchainsSource( new StringSource( "" ) ); + ToolchainsParseException parseException = new ToolchainsParseException( "MESSAGE", 4, 2 ); + when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenThrow( parseException ); + + try + { + toolchainBuilder.build( request ); + } + catch ( ToolchainsBuildingException e ) + { + assertEquals( "1 problem was encountered while building the effective toolchains" + LS + + "[FATAL] Non-parseable toolchains (memory): MESSAGE @ line 4, column 2" + LS, e.getMessage() ); + } + } + + @Test + public void testIOException() throws Exception + { + ToolchainsBuildingRequest request = new DefaultToolchainsBuildingRequest(); + request.setGlobalToolchainsSource( new StringSource( "", "LOCATION" ) ); + IOException ioException = new IOException( "MESSAGE" ); + when( toolchainsReader.read( any( InputStream.class ), anyMap() ) ).thenThrow( ioException ); + + try + { + toolchainBuilder.build( request ); + } + catch ( ToolchainsBuildingException e ) + { + assertEquals( "1 problem was encountered while building the effective toolchains" + LS + + "[FATAL] Non-readable toolchains LOCATION: MESSAGE" + LS, e.getMessage() ); + } + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/building/ToolchainsBuildingExceptionTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/building/ToolchainsBuildingExceptionTest.java new file mode 100644 index 00000000..bf745c2a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/building/ToolchainsBuildingExceptionTest.java @@ -0,0 +1,73 @@ +package org.apache.maven.toolchain.building; + +/* + * 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 static org.junit.Assert.assertEquals; + +import java.util.Collections; + +import org.apache.maven.building.Problem; +import org.apache.maven.building.ProblemCollector; +import org.apache.maven.building.ProblemCollectorFactory; +import org.junit.Test; + +public class ToolchainsBuildingExceptionTest +{ + private static final String LS = System.getProperty( "line.separator" ); + + @Test + public void testNoProblems() + { + ToolchainsBuildingException e = new ToolchainsBuildingException( Collections.<Problem>emptyList() ); + assertEquals( "0 problems were encountered while building the effective toolchains" + LS, e.getMessage() ); + } + + @Test + public void testOneProblem() + { + ProblemCollector problemCollector = ProblemCollectorFactory.newInstance( null ); + problemCollector.add( Problem.Severity.ERROR, "MESSAGE", 3, 5, new Exception() ); + ToolchainsBuildingException e = new ToolchainsBuildingException( problemCollector.getProblems() ); + assertEquals( "1 problem was encountered while building the effective toolchains" + LS + + "[ERROR] MESSAGE @ line 3, column 5" + LS, e.getMessage() ); + } + + @Test + public void testUnknownPositionAndSource() + { + ProblemCollector problemCollector = ProblemCollectorFactory.newInstance( null ); + problemCollector.add( Problem.Severity.ERROR, "MESSAGE", -1, -1, new Exception() ); + ToolchainsBuildingException e = new ToolchainsBuildingException( problemCollector.getProblems() ); + assertEquals( "1 problem was encountered while building the effective toolchains" + LS + + "[ERROR] MESSAGE" + LS, e.getMessage() ); + } + + @Test + public void testUnknownPosition() + { + ProblemCollector problemCollector = ProblemCollectorFactory.newInstance( null ); + problemCollector.setSource( "SOURCE" ); + problemCollector.add( Problem.Severity.ERROR, "MESSAGE", -1, -1, new Exception() ); + ToolchainsBuildingException e = new ToolchainsBuildingException( problemCollector.getProblems() ); + assertEquals( "1 problem was encountered while building the effective toolchains" + LS + + "[ERROR] MESSAGE @ SOURCE" + LS, e.getMessage() ); + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/merge/MavenToolchainMergerTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/merge/MavenToolchainMergerTest.java new file mode 100644 index 00000000..9183e175 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/java/org/apache/maven/toolchain/merge/MavenToolchainMergerTest.java @@ -0,0 +1,176 @@ +package org.apache.maven.toolchain.merge; + +/* + * 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 static org.junit.Assert.assertEquals; + +import java.io.InputStream; + +import org.apache.maven.toolchain.model.PersistedToolchains; +import org.apache.maven.toolchain.model.ToolchainModel; +import org.apache.maven.toolchain.model.TrackableBase; +import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.junit.Test; + +public class MavenToolchainMergerTest +{ + private MavenToolchainMerger merger = new MavenToolchainMerger(); + + private MavenToolchainsXpp3Reader reader = new MavenToolchainsXpp3Reader(); + + @Test + public void testMergeNulls() + { + merger.merge( null, null, null ); + + PersistedToolchains pt = new PersistedToolchains(); + merger.merge( pt, null, null ); + merger.merge( null, pt, null ); + } + + @Test + public void testMergeJdk() throws Exception + { + InputStream isDominant = null; + InputStream isRecessive = null; + try + { + isDominant = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); + isRecessive = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); + + PersistedToolchains dominant = reader.read( isDominant ); + PersistedToolchains recessive = reader.read( isRecessive ); + assertEquals( 2, dominant.getToolchains().size() ); + + merger.merge( dominant, recessive, TrackableBase.USER_LEVEL ); + assertEquals( 2, dominant.getToolchains().size() ); + } + finally + { + IOUtil.close( isDominant ); + } + } + + @Test + public void testMergeJdkExtra() throws Exception + { + InputStream jdksIS = null; + InputStream jdksExtraIS = null; + try + { + jdksIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); + jdksExtraIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks-extra.xml" ); + + PersistedToolchains jdks = reader.read( jdksIS ); + PersistedToolchains jdksExtra = reader.read( jdksExtraIS ); + assertEquals( 2, jdks.getToolchains().size() ); + + merger.merge( jdks, jdksExtra, TrackableBase.USER_LEVEL ); + assertEquals( 4, jdks.getToolchains().size() ); + assertEquals( 2, jdksExtra.getToolchains().size() ); + } + finally + { + IOUtil.close( jdksIS ); + IOUtil.close( jdksExtraIS ); + } + + try + { + jdksIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); + jdksExtraIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks-extra.xml" ); + + PersistedToolchains jdks = reader.read( jdksIS ); + PersistedToolchains jdksExtra = reader.read( jdksExtraIS ); + assertEquals( 2, jdks.getToolchains().size() ); + + // switch dominant with reccessive + merger.merge( jdksExtra, jdks, TrackableBase.USER_LEVEL ); + assertEquals( 4, jdksExtra.getToolchains().size() ); + assertEquals( 2, jdks.getToolchains().size() ); + } + finally + { + IOUtil.close( jdksIS ); + IOUtil.close( jdksExtraIS ); + } + } + + @Test + public void testMergeJdkExtend() throws Exception + { + InputStream jdksIS = null; + InputStream jdksExtendIS = null; + try + { + jdksIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); + jdksExtendIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks-extend.xml" ); + + PersistedToolchains jdks = reader.read( jdksIS ); + PersistedToolchains jdksExtend = reader.read( jdksExtendIS ); + assertEquals( 2, jdks.getToolchains().size() ); + + merger.merge( jdks, jdksExtend, TrackableBase.USER_LEVEL ); + assertEquals( 2, jdks.getToolchains().size() ); + Xpp3Dom config0 = (Xpp3Dom) jdks.getToolchains().get( 0 ).getConfiguration(); + assertEquals( "lib/tools.jar", config0.getChild( "toolsJar" ).getValue() ); + assertEquals( 2, config0.getChildCount() ); + Xpp3Dom config1 = (Xpp3Dom) jdks.getToolchains().get( 1 ).getConfiguration(); + assertEquals( 2, config1.getChildCount() ); + assertEquals( "lib/classes.jar", config1.getChild( "toolsJar" ).getValue() ); + assertEquals( 2, jdksExtend.getToolchains().size() ); + } + finally + { + IOUtil.close( jdksIS ); + IOUtil.close( jdksExtendIS ); + } + + try + { + jdksIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks.xml" ); + jdksExtendIS = ToolchainModel.class.getResourceAsStream( "toolchains-jdks-extend.xml" ); + + PersistedToolchains jdks = reader.read( jdksIS ); + PersistedToolchains jdksExtend = reader.read( jdksExtendIS ); + assertEquals( 2, jdks.getToolchains().size() ); + + // switch dominant with reccessive + merger.merge( jdksExtend, jdks, TrackableBase.USER_LEVEL ); + assertEquals( 2, jdksExtend.getToolchains().size() ); + Xpp3Dom config0 = (Xpp3Dom) jdksExtend.getToolchains().get( 0 ).getConfiguration(); + assertEquals( "lib/tools.jar", config0.getChild( "toolsJar" ).getValue() ); + assertEquals( 2, config0.getChildCount() ); + Xpp3Dom config1 = (Xpp3Dom) jdksExtend.getToolchains().get( 1 ).getConfiguration(); + assertEquals( 2, config1.getChildCount() ); + assertEquals( "lib/classes.jar", config1.getChild( "toolsJar" ).getValue() ); + assertEquals( 2, jdks.getToolchains().size() ); + } + finally + { + IOUtil.close( jdksIS ); + IOUtil.close( jdksExtendIS ); + } + + } + +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/module-a/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/module-a/pom.xml new file mode 100644 index 00000000..56ec3412 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/module-a/pom.xml @@ -0,0 +1,19 @@ +<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>cyclic-reference</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <artifactId>module-a</artifactId> + + <dependencies> + <dependency> + <groupId>cyclic-reference</groupId> + <artifactId>module-b</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/module-b/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/module-b/pom.xml new file mode 100644 index 00000000..ffa4f347 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/module-b/pom.xml @@ -0,0 +1,19 @@ +<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>cyclic-reference</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <artifactId>module-b</artifactId> + + <dependencies> + <dependency> + <groupId>cyclic-reference</groupId> + <artifactId>module-a</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/pom.xml new file mode 100644 index 00000000..e2666190 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/default-maven/cyclic-reference/pom.xml @@ -0,0 +1,14 @@ +<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>cyclic-reference</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <modules> + <module>module-a</module> + <module>module-b</module> + </modules> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/mojo-configuration/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/mojo-configuration/pom.xml new file mode 100644 index 00000000..a821765b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/mojo-configuration/pom.xml @@ -0,0 +1,67 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.lifecycle.test</groupId> + <artifactId>mojo-configuration</artifactId> + <packaging>jar</packaging> + <version>1.0</version> + <name>project-with-additional-lifecycle-elements</name> + <url>http://maven.apache.org</url> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <executions> + <execution> + <goals> + <goal>xpp3-reader</goal> + </goals> + <phase>generate-sources</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-basic/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-basic/pom.xml new file mode 100644 index 00000000..ab8584d9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-basic/pom.xml @@ -0,0 +1,79 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.lifecycle.test</groupId> + <artifactId>project-basic</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Test Project</name> + <inceptionYear>2009</inceptionYear> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/pom.xml new file mode 100644 index 00000000..83080888 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/pom.xml @@ -0,0 +1,72 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.lifecycle.test</groupId> + <artifactId>project-with-additional-lifecycle-elements</artifactId> + <packaging>jar</packaging> + <version>1.0</version> + <name>project-with-additional-lifecycle-elements</name> + <url>http://maven.apache.org</url> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + <goal>generate-test-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1</version> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/src/main/java/org/apache/maven/lifecycle/test/App.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/src/main/java/org/apache/maven/lifecycle/test/App.java new file mode 100644 index 00000000..826279cc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/src/main/java/org/apache/maven/lifecycle/test/App.java @@ -0,0 +1,13 @@ +package org.apache.maven.lifecycle.test; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/src/test/java/org/apache/maven/lifecycle/test/AppTest.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/src/test/java/org/apache/maven/lifecycle/test/AppTest.java new file mode 100644 index 00000000..469cb2c4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-additional-lifecycle-elements/src/test/java/org/apache/maven/lifecycle/test/AppTest.java @@ -0,0 +1,38 @@ +package org.apache.maven.lifecycle.test; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-inheritance/pom.xml new file mode 100644 index 00000000..0f49e9ae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-inheritance/pom.xml @@ -0,0 +1,628 @@ +<?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-parent</artifactId> + <version>11</version> + <relativePath>../pom/maven/pom.xml</relativePath> + </parent> + <groupId>org.apache.maven</groupId> + <artifactId>maven</artifactId> + <version>3.0-SNAPSHOT</version> + <packaging>pom</packaging> + <name>Apache Maven</name> + <description>Maven is a project development management and + comprehension tool. Based on the concept of a project object model: + builds, dependency management, documentation creation, site + publication, and distribution publication are all controlled from + the declarative file. Maven can be extended by plugins to utilise a + number of other development tools for reporting or the build + process. + </description> + <url>http://maven.apache.org/</url> + <inceptionYear>2001</inceptionYear> + <properties> + <classWorldsVersion>1.3</classWorldsVersion> + <commonsCliVersion>1.0</commonsCliVersion> + <!-- + + Do not update this, Doxia will be decoupled completely from 3.x and someone can + create a rendering engine for it if they like when the release stabilizes. JVZ + + --> + <doxiaVersion>1.0-alpha-9</doxiaVersion> + <easyMockVersion>1.2_Java1.3</easyMockVersion> + <junitVersion>3.8.1</junitVersion> + <plexusVersion>1.0-beta-3.0.7</plexusVersion> + <plexusInteractivityVersion>1.0-alpha-6</plexusInteractivityVersion> + <plexusInterpolationVersion>1.1</plexusInterpolationVersion> + <plexusPluginManagerVersion>1.0-alpha-1</plexusPluginManagerVersion> + <plexusUtilsVersion>1.5.8</plexusUtilsVersion> + <plexusJetty6Version>1.6</plexusJetty6Version> + <plexusWebdavVersion>1.0</plexusWebdavVersion> + <wagonVersion>1.0-beta-4</wagonVersion> + <modelBuilderVersion>1.7-SNAPSHOT</modelBuilderVersion> + <mercuryVersion>1.0-alpha-6-SNAPSHOT</mercuryVersion> + <mercuryMp3Version>1.0-alpha-1</mercuryMp3Version> + <securityDispatcherVersion>1.2</securityDispatcherVersion> + <woodstoxVersion>3.2.6</woodstoxVersion> + <modelloVersion>1.0.1-SNAPSHOT</modelloVersion> + <jxpathVersion>1.3</jxpathVersion> + </properties> + <issueManagement> + <system>jira</system> + <url>http://jira.codehaus.org/browse/MNG</url> + </issueManagement> + <mailingLists> + <mailingList> + <name>Maven Developer List</name> + <subscribe>dev-subscribe@maven.apache.org</subscribe> + <unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe> + <post>dev@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/dev@maven.apache.org/</otherArchive> + <otherArchive>http://www.nabble.com/Maven-Developers-f179.html</otherArchive> + <otherArchive>http://maven.dev.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven User List</name> + <subscribe>users-subscribe@maven.apache.org</subscribe> + <unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe> + <post>users@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive> + <otherArchive>http://maven.users.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Issues List</name> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/issues@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Issues-f15573.html</otherArchive> + <otherArchive>http://maven.issues.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Commits List</name> + <subscribe>commits-subscribe@maven.apache.org</subscribe> + <unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/maven-commits</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/commits@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Commits-f15575.html</otherArchive> + <otherArchive>http://maven.commits.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <!-- + duplication from parent pom - temporary until they inherit + properly + --> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/announce@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven-Announcements-f15617.html</otherArchive> + <otherArchive>http://maven.announce.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Notifications List</name> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/notifications@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Notifications-f15574.html</otherArchive> + <otherArchive>http://maven.notifications.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + </mailingLists> + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/maven/components/trunk</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/components/trunk</developerConnection> + <url>http://svn.apache.org/viewcvs.cgi/maven/components/trunk</url> + </scm> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <version>${plexusVersion}</version> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + <goal>generate-test-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <tagBase>https://svn.apache.org/repos/asf/maven/components/tags</tagBase> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>${modelloVersion}</version> + <configuration> + <useJava5>true</useJava5> + </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> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>1.0.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.2-beta-2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.4-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> + <modules> + <module>maven-core</module> + <module>apache-maven</module> + <module>maven-model</module> + <module>maven-plugin-api</module> + <module>maven-project</module> + <module>maven-reporting-api</module> + <module>maven-project-builder</module> + <module>maven-mercury</module> + <module>maven-embedder</module> + <module>maven-toolchain</module> + <module>maven-compat</module> + <module>maven-repository</module> + <module>maven-repository-mercury</module> + </modules> + <!--start--> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junitVersion}</version> + <scope>test</scope> + </dependency> + </dependencies> + <dependencyManagement> + <!--end--> + <dependencies> + <!-- Maven Modules --> + <!--start--> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-mercury</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-lifecycle</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-reporting-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-profile</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-toolchain</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-embedder</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project-builder</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-repository</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> + <version>${project.version}</version> + </dependency> + <!--end--> + <!-- Plexus --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>${plexusUtilsVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>${plexusVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-annotations</artifactId> + <version>${plexusVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <version>${classWorldsVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <version>${plexusInterpolationVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interactivity-api</artifactId> + <version>${plexusInteractivityVersion}</version> + <exclusions> + <exclusion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <!-- Plexus test dependencies --> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-jetty6</artifactId> + <version>${plexusJetty6Version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.sonatype.spice</groupId> + <artifactId>plexus-webdav</artifactId> + <version>${plexusWebdavVersion}</version> + <scope>test</scope> + </dependency> + + <!-- Wagon --> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-provider-api</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-file</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http-lightweight</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh-external</artifactId> + <version>${wagonVersion}</version> + </dependency> + <!-- Doxia --> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-sink-api</artifactId> + <version>${doxiaVersion}</version> + </dependency> + <!-- Maven Shared --> + <dependency> + <groupId>org.sonatype.spice</groupId> + <artifactId>model-builder</artifactId> + <version>${modelBuilderVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.woodstox</groupId> + <artifactId>wstx-asl</artifactId> + <version>${woodstoxVersion}</version> + </dependency> + <!-- Commons --> + <dependency> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <version>${commonsCliVersion}</version> + <exclusions> + <exclusion> + <artifactId>commons-lang</artifactId> + <groupId>commons-lang</groupId> + </exclusion> + <exclusion> + <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-jxpath</groupId> + <artifactId>commons-jxpath</artifactId> + <version>${jxpathVersion}</version> + </dependency> + + <!-- Mercury --> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-artifact</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-external</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-plexus</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-virtual</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.sonatype.mercury</groupId> + <artifactId>mercury-mp3-cli</artifactId> + <version>${mercuryMp3Version}</version> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + <version>${securityDispatcherVersion}</version> + </dependency> + + + <!-- Mercury test dependencies --> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-local-m2</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-remote-m2</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-md-sat</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-util</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-transport-http</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-transport-http</artifactId> + <version>${mercuryVersion}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-plugin-manager</artifactId> + <version>${plexusPluginManagerVersion}</version> + </dependency> + <!--start--> + <dependency> + <groupId>easymock</groupId> + <artifactId>easymock</artifactId> + <version>${easyMockVersion}</version> + <scope>test</scope> + </dependency> + <!--end--> + </dependencies> + <!--start--> + </dependencyManagement> + <!--end--> + <distributionManagement> + <site> + <id>apache.website</id> + <url>scp://people.apache.org/www/maven.apache.org/ref/${project.version}/</url> + </site> + </distributionManagement> + <profiles> + <profile> + <id>osgi</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>manifest</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- Needed for including the manifest, see MJAR-71 --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.1</version> + <configuration> + <archive> + <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> + </archive> + </configuration> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <inherited>false</inherited> + <configuration> + <descriptors> + <descriptor>src/main/assembly/src.xml</descriptor> + </descriptors> + <tarLongFileMode>gnu</tarLongFileMode> + <finalName>maven-${project.version}-src</finalName> + </configuration> + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>strict</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0-alpha-3</version> + <executions> + <execution> + <id>enforce-jdk-15</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireJavaVersion> + <version>1.5</version> + </requireJavaVersion> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/pom.xml new file mode 100644 index 00000000..e7a38347 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/pom.xml @@ -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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>project-with-multiple-executions</artifactId> + <version>1.0.1</version> + <packaging>maven-plugin</packaging> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <executions> + <execution> + <id>remote-resources</id> + <goals> + <goal>xpp3-writer</goal> + <goal>java</goal> + <goal>xpp3-reader</goal> + </goals> + <configuration> + <version>1.1.0</version> + <models> + <model>src/main/mdo/remote-resources.mdo</model> + </models> + </configuration> + </execution> + <execution> + <id>supplemental-models</id> + <goals> + <goal>xpp3-writer</goal> + <goal>java</goal> + <goal>xpp3-reader</goal> + </goals> + <configuration> + <version>1.0.0</version> + <models> + <model>src/main/mdo/supplemental-model.mdo</model> + </models> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/src/main/mdo/remote-resources.mdo b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/src/main/mdo/remote-resources.mdo new file mode 100644 index 00000000..c64cfbc8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/src/main/mdo/remote-resources.mdo @@ -0,0 +1,61 @@ +<!-- +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. +--> + +<model> + <id>remoteResourcesBundle</id> + <name>RemoteResourcesBundle</name> + <description><![CDATA[ + A bundle of remote resources. + This is the model specification for remote-resources.xml. + ]]></description> + <defaults> + <default> + <key>package</key> + <value>org.apache.maven.plugin.resources.remote</value> + </default> + </defaults> + <classes> + <class rootElement="true" xml.tagName="remoteResourcesBundle"> + <name>RemoteResourcesBundle</name> + <version>1.1.0</version> + <description>Root element of the remote-resources.xml file.</description> + <fields> + <field> + <name>remoteResources</name> + <version>1.1.0</version> + <description><![CDATA[ + Remote resources that are contained in a remote resources bundle. + ]]></description> + <association> + <type>String</type> + <multiplicity>*</multiplicity> + </association> + </field> + <field> + <name>sourceEncoding</name> + <version>1.1.0</version> + <description><![CDATA[ + Source encoding of the remote resources contained in the bundle. + ]]></description> + <type>String</type> + </field> + </fields> + </class> + </classes> +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/src/main/mdo/supplemental-model.mdo b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/src/main/mdo/supplemental-model.mdo new file mode 100644 index 00000000..102149df --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-multiple-executions/src/main/mdo/supplemental-model.mdo @@ -0,0 +1,61 @@ +<!-- +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. +--> + +<model> + <id>supplementalModel</id> + <name>SupplementalDataModel</name> + <description>Provides access to supplemental POM data models.</description> + <defaults> + <default> + <key>package</key> + <value>org.apache.maven.plugin.resources.remote</value> + </default> + </defaults> + <classes> + <class rootElement="true" xml.tagName="supplementalDataModels" xsd.compositor="sequence"> + <name>SupplementalDataModel</name> + <version>1.0.0</version> + <description>Root element of the supplemental-models.xml file.</description> + <fields> + <field xml.listStyle="flat"> + <name>supplement</name> + <version>1.0.0</version> + <description>Snippets of POM xml files used to supplement the data model.</description> + <association> + <type>Supplement</type> + <multiplicity>*</multiplicity> + </association> + </field> + </fields> + </class> + <class> + <name>Supplement</name> + <version>1.0.0</version> + <description>A single supplement</description> + <fields> + <field> + <name>project</name> + <version>1.0.0</version> + <description>Snippets of POM xml files used to supplement the data model.</description> + <type>DOM</type> + </field> + </fields> + </class> + </classes> +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-plugin-level-configuration-only/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-plugin-level-configuration-only/pom.xml new file mode 100644 index 00000000..b3bb2dd9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-executor/project-with-plugin-level-configuration-only/pom.xml @@ -0,0 +1,42 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>project-plugin-level-configuration-only</artifactId> + <version>1.0.1</version> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0.1</version> + <configuration> + <version>1.1.0</version> + <models> + <model>src/main/mdo/remote-resources.mdo</model> + </models> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-listener-dependency-injection/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-listener-dependency-injection/pom.xml new file mode 100644 index 00000000..41b99c72 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-listener-dependency-injection/pom.xml @@ -0,0 +1,30 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.lifecycle-listener.test</groupId> + <artifactId>simple</artifactId> + <version>1.0</version> + + <properties> + <foo>${injected}</foo> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>it</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/module-a/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/module-a/pom.xml new file mode 100644 index 00000000..6a173f61 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/module-a/pom.xml @@ -0,0 +1,12 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>lifecycle-participant-reactor-dependency-injection</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + </parent> + + <artifactId>module-a</artifactId> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/module-b/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/module-b/pom.xml new file mode 100644 index 00000000..795111a2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/module-b/pom.xml @@ -0,0 +1,12 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>lifecycle-participant-reactor-dependency-injection</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + </parent> + + <artifactId>module-b</artifactId> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/pom.xml new file mode 100644 index 00000000..2830b321 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/lifecycle-listener/lifecycle-participant-reactor-dependency-injection/pom.xml @@ -0,0 +1,13 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>lifecycle-participant-reactor-dependency-injection</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + + <modules> + <module>module-a</module> + <module>module-b</module> + </modules> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/mng-5003-plugin-realm-cache/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/mng-5003-plugin-realm-cache/pom.xml new file mode 100644 index 00000000..55f8e317 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/mng-5003-plugin-realm-cache/pom.xml @@ -0,0 +1,8 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng5003</groupId> + <artifactId>mng-5003-plugin-realm-cache</artifactId> + <version>1.0</version> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-contributing-system-scope-plugin-dep/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-contributing-system-scope-plugin-dep/pom.xml new file mode 100644 index 00000000..a9fa3cac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-contributing-system-scope-plugin-dep/pom.xml @@ -0,0 +1,44 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3586</groupId> + <artifactId>test2</artifactId> + <version>1.0</version> + + <name>Maven Integration Test :: MNG-3586</name> + <description> + Test that plugin dependencies with scope system are part of the plugin class realm. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3586</groupId> + <artifactId>tools</artifactId> + <version>1.5.0</version> + <scope>system</scope> + <systemPath>${basedir}/tools.jar</systemPath> + </dependency> + </dependencies> + <executions> + <execution> + <id>load</id> + <phase>validate</phase> + <configuration> + <resourcePaths>maven-core-it.properties</resourcePaths> + <pluginClassLoaderOutput>target/pcl.properties</pluginClassLoaderOutput> + </configuration> + <goals> + <goal>load</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-contributing-system-scope-plugin-dep/tools.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-contributing-system-scope-plugin-dep/tools.jar new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-contributing-system-scope-plugin-dep/tools.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-build-extensions-plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-build-extensions-plugin/pom.xml new file mode 100644 index 00000000..d4e34a5d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-build-extensions-plugin/pom.xml @@ -0,0 +1,31 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.test</groupId> + <artifactId>project-with-build-extensions-plugin</artifactId> + <version>1.0</version> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <extensions>true</extensions> + <executions> + <execution> + <id>load</id> + <phase>validate</phase> + <configuration> + <resourcePaths>maven-core-it.properties</resourcePaths> + <pluginClassLoaderOutput>target/pcl.properties</pluginClassLoaderOutput> + </configuration> + <goals> + <goal>load</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-inheritance/pom.xml new file mode 100644 index 00000000..0f49e9ae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-inheritance/pom.xml @@ -0,0 +1,628 @@ +<?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-parent</artifactId> + <version>11</version> + <relativePath>../pom/maven/pom.xml</relativePath> + </parent> + <groupId>org.apache.maven</groupId> + <artifactId>maven</artifactId> + <version>3.0-SNAPSHOT</version> + <packaging>pom</packaging> + <name>Apache Maven</name> + <description>Maven is a project development management and + comprehension tool. Based on the concept of a project object model: + builds, dependency management, documentation creation, site + publication, and distribution publication are all controlled from + the declarative file. Maven can be extended by plugins to utilise a + number of other development tools for reporting or the build + process. + </description> + <url>http://maven.apache.org/</url> + <inceptionYear>2001</inceptionYear> + <properties> + <classWorldsVersion>1.3</classWorldsVersion> + <commonsCliVersion>1.0</commonsCliVersion> + <!-- + + Do not update this, Doxia will be decoupled completely from 3.x and someone can + create a rendering engine for it if they like when the release stabilizes. JVZ + + --> + <doxiaVersion>1.0-alpha-9</doxiaVersion> + <easyMockVersion>1.2_Java1.3</easyMockVersion> + <junitVersion>3.8.1</junitVersion> + <plexusVersion>1.0-beta-3.0.7</plexusVersion> + <plexusInteractivityVersion>1.0-alpha-6</plexusInteractivityVersion> + <plexusInterpolationVersion>1.1</plexusInterpolationVersion> + <plexusPluginManagerVersion>1.0-alpha-1</plexusPluginManagerVersion> + <plexusUtilsVersion>1.5.8</plexusUtilsVersion> + <plexusJetty6Version>1.6</plexusJetty6Version> + <plexusWebdavVersion>1.0</plexusWebdavVersion> + <wagonVersion>1.0-beta-4</wagonVersion> + <modelBuilderVersion>1.7-SNAPSHOT</modelBuilderVersion> + <mercuryVersion>1.0-alpha-6-SNAPSHOT</mercuryVersion> + <mercuryMp3Version>1.0-alpha-1</mercuryMp3Version> + <securityDispatcherVersion>1.2</securityDispatcherVersion> + <woodstoxVersion>3.2.6</woodstoxVersion> + <modelloVersion>1.0.1-SNAPSHOT</modelloVersion> + <jxpathVersion>1.3</jxpathVersion> + </properties> + <issueManagement> + <system>jira</system> + <url>http://jira.codehaus.org/browse/MNG</url> + </issueManagement> + <mailingLists> + <mailingList> + <name>Maven Developer List</name> + <subscribe>dev-subscribe@maven.apache.org</subscribe> + <unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe> + <post>dev@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/dev@maven.apache.org/</otherArchive> + <otherArchive>http://www.nabble.com/Maven-Developers-f179.html</otherArchive> + <otherArchive>http://maven.dev.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven User List</name> + <subscribe>users-subscribe@maven.apache.org</subscribe> + <unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe> + <post>users@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive> + <otherArchive>http://maven.users.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Issues List</name> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/issues@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Issues-f15573.html</otherArchive> + <otherArchive>http://maven.issues.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Commits List</name> + <subscribe>commits-subscribe@maven.apache.org</subscribe> + <unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/maven-commits</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/commits@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Commits-f15575.html</otherArchive> + <otherArchive>http://maven.commits.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <!-- + duplication from parent pom - temporary until they inherit + properly + --> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/announce@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven-Announcements-f15617.html</otherArchive> + <otherArchive>http://maven.announce.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Notifications List</name> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/notifications@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Notifications-f15574.html</otherArchive> + <otherArchive>http://maven.notifications.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + </mailingLists> + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/maven/components/trunk</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/components/trunk</developerConnection> + <url>http://svn.apache.org/viewcvs.cgi/maven/components/trunk</url> + </scm> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <version>${plexusVersion}</version> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + <goal>generate-test-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <tagBase>https://svn.apache.org/repos/asf/maven/components/tags</tagBase> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>${modelloVersion}</version> + <configuration> + <useJava5>true</useJava5> + </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> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>1.0.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.2-beta-2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.4-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> + <modules> + <module>maven-core</module> + <module>apache-maven</module> + <module>maven-model</module> + <module>maven-plugin-api</module> + <module>maven-project</module> + <module>maven-reporting-api</module> + <module>maven-project-builder</module> + <module>maven-mercury</module> + <module>maven-embedder</module> + <module>maven-toolchain</module> + <module>maven-compat</module> + <module>maven-repository</module> + <module>maven-repository-mercury</module> + </modules> + <!--start--> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junitVersion}</version> + <scope>test</scope> + </dependency> + </dependencies> + <dependencyManagement> + <!--end--> + <dependencies> + <!-- Maven Modules --> + <!--start--> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-mercury</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-lifecycle</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-reporting-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-profile</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-toolchain</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-embedder</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project-builder</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-repository</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> + <version>${project.version}</version> + </dependency> + <!--end--> + <!-- Plexus --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>${plexusUtilsVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>${plexusVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-annotations</artifactId> + <version>${plexusVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <version>${classWorldsVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <version>${plexusInterpolationVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interactivity-api</artifactId> + <version>${plexusInteractivityVersion}</version> + <exclusions> + <exclusion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <!-- Plexus test dependencies --> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-jetty6</artifactId> + <version>${plexusJetty6Version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.sonatype.spice</groupId> + <artifactId>plexus-webdav</artifactId> + <version>${plexusWebdavVersion}</version> + <scope>test</scope> + </dependency> + + <!-- Wagon --> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-provider-api</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-file</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http-lightweight</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh-external</artifactId> + <version>${wagonVersion}</version> + </dependency> + <!-- Doxia --> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-sink-api</artifactId> + <version>${doxiaVersion}</version> + </dependency> + <!-- Maven Shared --> + <dependency> + <groupId>org.sonatype.spice</groupId> + <artifactId>model-builder</artifactId> + <version>${modelBuilderVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.woodstox</groupId> + <artifactId>wstx-asl</artifactId> + <version>${woodstoxVersion}</version> + </dependency> + <!-- Commons --> + <dependency> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <version>${commonsCliVersion}</version> + <exclusions> + <exclusion> + <artifactId>commons-lang</artifactId> + <groupId>commons-lang</groupId> + </exclusion> + <exclusion> + <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-jxpath</groupId> + <artifactId>commons-jxpath</artifactId> + <version>${jxpathVersion}</version> + </dependency> + + <!-- Mercury --> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-artifact</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-external</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-plexus</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-virtual</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.sonatype.mercury</groupId> + <artifactId>mercury-mp3-cli</artifactId> + <version>${mercuryMp3Version}</version> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + <version>${securityDispatcherVersion}</version> + </dependency> + + + <!-- Mercury test dependencies --> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-local-m2</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-remote-m2</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-md-sat</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-util</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-transport-http</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-transport-http</artifactId> + <version>${mercuryVersion}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-plugin-manager</artifactId> + <version>${plexusPluginManagerVersion}</version> + </dependency> + <!--start--> + <dependency> + <groupId>easymock</groupId> + <artifactId>easymock</artifactId> + <version>${easyMockVersion}</version> + <scope>test</scope> + </dependency> + <!--end--> + </dependencies> + <!--start--> + </dependencyManagement> + <!--end--> + <distributionManagement> + <site> + <id>apache.website</id> + <url>scp://people.apache.org/www/maven.apache.org/ref/${project.version}/</url> + </site> + </distributionManagement> + <profiles> + <profile> + <id>osgi</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>manifest</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- Needed for including the manifest, see MJAR-71 --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.1</version> + <configuration> + <archive> + <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> + </archive> + </configuration> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <inherited>false</inherited> + <configuration> + <descriptors> + <descriptor>src/main/assembly/src.xml</descriptor> + </descriptors> + <tarLongFileMode>gnu</tarLongFileMode> + <finalName>maven-${project.version}-src</finalName> + </configuration> + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>strict</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0-alpha-3</version> + <executions> + <execution> + <id>enforce-jdk-15</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireJavaVersion> + <version>1.5</version> + </requireJavaVersion> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/pom.xml new file mode 100644 index 00000000..32124c53 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/pom.xml @@ -0,0 +1,63 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3906</name> + <description> + Test that project-level plugin dependencies are properly merged during inheritance. + </description> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <version>2.1-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>e</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>d</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/pom.xml new file mode 100644 index 00000000..e13262b0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/pom.xml @@ -0,0 +1,77 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3906</name> + <description> + Test that project-level plugin dependencies are properly merged during inheritance. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <version>2.1-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>c</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>0.2</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + <executions> + <execution> + <id>load</id> + <phase>validate</phase> + <configuration> + <resourcePaths>org/apache/maven/its/mng3906/SomeClass.class</resourcePaths> + <pluginClassLoaderOutput>target/pcl.properties</pluginClassLoaderOutput> + </configuration> + <goals> + <goal>load</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.1/a-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.1/a-0.1.jar Binary files differnew file mode 100644 index 00000000..0db2c9f4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.1/a-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.1/a-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.1/a-0.1.pom new file mode 100644 index 00000000..ed095b25 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.1/a-0.1.pom @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.2/a-0.2.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.2/a-0.2.jar Binary files differnew file mode 100644 index 00000000..c5fb69a1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.2/a-0.2.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.2/a-0.2.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.2/a-0.2.pom new file mode 100644 index 00000000..cb5373bd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/0.2/a-0.2.pom @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>0.2</version> + <packaging>jar</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/maven-metadata.xml new file mode 100644 index 00000000..472f1c8c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/a/maven-metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?><metadata> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <versioning> + <release>0.2</release> + <versions> + <version>0.1</version> + <version>0.2</version> + </versions> + <lastUpdated>20081214111115</lastUpdated> + </versioning> +</metadata>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/0.1/b-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/0.1/b-0.1.jar Binary files differnew file mode 100644 index 00000000..7817617f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/0.1/b-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/0.1/b-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/0.1/b-0.1.pom new file mode 100644 index 00000000..d4dbbb73 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/0.1/b-0.1.pom @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/maven-metadata.xml new file mode 100644 index 00000000..2847985b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/b/maven-metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?><metadata> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <versioning> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20081214111129</lastUpdated> + </versioning> +</metadata>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/0.1/c-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/0.1/c-0.1.jar Binary files differnew file mode 100644 index 00000000..a4dcec7a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/0.1/c-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/0.1/c-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/0.1/c-0.1.pom new file mode 100644 index 00000000..afc967cb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/0.1/c-0.1.pom @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>c</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/maven-metadata.xml new file mode 100644 index 00000000..bcc92824 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/c/maven-metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?><metadata> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>c</artifactId> + <version>0.1</version> + <versioning> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20081214111138</lastUpdated> + </versioning> +</metadata>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/0.1/d-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/0.1/d-0.1.jar Binary files differnew file mode 100644 index 00000000..067491b4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/0.1/d-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/0.1/d-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/0.1/d-0.1.pom new file mode 100644 index 00000000..bfd077cb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/0.1/d-0.1.pom @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>d</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/maven-metadata.xml new file mode 100644 index 00000000..06b6e18d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/d/maven-metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?><metadata> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>d</artifactId> + <version>0.1</version> + <versioning> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20081214111146</lastUpdated> + </versioning> +</metadata>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/0.1/e-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/0.1/e-0.1.jar Binary files differnew file mode 100644 index 00000000..2469da59 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/0.1/e-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/0.1/e-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/0.1/e-0.1.pom new file mode 100644 index 00000000..24f2705e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/0.1/e-0.1.pom @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>e</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/maven-metadata.xml new file mode 100644 index 00000000..95023c7a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/repo/org/apache/maven/its/mng3906/e/maven-metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?><metadata> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>e</artifactId> + <version>0.1</version> + <versioning> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20081214111155</lastUpdated> + </versioning> +</metadata>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/settings-template.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/settings-template.xml new file mode 100644 index 00000000..cde42158 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/plugin-manager/project-with-plugin-classpath-ordering/sub/settings-template.xml @@ -0,0 +1,55 @@ +<?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. +--> + +<settings> + <profiles> + <profile> + <id>maven-core-it-repo</id> + <repositories> + <repository> + <id>maven-core-it</id> + <url>@baseurl@/repo</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>maven-core-it</id> + <url>@baseurl@/repo</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> + <activeProfiles> + <activeProfile>maven-core-it-repo</activeProfile> + </activeProfiles> +</settings> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/jdk/jre/placeholder.txt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/jdk/jre/placeholder.txt new file mode 100644 index 00000000..e26e8608 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/jdk/jre/placeholder.txt @@ -0,0 +1 @@ +need it so that empty folder does not get deleted
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/jdk/lib/tools.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/jdk/lib/tools.jar Binary files differnew file mode 100644 index 00000000..d6435519 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/jdk/lib/tools.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/pom.xml new file mode 100644 index 00000000..0d7b08a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/it0063/pom.xml @@ -0,0 +1,55 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.it0063</groupId> + <artifactId>maven-it-it0063</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: it0063</name> + <description>Test the use of a system scoped dependency to a (fake) tools.jar.</description> + + <dependencies> + <dependency> + <groupId>com.sun</groupId> + <artifactId>tools</artifactId> + <version>1.4.2</version> + <scope>system</scope> + <systemPath>${jre.home}/../lib/tools.jar</systemPath> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <compileClassPath>target/compile.txt</compileClassPath> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/consumer/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/consumer/pom.xml new file mode 100644 index 00000000..a70b208c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/consumer/pom.xml @@ -0,0 +1,66 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3023</groupId> + <artifactId>parent</artifactId> + <version>1</version> + </parent> + + <artifactId>consumer</artifactId> + + <name>Maven Integration Test :: MNG-3023 :: Consumer</name> + <description>Test that reactor projects are included in dependency resolution.</description> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3023</groupId> + <artifactId>dependency</artifactId> + <version>1</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>compile-classpath</id> + <phase>validate</phase> + <goals> + <goal>compile</goal> + </goals> + <configuration> + <compileClassPath>${project.build.directory}/compile.classpath</compileClassPath> + <significantPathLevels>1</significantPathLevels> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/dependency/dependency-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/dependency/dependency-1.jar Binary files differnew file mode 100644 index 00000000..d1fb4ec7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/dependency/dependency-1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/dependency/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/dependency/pom.xml new file mode 100644 index 00000000..e783f85c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/dependency/pom.xml @@ -0,0 +1,70 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3023</groupId> + <artifactId>parent</artifactId> + <version>1</version> + </parent> + + <artifactId>dependency</artifactId> + + <name>Maven Integration Test :: MNG-3023 :: Dependency</name> + <description>Test that reactor projects are included in dependency resolution.</description> + + <build> + <outputDirectory>dependency-classes</outputDirectory> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-artifact</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>compile</id> + <phase>initialize</phase> + <goals> + <goal>set</goal> + </goals> + <configuration> + <mainFile>dependency-classes</mainFile> + </configuration> + </execution> + <execution> + <id>install</id> + <phase>generate-sources</phase> + <goals> + <goal>set</goal> + <goal>attach-pom</goal> + <goal>install</goal> + </goals> + <configuration> + <mainFile>dependency-1.jar</mainFile> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/pom.xml new file mode 100644 index 00000000..23f09ce5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-builder/mng-3023/pom.xml @@ -0,0 +1,37 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3023</groupId> + <artifactId>parent</artifactId> + <version>1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3023</name> + <description>Test that reactor projects are included in dependency resolution.</description> + + <modules> + <module>dependency</module> + <module>consumer</module> + </modules> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/jre/placeholder.txt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/jre/placeholder.txt new file mode 100644 index 00000000..e26e8608 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/jre/placeholder.txt @@ -0,0 +1 @@ +need it so that empty folder does not get deleted
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/lib/tools.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/lib/tools.jar Binary files differnew file mode 100644 index 00000000..d6435519 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/jdk/lib/tools.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/pom.xml new file mode 100644 index 00000000..0d7b08a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/it0063/pom.xml @@ -0,0 +1,55 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.it0063</groupId> + <artifactId>maven-it-it0063</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: it0063</name> + <description>Test the use of a system scoped dependency to a (fake) tools.jar.</description> + + <dependencies> + <dependency> + <groupId>com.sun</groupId> + <artifactId>tools</artifactId> + <version>1.4.2</version> + <scope>system</scope> + <systemPath>${jre.home}/../lib/tools.jar</systemPath> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <compileClassPath>target/compile.txt</compileClassPath> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/project-with-exclusions/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/project-with-exclusions/pom.xml new file mode 100644 index 00000000..9fae2925 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/projects/project-dependencies-resolver/project-with-exclusions/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> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.its.mng4034</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>maven-core-it-support</artifactId> + <version>1.3</version> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.jar Binary files differnew file mode 100644 index 00000000..609ec21b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom new file mode 100644 index 00000000..f4514188 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/0.1/a-0.1.pom @@ -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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: Dummy Artifact</name> + <description> + + </description> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/maven-metadata.xml new file mode 100644 index 00000000..8099175e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/a/maven-metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.its</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <versioning> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023222756</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.jar Binary files differnew file mode 100644 index 00000000..19df0485 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom new file mode 100644 index 00000000..ca20cbf5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/0.1/b-0.1.pom @@ -0,0 +1,49 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: Dummy Artifact</name> + <description> + + </description> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/maven-metadata.xml new file mode 100644 index 00000000..e77af628 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/b/maven-metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.its</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <versioning> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023222817</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/maven-it-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/maven-it-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..84a4bf7a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/maven-it-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/maven-it-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/maven-it-plugin-0.1.pom new file mode 100644 index 00000000..4cd0ff00 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/maven-it-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/pom.xml new file mode 100644 index 00000000..4cd0ff00 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/0.1/pom.xml @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/maven-metadata.xml new file mode 100644 index 00000000..65155293 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-it-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023233513</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-metadata.xml new file mode 100644 index 00000000..637ec122 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/its/plugins/maven-metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <plugins> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>it</prefix> + <artifactId>maven-it-plugin</artifactId> + </plugin> + </plugins> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.jar Binary files differnew file mode 100644 index 00000000..5150c162 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom new file mode 100644 index 00000000..f4ea8d1d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom @@ -0,0 +1,23 @@ +<project> + <parent> + <artifactId>maven</artifactId> + <groupId>org.apache.maven</groupId> + <version>2.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <name>Maven Plugin API</name> + <version>2.0</version> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven/2.0/maven-2.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven/2.0/maven-2.0.pom new file mode 100644 index 00000000..3fe5d31d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/maven/2.0/maven-2.0.pom @@ -0,0 +1,264 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven</groupId> + <artifactId>maven</artifactId> + <packaging>pom</packaging> + <name>Maven</name> + <version>2.0</version> + <description>Maven is a project development management and comprehension tool. Based on the concept of a project object model: builds, dependency management, documentation creation, site publication, and distribution publication are all controlled from the declarative file. Maven can be extended by plugins to utilise a number of other development tools for reporting or the build process.</description> + <url>http://maven.apache.org/maven2/</url> + <issueManagement> + <system>jira</system> + <url>http://jira.codehaus.org/browse/MNG</url> + </issueManagement> + <ciManagement> + <system>continuum</system> + <notifiers> + <notifier> + <configuration> + <address>commits@maven.apache.org</address> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <mailingLists> + <mailingList> + <name>Maven User List</name> + <subscribe>users-subscribe@maven.apache.org</subscribe> + <unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe> + <post>users@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive> + </mailingList> + <mailingList> + <name>Maven Developer List</name> + <subscribe>dev-subscribe@maven.apache.org</subscribe> + <unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe> + <post>dev@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive> + </mailingList> + <mailingList> + <name>Maven Commits List</name> + <subscribe>commits-subscribe@maven.apache.org</subscribe> + <unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe> + <post>commits@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive> + </mailingList> + <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> + <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>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>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>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>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>vsiveton</id> + <name>Vincent Siveton</name> + <email>vsiveton@apache.org</email> + <organization>ASF</organization> + <roles> + <role>Committer</role> + </roles> + <timezone>-5</timezone> + </developer> + </developers> + <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> + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/maven/components/tags/maven-2.0</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/components/tags/maven-2.0</developerConnection> + <url>http://svn.apache.org/viewcvs.cgi/maven/components/tags/maven-2.0</url> + </scm> + <organization> + <name>Apache Software Foundation</name> + <url>http://www.apache.org/</url> + </organization> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <tagBase>https://svn.apache.org/repos/asf/maven/components/tags</tagBase> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + <modules> + <module>maven-archiver</module> + <module>maven-artifact</module> + <module>maven-artifact-manager</module> + <module>maven-artifact-ant</module> + <module>maven-artifact-test</module> + <module>maven-core</module> + <module>maven-error-diagnostics</module> + <module>maven-model</module> + <module>maven-monitor</module> + <module>maven-plugin-api</module> + <module>maven-plugin-descriptor</module> + <module>maven-plugin-parameter-documenter</module> + <module>maven-plugin-registry</module> + <module>maven-plugin-tools</module> + <module>maven-profile</module> + <module>maven-project</module> + <module>maven-reporting</module> + <module>maven-repository-metadata</module> + <module>maven-script</module> + <module>maven-settings</module> + </modules> + <repositories> + <repository> + <releases> + <enabled>false</enabled> + </releases> + <id>snapshots</id> + <name>Maven Central Development Repository</name> + <url>http://snapshots.maven.codehaus.org/maven2</url> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <releases> + <enabled>false</enabled> + </releases> + <id>snapshots</id> + <name>Maven Central Plugins Development Repository</name> + <url>http://snapshots.maven.codehaus.org/maven2</url> + </pluginRepository> + </pluginRepositories> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-alpha-8</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.0.4</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-provider-api</artifactId> + <version>1.0-alpha-5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh</artifactId> + <version>1.0-alpha-5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-file</artifactId> + <version>1.0-alpha-5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http-lightweight</artifactId> + <version>1.0-alpha-5</version> + </dependency> + </dependencies> + </dependencyManagement> + <distributionManagement> + <repository> + <id>repo1</id> + <name>Maven Central Repository</name> + <url>scp://repo1.maven.org/home/projects/maven/repository-staging/to-ibiblio/maven2</url> + </repository> + <snapshotRepository> + <id>snapshots</id> + <name>Maven Central Development Repository</name> + <url>scp://repo1.maven.org/home/projects/maven/repository-staging/snapshots/maven2</url> + </snapshotRepository> + <site> + <id>website</id> + <url>scp://minotaur.apache.org/www/maven.apache.org/maven2/</url> + </site> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/0.1/maven-clean-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/0.1/maven-clean-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..ee01f101 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/0.1/maven-clean-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/0.1/maven-clean-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/0.1/maven-clean-plugin-0.1.pom new file mode 100644 index 00000000..e4318d07 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/0.1/maven-clean-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/maven-metadata.xml new file mode 100644 index 00000000..91261b37 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-clean-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023224342</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/0.1/maven-compiler-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/0.1/maven-compiler-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..e5ef4464 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/0.1/maven-compiler-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/0.1/maven-compiler-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/0.1/maven-compiler-plugin-0.1.pom new file mode 100644 index 00000000..22371630 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/0.1/maven-compiler-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml new file mode 100644 index 00000000..544f16ea --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023224813</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/0.1/maven-deploy-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/0.1/maven-deploy-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..f2432a6d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/0.1/maven-deploy-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/0.1/maven-deploy-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/0.1/maven-deploy-plugin-0.1.pom new file mode 100644 index 00000000..82ed5748 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/0.1/maven-deploy-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml new file mode 100644 index 00000000..f0af94c7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023224421</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/0.1/maven-install-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/0.1/maven-install-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..a6adb988 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/0.1/maven-install-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/0.1/maven-install-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/0.1/maven-install-plugin-0.1.pom new file mode 100644 index 00000000..1ce2bd06 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/0.1/maven-install-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml new file mode 100644 index 00000000..bb528791 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023224444</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/0.1/maven-jar-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/0.1/maven-jar-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..0b03b350 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/0.1/maven-jar-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/0.1/maven-jar-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/0.1/maven-jar-plugin-0.1.pom new file mode 100644 index 00000000..d8abdf6f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/0.1/maven-jar-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml new file mode 100644 index 00000000..6b734ad5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-jar-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023232454</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-metadata.xml new file mode 100644 index 00000000..615714cc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-metadata.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <plugins> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>clean</prefix> + <artifactId>maven-clean-plugin</artifactId> + </plugin> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>deploy</prefix> + <artifactId>maven-deploy-plugin</artifactId> + </plugin> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>install</prefix> + <artifactId>maven-install-plugin</artifactId> + </plugin> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>jar</prefix> + <artifactId>maven-jar-plugin</artifactId> + </plugin> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>surefire</prefix> + <artifactId>maven-surefire-plugin</artifactId> + </plugin> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>compiler</prefix> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>resources</prefix> + <artifactId>maven-resources-plugin</artifactId> + </plugin> + <plugin> + <name>Maven Integration Test Plugin</name> + <prefix>plugin</prefix> + <artifactId>maven-plugin-plugin</artifactId> + </plugin> + </plugins> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/0.1/maven-plugin-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/0.1/maven-plugin-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..e2eab46e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/0.1/maven-plugin-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/0.1/maven-plugin-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/0.1/maven-plugin-plugin-0.1.pom new file mode 100644 index 00000000..7df6bdbc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/0.1/maven-plugin-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/maven-metadata.xml new file mode 100644 index 00000000..4c29db7d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-plugin-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023225046</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/0.1/maven-resources-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/0.1/maven-resources-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..ffa11df4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/0.1/maven-resources-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/0.1/maven-resources-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/0.1/maven-resources-plugin-0.1.pom new file mode 100644 index 00000000..782dbf7d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/0.1/maven-resources-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xml new file mode 100644 index 00000000..38c5503a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023224958</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/0.1/maven-surefire-plugin-0.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/0.1/maven-surefire-plugin-0.1.jar Binary files differnew file mode 100644 index 00000000..989e5837 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/0.1/maven-surefire-plugin-0.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/0.1/maven-surefire-plugin-0.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/0.1/maven-surefire-plugin-0.1.pom new file mode 100644 index 00000000..3588a043 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/0.1/maven-surefire-plugin-0.1.pom @@ -0,0 +1,70 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1</version> + <packaging>maven-plugin</packaging> + + <name>Maven Integration Test Plugin</name> + <description> + A test plugin to assist testing of Maven core. + </description> + <inceptionYear>2009</inceptionYear> + + <distributionManagement> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + </repository> + </distributionManagement> + + <properties> + <maven.test.skip>true</maven.test.skip> + <updateReleaseInfo>true</updateReleaseInfo> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>.</directory> + <includes> + <include>pom.xml</include> + <include>src/**</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml new file mode 100644 index 00000000..c6d1df93 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metadata> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1</version> + <versioning> + <latest>0.1</latest> + <release>0.1</release> + <versions> + <version>0.1</version> + </versions> + <lastUpdated>20091023225125</lastUpdated> + </versioning> +</metadata> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar Binary files differnew file mode 100644 index 00000000..5c50e177 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom new file mode 100644 index 00000000..6cf90799 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/remote-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?><project> + <parent> + <artifactId>plexus</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0.4</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>plexus-utils</artifactId> + <name>Plexus Common Utilities</name> + <version>1.1</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/codehaus/plexus/util/FileBasedTestCase.java</exclude> + <exclude>**/Test*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/artifact-id-inheritance/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/artifact-id-inheritance/child/pom.xml new file mode 100644 index 00000000..eee189d4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/artifact-id-inheritance/child/pom.xml @@ -0,0 +1,32 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <!-- while groupId and version are inherited, artifactId is not and must be specified --> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/artifact-id-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/artifact-id-inheritance/pom.xml new file mode 100644 index 00000000..f22afbc0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/artifact-id-inheritance/pom.xml @@ -0,0 +1,35 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <!-- + NOTE: This extends the test to check an edge case of URL adjustment which must not error out during inheritance + if the child misses the artifactId (as to be reported by validation). + --> + <url>http://maven.apache.org/</url> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml new file mode 100644 index 00000000..1885fc48 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml @@ -0,0 +1,60 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3822</groupId> + <artifactId>test1</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3822</name> + <description> + Verify that POM interpolation uses basedir-aligned build directories. + </description> + + <properties> + <!-- this is where we collect all the interpolated values for the POM dump --> + <buildMainSrc>${project.build.sourceDirectory}</buildMainSrc> + <buildTestSrc>${project.build.testSourceDirectory}</buildTestSrc> + <buildScriptSrc>${project.build.scriptSourceDirectory}</buildScriptSrc> + <buildOut>${project.build.directory}</buildOut> + <buildMainOut>${project.build.outputDirectory}</buildMainOut> + <buildTestOut>${project.build.testOutputDirectory}</buildTestOut> + <siteOut>${project.reporting.outputDirectory}</siteOut> + </properties> + + <build> + <!-- + NOTE: Deliberately set all build directories to relative paths to ensure they really need basedir alignment. + --> + <sourceDirectory>src/main/java</sourceDirectory> + <testSourceDirectory>src/test/java</testSourceDirectory> + <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> + <directory>target</directory> + <outputDirectory>target/classes</outputDirectory> + <testOutputDirectory>target/test-classes</testOutputDirectory> + </build> + + <reporting> + <outputDirectory>target/site</outputDirectory> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/basedir-interpolation/pom-with-unusual-name.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/basedir-interpolation/pom-with-unusual-name.xml new file mode 100644 index 00000000..1c037e63 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/basedir-interpolation/pom-with-unusual-name.xml @@ -0,0 +1,39 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3944</groupId> + <artifactId>test1</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3944</name> + <description> + Test that interpolation of ${basedir} works for a POM that is not named "pom.xml" + </description> + + <properties> + <!-- this is where we collect all the interpolated values for the POM dump --> + <prop0>${basedir}</prop0> + <prop1>${project.basedir}</prop1> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/baseurl-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/baseurl-interpolation/pom.xml new file mode 100644 index 00000000..f1d4e6ca --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/baseurl-interpolation/pom.xml @@ -0,0 +1,38 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3760</groupId> + <artifactId>test1</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3760</name> + <description> + Test interpolation of ${project.baseUri} + </description> + + <properties> + <!-- this is where we collect all the interpolated values for the POM dump --> + <prop1>${project.baseUri}</prop1> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/boolean-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/boolean-interpolation/pom.xml new file mode 100644 index 00000000..992eac1e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/boolean-interpolation/pom.xml @@ -0,0 +1,82 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng1995</groupId> + <artifactId>test1</artifactId> + <version>1.0</version> + + <name>Maven Integration Test :: MNG-1995</name> + <description> + Verify that POM fields that are of type boolean can be interpolated with expressions. + </description> + + <properties> + <filter.resources>true</filter.resources> + <releasesEnabled>true</releasesEnabled> + </properties> + + <repositories> + <repository> + <id>maven-core-it</id> + <url>file:///${basedir}/repo</url> + <releases> + <!-- That's the boolean POM field we would like to interpolate --> + <enabled>${releasesEnabled}</enabled> + </releases> + </repository> + </repositories> + + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <!-- That's the boolean POM field we would like to interpolate --> + <filtering>${filter.resources}</filtering> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>target/expression.properties</outputFile> + <expressions> + <expression>project/build/resources/0/filtering</expression> + <expression>project/repositories</expression> + </expressions> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/build-extension-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/build-extension-inheritance/pom.xml new file mode 100644 index 00000000..262af4fb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/build-extension-inheritance/pom.xml @@ -0,0 +1,49 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3899</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3899</name> + <description> + Test that build extensions are properly merged during inheritance. + </description> + + <build> + <extensions> + <extension> + <groupId>org.apache.maven.its.mng3899</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </extension> + <extension> + <groupId>org.apache.maven.its.mng3899</groupId> + <artifactId>c</artifactId> + <version>0.1</version> + </extension> + </extensions> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/build-extension-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/build-extension-inheritance/sub/pom.xml new file mode 100644 index 00000000..dc8f6f5b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/build-extension-inheritance/sub/pom.xml @@ -0,0 +1,75 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3899</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3899</name> + <description> + Test that build extensions are properly merged during inheritance. + </description> + + <build> + <!-- project extensions should precede inherited extensions --> + <extensions> + <extension> + <groupId>org.apache.maven.its.mng3899</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + </extension> + <extension> + <!-- project extensions should override inherited extension with equal gid:aid --> + <groupId>org.apache.maven.its.mng3899</groupId> + <artifactId>a</artifactId> + <version>0.2</version> + </extension> + </extensions> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>target/extension.properties</outputFile> + <expressions> + <expression>project/build/extensions</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/w-parent/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/w-parent/pom.xml new file mode 100644 index 00000000..ebcd7d1e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/w-parent/pom.xml @@ -0,0 +1,31 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <!-- minimal parent just to have one more level of inheritance --> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/w-parent/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/w-parent/sub/pom.xml new file mode 100644 index 00000000..68ca28dd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/w-parent/sub/pom.xml @@ -0,0 +1,319 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng</groupId> + <artifactId>test</artifactId> + <version>0.2</version> + <packaging>pom</packaging> + + <name>project-name</name> + <description>project-description</description> + <url>http://project.url/</url> + <inceptionYear>2009</inceptionYear> + <organization> + <name>project-org</name> + <url>http://project-org.url/</url> + </organization> + <licenses> + <license> + <name>project-license</name> + <url>http://project.url/license</url> + <distribution>repo</distribution> + <comments>free</comments> + </license> + </licenses> + + <developers> + <developer> + <id>dev</id> + <name>project-developer</name> + <email>developer@</email> + <url>http://developer</url> + <organization>developer</organization> + <organizationUrl>http://devel.org</organizationUrl> + <roles> + <role>devel</role> + </roles> + <timezone>-1</timezone> + <properties> + <developer>yes</developer> + </properties> + </developer> + </developers> + <contributors> + <contributor> + <name>project-contributor</name> + <email>contributor@</email> + <url>http://contributor</url> + <organization>contributor</organization> + <organizationUrl>http://contrib.org</organizationUrl> + <roles> + <role>contrib</role> + </roles> + <timezone>+1</timezone> + <properties> + <contributor>yes</contributor> + </properties> + </contributor> + </contributors> + + <mailingLists> + <mailingList> + <name>project-mailing-list</name> + <subscribe>subscribe@</subscribe> + <unsubscribe>unsubscribe@</unsubscribe> + <post>post@</post> + <archive>mail-archive</archive> + <otherArchives> + <otherArchive>other-archive</otherArchive> + </otherArchives> + </mailingList> + </mailingLists> + + <prerequisites> + <maven>2.0.1</maven> + </prerequisites> + + <scm> + <url>http://project.url/trunk</url> + <connection>http://project.url/scm</connection> + <developerConnection>https://project.url/scm</developerConnection> + <tag>TAG</tag> + </scm> + <issueManagement> + <system>issues</system> + <url>http://project.url/issues</url> + </issueManagement> + <ciManagement> + <system>ci</system> + <url>http://project.url/ci</url> + <notifiers> + <notifier> + <type>irc</type> + <address>ci@</address> + <sendOnError>true</sendOnError> + <sendOnFailure>false</sendOnFailure> + <sendOnSuccess>false</sendOnSuccess> + <sendOnWarning>false</sendOnWarning> + <configuration> + <ciProp>ci</ciProp> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <distributionManagement> + <repository> + <url>http://project.url/dist</url> + <id>project.distros</id> + <name>distros</name> + </repository> + <snapshotRepository> + <url>http://project.url/snaps</url> + <id>project.snaps</id> + <name>snaps</name> + <uniqueVersion>false</uniqueVersion> + </snapshotRepository> + <site> + <url>http://project.url/site</url> + <id>project.site</id> + <name>docs</name> + </site> + <downloadUrl>http://project.url/download</downloadUrl> + <relocation> + <groupId>reloc-gid</groupId> + <artifactId>reloc-aid</artifactId> + <version>reloc-version</version> + <message>project-reloc-msg</message> + </relocation> + </distributionManagement> + + <modules> + <module>sub</module> + </modules> + + <properties> + <itProperty>project-property</itProperty> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>managed-dep</artifactId> + <version>0.1</version> + <type>war</type> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>org.apache.maven.its</groupId> + <artifactId>excluded-managed-dep</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>dep</artifactId> + <version>0.2</version> + <type>ejb</type> + <scope>test</scope> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>org.apache.maven.its</groupId> + <artifactId>excluded-dep</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <repositories> + <repository> + <id>project-remote-repo</id> + <url>http://project.url/remote</url> + <name>repo</name> + </repository> + </repositories> + + <build> + <extensions> + <extension> + <groupId>org.apache.maven.its.ext</groupId> + <artifactId>ext</artifactId> + <version>3.0</version> + </extension> + </extensions> + + <defaultGoal>test</defaultGoal> + <directory>build</directory> + <sourceDirectory>sources/main</sourceDirectory> + <scriptSourceDirectory>sources/scripts</scriptSourceDirectory> + <testSourceDirectory>sources/test</testSourceDirectory> + <outputDirectory>build/main</outputDirectory> + <testOutputDirectory>build/test</testOutputDirectory> + <finalName>coreit</finalName> + <resources> + <resource> + <directory>res/main</directory> + <filtering>true</filtering> + <targetPath>main</targetPath> + <includes> + <include>main.included</include> + </includes> + <excludes> + <exclude>main.excluded</exclude> + </excludes> + </resource> + </resources> + <testResources> + <testResource> + <directory>res/test</directory> + <filtering>true</filtering> + <targetPath>test</targetPath> + <includes> + <include>test.included</include> + </includes> + <excludes> + <exclude>test.excluded</exclude> + </excludes> + </testResource> + </testResources> + <filters> + <filter>src/main/filter/it.properties</filter> + </filters> + + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-build</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>test.properties</outputFile> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>pom.properties</outputFile> + </configuration> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>build-plugin-dep</artifactId> + <version>0.3</version> + <type>zip</type> + <exclusions> + <exclusion> + <groupId>org.apache.maven.its</groupId> + <artifactId>excluded-build-plugin-dep</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + + <reporting> + <excludeDefaults>true</excludeDefaults> + <outputDirectory>docs</outputDirectory> + + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-reporting</artifactId> + <version>2.0-SNAPSHOT</version> + <configuration> + <outputFile>test.html</outputFile> + </configuration> + <reportSets> + <reportSet> + <id>it</id> + <reports> + <report>run</report> + </reports> + <configuration> + <outputFile>index.html</outputFile> + </configuration> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/wo-parent/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/wo-parent/pom.xml new file mode 100644 index 00000000..7b1ad794 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/complete-model/wo-parent/pom.xml @@ -0,0 +1,313 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng</groupId> + <artifactId>test</artifactId> + <version>0.2</version> + <packaging>pom</packaging> + + <name>project-name</name> + <description>project-description</description> + <url>http://project.url/</url> + <inceptionYear>2009</inceptionYear> + <organization> + <name>project-org</name> + <url>http://project-org.url/</url> + </organization> + <licenses> + <license> + <name>project-license</name> + <url>http://project.url/license</url> + <distribution>repo</distribution> + <comments>free</comments> + </license> + </licenses> + + <developers> + <developer> + <id>dev</id> + <name>project-developer</name> + <email>developer@</email> + <url>http://developer</url> + <organization>developer</organization> + <organizationUrl>http://devel.org</organizationUrl> + <roles> + <role>devel</role> + </roles> + <timezone>-1</timezone> + <properties> + <developer>yes</developer> + </properties> + </developer> + </developers> + <contributors> + <contributor> + <name>project-contributor</name> + <email>contributor@</email> + <url>http://contributor</url> + <organization>contributor</organization> + <organizationUrl>http://contrib.org</organizationUrl> + <roles> + <role>contrib</role> + </roles> + <timezone>+1</timezone> + <properties> + <contributor>yes</contributor> + </properties> + </contributor> + </contributors> + + <mailingLists> + <mailingList> + <name>project-mailing-list</name> + <subscribe>subscribe@</subscribe> + <unsubscribe>unsubscribe@</unsubscribe> + <post>post@</post> + <archive>mail-archive</archive> + <otherArchives> + <otherArchive>other-archive</otherArchive> + </otherArchives> + </mailingList> + </mailingLists> + + <prerequisites> + <maven>2.0.1</maven> + </prerequisites> + + <scm> + <url>http://project.url/trunk</url> + <connection>http://project.url/scm</connection> + <developerConnection>https://project.url/scm</developerConnection> + <tag>TAG</tag> + </scm> + <issueManagement> + <system>issues</system> + <url>http://project.url/issues</url> + </issueManagement> + <ciManagement> + <system>ci</system> + <url>http://project.url/ci</url> + <notifiers> + <notifier> + <type>irc</type> + <address>ci@</address> + <sendOnError>true</sendOnError> + <sendOnFailure>false</sendOnFailure> + <sendOnSuccess>false</sendOnSuccess> + <sendOnWarning>false</sendOnWarning> + <configuration> + <ciProp>ci</ciProp> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <distributionManagement> + <repository> + <url>http://project.url/dist</url> + <id>project.distros</id> + <name>distros</name> + </repository> + <snapshotRepository> + <url>http://project.url/snaps</url> + <id>project.snaps</id> + <name>snaps</name> + <uniqueVersion>false</uniqueVersion> + </snapshotRepository> + <site> + <url>http://project.url/site</url> + <id>project.site</id> + <name>docs</name> + </site> + <downloadUrl>http://project.url/download</downloadUrl> + <relocation> + <groupId>reloc-gid</groupId> + <artifactId>reloc-aid</artifactId> + <version>reloc-version</version> + <message>project-reloc-msg</message> + </relocation> + </distributionManagement> + + <modules> + <module>sub</module> + </modules> + + <properties> + <itProperty>project-property</itProperty> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>managed-dep</artifactId> + <version>0.1</version> + <type>war</type> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>org.apache.maven.its</groupId> + <artifactId>excluded-managed-dep</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>dep</artifactId> + <version>0.2</version> + <type>ejb</type> + <scope>test</scope> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>org.apache.maven.its</groupId> + <artifactId>excluded-dep</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <repositories> + <repository> + <id>project-remote-repo</id> + <url>http://project.url/remote</url> + <name>repo</name> + </repository> + </repositories> + + <build> + <extensions> + <extension> + <groupId>org.apache.maven.its.ext</groupId> + <artifactId>ext</artifactId> + <version>3.0</version> + </extension> + </extensions> + + <defaultGoal>test</defaultGoal> + <directory>build</directory> + <sourceDirectory>sources/main</sourceDirectory> + <scriptSourceDirectory>sources/scripts</scriptSourceDirectory> + <testSourceDirectory>sources/test</testSourceDirectory> + <outputDirectory>build/main</outputDirectory> + <testOutputDirectory>build/test</testOutputDirectory> + <finalName>coreit</finalName> + <resources> + <resource> + <directory>res/main</directory> + <filtering>true</filtering> + <targetPath>main</targetPath> + <includes> + <include>main.included</include> + </includes> + <excludes> + <exclude>main.excluded</exclude> + </excludes> + </resource> + </resources> + <testResources> + <testResource> + <directory>res/test</directory> + <filtering>true</filtering> + <targetPath>test</targetPath> + <includes> + <include>test.included</include> + </includes> + <excludes> + <exclude>test.excluded</exclude> + </excludes> + </testResource> + </testResources> + <filters> + <filter>src/main/filter/it.properties</filter> + </filters> + + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-build</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>test.properties</outputFile> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>pom.properties</outputFile> + </configuration> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>build-plugin-dep</artifactId> + <version>0.3</version> + <type>zip</type> + <exclusions> + <exclusion> + <groupId>org.apache.maven.its</groupId> + <artifactId>excluded-build-plugin-dep</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + + <reporting> + <excludeDefaults>true</excludeDefaults> + <outputDirectory>docs</outputDirectory> + + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-reporting</artifactId> + <version>2.0-SNAPSHOT</version> + <configuration> + <outputFile>test.html</outputFile> + </configuration> + <reportSets> + <reportSet> + <id>it</id> + <reports> + <report>run</report> + </reports> + <configuration> + <outputFile>index.html</outputFile> + </configuration> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/config-with-plugin-mng/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/config-with-plugin-mng/pom.xml new file mode 100644 index 00000000..e13c8a89 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/config-with-plugin-mng/pom.xml @@ -0,0 +1,39 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <executions> + <execution> + <id>nexus.xml</id> + <configuration> + <version>1.0.8</version> + </configuration> + </execution> + <execution> + <id>security.xml</id> + <configuration> + <version>1.0.0</version> + <model>src/main/mdo/security.xml</model> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + </plugin> + </plugins> + </pluginManagement> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/consecutive_empty_elements/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/consecutive_empty_elements/pom.xml new file mode 100644 index 00000000..16d1968f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/consecutive_empty_elements/pom.xml @@ -0,0 +1,14 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>test</groupId> + <artifactId>artifact</artifactId> + <version>1.0</version> + + <developers> + <developer> + <organization/> + <organizationUrl/> + </developer> + </developers> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/contributors-inheritance/child-2/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/contributors-inheritance/child-2/pom.xml new file mode 100644 index 00000000..745289fd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/contributors-inheritance/child-2/pom.xml @@ -0,0 +1,45 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + While <contributors> are inherited, they are not aggregated, only the child elements are used. + --> + + <parent> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng3843.child</groupId> + <artifactId>child-2</artifactId> + <version>0.2</version> + <packaging>jar</packaging> + + <contributors> + <contributor> + <name>child-contributor</name> + </contributor> + </contributors> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/contributors-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/contributors-inheritance/pom.xml new file mode 100644 index 00000000..1f65eb5f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/contributors-inheritance/pom.xml @@ -0,0 +1,35 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <contributors> + <contributor> + <name>parent-contributor</name> + </contributor> + </contributors> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/maven-parent.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/maven-parent.xml new file mode 100644 index 00000000..6d642626 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/maven-parent.xml @@ -0,0 +1,31 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven</groupId> + <artifactId>maven-parent</artifactId> + <version>11</version> + <packaging>pom</packaging> + + <name>Apache Maven</name> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/pom.xml new file mode 100644 index 00000000..c2c061c3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/pom.xml @@ -0,0 +1,48 @@ +<?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-parent</artifactId> + <version>11</version> + <relativePath>maven-parent.xml</relativePath> + </parent> + <groupId>org.apache.maven</groupId> + <artifactId>maven</artifactId> + <version>3.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <properties> + <junitVersion>3.8.1</junitVersion> + </properties> + <!--start--> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junitVersion}</version> + <scope>test</scope> + </dependency> + </dependencies> + <!--end--> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/sub/pom.xml new file mode 100644 index 00000000..788c5a72 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-inheritance/sub/pom.xml @@ -0,0 +1,34 @@ +<?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"> + <parent> + <artifactId>maven</artifactId> + <groupId>org.apache.maven</groupId> + <version>3.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project-builder</artifactId> + <version>3.0-SNAPSHOT</version> + <name>Maven Project Builder</name> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.4</version> + <scope>test</scope> + </dependency> + </dependencies> + + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-management-with-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-management-with-interpolation/pom.xml new file mode 100644 index 00000000..49ffab5a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-management-with-interpolation/pom.xml @@ -0,0 +1,19 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <artifactId>asm-parent</artifactId> + <groupId>asm</groupId> + <version>3.0</version> + <packaging>pom</packaging> + + <dependencyManagement> + <dependencies> + <dependency> + <artifactId>asm-util</artifactId> + <groupId>${project.groupId}</groupId> + <version>${project.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-management-with-interpolation/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-management-with-interpolation/sub/pom.xml new file mode 100644 index 00000000..2423568e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-management-with-interpolation/sub/pom.xml @@ -0,0 +1,17 @@ +<?xml version="1.0"?><project> + <parent> + <artifactId>asm-parent</artifactId> + <groupId>asm</groupId> + <version>3.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>asm-xml</artifactId> + <version>3.0</version> + <dependencies> + <dependency> + <groupId>asm</groupId> + <artifactId>asm-util</artifactId> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..5882ab5c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-order/w-plugin-mngt/pom.xml @@ -0,0 +1,68 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-4003</name> + <description> + Verify that dependencies survive the project construction in the POM order. + </description> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>a</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>c</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>b</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>d</artifactId> + <version>1</version> + </dependency> + </dependencies> + + <build> + <!-- NOTE: The combination with a plugin management section is an essential part of the test --> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <version>2.3</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..57bd6d0f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,66 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-4003</name> + <description> + Verify that dependencies survive the project construction in the POM order. + </description> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>a</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>c</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>b</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4003</groupId> + <artifactId>d</artifactId> + <version>1</version> + </dependency> + </dependencies> + + <build> + <!-- NOTE: The combination with a plugin section is an essential part of the test --> + <plugins> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <version>2.3</version> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope-inheritance/pom.xml new file mode 100644 index 00000000..9f2ab958 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope-inheritance/pom.xml @@ -0,0 +1,16 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <artifactId>p0</artifactId> + <groupId>maven</groupId> + <version>1.0</version> + <packaging>pom</packaging> + + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <version>1.0</version> + <artifactId>a</artifactId> + <scope>test</scope> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope-inheritance/sub/pom.xml new file mode 100644 index 00000000..80c5570c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope-inheritance/sub/pom.xml @@ -0,0 +1,19 @@ +<project> + <parent> + <artifactId>p0</artifactId> + <groupId>maven</groupId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>maven</groupId> + <artifactId>p1</artifactId> + <version>1.0</version> + + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <version>1.0</version> + <artifactId>a</artifactId> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope/pom.xml new file mode 100644 index 00000000..0f9ae5c6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope/pom.xml @@ -0,0 +1,18 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-t10</groupId> + <artifactId>p0</artifactId> + <packaging>pom</packaging> + <name>p0</name> + <version>1.0</version> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>t10-a</artifactId> + <version>2.0</version> + </dependency> + </dependencies> + </dependencyManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope/sub/pom.xml new file mode 100644 index 00000000..8cec33d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dependency-scope/sub/pom.xml @@ -0,0 +1,24 @@ +<project> + <parent> + <artifactId>p0</artifactId> + <groupId>maven-t10</groupId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-t10</groupId> + <artifactId>p1</artifactId> + <packaging>pom</packaging> + <name>p1</name> + <version>1.0</version> + <scm> + <url>scm-url</url> + </scm> + + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>t10-a</artifactId> + <version>1.0</version> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/developers-inheritance/child-2/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/developers-inheritance/child-2/pom.xml new file mode 100644 index 00000000..dad2375b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/developers-inheritance/child-2/pom.xml @@ -0,0 +1,45 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + While <developers> are inherited, they are not aggregated, only the child elements are used. + --> + + <parent> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng3843.child</groupId> + <artifactId>child-2</artifactId> + <version>0.2</version> + <packaging>jar</packaging> + + <developers> + <developer> + <name>child-developer</name> + </developer> + </developers> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/developers-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/developers-inheritance/pom.xml new file mode 100644 index 00000000..6e7c44d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/developers-inheritance/pom.xml @@ -0,0 +1,35 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <developers> + <developer> + <name>parent-developer</name> + </developer> + </developers> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/distribution-management/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/distribution-management/pom.xml new file mode 100644 index 00000000..1a0acb08 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/distribution-management/pom.xml @@ -0,0 +1,39 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.it0061</groupId> + <artifactId>maven-it-it0061</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: it0061</name> + + <distributionManagement> + <repository> + <id>test</id> + <url>file:target/test-repo</url> + <layout>legacy</layout> + </repository> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dual-execution-ids/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dual-execution-ids/pom.xml new file mode 100644 index 00000000..8833c089 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dual-execution-ids/pom.xml @@ -0,0 +1,28 @@ + +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-parent</artifactId> + <version>1.0.0-alpha-3-SNAPSHOT</version> + <packaging>pom</packaging> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-remote-resources-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>process</goal> + </goals> + <configuration> + <resourceBundles> + <resourceBundle>org.apache:apache-jar-resource-bundle:1.5</resourceBundle> + </resourceBundles> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dual-execution-ids/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dual-execution-ids/sub/pom.xml new file mode 100644 index 00000000..6ebd5994 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/dual-execution-ids/sub/pom.xml @@ -0,0 +1,43 @@ +<project> + +<parent> + <artifactId>mercury-parent</artifactId> + <groupId>org.apache.maven.mercury</groupId> + <version>1.0.0-alpha-3-SNAPSHOT</version> +</parent> + +<modelVersion>4.0.0</modelVersion> +<groupId>org.apache.maven.mercury</groupId> +<artifactId>mercury-util</artifactId> +<name>Mercury Shared Utilities</name> +<version>1.0.0-alpha-3-SNAPSHOT</version> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-remote-resources-plugin</artifactId> + <version>1.0</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <artifactId>maven-remote-resources-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <id>default</id> + <goals> + <goal>process</goal> + </goals> + <configuration> + <resourceBundles> + <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle> + </resourceBundles> + </configuration> + </execution> + </executions> + </plugin> + </plugins> +</build> + </project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/nexus-parent.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/nexus-parent.xml new file mode 100644 index 00000000..d2ac100c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/nexus-parent.xml @@ -0,0 +1,29 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus-parent</artifactId> + <version>8-SNAPSHOT</version> + <packaging>pom</packaging> + + <properties> + <plexus.version>1.0-beta-3.0.5-SNAPSHOT</plexus.version> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>${plexus.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging-api</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </dependencyManagement> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/pom.xml new file mode 100644 index 00000000..b12db4f0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/pom.xml @@ -0,0 +1,33 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus-parent</artifactId> + <version>8-SNAPSHOT</version> + <relativePath>nexus-parent.xml</relativePath> + </parent> + + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <packaging>pom</packaging> + <name>Nexus Repository Manager</name> + <version>1.3.0-SNAPSHOT</version> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <scope>provided</scope> + <version>${plexus.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging-api</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </dependencyManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/sub/pom.xml new file mode 100644 index 00000000..37b166d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/duplicate-exclusions-dependency/sub/pom.xml @@ -0,0 +1,16 @@ +<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/maven-v4_0_0.xsd"> + <parent> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>nexus-proxy</artifactId> + <dependencies> + <!-- For App basic --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/empty-distMng-repo-url/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/empty-distMng-repo-url/pom.xml new file mode 100644 index 00000000..91ce38df --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/empty-distMng-repo-url/pom.xml @@ -0,0 +1,15 @@ +<project > + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.commons</groupId> + <artifactId>commons-parent</artifactId> + <packaging>pom</packaging> + <version>11</version> + + <distributionManagement> + <repository> + <id>dummy</id> + <name>Dummy to avoid accidental deploys</name> + <url /> + </repository> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/empty-scm/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/empty-scm/pom.xml new file mode 100644 index 00000000..a0462ddd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/empty-scm/pom.xml @@ -0,0 +1,58 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + This (almost) minimal POM tests direct inheritance from the super POM. + --> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>test-1</artifactId> + <version>0.1</version> + + <name>test</name> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>target/pom.properties</outputFile> + <expressions> + <expression>project</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/equal-plugin-deps/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/equal-plugin-deps/pom.xml new file mode 100644 index 00000000..d33b2bae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/equal-plugin-deps/pom.xml @@ -0,0 +1,64 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3838</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3838</name> + <description> + Verify that using the same dependency for different plugins doesn't blow up the project builder. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <dependencies> + <!-- NOTE: That's exactly the same dependency as for the other plugin. --> + <dependency> + <groupId>org.apache.maven.its.mng3838</groupId> + <artifactId>dep</artifactId> + <version>123</version> + </dependency> + </dependencies> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-b</artifactId> + <version>1.0-SNAPSHOT</version> + <dependencies> + <!-- NOTE: That's exactly the same dependency as for the other plugin. --> + <dependency> + <groupId>org.apache.maven.its.mng3838</groupId> + <artifactId>dep</artifactId> + <version>123</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/equal-plugin-exec-ids/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/equal-plugin-exec-ids/pom.xml new file mode 100644 index 00000000..a05d45d0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/equal-plugin-exec-ids/pom.xml @@ -0,0 +1,83 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3821</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3821</name> + <description> + Verify that using the same id for executions/reportsets of different plugins doesn't blow up the project builder. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>the-one-and-only-id</id> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-b</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>the-one-and-only-id</id> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <reportSets> + <reportSet> + <id>the-one-and-only-id</id> + </reportSet> + </reportSets> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-b</artifactId> + <version>1.0-SNAPSHOT</version> + <reportSets> + <reportSet> + <id>the-one-and-only-id</id> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration-join/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration-join/pom.xml new file mode 100644 index 00000000..28defaa2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration-join/pom.xml @@ -0,0 +1,35 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + <executions> + <execution> + <configuration> + <fileset dir="${basedir}"> + <include name="LICENSE.txt" /> + <include name="NOTICE.txt" /> + </fileset> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration-subcollections/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration-subcollections/pom.xml new file mode 100644 index 00000000..e5b19d4e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration-subcollections/pom.xml @@ -0,0 +1,42 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>test</groupId> + <artifactId>nexus</artifactId> + <packaging>pom</packaging> + <name>Nexus Repository Manager</name> + <version>1.1-M1</version> + + <!-- build information for the project --> + <build> + <plugins> + <plugin> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <goals> + <goal>enforce</goal> + </goals> + <id>enforce</id> + <configuration> + <rules> + <bannedDependencies> + <excludes> + <exclude>commons-logging:*</exclude> + </excludes> + <message>a</message> + </bannedDependencies> + <bannedDependencies> + <excludes> + <exclude>*:plexus-component-api</exclude> + </excludes> + </bannedDependencies> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration/pom.xml new file mode 100644 index 00000000..130174d5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/execution-configuration/pom.xml @@ -0,0 +1,58 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + <executions> + <execution> + <id>nexus.xml</id> + <goals> + <goal>java</goal> + <goal>xpp3-reader</goal> + <goal>xpp3-writer</goal> + </goals> + <configuration> + <version>1.0.8</version> + <packagedVersions> + <packagedVersion>1.0.0</packagedVersion> + <packagedVersion>1.0.1</packagedVersion> + <packagedVersion>1.0.6</packagedVersion> + </packagedVersions> + <model>src/main/mdo/nexus.xml</model> + </configuration> + </execution> + + <execution> + <id>security.xml</id> + <goals> + <goal>java1</goal> + <goal>xpp3-reader1</goal> + <goal>xpp3-writer1</goal> + </goals> + <configuration> + <version>1.0.0</version> + <model>src/main/mdo/security.xml</model> + </configuration> + </execution> + + </executions> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + </plugin> + </plugins> + </pluginManagement> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/foo/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/foo/sub/pom.xml new file mode 100644 index 00000000..c5e3d9a6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/foo/sub/pom.xml @@ -0,0 +1,418 @@ +<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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <!-- + <parent> + <groupId>org.apache.maven.archetype</groupId> + <artifactId>maven-archetype</artifactId> + <version>2.0-alpha-1</version> + </parent> + --> + <artifactId>archetype-common</artifactId> + <name>Maven Archetype Common</name> + <packaging>jar</packaging> + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + </dependency> + <dependency> + <groupId>net.sourceforge.jchardet</groupId> + <artifactId>jchardet</artifactId> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + </dependency> + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-plugin-testing-harness</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-velocity</artifactId> + </dependency> + <dependency> + <groupId>velocity</groupId> + <artifactId>velocity</artifactId> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-core-api-container</artifactId> + <version>0.9</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-core-api-util</artifactId> + <version>0.9</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-core-api-generic</artifactId> + <version>0.9</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-core-api-module</artifactId> + <version>0.9</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-core-container-jetty</artifactId> + <version>0.9</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty</artifactId> + <version>6.1.4</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-file</artifactId> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http</artifactId> + <version>1.0-beta-2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>archetype-repository</artifactId> + <version>${project.version}</version> + <type>war</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>archetype-proxy</artifactId> + <version>${project.version}</version> + <type>war</type> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-14</version> + <executions> + <execution> + <id>archetype-common</id> + <goals> + <goal>java</goal> + <goal>xsd</goal> + <goal>xpp3-reader</goal> + <goal>xpp3-writer</goal> + </goals> + <configuration> + <version>1.0.0</version> + <model>src/main/mdo/archetype-common.mdo</model> + </configuration> + </execution> + <execution> + <id>archetype-registry</id> + <goals> + <goal>java</goal> + <goal>xsd</goal> + <goal>xpp3-reader</goal> + <goal>xpp3-writer</goal> + </goals> + <configuration> + <version>1.0.0</version> + <model>src/main/mdo/archetype-registry.mdo</model> + </configuration> + </execution> + <execution> + <id>archetype-descriptor</id> + <goals> + <goal>java</goal> + <goal>xsd</goal> + <goal>xpp3-reader</goal> + <goal>xpp3-writer</goal> + </goals> + <configuration> + <version>1.0.0</version> + <model>src/main/mdo/archetype-descriptor.mdo</model> + </configuration> + </execution> + <execution> + <id>archetype-catalog</id> + <goals> + <goal>java</goal> + <goal>xsd</goal> + <goal>xpp3-reader</goal> + <goal>xpp3-writer</goal> + </goals> + <configuration> + <version>1.0.0</version> + <model>src/main/mdo/archetype-catalog.mdo</model> + </configuration> + </execution> + <execution> + <id>archetype-old</id> + <goals> + <goal>java</goal> + <goal>xsd</goal> + <goal>xpp3-reader</goal> + <goal>xpp3-writer</goal> + </goals> + <configuration> + <version>1.0.0</version> + <model>src/main/mdo/archetype.mdo</model> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy</id> + <phase>process-test-resources</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/wars</outputDirectory> + <overWriteReleases>true</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + <includeTypes>war</includeTypes> + <stripVersion>true</stripVersion> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <dependencies> + <dependency> + <groupId>ant</groupId> + <artifactId>ant-antlr</artifactId> + <version>1.6.5</version> + </dependency> + </dependencies> + + <executions> + <execution> + <id>archetype-test</id> + <phase>process-test-resources</phase> + <configuration> + <tasks> + <property name="test.projects.name" value="basic" /> + <property name="test.projects.version" value="1.0" /> + <property name="test.projects.archetype" value="${test.projects.name}-${test.projects.version}" /> + <property name="test.projects.source.directory" value="${test.projects.archetype}" /> + <property name="test.projects.target.directory" value="archetypes/${test.projects.name}/${test.projects.version}" /> + <property name="test.projects.repository" value="repositories/central" /> + + <mkdir dir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/" /> + + <jar destfile="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/${test.projects.archetype}.jar" basedir="${basedir}/src/test/archetypes/${test.projects.source.directory}/" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + <execution> + <id>archetype-test-partial</id> + <phase>process-test-resources</phase> + <configuration> + <tasks> + <property name="test.projects.name" value="partial" /> + <property name="test.projects.version" value="1.0" /> + <property name="test.projects.archetype" value="${test.projects.name}-${test.projects.version}" /> + <property name="test.projects.source.directory" value="${test.projects.archetype}" /> + <property name="test.projects.target.directory" value="archetypes/${test.projects.name}/${test.projects.version}" /> + <property name="test.projects.repository" value="repositories/central" /> + <mkdir dir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/" /> + + <jar destfile="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/${test.projects.archetype}.jar" basedir="${basedir}/src/test/archetypes/${test.projects.source.directory}/" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + <execution> + <id>archetype-test-site</id> + <phase>process-test-resources</phase> + <configuration> + <tasks> + <property name="test.projects.name" value="site" /> + <property name="test.projects.version" value="1.0" /> + <property name="test.projects.archetype" value="${test.projects.name}-${test.projects.version}" /> + <property name="test.projects.source.directory" value="${test.projects.archetype}" /> + <property name="test.projects.target.directory" value="archetypes/${test.projects.name}/${test.projects.version}" /> + <property name="test.projects.repository" value="repositories/central" /> + + <mkdir dir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/" /> + + <jar destfile="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/${test.projects.archetype}.jar" basedir="${basedir}/src/test/archetypes/${test.projects.source.directory}/" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + <execution> + <id>archetype-test-old</id> + <phase>process-test-resources</phase> + <configuration> + <tasks> + <property name="test.projects.name" value="old" /> + <property name="test.projects.version" value="1.0" /> + <property name="test.projects.archetype" value="${test.projects.name}-${test.projects.version}" /> + <property name="test.projects.source.directory" value="${test.projects.archetype}" /> + <property name="test.projects.target.directory" value="archetypes/${test.projects.name}/${test.projects.version}" /> + <property name="test.projects.repository" value="repositories/central" /> + + <mkdir dir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/" /> + + <jar destfile="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/${test.projects.archetype}.jar" basedir="${basedir}/src/test/archetypes/${test.projects.source.directory}/" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + <execution> + <id>archetype-test-fileset</id> + <phase>process-test-resources</phase> + <configuration> + <tasks> + <property name="test.projects.name" value="fileset" /> + <property name="test.projects.version" value="1.0" /> + <property name="test.projects.archetype" value="${test.projects.name}-${test.projects.version}" /> + <property name="test.projects.source.directory" value="${test.projects.archetype}" /> + <property name="test.projects.target.directory" value="archetypes/${test.projects.name}/${test.projects.version}" /> + <property name="test.projects.repository" value="repositories/central" /> + + <mkdir dir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/" /> + + <jar destfile="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}/${test.projects.archetype}.jar" basedir="${basedir}/src/test/archetypes/${test.projects.source.directory}/" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + <execution> + <id>repository-metadata</id> + <phase>process-test-resources</phase> + <configuration> + <tasks> + <property name="test.projects.source.directory" value="${test.projects.archetype}" /> + <property name="test.projects.target.directory" value="archetypes" /> + <property name="test.projects.repository" value="repositories/central" /> + + <mkdir dir="${basedir}/target/test-classes/${test.projects.repository}/${test.projects.target.directory}" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/ArchetyperRoundtripTest.java</exclude> + <exclude>**/ArchetyperRoundtripWithProxyTest.java</exclude> + <exclude>**/DefaultRepositoryCrawlerTest.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <reporting> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.2</version> + </plugin> + </plugins> + </reporting> + + <profiles> + <profile> + <id>internal-catalog</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/*Verification.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/full-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/full-interpolation/pom.xml new file mode 100644 index 00000000..503dadb9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/full-interpolation/pom.xml @@ -0,0 +1,66 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3833</groupId> + <artifactId>coreit</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-3833</name> + <description> + Test that POM interpolation fully interpolates all properties in data flow chain, i.e. where property + A depends on property B, and property B depends on property C and so on. + </description> + + <properties> + <!-- + NOTE: Both the ordering (i.e. neither ascending nor descending) and the number of properties is crucial to + exhibit the bug. + --> + <property23>${property22}</property23> + <property21>${property20}</property21> + <property19>${property18}</property19> + <property17>${property16}</property17> + <property15>${property14}</property15> + <property13>${property12}</property13> + <property11>${property10}</property11> + <property09>${property08}</property09> + <property07>${property06}</property07> + <property05>${property04}</property05> + <property03>${property02}</property03> + <property01>${property00}</property01> + <property00>PASSED</property00> + <property02>${property01}</property02> + <property04>${property03}</property04> + <property06>${property05}</property06> + <property10>${property09}</property10> + <property12>${property11}</property12> + <property08>${property07}</property08> + <property14>${property13}</property14> + <property16>${property15}</property16> + <property18>${property17}</property18> + <property20>${property19}</property20> + <property22>${property21}</property22> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml new file mode 100644 index 00000000..4db43cd4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml @@ -0,0 +1,97 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3979</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3979</name> + <description> + Test that during inheritance the merging/joining of sub trees with equal identifier doesn't crash if the parent + POM has a non-empty element and the child POM has an empty element to join. + </description> + + <properties> + <prop0>test</prop0> + </properties> + + <repositories> + <repository> + <id>equal-repo-id</id> + <url>http://maven.apache.org/null</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + </repository> + </repositories> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>equal-build-exec-id</id> + <phase>initialize</phase> + <goals> + <goal>reset</goal> + </goals> + <configuration> + <logFile>target/exec.log</logFile> + <string>test</string> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <reportSets> + <reportSet> + <id>equal-report-exec-id</id> + <reports> + <report>reset</report> + </reports> + <configuration> + <logFile>target/exec.log</logFile> + <string>test</string> + </configuration> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml new file mode 100644 index 00000000..e65d26c2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml @@ -0,0 +1,84 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3979</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3979</name> + <description> + Test that during inheritance the merging/joining of sub trees with equal identifier doesn't crash if the parent + POM has a non-empty element and the child POM has an empty element to join. + </description> + + <properties/> + + <repositories> + <repository> + <id>equal-repo-id</id> + <url>file:///${basedir}/null</url> + <snapshots/> + <releases/> + </repository> + </repositories> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>equal-build-exec-id</id> + <phase>initialize</phase> + <goals/> + <configuration/> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <reportSets> + <reportSet> + <id>equal-report-exec-id</id> + <reports/> + <configuration/> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml new file mode 100644 index 00000000..640cf288 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/pom.xml @@ -0,0 +1,50 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4102</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-4102</name> + <description> + Verify that the effective value of an inherited property reflects the values of any nested property + as defined by the child. This boils down to the order of inheritance and (parent) interpolation. + </description> + + <properties> + <overridden>PARENT</overridden> + <!-- Test the effective value of this property in the child when "overridden" is defined by child as well --> + <interpolated>${overridden}</interpolated> + </properties> + + <profiles> + <profile> + <id>it-parent</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml new file mode 100644 index 00000000..2aa40ded --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/active-profile/sub/pom.xml @@ -0,0 +1,54 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4102</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng4102</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4102 :: Child</name> + <description> + Verify that the effective value of an inherited property reflects the values of any nested property + as defined by the child. This boils down to the order of inheritance and (parent) interpolation. + </description> + + <properties> + <overridden>CHILD</overridden> + </properties> + + <profiles> + <profile> + <id>it-child</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/pom.xml new file mode 100644 index 00000000..3e11a6d6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4102</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-4102</name> + <description> + Verify that the effective value of an inherited property reflects the values of any nested property + as defined by the child. This boils down to the order of inheritance and (parent) interpolation. + </description> + + <properties> + <overridden>PARENT</overridden> + <!-- Test the effective value of this property in the child when "overridden" is defined by child as well --> + <interpolated>${overridden}</interpolated> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/pom.xml new file mode 100644 index 00000000..49c8fd21 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/inherited-properties-interpolation/no-profile/sub/pom.xml @@ -0,0 +1,45 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4102</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng4102</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4102 :: Child</name> + <description> + Verify that the effective value of an inherited property reflects the values of any nested property + as defined by the child. This boils down to the order of inheritance and (parent) interpolation. + </description> + + <properties> + <overridden>CHILD</overridden> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/interpolation-cli-wins/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/interpolation-cli-wins/pom.xml new file mode 100644 index 00000000..39d8d9f8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/interpolation-cli-wins/pom.xml @@ -0,0 +1,39 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4208</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4208</name> + <description> + Test that CLI properties specified by the user override project properties during interpolation. + </description> + + <properties> + <testProperty>FAILED</testProperty> + <interpolatedProperty>${testProperty}</interpolatedProperty> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/jdk-activation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/jdk-activation/pom.xml new file mode 100644 index 00000000..c0431f58 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/jdk-activation/pom.xml @@ -0,0 +1,105 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng1957</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-1957</name> + <description> + Test that JDK profile activation allows version ranges. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>target/jdk.properties</outputFile> + <expressions> + <expression>project/properties</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>test-1</id> + <activation> + <jdk>[1.4,)</jdk> + </activation> + <properties> + <jdkProperty1>PASSED</jdkProperty1> + </properties> + </profile> + <profile> + <id>test-2</id> + <activation> + <jdk>(,100)</jdk> + </activation> + <properties> + <jdkProperty2>PASSED</jdkProperty2> + </properties> + </profile> + <profile> + <id>test-3</id> + <activation> + <jdk>(1.3,100)</jdk> + </activation> + <properties> + <jdkProperty3>PASSED</jdkProperty3> + </properties> + </profile> + <profile> + <id>test-4</id> + <activation> + <jdk>(100,)</jdk> + </activation> + <properties> + <jdkProperty4>FAILED</jdkProperty4> + </properties> + </profile> + <profile> + <id>test-5</id> + <activation> + <jdk>(,1.4)</jdk> + </activation> + <properties> + <jdkProperty5>FAILED</jdkProperty5> + </properties> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/join-different-containers-same-id/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/join-different-containers-same-id/pom.xml new file mode 100644 index 00000000..b3f48caa --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/join-different-containers-same-id/pom.xml @@ -0,0 +1,66 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>mng3984</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>MNG-3984</name> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-b</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>foo</id> + <goals> + <goal>a</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>foo</id> + <goals> + <goal>b</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/licenses-inheritance/child-2/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/licenses-inheritance/child-2/pom.xml new file mode 100644 index 00000000..9fd30bf5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/licenses-inheritance/child-2/pom.xml @@ -0,0 +1,47 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + While <licenses> are inherited, they are not aggregated, only the child licenses are used. + --> + + <parent> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng3843.child</groupId> + <artifactId>child-2</artifactId> + <version>0.2</version> + <packaging>jar</packaging> + + <licenses> + <license> + <name>child-license</name> + <url>http://child.url/license</url> + <distribution>repo</distribution> + </license> + </licenses> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/licenses-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/licenses-inheritance/pom.xml new file mode 100644 index 00000000..641bb37f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/licenses-inheritance/pom.xml @@ -0,0 +1,37 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <licenses> + <license> + <name>parent-license</name> + <url>http://parent.url/license</url> + <distribution>repo</distribution> + </license> + </licenses> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/limited-inheritance/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/limited-inheritance/child/pom.xml new file mode 100644 index 00000000..8e9e6237 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/limited-inheritance/child/pom.xml @@ -0,0 +1,61 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3845</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <organization> + <name>child-org</name> + </organization> + + <scm> + <developerConnection>https://child.url/scm</developerConnection> + </scm> + <issueManagement> + <url>http://child.url/issues</url> + </issueManagement> + <ciManagement> + <system>child-ci</system> + <url>http://child.url/ci</url> + </ciManagement> + <distributionManagement> + <repository> + <id>child-distros</id> + <url>ssh://child.url/distros</url> + </repository> + <snapshotRepository> + <id>child-snaps</id> + <url>ssh://child.url/snaps</url> + </snapshotRepository> + <site> + <id>child-site</id> + <url>scp://child.url/site</url> + </site> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/limited-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/limited-inheritance/pom.xml new file mode 100644 index 00000000..8bbe6eae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/limited-inheritance/pom.xml @@ -0,0 +1,87 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3845</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3845</name> + <description> + Test that inheritance is all-or-nothing for certain sub-trees of the POM. + </description> + + <organization> + <name>parent-org</name> + <url>http://parent.url/org</url> + </organization> + + <scm> + <url>http://parent.url/viewvc</url> + <connection>http://parent.url/scm</connection> + <developerConnection>https://parent.url/scm</developerConnection> + <tag>parent-tag</tag> + </scm> + <issueManagement> + <system>parent-issues</system> + <url>http://parent.url/issues</url> + </issueManagement> + <ciManagement> + <system>parent-ci</system> + <url>http://parent.url/ci</url> + <notifiers> + <notifier> + <type>irc</type> + <sendOnError>true</sendOnError> + <sendOnFailure>true</sendOnFailure> + <sendOnSuccess>false</sendOnSuccess> + <sendOnWarning>false</sendOnWarning> + <configuration> + <address>irc://parent.url/#ci</address> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <distributionManagement> + <repository> + <id>parent-distros</id> + <name>parent-distros</name> + <url>ssh://parent.url/distros</url> + <uniqueVersion>false</uniqueVersion> + <layout>legacy</layout> + </repository> + <snapshotRepository> + <id>parent-snaps</id> + <name>parent-snaps</name> + <url>ssh://parent.url/snaps</url> + <uniqueVersion>false</uniqueVersion> + <layout>legacy</layout> + </snapshotRepository> + <site> + <id>parent-site</id> + <name>parent-site</name> + <url>scp://parent.url/site</url> + </site> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/child-2/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/child-2/pom.xml new file mode 100644 index 00000000..95ce7fe6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/child-2/pom.xml @@ -0,0 +1,45 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + While <mailingLists> are inherited, they are not aggregated, only the child elements are used. + --> + + <parent> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng3843.child</groupId> + <artifactId>child-2</artifactId> + <version>0.2</version> + <packaging>jar</packaging> + + <mailingLists> + <mailingList> + <name>child-mailing-list</name> + </mailingList> + </mailingLists> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/pom.xml new file mode 100644 index 00000000..c9b05dfd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/mailing-lists-inheritance/pom.xml @@ -0,0 +1,35 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <mailingLists> + <mailingList> + <name>parent-mailing-list</name> + </mailingList> + </mailingLists> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/managed-profile-dependency/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/managed-profile-dependency/pom.xml new file mode 100644 index 00000000..88c9813a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/managed-profile-dependency/pom.xml @@ -0,0 +1,55 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4034</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-4034</name> + <description> + Verify that dependencies defined in profiles are subject to the dependency management of the parent. + </description> + + <modules> + <module>sub</module> + </modules> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>maven-core-it-support</artifactId> + <version>1.3</version> + <scope>runtime</scope> + <exclusions> + <exclusion> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </dependencyManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/managed-profile-dependency/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/managed-profile-dependency/sub/pom.xml new file mode 100644 index 00000000..88204fcd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/managed-profile-dependency/sub/pom.xml @@ -0,0 +1,55 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4034</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + + <groupId>org.apache.maven.its.mng4034</groupId> + <artifactId>child</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-4034</name> + <description> + Verify that dependencies defined in profiles are subject to the dependency management of the parent. + </description> + + <profiles> + <profile> + <id>maven-core-it</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>maven-core-it-support</artifactId> + <!-- version should be injected from dependency management of parent --> + </dependency> + </dependencies> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-filter-order/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-filter-order/pom.xml new file mode 100644 index 00000000..6f4df9ac --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-filter-order/pom.xml @@ -0,0 +1,44 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4008</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-4008</name> + <description> + Verify that filter definitions are properly merged. + </description> + + <build> + <filters> + <!-- NOTE: The first filter is deliberately defined by the child as well, so should not be added twice --> + <filter>src/main/filters/child-a.properties</filter> + <filter>src/main/filters/parent-c.properties</filter> + <filter>src/main/filters/parent-b.properties</filter> + <filter>src/main/filters/parent-d.properties</filter> + </filters> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-filter-order/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-filter-order/sub/pom.xml new file mode 100644 index 00000000..7e7155bf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-filter-order/sub/pom.xml @@ -0,0 +1,49 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4008</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + </parent> + + <groupId>org.apache.maven.its.mng4008</groupId> + <artifactId>test</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4008</name> + <description> + Verify that filter definitions are properly merged. + </description> + + <build> + <filters> + <filter>src/main/filters/child-a.properties</filter> + <filter>src/main/filters/child-c.properties</filter> + <filter>src/main/filters/child-b.properties</filter> + <filter>src/main/filters/child-d.properties</filter> + </filters> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..aba6bdf0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mngt/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3906</name> + <description> + Test that project-level plugin dependencies are properly merged during inheritance. + </description> + + <build> + <!-- NOTE: This parent uses plugin management --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <version>2.1-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>e</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>d</artifactId> + <version>1</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..1877ea54 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/w-plugin-mngt/sub/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3906</name> + <description> + Test that project-level plugin dependencies are properly merged during inheritance. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <version>2.1-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>c</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>2</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>b</artifactId> + <version>1</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..10226cfb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,62 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3906</name> + <description> + Test that project-level plugin dependencies are properly merged during inheritance. + </description> + + <build> + <!-- NOTE: This parent does not use plugin management --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <version>2.1-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>e</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>d</artifactId> + <version>1</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..1877ea54 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-class-path-order/wo-plugin-mngt/sub/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3906</name> + <description> + Test that project-level plugin dependencies are properly merged during inheritance. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <version>2.1-SNAPSHOT</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>c</artifactId> + <version>1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>a</artifactId> + <version>2</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng3906</groupId> + <artifactId>b</artifactId> + <version>1</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..fc09dba1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mngt/pom.xml @@ -0,0 +1,59 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3937</groupId> + <artifactId>parent-2</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3937</name> + <description> + Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly + ordered. + </description> + + <build> + <!-- This project uses plugin management for the test plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>merge</id> + <phase>validate</phase> + <goals> + <goal>parent-b</goal> + <goal>merged</goal> + <goal>parent-a</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..2148aa9b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/w-plugin-mngt/sub/pom.xml @@ -0,0 +1,59 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3937</groupId> + <artifactId>parent-2</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child-2</artifactId> + + <name>Maven Integration Test :: MNG-3937</name> + <description> + Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly + ordered. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>merge</id> + <phase>validate</phase> + <goals> + <goal>child-a</goal> + <goal>merged</goal> + <goal>child-b</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..b9c3f18b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,57 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3937</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3937</name> + <description> + Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly + ordered. + </description> + + <build> + <!-- This project does not use plugin management for the test plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>merge</id> + <phase>validate</phase> + <goals> + <goal>parent-b</goal> + <goal>merged</goal> + <goal>parent-a</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..fab233b2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-goals-order/wo-plugin-mngt/sub/pom.xml @@ -0,0 +1,59 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3937</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child-1</artifactId> + + <name>Maven Integration Test :: MNG-3937</name> + <description> + Test that during inheritance/merging of a plugin execution the goals specified by child and parent are properly + ordered. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>merge</id> + <phase>validate</phase> + <goals> + <goal>child-a</goal> + <goal>merged</goal> + <goal>child-b</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..ee4dedcf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/pom.xml @@ -0,0 +1,71 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3925</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3925</name> + <description> + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + </description> + + <build> + <!-- This project uses plugin management for the test plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>parent-1</id> + <phase>validate</phase> + <goals> + <goal>parent-1</goal> + </goals> + </execution> + <execution> + <id>parent-2</id> + <phase>validate</phase> + <goals> + <goal>parent-2</goal> + </goals> + </execution> + <execution> + <!-- NOTE: <id> deliberately omitted to use default value --> + <phase>validate</phase> + <goals> + <goal>parent-default</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..bf777db9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/w-plugin-mngt/sub/pom.xml @@ -0,0 +1,71 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3925</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3925</name> + <description> + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>child-1</id> + <phase>validate</phase> + <goals> + <goal>child-1</goal> + </goals> + </execution> + <execution> + <id>child-2</id> + <phase>validate</phase> + <goals> + <goal>child-2</goal> + </goals> + </execution> + <execution> + <!-- NOTE: <id> deliberately omitted to use default value --> + <phase>validate</phase> + <goals> + <goal>child-default</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..a816975f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,69 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3925</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3925</name> + <description> + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + </description> + + <build> + <!-- This project does not use plugin management for the test plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>parent-1</id> + <phase>validate</phase> + <goals> + <goal>parent-1</goal> + </goals> + </execution> + <execution> + <id>parent-2</id> + <phase>validate</phase> + <goals> + <goal>parent-2</goal> + </goals> + </execution> + <execution> + <!-- NOTE: <id> deliberately omitted to use default value --> + <phase>validate</phase> + <goals> + <goal>parent-default</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..bf777db9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/merged-plugin-exec-order/wo-plugin-mngt/sub/pom.xml @@ -0,0 +1,71 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3925</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3925</name> + <description> + Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with + parent executions. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>child-1</id> + <phase>validate</phase> + <goals> + <goal>child-1</goal> + </goals> + </execution> + <execution> + <id>child-2</id> + <phase>validate</phase> + <goals> + <goal>child-2</goal> + </goals> + </execution> + <execution> + <!-- NOTE: <id> deliberately omitted to use default value --> + <phase>validate</phase> + <goals> + <goal>child-default</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/micromailer/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/micromailer/pom.xml new file mode 100644 index 00000000..780faac2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/micromailer/pom.xml @@ -0,0 +1,124 @@ +<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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.sonatype.spice</groupId> + <artifactId>spice-parent</artifactId> + <version>11</version> + <relativePath>spice-parent-9.pom</relativePath> + </parent> + + <groupId>org.sonatype.micromailer</groupId> + <artifactId>micromailer</artifactId> + <version>1.0.3</version> + <packaging>jar</packaging> + <name>Micro Mailer</name> + <!-- SCM --> + <scm> + <connection>scm:svn:http://svn.sonatype.org/spice/trunk/micromailer</connection> + <url>http://svn.sonatype.org/spice/trunk/micromailer</url> + <developerConnection>scm:svn:https://svn.sonatype.org/spice/trunk/micromailer</developerConnection> + </scm> + + <dependencies> + + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-alpha-47</version> + <type>jar</type> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging-api</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.5.5</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + + <!-- Mail composition --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-velocity</artifactId> + <version>1.1.7</version> + <type>jar</type> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-api</artifactId> + </exclusion> + <exclusion> + <groupId>velocity</groupId> + <artifactId>velocity</artifactId> + </exclusion> + <exclusion> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity</artifactId> + <version>1.5</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + + <!-- Mail sending --> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + + <!-- Testing --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <type>jar</type> + <scope>test</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-maven-plugin</artifactId> + <version>1.3.8</version> + <executions> + <execution> + <goals> + <goal>child-descriptor</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/micromailer/spice-parent-9.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/micromailer/spice-parent-9.pom new file mode 100644 index 00000000..695c3c93 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/micromailer/spice-parent-9.pom @@ -0,0 +1,103 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.spice</groupId> + <artifactId>spice-parent</artifactId> + <version>11</version> + <packaging>pom</packaging> + <name>Sonatype Spice Components</name> + + <scm> + <connection>scm:svn:http://svn.sonatype.org/spice/trunk/spice-parent</connection> + <url>http://svn.sonatype.org/spice/trunk/spice-parent</url> + <developerConnection>scm:svn:https://svn.sonatype.org/spice/trunk/spice-parent</developerConnection> + </scm> + + <properties> + <!-- 2008.12.07 Oleg: reverted to 6.1.12 as http transport only works with that version + | Please always sync with mercury-http-transport !! + --> + <jetty.version>6.1.12</jetty.version> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-beta-1</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging-api</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-annotations</artifactId> + <version>1.0-beta-1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.5.5</version> + </dependency> + <dependency> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty</artifactId> + <version>${jetty.version}</version> + </dependency> + <dependency> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-client</artifactId> + <version>${jetty.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.5</version> + <scope>test</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <version>1.0-beta-1</version> + <executions> + <execution> + <id>process-classes</id> + <goals> + <goal>generate-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-maven-plugin</artifactId> + <version>1.3.8</version> + <executions> + <execution> + <goals> + <goal>descriptor</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-filters/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-filters/pom.xml new file mode 100644 index 00000000..1141efb5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-filters/pom.xml @@ -0,0 +1,17 @@ +<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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>a</groupId> + <artifactId>b</artifactId> + <version>1.0</version> + + <build> + <filters> + <filter>src/main/filters/a.properties</filter> + <filter>src/main/filters/c.properties</filter> + <filter>src/main/filters/b.properties</filter> + <filter>src/main/filters/d.properties</filter> + </filters> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-repos/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-repos/pom.xml new file mode 100644 index 00000000..e59cd0c3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-repos/pom.xml @@ -0,0 +1,44 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>mng3984</groupId> + <artifactId>test-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>MNG-3984</name> + <repositories> + <repository> + <id>central-parent</id> + <name>Maven Repository Switchboard</name> + <layout>default</layout> + <url>http://repo1.maven.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-repos/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-repos/sub/pom.xml new file mode 100644 index 00000000..d7b21020 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/multiple-repos/sub/pom.xml @@ -0,0 +1,45 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>mng3984</groupId> + <artifactId>test-1</artifactId> + <version>0.1</version> + </parent> + <groupId>mng3984</groupId> + <artifactId>test-2</artifactId> + <version>0.1</version> + + <name>MNG-3984</name> + <repositories> + <repository> + <id>central-child</id> + <name>Maven Repository Switchboard</name> + <layout>default</layout> + <url>http://repo1.maven.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/nested-build-dir-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/nested-build-dir-interpolation/pom.xml new file mode 100644 index 00000000..5632fad4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/nested-build-dir-interpolation/pom.xml @@ -0,0 +1,55 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3904</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-3904</name> + <description> + Test that properties which refer to build directories which in turn refer to other build directories are + properly interpolated. + </description> + + <properties> + <!-- These are the properties of interest --> + <dir0>${project.build.outputDirectory}/dir0</dir0> + <dir1>${project.build.testSourceDirectory}/dir1</dir1> + <dir2>${project.reporting.outputDirectory}/dir2</dir2> + </properties> + + <build> + <!-- Test properties which finally refer to ${project.basedir} --> + <directory>${project.basedir}/target</directory> + <outputDirectory>${project.build.directory}/classes</outputDirectory> + <!-- Test properties which finally refer to ${basedir} --> + <sourceDirectory>${basedir}/src</sourceDirectory> + <testSourceDirectory>${project.build.sourceDirectory}/test</testSourceDirectory> + </build> + + <reporting> + <outputDirectory>${project.build.directory}/site</outputDirectory> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/child3.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/child3.xml new file mode 100644 index 00000000..873f6f97 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/child3.xml @@ -0,0 +1,7 @@ +<project> + <groupId>gid</groupId> + <artifactId>child-3</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + <modelVersion>4.0.0</modelVersion> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/pom.xml new file mode 100644 index 00000000..89209d79 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/pom.xml @@ -0,0 +1,11 @@ +<project> + <parent> + <groupId>gid</groupId> + <artifactId>child-3</artifactId> + <version>1.0</version> + <relativePath>child3.xml</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>child-2</artifactId> + <packaging>pom</packaging> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/sub/pom.xml new file mode 100644 index 00000000..2d4671ed --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-inheritance/sub/pom.xml @@ -0,0 +1,9 @@ +<project> + <parent> + <groupId>gid</groupId> + <artifactId>child-2</artifactId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>child-1</artifactId> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-interpolation/pom.xml new file mode 100644 index 00000000..d2ae6ea2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-interpolation/pom.xml @@ -0,0 +1,16 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + <packaging>pom</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>${project.version}</version> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-interpolation/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-interpolation/sub/pom.xml new file mode 100644 index 00000000..752852b1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-interpolation/sub/pom.xml @@ -0,0 +1,9 @@ +<project> + <parent> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>a</artifactId> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-pom-packaging/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-pom-packaging/pom.xml new file mode 100644 index 00000000..16952455 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-pom-packaging/pom.xml @@ -0,0 +1,35 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4283</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <!-- NOTE: Any packaging other than "pom" must be rejected for a parent POM --> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4283</name> + <description> + Test that the model builder fails when a parent POM has not "pom" packaging. + </description> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-pom-packaging/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-pom-packaging/sub/pom.xml new file mode 100644 index 00000000..eca47eb3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/parent-pom-packaging/sub/pom.xml @@ -0,0 +1,40 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4283</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng4283</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4283</name> + <description> + Test that the model builder fails when a parent POM has not "pom" packaging. + </description> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/platform-file-separator/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/platform-file-separator/pom.xml new file mode 100644 index 00000000..26ba2943 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/platform-file-separator/pom.xml @@ -0,0 +1,40 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3877</groupId> + <artifactId>test</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-3877</name> + <description> + Verify that paths to project directories use the platform-specific file separator. + </description> + + <build> + <filters> + <filter>src/main/filters/it.properties</filter> + </filters> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/pom.xml new file mode 100644 index 00000000..60180d51 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/pom.xml @@ -0,0 +1,80 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng2591</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-2591</name> + <description> + Test aggregation of list configuration items for build plugins when using + 'combine.children=append' attribute. + </description> + + <modules> + <module>subproject</module> + </modules> + + <build> + <pluginManagement> + <plugins> + <plugin> + <!-- inherit via <pluginManagement> --> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <inherited>true</inherited> + <configuration> + <listParam> + <!-- NOTE: These values are deliberately not in alpha order! --> + <listParam>PARENT-1</listParam> + <listParam>PARENT-3</listParam> + <listParam>PARENT-2</listParam> + <listParam>PARENT-4</listParam> + </listParam> + </configuration> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <!-- inherit not via <pluginManagement> --> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <inherited>true</inherited> + <configuration> + <stringParams> + <!-- NOTE: These values are deliberately not in alpha order! --> + <stringParam>PARENT-1</stringParam> + <stringParam>PARENT-3</stringParam> + <stringParam>PARENT-2</stringParam> + <stringParam>PARENT-4</stringParam> + </stringParams> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/subproject/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/subproject/pom.xml new file mode 100644 index 00000000..cef53d32 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/no-profile/subproject/pom.xml @@ -0,0 +1,70 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng2591</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + </parent> + + <artifactId>subproject</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <propertiesFile>target/config.properties</propertiesFile> + <stringParams combine.children="append"> + <!-- NOTE: These values are deliberately not in alpha order! --> + <stringParam>CHILD-1</stringParam> + <stringParam>CHILD-3</stringParam> + <stringParam>CHILD-2</stringParam> + <stringParam>CHILD-4</stringParam> + </stringParams> + <listParam combine.children="append"> + <!-- NOTE: These values are deliberately not in alpha order! --> + <listParam>CHILD-1</listParam> + <listParam>CHILD-3</listParam> + <listParam>CHILD-2</listParam> + <listParam>CHILD-4</listParam> + </listParam> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>config</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/pom.xml new file mode 100644 index 00000000..72ab3f45 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/pom.xml @@ -0,0 +1,90 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng2591</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-2591</name> + <description> + Test aggregation of list configuration items for build plugins when using + 'combine.children=append' attribute. + </description> + + <modules> + <module>subproject</module> + </modules> + + <build> + <pluginManagement> + <plugins> + <plugin> + <!-- inherit via <pluginManagement> --> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <inherited>true</inherited> + <configuration> + <listParam> + <!-- NOTE: These values are deliberately not in alpha order! --> + <listParam>PARENT-1</listParam> + <listParam>PARENT-3</listParam> + <listParam>PARENT-2</listParam> + <listParam>PARENT-4</listParam> + </listParam> + </configuration> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <!-- inherit not via <pluginManagement> --> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <inherited>true</inherited> + <configuration> + <stringParams> + <!-- NOTE: These values are deliberately not in alpha order! --> + <stringParam>PARENT-1</stringParam> + <stringParam>PARENT-3</stringParam> + <stringParam>PARENT-2</stringParam> + <stringParam>PARENT-4</stringParam> + </stringParams> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <!-- an active but empty profile to ensure profile injection does not interfere with plugin configuration --> + <id>parent</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/subproject/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/subproject/pom.xml new file mode 100644 index 00000000..70235030 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-append/with-profile/subproject/pom.xml @@ -0,0 +1,80 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng2591</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + </parent> + + <artifactId>subproject</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <propertiesFile>target/config.properties</propertiesFile> + <stringParams combine.children="append"> + <!-- NOTE: These values are deliberately not in alpha order! --> + <stringParam>CHILD-1</stringParam> + <stringParam>CHILD-3</stringParam> + <stringParam>CHILD-2</stringParam> + <stringParam>CHILD-4</stringParam> + </stringParams> + <listParam combine.children="append"> + <!-- NOTE: These values are deliberately not in alpha order! --> + <listParam>CHILD-1</listParam> + <listParam>CHILD-3</listParam> + <listParam>CHILD-2</listParam> + <listParam>CHILD-4</listParam> + </listParam> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>config</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <!-- an active but empty profile to ensure profile injection does not interfere with plugin configuration --> + <id>child</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..2f350715 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-plugin-mngt/pom.xml @@ -0,0 +1,62 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4053</groupId> + <artifactId>test2</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-4053</name> + <description> + Verify that attributes in plugin configuration elements are not erroneously duplicated to other elements when + plugin management is used. + </description> + + <build> + <!-- NOTE: This test used plugin management for the IT plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <propertiesFile>target/config.properties</propertiesFile> + <domParam> + <copy todir="src" overwrite="true"> + <fileset dir="target"/> + </copy> + </domParam> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-profile/pom.xml new file mode 100644 index 00000000..f2d8c6c0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/w-profile/pom.xml @@ -0,0 +1,74 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4053</groupId> + <artifactId>test3</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-4053</name> + <description> + Verify that attributes in plugin configuration elements are not erroneously duplicated to other elements when + plugin management and a profile are used. + </description> + + <build> + <!-- NOTE: This test used plugin management for the IT plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> + + <profiles> + <profile> + <!-- NOTE: This test injects the plugin configuration via a profile --> + <id>maven-core-it</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <propertiesFile>target/config.properties</propertiesFile> + <domParam> + <copy todir="src" overwrite="true"> + <fileset dir="target"/> + </copy> + </domParam> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..c844b447 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-attributes/wo-plugin-mngt/pom.xml @@ -0,0 +1,53 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4053</groupId> + <artifactId>test1</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-4053</name> + <description> + Verify that attributes in plugin configuration elements are not erroneously duplicated to other elements when + no plugin management is used. + </description> + + <build> + <!-- NOTE: This test does not use plugin management for the IT plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <propertiesFile>target/config.properties</propertiesFile> + <domParam> + <copy todir="src" overwrite="true"> + <fileset dir="target"/> + </copy> + </domParam> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-merging/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-merging/child/pom.xml new file mode 100644 index 00000000..f8172448 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-merging/child/pom.xml @@ -0,0 +1,76 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3836</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + + <groupId>org.apache.maven.its.mng3836</groupId> + <artifactId>child</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3836</name> + <description> + Verify that children can *override* inherited plugin configuration. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <!-- + All of these values should override the ones inherited from the parent. In particular, collections should not + be merged with the values given by the parent POM. + --> + <propertiesFile>PASSED</propertiesFile> + <stringParams> + <stringParam>PASSED-1</stringParam> + <stringParam>PASSED-3</stringParam> + <stringParam>PASSED-2</stringParam> + <stringParam>PASSED-4</stringParam> + </stringParams> + <listParam> + <listParam>PASSED-1</listParam> + <listParam>PASSED-3</listParam> + <listParam>PASSED-2</listParam> + <listParam>PASSED-4</listParam> + </listParam> + </configuration> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>config</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-merging/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-merging/pom.xml new file mode 100644 index 00000000..12f2c2d6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-merging/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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3836</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3836</name> + <description> + Verify that children can *override* inherited plugin configuration. + </description> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <propertiesFile>FAILED</propertiesFile> + <stringParams> + <stringParam>FAILED-1</stringParam> + <stringParam>FAILED-3</stringParam> + <stringParam>FAILED-2</stringParam> + <stringParam>FAILED-4</stringParam> + </stringParams> + </configuration> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <propertiesFile>FAILED</propertiesFile> + <listParam> + <listParam>FAILED-1</listParam> + <listParam>FAILED-3</listParam> + <listParam>FAILED-2</listParam> + <listParam>FAILED-4</listParam> + </listParam> + <parent>PASSED</parent> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..7d7dfd81 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-order/w-plugin-mngt/pom.xml @@ -0,0 +1,68 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3827</groupId> + <artifactId>test2</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3827</name> + <description> + Verify that plain plugin configuration works correctly. + </description> + + <build> + <!-- This project uses plugin management for the test plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <configuration> + <stringParams> + <stringParam>one</stringParam> + <stringParam>two</stringParam> + <stringParam>three</stringParam> + <stringParam>four</stringParam> + </stringParams> + </configuration> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>config</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..e300fe1e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,60 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3827</groupId> + <artifactId>test1</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3827</name> + <description> + Verify that plain plugin configuration works correctly. + </description> + + <build> + <!-- This project does not use plugin management for the test plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>1.0</version> + <configuration> + <stringParams> + <stringParam>one</stringParam> + <stringParam>two</stringParam> + <stringParam>three</stringParam> + <stringParam>four</stringParam> + </stringParams> + </configuration> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>config</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-properties/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-properties/pom.xml new file mode 100644 index 00000000..e5660391 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-config-properties/pom.xml @@ -0,0 +1,30 @@ +<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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>a</groupId> + <artifactId>b</artifactId> + <version>1.0</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4</version> + <configuration> + <systemProperties> + <property> + <name>my.property</name> + <value>my.value</value> + </property> + </systemProperties> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..9f66b49e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-config-order/w-plugin-mngt/pom.xml @@ -0,0 +1,78 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3827</groupId> + <artifactId>test2</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3864</name> + <description> + Verify that plain per-execution plugin configuration works correctly. + </description> + + <build> + <!-- This project uses plugin management for the test plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>config</goal> + </goals> + <configuration> + <stringParams> + <stringParam>one</stringParam> + <stringParam>two</stringParam> + <stringParam>three</stringParam> + <stringParam>four</stringParam> + </stringParams> + <propertiesParam> + <property> + <name>key1</name> + <value>value1</value> + </property> + <property> + <name>key2</name> + <value>value2</value> + </property> + </propertiesParam> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..4e1eafe3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-config-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,70 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3827</groupId> + <artifactId>test1</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-3864</name> + <description> + Verify that plain per-execution plugin configuration works correctly. + </description> + + <build> + <!-- This project does not use plugin management for the test plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>1.0</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>config</goal> + </goals> + <configuration> + <stringParams> + <stringParam>one</stringParam> + <stringParam>two</stringParam> + <stringParam>three</stringParam> + <stringParam>four</stringParam> + </stringParams> + <propertiesParam> + <property> + <name>key1</name> + <value>value1</value> + </property> + <property> + <name>key2</name> + <value>value2</value> + </property> + </propertiesParam> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..d4ac3b0e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/w-plugin-mngt/pom.xml @@ -0,0 +1,66 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3886</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3886</name> + <description> + Test that the goals from a plugin execution are executed in the order given by the POM, regardless whether + plugin management is present or not. + </description> + + <build> + <!-- This project uses plugin management for the test plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <goals> + <goal>b</goal> + <goal>a</goal> + <goal>d</goal> + <goal>c</goal> + <goal>e</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..438d9d1a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-goals-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,57 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3886</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3886</name> + <description> + Test that the goals from a plugin execution are executed in the order given by the POM, regardless whether + plugin management is present or not. + </description> + + <build> + <!-- This project does not use plugin management for the test plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <goals> + <goal>b</goal> + <goal>a</goal> + <goal>d</goal> + <goal>c</goal> + <goal>e</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/pom.xml new file mode 100644 index 00000000..2b534d76 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/pom.xml @@ -0,0 +1,75 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4129</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-4129</name> + <description> + Verify that plugin executions defined in the parent with inherited=false are not executed in child modules. + </description> + + <modules> + <module>child-1</module> + <module>child-2</module> + </modules> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>inherited-execution</id> + <inherited>true</inherited> + <phase>validate</phase> + <goals> + <goal>log-string</goal> + </goals> + <configuration> + <logFile>target/executions.txt</logFile> + <string>inherited-execution</string> + </configuration> + </execution> + <execution> + <id>non-inherited-execution</id> + <inherited>false</inherited> + <phase>validate</phase> + <goals> + <goal>log-string</goal> + </goals> + <configuration> + <logFile>target/executions.txt</logFile> + <string>non-inherited-execution</string> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/w-merge/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/w-merge/pom.xml new file mode 100644 index 00000000..f60cfd5c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/w-merge/pom.xml @@ -0,0 +1,48 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4129</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child-1</artifactId> + + <name>Maven Integration Test :: MNG-4129 :: Child-1</name> + <description> + Verify that plugin executions defined in the parent with inherited=false are not executed in child modules. + </description> + + <build> + <plugins> + <!-- NOTE: It's essential part of this test variant to redefine the test plugin again, i.e. trigger plugin merging --> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/wo-merge/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/wo-merge/pom.xml new file mode 100644 index 00000000..23cfc0c2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-inheritance/wo-merge/pom.xml @@ -0,0 +1,43 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4129</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child-2</artifactId> + + <name>Maven Integration Test :: MNG-4129 :: Child-2</name> + <description> + Verify that plugin executions defined in the parent with inherited=false are not executed in child modules. + </description> + + <build> + <plugins> + <!-- NOTE: It's essential part of this test variant to *not* define the test plugin again, i.e. bypass plugin merging --> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/pom.xml new file mode 100644 index 00000000..b64af3ae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/pom.xml @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3916</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3943</name> + <description> + Test that plugin executions are properly merged during inheritance, even if the child uses a different + plugin version than the parent. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <!-- NOTE: Use different version than child --> + <version>1.0</version> + <executions> + <execution> + <id>parent-1</id> + <phase>parent-1</phase> + </execution> + <execution> + <id>parent-2</id> + <phase>parent-2</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/sub/pom.xml new file mode 100644 index 00000000..f96116ad --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-version-insensitive/sub/pom.xml @@ -0,0 +1,59 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3916</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3943</name> + <description> + Test that plugin executions are properly merged during inheritance, even if the child uses a different + plugin version than the parent. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <!-- NOTE: Use different version than parent --> + <version>2.0</version> + <executions> + <execution> + <id>child-1</id> + <phase>child-1</phase> + </execution> + <execution> + <id>child-2</id> + <phase>child-2</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/pom.xml new file mode 100644 index 00000000..127fa259 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/pom.xml @@ -0,0 +1,55 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3916</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3916</name> + <description> + Test that plugin executions are properly merged during inheritance, even if the child plugin section has no + version. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0</version> + <executions> + <execution> + <id>parent-1</id> + <phase>parent-1</phase> + </execution> + <execution> + <id>parent-2</id> + <phase>parent-2</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/sub/pom.xml new file mode 100644 index 00000000..61841aec --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging-wo-version/sub/pom.xml @@ -0,0 +1,58 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3916</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3916</name> + <description> + Test that plugin executions are properly merged during inheritance, even if the child plugin section has no + version. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <!-- NOTE: <version> element deliberately omitted here --> + <executions> + <execution> + <id>child-1</id> + <phase>child-1</phase> + </execution> + <execution> + <id>child-2</id> + <phase>child-2</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..6bcfee56 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mngt/pom.xml @@ -0,0 +1,58 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3938</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3938</name> + <description> + Test that plugin executions with the same id are merged during inheritance, especially executions using the + default id, regardless whether the id is given explicitly by the user or implicitly assumed from defaults. + </description> + + <build> + <!-- This project uses plugin management for the test plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <!-- NOTE: Implicitly reference "default" id here, i.e. omit the <id> element --> + <phase>parent-default</phase> + </execution> + <execution> + <id>non-default</id> + <phase>parent-non-default</phase> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..3129ad02 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/w-plugin-mngt/sub/pom.xml @@ -0,0 +1,59 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3938</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3938</name> + <description> + Test that plugin executions with the same id are merged during inheritance, especially executions using the + default id, regardless whether the id is given explicitly by the user or implicitly assumed from defaults. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <!-- NOTE: Explicitly reference "default" id here --> + <id>default</id> + <phase>child-default</phase> + </execution> + <execution> + <id>non-default</id> + <phase>child-non-default</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..63db85f6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mngt/pom.xml @@ -0,0 +1,56 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3938</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3938</name> + <description> + Test that plugin executions with the same id are merged during inheritance, especially executions using the + default id, regardless whether the id is given explicitly by the user or implicitly assumed from defaults. + </description> + + <build> + <!-- This project does not use plugin management for the test plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <!-- NOTE: Implicitly reference "default" id here, i.e. omit the <id> element --> + <phase>parent-default</phase> + </execution> + <execution> + <id>non-default</id> + <phase>parent-non-default</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mngt/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mngt/sub/pom.xml new file mode 100644 index 00000000..3129ad02 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-merging/wo-plugin-mngt/sub/pom.xml @@ -0,0 +1,59 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3938</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + + <name>Maven Integration Test :: MNG-3938</name> + <description> + Test that plugin executions with the same id are merged during inheritance, especially executions using the + default id, regardless whether the id is given explicitly by the user or implicitly assumed from defaults. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <!-- NOTE: Explicitly reference "default" id here --> + <id>default</id> + <phase>child-default</phase> + </execution> + <execution> + <id>non-default</id> + <phase>child-non-default</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order-and-default-exec/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order-and-default-exec/pom.xml new file mode 100644 index 00000000..864fedb9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order-and-default-exec/pom.xml @@ -0,0 +1,71 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4332</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <!-- NOTE: The upper-case packaging name is intentional and triggers a special mode in the EmptyLifecycleExecutor --> + <packaging>JAR</packaging> + + <name>Maven Integration Test :: MNG-4332</name> + <description> + Verify that default plugin executions contributed by the packaging are executed before user-defined + executions from the POM's build section, regardless whether the executions are defined in the regular + plugins section or the plugin management section. + </description> + + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.2</version> + <executions> + <execution> + <id>test-1</id> + <goals> + <goal>resources</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.2</version> + <executions> + <execution> + <id>test-2</id> + <goals> + <goal>resources</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order-with-lifecycle/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order-with-lifecycle/pom.xml new file mode 100644 index 00000000..6035e816 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order-with-lifecycle/pom.xml @@ -0,0 +1,52 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4341</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <!-- NOTE: The upper-case packaging name is intentional and triggers a special mode in the EmptyLifecycleExecutor --> + <packaging>JAR</packaging> + + <name>Maven Integration Test :: MNG-4341</name> + <description> + Test that plugins bound to the same phase get executed in POM order even if one of the plugins participates + in the default lifecycle bindings for the project's packaging. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <!-- NOTE: It's essential that this plugin is also referenced by the default lifecycle bindings --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..2c552d4c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order/w-plugin-mngt/pom.xml @@ -0,0 +1,76 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3887</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3887</name> + <description> + Test that multiple plugin executions bound to the same phase are executed in the order given by the POM. + </description> + + <build> + <!-- This project uses plugin management for the test plugin --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>b</id> + <phase>validate</phase> + </execution> + <execution> + <id>a</id> + <phase>validate</phase> + </execution> + <execution> + <id>d</id> + <phase>validate</phase> + </execution> + <execution> + <id>c</id> + <phase>validate</phase> + </execution> + <execution> + <id>e</id> + <phase>validate</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..c4ceaae3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-order/wo-plugin-mngt/pom.xml @@ -0,0 +1,67 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3887</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3887</name> + <description> + Test that multiple plugin executions bound to the same phase are executed in the order given by the POM. + </description> + + <build> + <!-- This project does not use plugin management for the test plugin --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-a</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>b</id> + <phase>validate</phase> + </execution> + <execution> + <id>a</id> + <phase>validate</phase> + </execution> + <execution> + <id>d</id> + <phase>validate</phase> + </execution> + <execution> + <id>c</id> + <phase>validate</phase> + </execution> + <execution> + <id>e</id> + <phase>validate</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/w-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/w-plugin-mngt/pom.xml new file mode 100644 index 00000000..fbae181f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/w-plugin-mngt/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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4000</groupId> + <artifactId>test2</artifactId> + <version>0.1</version> + + <name>Maven Integration Test :: MNG-4000</name> + <description> + Test that plugin executions without id are not lost among other plugin executions. + </description> + + <build> + <!-- NOTE: This test uses plugin management for the IT plugin. --> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <configuration> + <logFile>target/exec.log</logFile> + <string>exec</string> + </configuration> + <executions> + <execution> + <id>exec-1</id> + <phase>validate</phase> + <goals> + <goal>log-string</goal> + </goals> + </execution> + <execution> + <!-- NOTE: <id> deliberately omitted here! --> + <phase>validate</phase> + <goals> + <goal>log-string</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/wo-plugin-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/wo-plugin-mngt/pom.xml new file mode 100644 index 00000000..7910084f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-exec-w-and-wo-id/wo-plugin-mngt/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4000</groupId> + <artifactId>test1</artifactId> + <version>0.1</version> + + <name>Maven Integration Test :: MNG-4000</name> + <description> + Test that plugin executions without id are not lost among other plugin executions. + </description> + + <build> + <!-- NOTE: This test does not use plugin management for the IT plugin. --> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <logFile>target/exec.log</logFile> + <string>exec</string> + </configuration> + <executions> + <execution> + <id>exec-1</id> + <phase>validate</phase> + <goals> + <goal>log-string</goal> + </goals> + </execution> + <execution> + <!-- NOTE: <id> deliberately omitted here! --> + <phase>validate</phase> + <goals> + <goal>log-string</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/pom.xml new file mode 100644 index 00000000..e42b0306 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/pom.xml @@ -0,0 +1,67 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4415</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-4415</name> + <description> + Test that merging of plugins during inheritance follows these rules regarding ordering: + parent: X -> A -> B -> D -> E + child: Y -> A -> C -> D -> F + result: X -> Y -> A -> B -> C -> D -> E -> F + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-error</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-packaging</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-fork</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/sub/pom.xml new file mode 100644 index 00000000..8d44b8cc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-merge-order/sub/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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng4415</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng4415</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + + <name>Maven Integration Test :: MNG-4415</name> + <description> + Test that merging of plugins during inheritance follows these rules regarding ordering: + parent: X -> A -> B -> D -> E + child: Y -> A -> C -> D -> F + result: X -> Y -> A -> B -> C -> D -> E -> F + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-touch</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-order/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-order/child/pom.xml new file mode 100644 index 00000000..5350fa87 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-order/child/pom.xml @@ -0,0 +1,51 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3808</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + </parent> + <artifactId>child</artifactId> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-order/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-order/pom.xml new file mode 100644 index 00000000..f66ae25c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-order/pom.xml @@ -0,0 +1,68 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3808</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3808</name> + <description> + Test the reports are executeed in the order given in the POM. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </reporting> + + <modules> + <module>child</module> + </modules> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-simple/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-simple/pom.xml new file mode 100644 index 00000000..b73bfce5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-simple/pom.xml @@ -0,0 +1,17 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-simple/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-simple/sub/pom.xml new file mode 100644 index 00000000..f6ed4dd4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-inheritance-simple/sub/pom.xml @@ -0,0 +1,20 @@ +<project> + <parent> + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin2</artifactId> + <version>1.0-alpha-21</version> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-injection-merge-order/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-injection-merge-order/pom.xml new file mode 100644 index 00000000..76459e2d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-injection-merge-order/pom.xml @@ -0,0 +1,133 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4416</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + + <name>Maven Integration Test :: MNG-4416</name> + <description> + Test that merging of plugins during profile injection follows these rules regarding ordering: + model: X -> A -> B -> D -> E + profile: Y -> A -> C -> D -> F + result: X -> Y -> A -> B -> C -> D -> E -> F + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-error</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-packaging</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-fork</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>test</id> + <activation> + <property> + <name>!skip-mng4416</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <logFile>target/it.properties</logFile> + </configuration> + <executions> + <execution> + <id>first</id> + <phase>validate</phase> + <goals> + <goal>reset</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>target/it.properties</outputFile> + <expressions> + <expression>project/build/plugins</expression> + </expressions> + </configuration> + <executions> + <execution> + <id>second</id> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-touch</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-dependencies/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-dependencies/pom.xml new file mode 100644 index 00000000..bcdb05aa --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-dependencies/pom.xml @@ -0,0 +1,25 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + <dependencies> + <dependency> + <groupId>a</groupId> + <artifactId>b</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </pluginManagement> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-dependencies/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-dependencies/sub/pom.xml new file mode 100644 index 00000000..7f73423e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-dependencies/sub/pom.xml @@ -0,0 +1,25 @@ +<project> + <parent> + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + <profiles> + <profile> + <id>test</id> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-duplicate/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-duplicate/pom.xml new file mode 100644 index 00000000..37e7278a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-duplicate/pom.xml @@ -0,0 +1,39 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins + </groupId> + <artifactId>maven-it-plugin-configuration + </artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-duplicate/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-duplicate/sub/pom.xml new file mode 100644 index 00000000..5e844b79 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-duplicate/sub/pom.xml @@ -0,0 +1,64 @@ +<?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> + <parent> + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4053</groupId> + <artifactId>test2</artifactId> + <version>1.0-SNAPSHOT</version> + + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/child/pom.xml new file mode 100644 index 00000000..fce35882 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/child/pom.xml @@ -0,0 +1,53 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng0522</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + + <artifactId>child-project</artifactId> + <version>1.0-SNAPSHOT</version> + <!-- NOTE: The upper-case packaging name is intentional and triggers a special mode in the EmptyLifecycleExecutor --> + <packaging>JAR</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <executions> + <execution> + <id>test</id> + <phase>initialize</phase> + <goals> + <goal>reset</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/pom.xml new file mode 100644 index 00000000..d9412769 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-for-implicit-plugin/pom.xml @@ -0,0 +1,61 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng0522</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-522</name> + <description>Test for pluginManagement injection of plugin configuration.</description> + + <modules> + <module>child</module> + </modules> + + <build> + <pluginManagement> + <plugins> + <plugin> + <!-- this checks handling of a plugin which is implicitly bound to the lifecycle --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + <configuration> + <pathname>passed.txt</pathname> + </configuration> + </plugin> + <plugin> + <!-- this checks handling of a plugin which is explicitly bound to the lifecycle --> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <logFile>passed.txt</logFile> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-inheritance/pom.xml new file mode 100644 index 00000000..85b7bd94 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-management-inheritance/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.it0052</groupId> + <artifactId>maven-it-it0052</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: it0052</name> + <description>Test that source attachment doesn't take place when -DperformRelease=true is missing.</description> + + <!-- NOTE: Use stub versions of the core plugins referenced by the build --> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>0.1-stub-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-merge-simple/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-merge-simple/pom.xml new file mode 100644 index 00000000..10eac25f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-merge-simple/pom.xml @@ -0,0 +1,17 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus-indexer</artifactId> + <version>1.1.3-SNAPSHOT</version> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-order/nexus-parent.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-order/nexus-parent.xml new file mode 100644 index 00000000..607da777 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-order/nexus-parent.xml @@ -0,0 +1,19 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus-parent</artifactId> + <version>8-SNAPSHOT</version> + <packaging>pom</packaging> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <version>1.4.0</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-order/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-order/pom.xml new file mode 100644 index 00000000..408d17f0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/plugin-order/pom.xml @@ -0,0 +1,28 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus-parent</artifactId> + <version>8-SNAPSHOT</version> + <relativePath>nexus-parent.xml</relativePath> + </parent> + + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus-indexer</artifactId> + <version>1.1.3-SNAPSHOT</version> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + </plugin> + + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.3</version> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pluginmanagement-inherited/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pluginmanagement-inherited/pom.xml new file mode 100644 index 00000000..477451df --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pluginmanagement-inherited/pom.xml @@ -0,0 +1,18 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + <packaging>pom</packaging> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0-alpha-21</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pluginmanagement-inherited/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pluginmanagement-inherited/sub/pom.xml new file mode 100644 index 00000000..319e6adb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pluginmanagement-inherited/sub/pom.xml @@ -0,0 +1,17 @@ +<project> + <parent> + <groupId>org.sonatype.nexus</groupId> + <artifactId>nexus</artifactId> + <version>1.3.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>a</artifactId> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-encoding/latin-1/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-encoding/latin-1/pom.xml new file mode 100644 index 00000000..b338399f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-encoding/latin-1/pom.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- +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. +--> + +<!-- +NOTE: This POM's XML declaration intentionally declares Latin-1 encoding. +--> + +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng2254</groupId> + <artifactId>latin-1</artifactId> + <version>0.1-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-2254 :: Latin-1</name> + <description>TEST-CHARS: ÄÖÜäöüß</description> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-encoding/utf-8/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-encoding/utf-8/pom.xml new file mode 100644 index 00000000..4400aa70 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-encoding/utf-8/pom.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> + +<!-- +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. +--> + +<!-- +NOTE: This POM's XML declaration specified no encoding which should therefore default to UTF-8. +--> + +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng2254</groupId> + <artifactId>utf-8</artifactId> + <version>0.1-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-2254 :: UTF-8</name> + <description>TEST-CHARS: ßıΣЯ×€</description> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-inheritance/pom.xml new file mode 100644 index 00000000..f96a9400 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-inheritance/pom.xml @@ -0,0 +1,188 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + This parent POM overrides most super POM defaults to test inheritance in child modules. + --> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>parent-name</name> + <description>parent-description</description> + <url>http://parent.url/</url> + <inceptionYear>2008</inceptionYear> + <organization> + <name>parent-org</name> + <url>http://parent-org.url/</url> + </organization> + <licenses> + <license> + <name>parent-license</name> + <url>http://parent.url/license</url> + <distribution>repo</distribution> + </license> + </licenses> + + <developers> + <developer> + <name>parent-developer</name> + </developer> + </developers> + <contributors> + <contributor> + <name>parent-contributor</name> + </contributor> + </contributors> + + <mailingLists> + <mailingList> + <name>parent-mailing-list</name> + </mailingList> + </mailingLists> + + <prerequisites> + <maven>2.0</maven> + </prerequisites> + + <modules> + <module>child-1</module> + <module>child-2</module> + </modules> + + <scm> + <url>http://parent.url/trunk</url> + <connection>http://parent.url/scm</connection> + <developerConnection>https://parent.url/scm</developerConnection> + </scm> + <issueManagement> + <url>http://parent.url/issues</url> + </issueManagement> + <ciManagement> + <url>http://parent.url/ci</url> + </ciManagement> + <distributionManagement> + <repository> + <url>http://parent.url/dist</url> + <id>parent.distros</id> + </repository> + <snapshotRepository> + <url>http://parent.url/snaps</url> + <id>parent.snaps</id> + </snapshotRepository> + <site> + <url>http://parent.url/site</url> + <id>parent.site</id> + </site> + <downloadUrl>http://parent.url/download</downloadUrl> + <relocation> + <message>parent-reloc-msg</message> + </relocation> + </distributionManagement> + + <properties> + <parentProperty>parent-property</parentProperty> + <overriddenProperty>parent-property</overriddenProperty> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-dep-a</artifactId> + <version>1</version> + <scope>test</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-dep-b</artifactId> + <version>1</version> + <scope>test</scope> + </dependency> + </dependencies> + + <repositories> + <repository> + <id>parent-remote-repo</id> + <url>http://parent.url/remote</url> + </repository> + </repositories> + + <build> + <defaultGoal>initialize</defaultGoal> + <directory>out</directory> + <sourceDirectory>src/main</sourceDirectory> + <scriptSourceDirectory>src/scripts</scriptSourceDirectory> + <testSourceDirectory>src/test</testSourceDirectory> + <outputDirectory>out/main</outputDirectory> + <testOutputDirectory>out/test</testOutputDirectory> + <resources> + <resource> + <directory>res/main</directory> + </resource> + </resources> + <testResources> + <testResource> + <directory>res/test</directory> + </testResource> + </testResources> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>target/pom.properties</outputFile> + <expressions> + <expression>project</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <excludeDefaults>true</excludeDefaults> + <outputDirectory>site</outputDirectory> + </reporting> + + <profiles> + <profile> + <id>parent-profile</id> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-inheritance/sub/pom.xml new file mode 100644 index 00000000..ae749028 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/pom-inheritance/sub/pom.xml @@ -0,0 +1,36 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + This minimalistic POM tests mere inheritance from its parent. + --> + + <parent> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child-1</artifactId> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/prerequisites-inheritance/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/prerequisites-inheritance/child/pom.xml new file mode 100644 index 00000000..349a0c38 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/prerequisites-inheritance/child/pom.xml @@ -0,0 +1,36 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- + This minimalistic POM tests mere inheritance from its parent. The <prerequisites> should not be inherited. + --> + + <parent> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child-1</artifactId> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/prerequisites-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/prerequisites-inheritance/pom.xml new file mode 100644 index 00000000..3e4d8a45 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/prerequisites-inheritance/pom.xml @@ -0,0 +1,33 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <prerequisites> + <maven>2.0</maven> + </prerequisites> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-default-deactivation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-default-deactivation/pom.xml new file mode 100644 index 00000000..dfe19253 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-default-deactivation/pom.xml @@ -0,0 +1,35 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.its.mng3545</groupId> + <artifactId>test-artifact</artifactId> + <version>1.0-SNAPSHOT</version> + <profiles> + <profile> + <id>profile1</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-touch</artifactId> + <version>2.2</version> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>profile4</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-touch</artifactId> + <version>2.1</version> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-dependencies-multiple-profiles/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-dependencies-multiple-profiles/pom.xml new file mode 100644 index 00000000..d7af4e27 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-dependencies-multiple-profiles/pom.xml @@ -0,0 +1,81 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.it0021</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: it0021</name> + <description> + Test pom-level profile inclusion (this one is activated by system property). + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>profile-1</id> + <activation> + <property> + <name>includeProfile</name> + </property> + </activation> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.it0021</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + </profile> + <profile> + <id>profile-2</id> + <!-- to be activated explicitly on the CLI by its id --> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.it0021</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-injected-dependencies/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-injected-dependencies/pom.xml new file mode 100644 index 00000000..3fe02fbd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-injected-dependencies/pom.xml @@ -0,0 +1,75 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng1412</groupId> + <artifactId>test</artifactId> + <version>0.1-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-1412</name> + <description> + Check that dependencies are available in classpath in same order as declared in POM. + </description> + + <dependencies> + <!-- model dependencies first, in the order given --> + <dependency> + <groupId>org.apache.maven.its.mng1412</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng1412</groupId> + <artifactId>c</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng1412</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>mng-1412</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <!-- profile dependencies last, in the order given --> + <dependencies> + <dependency> + <!-- deliberately respecifying this dep to check merging behavior --> + <groupId>org.apache.maven.its.mng1412</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng1412</groupId> + <artifactId>d</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-injection-order/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-injection-order/pom.xml new file mode 100644 index 00000000..daf4607f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-injection-order/pom.xml @@ -0,0 +1,68 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng2309</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-2309</name> + <description> + Test that profiles are injected in declaration order, with the last profile being the most dominant. + </description> + + <profiles> + <!-- NOTE: Using intentionally more than two profiles to prevent random test success --> + <profile> + <id>pom-a</id> + <properties> + <pomProperty>a</pomProperty> + </properties> + </profile> + <profile> + <id>pom-b</id> + <properties> + <pomProperty>b</pomProperty> + </properties> + </profile> + <profile> + <id>pom-c</id> + <properties> + <pomProperty>c</pomProperty> + </properties> + </profile> + <profile> + <id>pom-d</id> + <properties> + <pomProperty>d</pomProperty> + </properties> + </profile> + <profile> + <id>pom-e</id> + <properties> + <pomProperty>e</pomProperty> + </properties> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module-inheritance/pom.xml new file mode 100644 index 00000000..4e4c40b2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module-inheritance/pom.xml @@ -0,0 +1,18 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.ops4j.pax</groupId> + <artifactId>construct</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + + <profiles> + <profile> + <id>dist</id> + <modules> + <module>maven-inherit-plugin</module> + <module>maven-pax-plugin</module> + </modules> + </profile> + </profiles> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module-inheritance/sub/pom.xml new file mode 100644 index 00000000..60f057cc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module-inheritance/sub/pom.xml @@ -0,0 +1,12 @@ +<project> + <parent> + <groupId>org.ops4j.pax</groupId> + <artifactId>construct</artifactId> + <version>1.0</version> + </parent> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.ops4j</groupId> + <artifactId>maven-inherit-plugin</artifactId> + <version>1.1</version> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module/pom.xml new file mode 100644 index 00000000..b6336fd4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-module/pom.xml @@ -0,0 +1,24 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + <modules> + <module>module-2</module> + <module>module-1</module> + <module>module-3</module> + </modules> + <profiles> + <profile> + <id>a</id> + <properties> + <b>test-prop</b> + </properties> + <modules> + <module>module-1</module> + <module>module-4</module> + </modules> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/pom.xml new file mode 100644 index 00000000..e283bb09 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/pom.xml @@ -0,0 +1,77 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng2174</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-2174</name> + <description> + Verify that plugin dependencies defined by plugin management of a parent profile are not lost when the + parent's main plugin management section is also present. + </description> + + <modules> + <module>sub</module> + </modules> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> + + <profiles> + <profile> + <id>maven-core-it</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng2174</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </pluginManagement> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/sub/pom.xml new file mode 100644 index 00000000..3614e305 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugin-mng-dependencies/sub/pom.xml @@ -0,0 +1,62 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng2174</groupId> + <artifactId>parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + + <groupId>org.apache.maven.its.mng2174</groupId> + <artifactId>child</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: MNG-2174</name> + <description> + Verify that plugin dependencies defined by plugin management of a parent profile are not lost when the + parent's main plugin management section is also present. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-class-loader</artifactId> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <configuration> + <resourcePaths>mng-2174.properties</resourcePaths> + <pluginClassLoaderOutput>target/pcl.properties</pluginClassLoaderOutput> + </configuration> + <goals> + <goal>load</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugins/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugins/pom.xml new file mode 100644 index 00000000..32e94d73 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-plugins/pom.xml @@ -0,0 +1,52 @@ +<?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> + + <groupId>org.apache.maven</groupId> + <artifactId>maven</artifactId> + <version>3.0-SNAPSHOT</version> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.3</version> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>standard</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly2-plugin</artifactId> + <version>2.0</version> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-properties-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-properties-interpolation/pom.xml new file mode 100644 index 00000000..a95e253b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/profile-properties-interpolation/pom.xml @@ -0,0 +1,54 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3900 </groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-3900</name> + <description> + Test that build properties defined via active profiles are used for + interpolation. + </description> + + <!-- + These are some POM elements we would like to interpolate with + properties from the profile. + --> + <url>http://maven.apache.org/${test} + </url> + <properties> + <test>FAILED</test> + <property>${test}</property> + </properties> + + <profiles> + <profile> + <id>interpolation-profile</id> + <!-- This profile defines the properties to use for interpolation. --> + <properties> + <test>PASSED</test> + <test1>PASSED</test1> + </properties> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-inheritance/pom.xml new file mode 100644 index 00000000..6d17dd3a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-inheritance/pom.xml @@ -0,0 +1,34 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <properties> + <parentProperty>parent-property</parentProperty> + <overriddenProperty>parent-property</overriddenProperty> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-inheritance/sub/pom.xml new file mode 100644 index 00000000..c5394df5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-inheritance/sub/pom.xml @@ -0,0 +1,40 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3843</groupId> + <artifactId>parent-1</artifactId> + <version>0.1</version> + </parent> + + <groupId>org.apache.maven.its.mng3843.child</groupId> + <artifactId>child-2</artifactId> + <version>0.2</version> + <packaging>jar</packaging> + + <properties> + <childProperty>child-property</childProperty> + <overriddenProperty>child-override</overriddenProperty> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-no-duplication/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-no-duplication/pom.xml new file mode 100644 index 00000000..c74f4465 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-no-duplication/pom.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.its</groupId> + <artifactId>test-parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + <properties> + <pomProfile>parent</pomProfile> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-no-duplication/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-no-duplication/sub/pom.xml new file mode 100644 index 00000000..9241b8bb --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/properties-no-duplication/sub/pom.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.maven.its</groupId> + <artifactId>test-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <groupId>org.apache.maven.its</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + <properties> + <pomProfile>child</pomProfile> + </properties> +</project> + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/repo-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/repo-inheritance/pom.xml new file mode 100644 index 00000000..5c1dacab --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/repo-inheritance/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.it0043</groupId> + <artifactId>maven-it-it0043</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>Maven Integration Test :: it0043</name> + <description>Test for repository inheritence - ensure using the same id overrides the defaults</description> + + <repositories> + <repository> + <id>central</id> + <name>it0043</name> + <url>file:///${basedir}/target/maven-core-it0043-repo</url> + </repository> + </repositories> + + <pluginRepositories> + <pluginRepository> + <id>central</id> + <name>it0043</name> + <url>file:///${basedir}/target/maven-core-it0043-repo</url> + </pluginRepository> + </pluginRepositories> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>target/expression.properties</outputFile> + <expressions> + <expression>project/repositories</expression> + <expression>project/pluginRepositories</expression> + </expressions> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-interpolation/pom.xml new file mode 100644 index 00000000..49df00a8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-interpolation/pom.xml @@ -0,0 +1,6 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-plugin-config/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-plugin-config/pom.xml new file mode 100644 index 00000000..fdb455a0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-plugin-config/pom.xml @@ -0,0 +1,51 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3811</groupId> + <artifactId>test-parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>MNG-3811 :: Parent</name> + <description>Test inheritance of reporting plugin configuration</description> + + <modules> + <module>child</module> + </modules> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <booleanParam>true</booleanParam> + <stringParams> + <stringParam>parentParam</stringParam> + </stringParams> + </configuration> + </plugin> + </plugins> + </reporting> +</project> + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml new file mode 100644 index 00000000..b0768271 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml @@ -0,0 +1,48 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + +<parent> + <groupId>org.apache.maven.its.mng3811</groupId> + <artifactId>test-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <artifactId>test-child</artifactId> + + <name>MNG-3811 :: Child</name> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <stringParams combine.children="append"> + <stringParam> childParam </stringParam> + <stringParam xml:space="preserve"> preserve space </stringParam> + </stringParams> + </configuration> + </plugin> + </plugins> + </reporting> +</project> + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/single-configuration-inheritance/jetty-parent.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/single-configuration-inheritance/jetty-parent.xml new file mode 100644 index 00000000..40031e36 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/single-configuration-inheritance/jetty-parent.xml @@ -0,0 +1,37 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-parent</artifactId> + <packaging>pom</packaging> + <name>Jetty :: Administrative Parent</name> + <version>7</version> + + <build> + + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0-alpha-3</version> + <executions> + <execution> + <id>enforce-java</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireMavenVersion> + <version>[2.0.6,)</version> + </requireMavenVersion> + <requireJavaVersion> + <version>[1.5,)</version> + </requireJavaVersion> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/single-configuration-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/single-configuration-inheritance/pom.xml new file mode 100644 index 00000000..695ffaff --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/single-configuration-inheritance/pom.xml @@ -0,0 +1,41 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-parent</artifactId> + <version>7</version> + <relativePath>jetty-parent.xml</relativePath> + </parent> + <groupId>org.mortbay.jetty</groupId> + <artifactId>project</artifactId> + <packaging>pom</packaging> + <name>Jetty Server Project</name> + <version>6.1.12</version> + <build> + <defaultGoal>install</defaultGoal> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>enforce-java</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireMavenVersion> + <version>2.0.6</version> + </requireMavenVersion> + <requireJavaVersion> + <version>[1.4,)</version> + </requireJavaVersion> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/sytem-property-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/sytem-property-interpolation/pom.xml new file mode 100644 index 00000000..7d48d903 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/sytem-property-interpolation/pom.xml @@ -0,0 +1,30 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>gid</groupId> + <artifactId>aid</artifactId> + <version>1.0</version> + + <name>${system.property}</name> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unc-path/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unc-path/pom.xml new file mode 100644 index 00000000..be2a825a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unc-path/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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3621</groupId> + <artifactId>test-parent</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>MNG-3621 :: Parent</name> + <description>Test inheritance of UNC paths</description> + + <modules> + <module>child</module> + </modules> + + <distributionManagement> + <site> + <id>site</id> + <url>file:////host/site</url> + </site> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unc-path/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unc-path/sub/pom.xml new file mode 100644 index 00000000..fddd8723 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unc-path/sub/pom.xml @@ -0,0 +1,57 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + +<parent> + <groupId>org.apache.maven.its.mng3621</groupId> + <artifactId>test-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <artifactId>test-child</artifactId> + + <name>MNG-3621 :: Child</name> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>target/pom.properties</outputFile> + <expressions> + <expression>project/distributionManagement/site/url</expression> + </expressions> + </configuration> + <executions> + <execution> + <id>test</id> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mngt-in-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mngt-in-profile/pom.xml new file mode 100644 index 00000000..38ad7f71 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mngt-in-profile/pom.xml @@ -0,0 +1,49 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <profiles> + <profile> + <id>test</id> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.2</version> + </dependency> + </dependencies> + </dependencyManagement> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mngt/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mngt/pom.xml new file mode 100644 index 00000000..de69bb4b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/dep-mngt/pom.xml @@ -0,0 +1,44 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.2</version> + </dependency> + </dependencies> + </dependencyManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/deps-in-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/deps-in-profile/pom.xml new file mode 100644 index 00000000..8d4ae56d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/deps-in-profile/pom.xml @@ -0,0 +1,47 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <profiles> + <profile> + <id>test</id> + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.2</version> + </dependency> + </dependencies> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/deps/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/deps/pom.xml new file mode 100644 index 00000000..a629c9f5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-dependency-key/deps/pom.xml @@ -0,0 +1,42 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>b</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its.mng4005</groupId> + <artifactId>a</artifactId> + <version>0.2</version> + </dependency> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo-in-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo-in-profile/pom.xml new file mode 100644 index 00000000..eb73c4e2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo-in-profile/pom.xml @@ -0,0 +1,51 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4193</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4193</name> + <description> + Test that multiple artifact repository declarations with the same id cause a validation error even if the + repositories are defined within a (non-active) profile. + </description> + + <profiles> + <profile> + <id>test</id> + <repositories> + <repository> + <id>one</id> + <url>http://repo1.maven.org/maven2</url> + </repository> + <repository> + <id>one</id> + <url>http://repository.codehaus.org/</url> + </repository> + </repositories> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo/pom.xml new file mode 100644 index 00000000..76d4f74a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/artifact-repo/pom.xml @@ -0,0 +1,45 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4193</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4193</name> + <description> + Test that multiple artifact repository declarations with the same id cause a validation error. + </description> + + <repositories> + <repository> + <id>one</id> + <url>http://repo1.maven.org/maven2</url> + </repository> + <repository> + <id>one</id> + <url>http://repository.codehaus.org/</url> + </repository> + </repositories> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo-in-profile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo-in-profile/pom.xml new file mode 100644 index 00000000..ac1fada5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo-in-profile/pom.xml @@ -0,0 +1,51 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4193</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4193</name> + <description> + Test that multiple plugin repository declarations with the same id cause a validation error even if the + repositories are defined within a (non-active) profile. + </description> + + <profiles> + <profile> + <id>test</id> + <pluginRepositories> + <pluginRepository> + <id>one</id> + <url>http://repo1.maven.org/maven2</url> + </pluginRepository> + <pluginRepository> + <id>one</id> + <url>http://repository.codehaus.org/</url> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo/pom.xml new file mode 100644 index 00000000..92fd1264 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unique-repo-id/plugin-repo/pom.xml @@ -0,0 +1,45 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4193</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4193</name> + <description> + Test that multiple plugin repository declarations with the same id cause a validation error. + </description> + + <pluginRepositories> + <pluginRepository> + <id>one</id> + <url>http://repo1.maven.org/maven2</url> + </pluginRepository> + <pluginRepository> + <id>one</id> + <url>http://repository.codehaus.org/</url> + </pluginRepository> + </pluginRepositories> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/child/pom.xml new file mode 100644 index 00000000..9304f5d0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/child/pom.xml @@ -0,0 +1,104 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng3831</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + </parent> + + <groupId>org.apache.maven.its.mng3831.child</groupId> + <artifactId>child</artifactId> + <version>2.0-alpha-1</version> + <packaging>jar</packaging> + + <name>child-name</name> + <description>child-desc</description> + <url>http://child.org/</url> + <inceptionYear>2008</inceptionYear> + <organization> + <name>child-org-name</name> + </organization> + + <prerequisites> + <maven>2.0.0</maven> + </prerequisites> + + <scm> + <url>http://scm.org/</url> + </scm> + <issueManagement> + <url>http://issue.org/</url> + </issueManagement> + <ciManagement> + <url>http://ci.org/</url> + </ciManagement> + <distributionManagement> + <repository> + <id>maven-core-it</id> + <name>child-dist-repo</name> + <url>http://dist.org/</url> + </repository> + <site> + <id>maven-core-it</id> + <name>child-site</name> + <url>http://site.org/</url> + </site> + </distributionManagement> + + <properties> + <!-- this is where we collect all the interpolated values for the POM dump --> + <projectDir>${basedir}</projectDir> + <projectGroupId>${groupId}</projectGroupId> + <projectArtifactId>${artifactId}</projectArtifactId> + <projectVersion>${version}</projectVersion> + <projectPackaging>${packaging}</projectPackaging> + <projectName>${name}</projectName> + <projectDesc>${description}</projectDesc> + <projectUrl>${url}</projectUrl> + <projectYear>${inceptionYear}</projectYear> + <projectOrgName>${organization.name}</projectOrgName> + <projectPrereqMvn>${prerequisites.maven}</projectPrereqMvn> + <projectScmUrl>${scm.url}</projectScmUrl> + <projectIssueUrl>${issueManagement.url}</projectIssueUrl> + <projectCiUrl>${ciManagement.url}</projectCiUrl> + <projectDistRepoName>${distributionManagement.repository.name}</projectDistRepoName> + <projectDistRepoUrl>${distributionManagement.repository.url}</projectDistRepoUrl> + <projectDistSiteUrl>${distributionManagement.site.url}</projectDistSiteUrl> + <projectBuildOut>${build.outputDirectory}</projectBuildOut> + <projectSiteOut>${reporting.outputDirectory}</projectSiteOut> + <parentGroupId>${parent.groupId}</parentGroupId> + <parentArtifactId>${parent.artifactId}</parentArtifactId> + <parentVersion>${parent.version}</parentVersion> + </properties> + + <build> + <outputDirectory>target/bin</outputDirectory> + </build> + + <reporting> + <outputDirectory>target/doc</outputDirectory> + </reporting> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/pom.xml new file mode 100644 index 00000000..768a5e98 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/unprefixed-expression-interpolation/pom.xml @@ -0,0 +1,36 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3831</groupId> + <artifactId>parent</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3831</name> + <description>Test POM interpolation with expressions of the form $ { * } (ugly but real)</description> + + <modules> + <module>parent/child</module> + </modules> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-append/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-append/child/pom.xml new file mode 100644 index 00000000..1f377df1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-append/child/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.mng2006</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <relativePath>../parent/pom.xml</relativePath> + </parent> + + <artifactId>child</artifactId> + <name>Child Project</name> + <description> + Test that inheritance of those URLs which automatically append the child's artifact id take the child's + relative location to the parent into account. + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>target/pom.properties</outputFile> + <expressions> + <expression>project/url</expression> + <expression>project/scm</expression> + <expression>project/distributionManagement/site</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-append/parent/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-append/parent/pom.xml new file mode 100644 index 00000000..f8b069f8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-append/parent/pom.xml @@ -0,0 +1,53 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng2006</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-2006</name> + <description> + Test that inheritance of those URLs which automatically append the child's artifact id take the child's + relative location to the parent into account. + </description> + + <modules> + <module>../child</module> + </modules> + + <url>http://project.url/parent</url> + + <scm> + <url>http://viewvc.project.url/parent</url> + <connection>http://scm.project.url/parent</connection> + <developerConnection>https://scm.project.url/parent</developerConnection> + </scm> + <distributionManagement> + <site> + <url>http://site.project.url/parent</url> + <id>parent.site</id> + </site> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/pom.xml new file mode 100644 index 00000000..463772fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/pom.xml @@ -0,0 +1,36 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- NOTE: The base directory name of this project deliberately does not match its artifact id! --> + + <parent> + <groupId>org.apache.maven.its.mng3846</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>ap</artifactId> + <packaging>pom</packaging> + <name>Another Parent to test multi-level URL adjustment</name> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/sub/pom.xml new file mode 100644 index 00000000..128e63d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/another-parent/sub/pom.xml @@ -0,0 +1,35 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- NOTE: The base directory name of this project deliberately does not match its artifact id! --> + + <parent> + <groupId>org.apache.maven.its.mng3846</groupId> + <artifactId>ap</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + <name>Child Project</name> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/pom.xml new file mode 100644 index 00000000..ed4cdf08 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/pom.xml @@ -0,0 +1,74 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3846</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + <packaging>pom</packaging> + + <name>Maven Integration Test :: MNG-3846</name> + <description> + Test that inheritance of certain URLs automatically appends the child's artifact id. + </description> + + <url>http://parent.url</url> + <organization> + <name>parent-org</name> + <url>http://parent.url/org</url> + </organization> + <licenses> + <license> + <name>parent-license</name> + <url>http://parent.url/license.txt</url> + <distribution>repo</distribution> + </license> + </licenses> + + <scm> + <url>http://parent.url/viewvc</url> + <connection>http://parent.url/scm</connection> + <developerConnection>https://parent.url/scm</developerConnection> + </scm> + <issueManagement> + <url>http://parent.url/issues</url> + </issueManagement> + <ciManagement> + <url>http://parent.url/ci</url> + </ciManagement> + <distributionManagement> + <repository> + <url>http://parent.url/dist</url> + <id>parent.distros</id> + </repository> + <snapshotRepository> + <url>http://parent.url/snaps</url> + <id>parent.snaps</id> + </snapshotRepository> + <site> + <url>http://parent.url/site</url> + <id>parent.site</id> + </site> + <downloadUrl>http://parent.url/download</downloadUrl> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/sub/pom.xml new file mode 100644 index 00000000..c8e9c108 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-inheritance/sub/pom.xml @@ -0,0 +1,35 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- NOTE: The base directory name of this project deliberately does not match its artifact id! --> + + <parent> + <groupId>org.apache.maven.its.mng3846</groupId> + <artifactId>parent</artifactId> + <version>0.1</version> + </parent> + + <artifactId>child</artifactId> + <name>Child Project</name> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-no-decoding/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-no-decoding/pom.xml new file mode 100644 index 00000000..2dcceb93 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/url-no-decoding/pom.xml @@ -0,0 +1,64 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4116</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4116</name> + <description> + Test that the project builder does not decode URLs (which must be done by the transport layer instead). + </description> + + <!-- some URLs using percent-encoded characters --> + <url>http://maven.apache.org/spacy%20path</url> + <scm> + <connection>scm:svn:svn+ssh://svn.apache.org/spacy%20path</connection> + <developerConnection>scm:svn:svn+ssh://svn.apache.org/spacy%20path</developerConnection> + <url>http://svn.apache.org/viewvc/spacy%20path</url> + </scm> + <issueManagement> + <system>none</system> + <url>http://issues.apache.org/spacy%20path</url> + </issueManagement> + <ciManagement> + <system>none</system> + <url>http://ci.apache.org/spacy%20path</url> + </ciManagement> + <distributionManagement> + <repository> + <id>dist</id> + <url>scm:svn:svn+ssh://dist.apache.org/spacy%20path</url> + </repository> + <snapshotRepository> + <id>snap</id> + <url>scm:svn:svn+ssh://snap.apache.org/spacy%20path</url> + </snapshotRepository> + <site> + <id>site</id> + <url>scm:svn:svn+ssh://site.apache.org/spacy%20path</url> + </site> + </distributionManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-coalesce-text/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-coalesce-text/pom.xml new file mode 100644 index 00000000..5822d8d3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-coalesce-text/pom.xml @@ -0,0 +1,567 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3839</groupId> + <artifactId>coreit</artifactId> + <version>0.1</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-3839</name> + <description> + Test that POM parsing properly coalesces text data. + </description> + + <properties> + <!-- + This checks the coalescing of CHARACTERS and CDATA events. Note that inner whitespace must be retained. + --> + <prop0>A <![CDATA[ Test ]]> Project<![CDATA[ ]]>Property</prop0> + + <!-- + This checks the coalescing of CHARACTERS events that are interleaved with comments. Note that inner whitespace + formed by whitespace-only events must be retained. + --> + <prop1><!-- X -->That's<!-- X --> <!-- X -->a<!-- X --> <!-- X -->test!<!-- X --></prop1> + + <!-- + This checks the coalescing of CHARACTERS events which would otherwise be reported in chunks of the internal parser + buffer size (usually 4 or 8 KB). The text block is designed such that its length is exactly 32 KB after leading + and traling whitespace has been removed and all line terminators have been removed. + --> + <prop2> +00 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +01 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +02 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +03 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +04 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +05 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +06 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +07 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +08 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +09 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +10 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +11 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +12 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +13 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +14 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +15 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +16 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +17 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +18 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +19 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +20 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +21 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +22 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +23 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +24 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +25 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +26 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +27 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +28 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +29 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +30 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +31 KB 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X +0 1 2 3 4 5 6 X + </prop2> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-markup-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-markup-interpolation/pom.xml new file mode 100644 index 00000000..584712fd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-markup-interpolation/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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3924</groupId> + <artifactId>test</artifactId> + <version>0.1-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-3924</name> + <description> + Test that interpolation of properties that resolve to XML markup doesn't crash the project builder. + </description> + + <properties> + <!-- That's the property containing escaped XML markup --> + <xmlMarkup><?xml version='1.0'?>Tom&Jerry</xmlMarkup> + <!-- That's a property where the above property will be resolved --> + <xmlTest>${xmlMarkup}</xmlTest> + </properties> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-whitespace/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-whitespace/pom.xml new file mode 100644 index 00000000..433dd522 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-whitespace/pom.xml @@ -0,0 +1,43 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- NOTE: The ugly formatting is essential part of this test! --> + <groupId> + org.apache.maven.its.mng4070 + </groupId> + <artifactId> + parent + </artifactId> + <version> + 1.0 + </version> + <packaging> + pom + </packaging> + + <name>Maven Integration Test :: MNG-4070</name> + <description> + Test that whitespace around artifact coordinates does not change artifact identity. + </description> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-whitespace/sub/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-whitespace/sub/pom.xml new file mode 100644 index 00000000..f5ea684d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-project-builder/xml-whitespace/sub/pom.xml @@ -0,0 +1,49 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <!-- NOTE: The ugly formatting is essential part of this test! --> + <parent> + <groupId> org.apache.maven.its.mng4070 </groupId> + <artifactId> parent </artifactId> + <version> 1.0 </version> + </parent> + + <artifactId>subproject</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4070 :: Child</name> + <description> + Test that whitespace around artifact coordinates does not change artifact identity. + </description> + + <dependencies> + <dependency> + <!-- NOTE: The ugly formatting is essential part of this test! --> + <groupId> org.apache.maven.its.mng4070 </groupId> + <artifactId> a </artifactId> + <version> 0.1 </version> + </dependency> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/repositories/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/repositories/pom.xml new file mode 100644 index 00000000..97023414 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/repositories/pom.xml @@ -0,0 +1,29 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4107</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/repositories/settings.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/repositories/settings.xml new file mode 100644 index 00000000..6f96f0b6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/repositories/settings.xml @@ -0,0 +1,55 @@ +<?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. +--> + +<settings> + <profiles> + <profile> + <id>maven-core-it-repo</id> + <repositories> + <repository> + <id>maven-core-it-0</id> + <url>@baseurl@/repo-0</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>maven-core-it-1</id> + <url>@baseurl@/repo-1</url> + <releases> + <checksumPolicy>ignore</checksumPolicy> + </releases> + <snapshots> + <checksumPolicy>ignore</checksumPolicy> + </snapshots> + </pluginRepository> + </pluginRepositories> + </profile> + </profiles> + <activeProfiles> + <activeProfile>maven-core-it-repo</activeProfile> + </activeProfiles> +</settings> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/settings-no-pom/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/settings-no-pom/pom.xml new file mode 100644 index 00000000..ee627826 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/settings-no-pom/pom.xml @@ -0,0 +1,13 @@ +<?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/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng3099</groupId> + <artifactId>maven-mng3099-plugin</artifactId> + <version>1</version> + <packaging>maven-plugin</packaging> + + <name>maven-mng3099-plugin</name> + <description>Tests properties injected as a result of active profiles in the user settings file.</description> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/settings-no-pom/settings.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/settings-no-pom/settings.xml new file mode 100644 index 00000000..964e0512 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/settings-no-pom/settings.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<settings + xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + + <profiles> + <profile> + <id>local-profile</id> + <properties> + <local-profile-prop>local-profile-prop-value</local-profile-prop> + </properties> + </profile> + </profiles> + + <activeProfiles> + <activeProfile>local-profile</activeProfile> + </activeProfiles> + +</settings> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/pom.xml new file mode 100644 index 00000000..245349a6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/pom.xml @@ -0,0 +1,78 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.mng4107</groupId> + <artifactId>test</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>Maven Integration Test :: MNG-4107</name> + <description> + Test that POM interpolation uses the property values from the dominant profile source (POM vs. profiles.xml + vs. settings.xml). This boils down to the proper order of profile injection and interpolation, i.e. + interpolate after profiles from all sources are injected. + </description> + + <properties> + <!-- collect the effective property values as derived by interpolation --> + <pomVsSettingsInterpolated>${pomVsSettings}</pomVsSettingsInterpolated> + </properties> + + <profiles> + <profile> + <id>pom</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <pomProfile>applied</pomProfile> + <pomVsSettings>pom</pomVsSettings> + </properties> + </profile> + </profiles> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + <configuration> + <outputFile>target/pom.properties</outputFile> + <expressions> + <expression>project/properties</expression> + </expressions> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/settings.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/settings.xml new file mode 100644 index 00000000..2d42d495 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources-settings/test-pom-and-settings-interpolation/settings.xml @@ -0,0 +1,35 @@ +<?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. +--> + +<settings> + <profiles> + <profile> + <id>settings</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <settingsProfile>applied</settingsProfile> + <pomVsSettings>settings</pomVsSettings> + </properties> + </profile> + </profiles> +</settings> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/META-INF/maven/org.apache.maven/maven-core/pom.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/META-INF/maven/org.apache.maven/maven-core/pom.properties new file mode 100644 index 00000000..ef45373a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/META-INF/maven/org.apache.maven/maven-core/pom.properties @@ -0,0 +1 @@ +version=2.1-SNAPSHOT
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/META-INF/plexus/components.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 00000000..714cb36b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/META-INF/plexus/components.xml @@ -0,0 +1,113 @@ +<component-set> + <components> + <component> + <role>org.apache.maven.lifecycle.binding.LegacyLifecycleParsingTestComponent</role> + <role-hint>default</role-hint> + <implementation>org.apache.maven.lifecycle.binding.LegacyLifecycleParsingTestComponent</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <phases> + <phase>validate</phase> + <phase>initialize</phase> + <phase>generate-sources</phase> + <phase>process-sources</phase> + <phase>generate-resources</phase> + <phase>process-resources</phase> + <phase>compile</phase> + <phase>process-classes</phase> + <phase>generate-test-sources</phase> + <phase>process-test-sources</phase> + <phase>generate-test-resources</phase> + <phase>process-test-resources</phase> + <phase>test-compile</phase> + <phase>process-test-classes</phase> + <phase>test</phase> + <phase>prepare-package</phase> + <phase>package</phase> + <phase>pre-integration-test</phase> + <phase>integration-test</phase> + <phase>post-integration-test</phase> + <phase>verify</phase> + <phase>install</phase> + <phase>deploy</phase> + </phases> + </lifecycle> + <lifecycle> + <id>clean</id> + <phases> + <phase>pre-clean</phase> + <phase>clean</phase> + <phase>post-clean</phase> + </phases> + <default-phases> + <clean>org.apache.maven.plugins:maven-clean-plugin:clean</clean> + </default-phases> + </lifecycle> + <lifecycle> + <id>site</id> + <phases> + <phase>pre-site</phase> + <phase>site</phase> + <phase>post-site</phase> + <phase>site-deploy</phase> + </phases> + <default-phases> + <site>org.apache.maven.plugins:maven-site-plugin:site</site> + <site-deploy>org.apache.maven.plugins:maven-site-plugin:deploy</site-deploy> + </default-phases> + </lifecycle> + </lifecycles> + </configuration> + </component> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>test-mapping</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: pom-lifecycle --> + + <phases> + <package>org.apache.maven.plugins:maven-site-plugin:attach-descriptor</package> + <install>org.apache.maven.plugins:maven-install-plugin:install</install> + <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy> + </phases> + <optional-mojos> + <optional-mojo>org.apache.maven.plugins:maven-site-plugin:attach-descriptor</optional-mojo> + </optional-mojos> + <!-- END SNIPPET: pom-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>test-mapping2</role-hint> + <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> + <configuration> + <lifecycles> + <lifecycle> + <id>default</id> + <!-- START SNIPPET: pom-lifecycle --> + <phases> + <package> + org.apache.maven.plugins:maven-site-plugin:attach-descriptor, + org.apache.maven.plugins:maven-clean-plugin:clean + </package> + <install>org.apache.maven.plugins:maven-install-plugin:install</install> + <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy> + </phases> + <optional-mojos> + <optional-mojo>org.apache.maven.plugins:maven-site-plugin:attach-descriptor</optional-mojo> + </optional-mojos> + <!-- END SNIPPET: pom-lifecycle --> + </lifecycle> + </lifecycles> + </configuration> + </component> + </components> +</component-set>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/canonical-pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/canonical-pom.xml new file mode 100644 index 00000000..82bf8725 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/canonical-pom.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- +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> + + <groupId>maven</groupId> + <artifactId>maven-core</artifactId> + <version>2.0-SNAPSHOT</version> + + <name>Maven</name> + + <build> + <plugins> + <plugin> + <artifactId>maven-plexus-plugin</artifactId> + <version>1.0</version> + <configuration> + <plexusConfiguration>src/conf/plexus.conf</plexusConfiguration> + <plexusConfigurationPropertiesFile>src/conf/plexus.properties</plexusConfigurationPropertiesFile> + <plexusApplicationName>Continuum</plexusApplicationName> + </configuration> + <executions> + <execution> + <goals> + <goal>plexus:runtime</goal> + </goals> + <configuration> + <plexusApplicationName>ContinuumPro</plexusApplicationName> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/dependencyManagement-pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/dependencyManagement-pom.xml new file mode 100644 index 00000000..2accaca8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/dependencyManagement-pom.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- +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> + + <groupId>maven</groupId> + <artifactId>maven-core</artifactId> + <version>2.0-SNAPSHOT</version> + + <name>Maven</name> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + </dependencyManagement> + + <build> + <plugins> + <plugin> + <artifactId>maven-plexus-plugin</artifactId> + <version>1.0</version> + <configuration> + <plexusConfiguration>src/conf/plexus.conf</plexusConfiguration> + <plexusConfigurationPropertiesFile>src/conf/plexus.properties</plexusConfigurationPropertiesFile> + <plexusApplicationName>Continuum</plexusApplicationName> + </configuration> + <executions> + <execution> + <goals> + <goal>plexus:runtime</goal> + </goals> + <configuration> + <plexusApplicationName>ContinuumPro</plexusApplicationName> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/distributionManagement-pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/distributionManagement-pom.xml new file mode 100644 index 00000000..1a8ee7ff --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/distributionManagement-pom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- + 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> + + <groupId>maven</groupId> + <artifactId>maven-core</artifactId> + <version>2.0-SNAPSHOT</version> + + <name>Maven</name> + + <distributionManagement> + <snapshotRepository> + <id>repo-id</id> + <name>my snapshot repository</name> + <url>file:///path/to/snapshot/repo</url> + </snapshotRepository> + <repository> + <id>repo-id2</id> + <name>my repository</name> + <url>file:///path/to/repo</url> + </repository> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-a-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-a-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-a-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-a-1.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-a-1.1.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-a-1.1.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-b-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-b-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-b-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-b-1.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-b-1.1.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-b-1.1.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-c-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-c-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-c-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-c-1.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-c-1.1.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-c-1.1.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.1.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.1.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.2.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.2.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/jars/maven-test-d-1.2.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-a-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-a-1.0.pom new file mode 100644 index 00000000..93fc0d0b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-a-1.0.pom @@ -0,0 +1,14 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + <packaging>jar</packaging> + <version>1.0</version> + <repositories> + <repository> + <id>central</id> + <name>Fake Maven Central Repository</name> + <url>file://dummy</url> + </repository> + </repositories> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-a-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-a-1.1.pom new file mode 100644 index 00000000..a0830861 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-a-1.1.pom @@ -0,0 +1,14 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + <packaging>jar</packaging> + <version>1.1</version> + <repositories> + <repository> + <id>central</id> + <name>Fake Maven Central Repository</name> + <url>file://dummy</url> + </repository> + </repositories> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-b-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-b-1.0.pom new file mode 100644 index 00000000..c173c663 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-b-1.0.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <packaging>jar</packaging> + <version>1.0</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-b-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-b-1.1.pom new file mode 100644 index 00000000..fff241a1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-b-1.1.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <packaging>jar</packaging> + <version>1.1</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-c-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-c-1.0.pom new file mode 100644 index 00000000..1f049786 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-c-1.0.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + <packaging>jar</packaging> + <version>1.0</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-c-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-c-1.1.pom new file mode 100644 index 00000000..8bd52514 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-c-1.1.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + <packaging>jar</packaging> + <version>1.1</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.0.pom new file mode 100644 index 00000000..ac6ef12e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.0.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <packaging>jar</packaging> + <version>1.0</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.1.pom new file mode 100644 index 00000000..6e22f608 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.1.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <packaging>jar</packaging> + <version>1.1</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.2.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.2.pom new file mode 100644 index 00000000..16f8d905 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/maven-test/poms/maven-test-d-1.2.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <packaging>jar</packaging> + <version>1.2</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p1/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p1/pom.xml new file mode 100644 index 00000000..7bfca342 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p1/pom.xml @@ -0,0 +1,45 @@ +<project> + <parent> + <artifactId>p0</artifactId> + <groupId>maven</groupId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>maven</groupId> + <artifactId>p1</artifactId> + <packaging>pom</packaging> + <name>p1</name> + <version>1.0</version> + <scm> + <url>scm-url</url> + </scm> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <configuration> + <tasks><echo>${project.parent.basedir}</echo></tasks> + </configuration> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p2/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p2/pom.xml new file mode 100644 index 00000000..b45ce9c6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p2/pom.xml @@ -0,0 +1,56 @@ +<project> + <parent> + <artifactId>p0</artifactId> + <groupId>maven</groupId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>maven</groupId> + <artifactId>p2</artifactId> + <packaging>pom</packaging> + <name>p2</name> + <version>1.0</version> + <scm> + <url>scm-url</url> + </scm> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>maven</groupId> + <artifactId>p1</artifactId> + <version>1.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <configuration> + <tasks><echo>${project.parent.basedir}</echo></tasks> + </configuration> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p3/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p3/pom.xml new file mode 100644 index 00000000..e9648e39 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p3/pom.xml @@ -0,0 +1,59 @@ +<project> + <parent> + <artifactId>p0</artifactId> + <groupId>maven</groupId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>maven</groupId> + <artifactId>p3</artifactId> + <packaging>pom</packaging> + <name>p3</name> + <version>1.0</version> + <scm> + <url>scm-url</url> + </scm> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <configuration> + <tasks><echo>${project.parent.basedir}</echo></tasks> + </configuration> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p4/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p4/pom.xml new file mode 100644 index 00000000..7ffef9d7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/p4/pom.xml @@ -0,0 +1,67 @@ +<project> + <parent> + <artifactId>p0</artifactId> + <groupId>maven</groupId> + <version>1.0</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>maven</groupId> + <artifactId>p4</artifactId> + <packaging>pom</packaging> + <name>p4</name> + <version>1.0</version> + <scm> + <url>scm-url</url> + </scm> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>maven</groupId> + <artifactId>p2</artifactId> + <version>1.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>maven</groupId> + <artifactId>p3</artifactId> + <version>1.0</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <version>1.1</version> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <configuration> + <tasks><echo>${project.parent.basedir}</echo></tasks> + </configuration> + </plugin> + </plugins> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/pom.xml new file mode 100644 index 00000000..3ccf7e63 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/imports-repo/t01/p0/pom.xml @@ -0,0 +1,26 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven</groupId> + <artifactId>p0</artifactId> + <packaging>pom</packaging> + <name>p0</name> + <version>1.0</version> + <organization> + <name>Codehaus</name> + </organization> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + <version>1.0</version> + </dependency> + </dependencies> + </dependencyManagement> + <modules> + <module>p1</module> + <module>p2</module> + <module>p3</module> + <module>p4</module> + </modules> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/marker.txt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/marker.txt new file mode 100644 index 00000000..d9bab060 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/marker.txt @@ -0,0 +1 @@ +this is just a marker file.
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-a-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-a-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-a-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-b-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-b-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-b-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-c-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-c-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-c-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-d-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-d-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/jars/maven-test-d-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-a-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-a-1.0.pom new file mode 100644 index 00000000..6905f6c8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-a-1.0.pom @@ -0,0 +1,23 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + <packaging>jar</packaging> + <version>1.0</version> + <repositories> + <repository> + <id>central</id> + <name>Fake Maven Central Repository</name> + <url>file://dummy</url> + </repository> + </repositories> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <version>1.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-b-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-b-1.0.pom new file mode 100644 index 00000000..e814951a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-b-1.0.pom @@ -0,0 +1,23 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <packaging>jar</packaging> + <version>1.0</version> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + <version>1.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <version>1.1</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-c-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-c-1.0.pom new file mode 100644 index 00000000..4631b88f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-c-1.0.pom @@ -0,0 +1,16 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-c</artifactId> + <packaging>jar</packaging> + <version>1.0</version> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <version>1.2</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-d-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-d-1.1.pom new file mode 100644 index 00000000..6e22f608 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-d-1.1.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <packaging>jar</packaging> + <version>1.1</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-d-1.2.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-d-1.2.pom new file mode 100644 index 00000000..6e22f608 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/maven-test/poms/maven-test-d-1.2.pom @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>maven-test</groupId> + <artifactId>maven-test-d</artifactId> + <packaging>jar</packaging> + <version>1.1</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..c2c027fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +local
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar.snapshot-version b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar.snapshot-version new file mode 100644 index 00000000..09f9180f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar.snapshot-version @@ -0,0 +1 @@ +20040101.101010
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..c2c027fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +local
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar.snapshot-version b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar.snapshot-version new file mode 100644 index 00000000..09f9180f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar.snapshot-version @@ -0,0 +1 @@ +20040101.101010
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-e-1.0-SNAPSHOT.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-e-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..c2c027fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-e-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +local
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-e-1.0-SNAPSHOT.jar.snapshot-version b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-e-1.0-SNAPSHOT.jar.snapshot-version new file mode 100644 index 00000000..09f9180f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/jars/maven-snapshot-e-1.0-SNAPSHOT.jar.snapshot-version @@ -0,0 +1 @@ +20040101.101010
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/poms/maven-test-snapshot-resolving-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/poms/maven-test-snapshot-resolving-1.0.pom new file mode 100644 index 00000000..64a075f4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/local-repo/snapshot-test/poms/maven-test-snapshot-resolving-1.0.pom @@ -0,0 +1,49 @@ +<project> + <groupId>snapshot-test</groupId> + <artifactId>maven-test-snapshot-resolving</artifactId> + <packaging>jar</packaging> + <repositories> + <repository> + <id>central</id> + <name>Fake Maven Central Repository</name> + <url>file://dummy</url> + </repository> + </repositories> + <dependencies> + <dependency> + <groupId>snapshot-test</groupId> + <artifactId>maven-snapshot-a</artifactId> + <version>1.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>snapshot-test</groupId> + <artifactId>maven-snapshot-b</artifactId> + <version>1.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>snapshot-test</groupId> + <artifactId>maven-snapshot-c</artifactId> + <version>1.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>snapshot-test</groupId> + <artifactId>maven-snapshot-d</artifactId> + <version>1.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>snapshot-test</groupId> + <artifactId>maven-snapshot-e</artifactId> + <version>1.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/MavenLifecycleParticipantTest.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/MavenLifecycleParticipantTest.xml new file mode 100644 index 00000000..ebbbf791 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/MavenLifecycleParticipantTest.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plexus> + <components> + <component> + <role>org.apache.maven.project.ProjectBuildingHelper</role> + <implementation>org.apache.maven.project.EmptyProjectBuildingHelper</implementation> + </component> + </components> +</plexus> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/execution/test-extension-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/execution/test-extension-1.jar Binary files differnew file mode 100644 index 00000000..0272ee3c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/execution/test-extension-1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar Binary files differnew file mode 100644 index 00000000..674d71e8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar.md5 new file mode 100644 index 00000000..92c6c765 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar.md5 @@ -0,0 +1 @@ +1f40fb782a4f2cf78f161d32670f7a3a
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar.sha1 new file mode 100644 index 00000000..ed10f030 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.jar.sha1 @@ -0,0 +1 @@ +99129f16442844f6a4a11ae22fbbee40b14d774f
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom new file mode 100644 index 00000000..2169a65d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom @@ -0,0 +1,29 @@ +<?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/maven-v4_0_0.xsd "> + <modelVersion>4.0.0</modelVersion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <name>JUnit</name> + <url>http://junit.org</url> + <description> + JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. + </description> + <organization> + <name>JUnit</name> + <url>http://www.junit.org</url> + </organization> + <licenses> + <license> + <name>Common Public License Version 1.0</name> + <url>http://www.opensource.org/licenses/cpl1.0.txt</url> + </license> + </licenses> + <scm> + <url>http://junit.cvs.sourceforge.net/junit/</url> + </scm> + <dependencies> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom.md5 new file mode 100644 index 00000000..51e102f6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom.md5 @@ -0,0 +1 @@ +50b40cb7342f52b702e6337d5debf1ae
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom.sha1 new file mode 100644 index 00000000..82ac6705 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/junit/junit/3.8.1/junit-3.8.1.pom.sha1 @@ -0,0 +1 @@ +16d74791c801c89b0071b1680ea0bc85c93417bb
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom new file mode 100644 index 00000000..1fc7e406 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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 http://maven.apache.org/maven-v4_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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom.md5 new file mode 100644 index 00000000..b9d0ea16 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom.md5 @@ -0,0 +1 @@ +c857ebbb5f303f435495e40e6c9e45a2
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom.sha1 new file mode 100644 index 00000000..ffb57bbc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/apache/3/apache-3.pom.sha1 @@ -0,0 +1 @@ +1bc0010136a890e2fd38d901a0b7ecdf0e3f9871
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar Binary files differnew file mode 100644 index 00000000..5bc9c06c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.md5 new file mode 100644 index 00000000..5ff89e83 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.jar.sha1 new file mode 100644 index 00000000..a3418804 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom new file mode 100644 index 00000000..8de3ce6d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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 http://maven.apache.org/maven-v4_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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.md5 new file mode 100644 index 00000000..11e35363 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/artifact/maven-artifact/3.0-SNAPSHOT/maven-artifact-3.0-SNAPSHOT.pom.sha1 new file mode 100644 index 00000000..4beb688d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar Binary files differnew file mode 100644 index 00000000..0272ee3c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom new file mode 100644 index 00000000..70114e72 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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 http://maven.apache.org/maven-v4_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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.md5 new file mode 100644 index 00000000..ad06718c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-extension/1/test-extension-1.pom.sha1 new file mode 100644 index 00000000..6065ee04 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar Binary files differnew file mode 100644 index 00000000..04fe3846 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom new file mode 100644 index 00000000..d9e4cde9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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 http://maven.apache.org/maven-v4_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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.md5 new file mode 100644 index 00000000..01d51942 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/core/test/test-lifecycle-and-artifactHandler/1/test-lifecycle-and-artifactHandler-1.pom.sha1 new file mode 100644 index 00000000..dac1e45a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom new file mode 100644 index 00000000..132d9d73 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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 http://maven.apache.org/maven-v4_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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.md5 new file mode 100644 index 00000000..9c417645 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 new file mode 100644 index 00000000..b6caacf5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom new file mode 100644 index 00000000..b3350401 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-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 http://maven.apache.org/maven-v4_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 overriden 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> + </plugin> + <!-- We want to package up license resources in the JARs produced --> + <plugin> + <artifactId>maven-remote-resources-plugin</artifactId> + <version>1.0-alpha-1</version> + <executions> + <execution> + <goals> + <goal>process</goal> + </goals> + <configuration> + <resourceBundles> + <resourceBundle>org.apache:apache-jar-resource-bundle:1.0</resourceBundle> + </resourceBundles> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>2.0.2</version> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.2</version> + <executions> + <execution> + <id>attach-javadocs</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + + <scm> + <connection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/tags/maven-parent-5</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/tags/maven-parent-5</developerConnection> + <url>https://svn.apache.org/repos/asf/maven/pom/tags/maven-parent-5</url> + </scm> +</project> + diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.md5 new file mode 100644 index 00000000..27ba3aaf --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.md5 @@ -0,0 +1 @@ +4da85635ce64dbec5b00232d5bb26453
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1 new file mode 100644 index 00000000..5d7a3eba --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1 @@ -0,0 +1 @@ +5c1ab38decaca1ccd08294aeab135047ebbae00d
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar Binary files differnew file mode 100644 index 00000000..79fcf226 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.md5 new file mode 100644 index 00000000..60aecbcd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.md5 @@ -0,0 +1 @@ +f41eb4e07a725eea3332743a29057855
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.sha1 new file mode 100644 index 00000000..e3f05109 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar.sha1 @@ -0,0 +1 @@ +abd1c9ace6e87c94a4b91f5176aeb09d954b23a3
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom new file mode 100644 index 00000000..dca027b2 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom @@ -0,0 +1,21 @@ +<?xml version="1.0"?><project> + <parent> + <artifactId>wagon</artifactId> + <groupId>org.apache.maven.wagon</groupId> + <version>1.0-beta-2</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>wagon-provider-api</artifactId> + <name>Maven Wagon API</name> + <version>1.0-beta-2</version> + <description>Maven Wagon API that defines the contract between different Wagon implementations</description> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + </dependencies> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.md5 new file mode 100644 index 00000000..0f10b3fd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.md5 @@ -0,0 +1 @@ +97f0a0bd0b81520ccccf8736b1fe380c
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.sha1 new file mode 100644 index 00000000..56b9559d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom.sha1 @@ -0,0 +1 @@ +8b3013d0754edbeb694831ddf1c5d1a0019ee042
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom new file mode 100644 index 00000000..27faa8ef --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom @@ -0,0 +1,170 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>maven-parent</artifactId> + <groupId>org.apache.maven</groupId> + <version>4</version> + <relativePath>../pom/maven/pom.xml</relativePath> + </parent> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon</artifactId> + <packaging>pom</packaging> + <name>Maven Wagon</name> + <version>1.0-beta-2</version> + <description>Tools to manage artifacts and deployment</description> + <url>http://maven.apache.org/wagon</url> + + <issueManagement> + <system>jira</system> + <url>http://jira.codehaus.org/browse/WAGON</url> + </issueManagement> + <inceptionYear>2003</inceptionYear> + <mailingLists> + <mailingList> + <name>Maven Wagon User List</name> + <subscribe>wagon-users-subscribe@maven.apache.org</subscribe> + <unsubscribe>wagon-users-unsubscribe@maven.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/maven-wagon-users/</archive> + </mailingList> + <mailingList> + <name>Maven Wagon Developer List</name> + <subscribe>wagon-dev-subscribe@maven.apache.org</subscribe> + <unsubscribe>wagon-dev-unsubscribe@maven.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/maven-wagon-dev/</archive> + </mailingList> + <mailingList> + <name>Maven Commits List</name> + <subscribe>wagon-commits-subscribe@maven.apache.org</subscribe> + <unsubscribe>wagon-commits-unsubscribe@maven.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/maven-wagon-commits/</archive> + </mailingList> + </mailingLists> + <developers> + <developer> + <id>michal</id> + <name>Michal Maczka</name> + <email>michal@codehaus.org</email> + <organization>Codehaus</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + </developers> + <scm> + <connection>scm:svn:https://svn.apache.org/repos/asf/maven/wagon/tags/wagon-1.0-beta-2</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/wagon/tags/wagon-1.0-beta-2</developerConnection> + <url>https://svn.apache.org/repos/asf/maven/wagon/tags/wagon-1.0-beta-2</url> + </scm> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <tagBase>https://svn.apache.org/repos/asf/maven/wagon/tags</tagBase> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + <modules> + <module>wagon-provider-api</module> + <module>wagon-provider-test</module> + <module>wagon-providers</module> + </modules> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + <dependencyManagement> + <dependencies> + <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-provider-test</artifactId> + <version>1.0-beta-2</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh-common-test</artifactId> + <version>1.0-beta-2</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh-common</artifactId> + <version>1.0-beta-2</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interactivity-api</artifactId> + <version>1.0-alpha-4</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-alpha-8</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.0.4</version> + </dependency> + </dependencies> + </dependencyManagement> + <!-- TODO: point to ref location + <distributionManagement> + <site> + <id>apache.website</id> + <url>scp://people.apache.org/www/maven.apache.org/wagon/</url> + </site> + </distributionManagement> + --> + <profiles> + <profile> + <id>sharedResources</id> + <pluginRepositories> + <pluginRepository> + <id>people.apache.org</id> + <url>http://people.apache.org/repo/m2-snapshot-repository</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-remote-resources-plugin</artifactId> + <version>1.0-alpha-1</version> + <executions> + <execution> + <goals> + <goal>process</goal> + </goals> + <configuration> + <resourceBundles> + <resourceBundle>org.apache:apache-jar-resource-bundle:1.0</resourceBundle> + </resourceBundles> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5 new file mode 100644 index 00000000..45e066d7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.md5 @@ -0,0 +1 @@ +e739bffedc84a18c6e10a0958e2006ad
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1 new file mode 100644 index 00000000..5f82f766 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom.sha1 @@ -0,0 +1 @@ +6cf8a47018be792d2b1774d2bacd7541c888ae50
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar Binary files differnew file mode 100644 index 00000000..d3232758 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.md5 new file mode 100644 index 00000000..1a9a2b6f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.md5 @@ -0,0 +1 @@ +1078ac2103fe666952a3cbcbff19ec71
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.sha1 new file mode 100644 index 00000000..17dbef2e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.jar.sha1 @@ -0,0 +1 @@ +c76ce4f9f1a3d04ef849c1d067519b77f07e01f3
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom new file mode 100644 index 00000000..80ac6d90 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom @@ -0,0 +1,51 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>plexus-components</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.1.6</version> + </parent> + + <artifactId>plexus-active-collections</artifactId> + <version>1.0-beta-1</version> + <name>Plexus Container-Backed Active Collections</name> + + <dependencies> + <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> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>**/TestComponent.java</exclude> + <exclude>**/TestBadComponent.java</exclude> + <exclude>**/*TCK.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + + <scm> + <connection>scm:svn:https://svn.codehaus.org/plexus/tags/plexus-active-collections-1.0-beta-1</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/tags/plexus-active-collections-1.0-beta-1</developerConnection> + </scm> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.md5 new file mode 100644 index 00000000..14519126 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.md5 @@ -0,0 +1 @@ +d844f3e1934a76cefc25342bf02f3bff
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.sha1 new file mode 100644 index 00000000..5442cbcd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-active-collections/1.0-beta-1/plexus-active-collections-1.0-beta-1.pom.sha1 @@ -0,0 +1 @@ +cf6a9d40df4ca79c210b2b8a90ce28fffb202769
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar Binary files differnew file mode 100644 index 00000000..e2143250 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.md5 new file mode 100644 index 00000000..c7dfa1ea --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.md5 @@ -0,0 +1 @@ +f55402879506f435a386f2c002ed5001
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.sha1 new file mode 100644 index 00000000..a333efb8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.jar.sha1 @@ -0,0 +1 @@ +fc41205635dab152bf794785be80a0a70fda686e
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom new file mode 100644 index 00000000..be71f49f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom @@ -0,0 +1,94 @@ +<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ + ~ Copyright 2001-2006 The Codehaus 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 http://maven.apache.org/maven-v4_0_0.xsd"> + <parent> + <artifactId>plexus</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0.10</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <packaging>jar</packaging> + <name>Plexus Classworlds</name> + <version>1.2-alpha-10</version> + <description /> + <inceptionYear>2002</inceptionYear> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <forkMode>once</forkMode> + </configuration> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/codehaus/plexus/classworlds/event/*</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <profiles> + <profile> + <id>debug</id> + <dependencies> + <dependency> + <groupId>aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>1.5.0</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>aspectj-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + <configuration> + <complianceLevel>1.4</complianceLevel> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-10</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-10</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-10</url> + </scm> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.md5 new file mode 100644 index 00000000..47dbce55 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.md5 @@ -0,0 +1 @@ +1a7177f5992983aeb393089af67e51dc
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.sha1 new file mode 100644 index 00000000..eafd9a79 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-10/plexus-classworlds-1.2-alpha-10.pom.sha1 @@ -0,0 +1 @@ +11215912b045533ec9aaba9f63ea27acf6da850e
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar Binary files differnew file mode 100644 index 00000000..a8f6a7d3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.md5 new file mode 100644 index 00000000..09c3bbad --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.md5 @@ -0,0 +1 @@ +b00a4521e82cd7cdf502039dd59a1ffb
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.sha1 new file mode 100644 index 00000000..9a43138c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.jar.sha1 @@ -0,0 +1 @@ +ed03d1eeb9b2576747df0d2883d9006fa5e1febe
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom new file mode 100644 index 00000000..6e29cd26 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom @@ -0,0 +1,78 @@ +<?xml version="1.0"?><project> + <parent> + <artifactId>plexus</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0.9</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <name>Plexus Classworlds</name> + <version>1.2-alpha-7</version> + <description></description> + <inceptionYear>2002</inceptionYear> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-7</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-7</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-7</url> + </scm> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <forkMode>once</forkMode> + </configuration> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/codehaus/plexus/classworlds/event/*</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <profiles> + <profile> + <id>debug</id> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>aspectj-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + <configuration> + <complianceLevel>1.4</complianceLevel> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>1.5.0</version> + </dependency> + </dependencies> + </profile> + </profiles> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>compile</scope> + </dependency> + </dependencies> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.md5 new file mode 100644 index 00000000..e9083e79 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.md5 @@ -0,0 +1 @@ +80962d09b250824806ca66b0bd0ad4c1
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1 new file mode 100644 index 00000000..4b9e8a40 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1 @@ -0,0 +1 @@ +6944ec0d0cab19adf167332f7197e045d64a577c
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar Binary files differnew file mode 100644 index 00000000..85669fdd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.md5 new file mode 100644 index 00000000..1830fc9e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.md5 @@ -0,0 +1 @@ +4fe3c03b97ff12905d0fb10fc5b36766
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.sha1 new file mode 100644 index 00000000..7456120d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar.sha1 @@ -0,0 +1 @@ +5a2100a1c6a37804b1abfc70000b0ea33b83b7f9
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom new file mode 100644 index 00000000..b1511640 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom @@ -0,0 +1,63 @@ +<?xml version="1.0"?><project> + <parent> + <artifactId>plexus-containers</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0-alpha-16</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>plexus-component-api</artifactId> + <name>Plexus Component API</name> + <version>1.0-alpha-16</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.2</version> + <configuration> + <excludes> + <exclude>**/Test*.java</exclude> + <exclude>**/Abstract*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + </dependency> + </dependencies> + <reporting> + <plugins> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + </plugin> + <plugin> + <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> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.md5 new file mode 100644 index 00000000..78fc8ace --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.md5 @@ -0,0 +1 @@ +751ea77f1e617aea90f36d7156762bf5
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1 new file mode 100644 index 00000000..dea60884 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1 @@ -0,0 +1 @@ +53ad54acd9589c497ba54740f0455fec55db64d7
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar Binary files differnew file mode 100644 index 00000000..5e3a919c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.md5 new file mode 100644 index 00000000..beb51a4f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.md5 @@ -0,0 +1 @@ +7146edcc3412c2b54df27edaf66b00a6
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.sha1 new file mode 100644 index 00000000..4a7df6b7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.jar.sha1 @@ -0,0 +1 @@ +b226de4eb8db939dff4e14eb5aa1be045c39f6f4
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom new file mode 100644 index 00000000..6369d8ec --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom @@ -0,0 +1,61 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-containers</artifactId> + <version>1.0-alpha-32</version> + </parent> + <artifactId>plexus-component-api</artifactId> + <name>Plexus Component API</name> + <version>1.0-alpha-32</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.2</version> + <configuration> + <excludes> + <exclude>**/Test*.java</exclude> + <exclude>**/Abstract*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + </dependency> + </dependencies> + + <reporting> + <plugins> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + </plugin> + <plugin> + <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> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.md5 new file mode 100644 index 00000000..40890b2c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.md5 @@ -0,0 +1 @@ +a181ee89516009cff7658eec175ccb23
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.sha1 new file mode 100644 index 00000000..f854c7a1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-component-api/1.0-alpha-32/plexus-component-api-1.0-alpha-32.pom.sha1 @@ -0,0 +1 @@ +e214782e714b87b38d5605cb8da53b7d98efde06
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom new file mode 100644 index 00000000..0afa8021 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom @@ -0,0 +1,60 @@ +<!-- + + !!! + + NOTE: If you change this file, you MUST bump the version up from 1.0. That is the version of the POM, and was + used for releases of plexus-compiler and plexus-archiver in the past. + + !!! + +--> + +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>plexus</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0.8</version> + </parent> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-components</artifactId> + <packaging>pom</packaging> + <version>1.1.6</version> + <name>Plexus Components Parent Project</name> + <!-- + TODO: should this be pushed down to all the dependencies? + - a more stable API JAR may be useful, for the interfaces and classes such as AbstractLogEnabled + --> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-alpha-8</version> + </dependency> + </dependencies> + <modules> + <module>plexus-action</module> + <module>plexus-archiver</module> + <module>plexus-bayesian</module> + <module>plexus-command</module> + <module>plexus-compiler</module> + <module>plexus-drools</module> + <module>plexus-formica</module> + <module>plexus-formica-web</module> + <module>plexus-hibernate</module> + <module>plexus-i18n</module> + <module>plexus-interactivity</module> + <module>plexus-ircbot</module> + <module>plexus-jdo</module> + <module>plexus-jetty-httpd</module> + <module>plexus-jetty</module> + <module>plexus-mimetyper</module> + <module>plexus-notification</module> + <module>plexus-resource</module> + <module>plexus-security</module> + <module>plexus-summit</module> + <module>plexus-taskqueue</module> + <module>plexus-velocity</module> + <module>plexus-xmlrpc</module> + </modules> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.md5 new file mode 100644 index 00000000..cf57067b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.md5 @@ -0,0 +1 @@ +b76cb94eb4ade475f4743d3656c40899
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1 new file mode 100644 index 00000000..b9f0aa79 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1 @@ -0,0 +1 @@ +682713aa402653d0ea5e224870dc899803734519
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar Binary files differnew file mode 100644 index 00000000..ef2bd907 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.md5 new file mode 100644 index 00000000..fc1ee0b6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.md5 @@ -0,0 +1 @@ +00b4ce443fa584a1998cd6f991ea6514
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.sha1 new file mode 100644 index 00000000..879c8890 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.jar.sha1 @@ -0,0 +1 @@ +dcad8d44306c5ecc109b9449f292fb28b75d37ef
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom new file mode 100644 index 00000000..f5ae5489 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom @@ -0,0 +1,56 @@ +<?xml version="1.0"?><project> + <parent> + <artifactId>plexus-containers</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0-alpha-16</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>plexus-container-default</artifactId> + <name>Default Plexus Container</name> + <version>1.0-alpha-16</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <forkMode>once</forkMode> + <excludes> + <exclude>**/Test*.java</exclude> + <exclude>**/Abstract*.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-api</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + </dependency> + <dependency> + <groupId>jmock</groupId> + <artifactId>jmock</artifactId> + <version>1.0.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.md5 new file mode 100644 index 00000000..611807a8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.md5 @@ -0,0 +1 @@ +883b6e1e40cccb06c1d1ce93728b0a9d
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.sha1 new file mode 100644 index 00000000..ea4d6dc0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-16/plexus-container-default-1.0-alpha-16.pom.sha1 @@ -0,0 +1 @@ +435f5d09ea241e93acaecd4b6680ddb13a36837d
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar Binary files differnew file mode 100644 index 00000000..308893f6 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.md5 new file mode 100644 index 00000000..291ffea0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.md5 @@ -0,0 +1 @@ +556231599b5413a7c1f16a5fd15be574
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.sha1 new file mode 100644 index 00000000..b8ef047d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.jar.sha1 @@ -0,0 +1 @@ +91410b971f9659f76b0ff26a97b9fbac5de2f69e
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom new file mode 100644 index 00000000..fbfdb2ba --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom @@ -0,0 +1,98 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-containers</artifactId> + <version>1.0-alpha-32</version> + </parent> + <artifactId>plexus-container-default</artifactId> + <name>Default Plexus Container</name> + <version>1.0-alpha-32</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <forkMode>once</forkMode> + <excludes> + <exclude>**/Test*.java</exclude> + <exclude>**/Abstract*.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <artifactId>shade-maven-plugin</artifactId> + <groupId>org.codehaus.mojo</groupId> + <version>1.0-alpha-9</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <artifactSet> + <excludes> + <exclude>classworlds:classworlds</exclude> + <exclude>junit:junit</exclude> + <exclude>jmock:jmock</exclude> + <exclude>org.codehaus.plexus:plexus-classworlds</exclude> + <exclude>org.codehaus.plexus:plexus-utils</exclude> + </excludes> + </artifactSet> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-api</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + </dependency> + <dependency> + <groupId>jmock</groupId> + <artifactId>jmock</artifactId> + <version>1.0.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <reporting> + <plugins> + <!--plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin--> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + </plugin> + <plugin> + <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> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.md5 new file mode 100644 index 00000000..3b237719 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.md5 @@ -0,0 +1 @@ +af4ca0022b674405556b3f397e375adc
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.sha1 new file mode 100644 index 00000000..00b60872 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-container-default/1.0-alpha-32/plexus-container-default-1.0-alpha-32.pom.sha1 @@ -0,0 +1 @@ +8f4d09d36a2345a39301dbd77ef9906c795887f7
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom new file mode 100644 index 00000000..5800d75b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom @@ -0,0 +1,49 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus</artifactId> + <version>1.0.9</version> + </parent> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-containers</artifactId> + <packaging>pom</packaging> + <name>Parent Plexus Container POM</name> + <version>1.0-alpha-16</version> + <modules> + <module>plexus-component-api</module> + <module>plexus-container-default</module> + </modules> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/plexus-containers/tags/plexus-containers-1.0-alpha-16</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/plexus-containers/tags/plexus-containers-1.0-alpha-16</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/plexus-containers/tags/plexus-containers-1.0-alpha-16</url> + </scm> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>compile</scope> + </dependency> + </dependencies> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <version>1.2-alpha-7</version> + </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-utils</artifactId> + <version>1.3</version> + </dependency> + </dependencies> + </dependencyManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.md5 new file mode 100644 index 00000000..3db22e20 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.md5 @@ -0,0 +1 @@ +3eee2016e3e307618048e30f088b546e
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1 new file mode 100644 index 00000000..3eb36271 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1 @@ -0,0 +1 @@ +46b79dd7d6a8130d2fa81c80b16b695d491548fe
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom new file mode 100644 index 00000000..4678bd87 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom @@ -0,0 +1,49 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus</artifactId> + <version>1.0.11</version> + </parent> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-containers</artifactId> + <packaging>pom</packaging> + <name>Parent Plexus Container POM</name> + <version>1.0-alpha-32</version> + <modules> + <module>plexus-component-api</module> + <module>plexus-container-default</module> + </modules> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/plexus-containers/tags/plexus-containers-1.0-alpha-32</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/plexus-containers/tags/plexus-containers-1.0-alpha-32</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/plexus-containers/tags/plexus-containers-1.0-alpha-32</url> + </scm> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>compile</scope> + </dependency> + </dependencies> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <version>1.2-alpha-10</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.4.5</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-api</artifactId> + <version>1.0-alpha-32</version> + </dependency> + </dependencies> + </dependencyManagement> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.md5 new file mode 100644 index 00000000..41815f08 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.md5 @@ -0,0 +1 @@ +8ac33e07134648d37e2b1253286889a7
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.sha1 new file mode 100644 index 00000000..41260716 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-containers/1.0-alpha-32/plexus-containers-1.0-alpha-32.pom.sha1 @@ -0,0 +1 @@ +8486ff9b37d1ade2a4524c6fee72d394f88fbe08
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar Binary files differnew file mode 100644 index 00000000..5c50e177 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.md5 new file mode 100644 index 00000000..a7ca769a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.md5 @@ -0,0 +1 @@ +49e112a6c1ad24962643ef9494f9cbe1
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1 new file mode 100644 index 00000000..28f6dbb5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1 @@ -0,0 +1 @@ +fa632b7f1cb7c50963d0fb7d818ca93c75c10127
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom new file mode 100644 index 00000000..6cf90799 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?><project> + <parent> + <artifactId>plexus</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0.4</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>plexus-utils</artifactId> + <name>Plexus Common Utilities</name> + <version>1.1</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/codehaus/plexus/util/FileBasedTestCase.java</exclude> + <exclude>**/Test*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.md5 new file mode 100644 index 00000000..6de9bf47 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.md5 @@ -0,0 +1 @@ +6e902bab552ae52fef5875d27c4cf0a0
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1 new file mode 100644 index 00000000..4dc64d4a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1 @@ -0,0 +1 @@ +15492ecd00920daca9ec15f6acd695b626621e5b
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar Binary files differnew file mode 100644 index 00000000..449afb9c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5 new file mode 100644 index 00000000..eff56f28 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.md5 @@ -0,0 +1 @@ +e158df8d1a539cc6482567f9689cc36f
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1 new file mode 100644 index 00000000..953f76d8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar.sha1 @@ -0,0 +1 @@ +56559396674aacd498c298964b691db0177027c0
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom new file mode 100644 index 00000000..bc634a6f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom @@ -0,0 +1,61 @@ +<?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/maven-v4_0_0.xsd"> + <parent> + <artifactId>plexus</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0.11</version> + <relativePath>../pom/pom.xml</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>plexus-utils</artifactId> + <name>Plexus Common Utilities</name> + <version>1.4.5</version> + <url>http://plexus.codehaus.org/plexus-utils</url> + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <!-- surefire requires plexus-utils to be jdk 1.3 compatible --> + <source>1.3</source> + <target>1.3</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <!-- required to ensure the test classes are used, not surefire's plexus-utils --> + <childDelegation>true</childDelegation> + <excludes> + <exclude>org/codehaus/plexus/util/FileBasedTestCase.java</exclude> + <exclude>**/Test*.java</exclude> + </excludes> + <systemProperties> + <property> + <name>JAVA_HOME</name> + <value>${JAVA_HOME}</value> + </property> + <property> + <name>M2_HOME</name> + <value>${M2_HOME}</value> + </property> + </systemProperties> + </configuration> + </plugin> + </plugins> + </build> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/plexus-utils/tags/plexus-utils-1.4.5</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/plexus-utils/tags/plexus-utils-1.4.5</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/plexus-utils/tags/plexus-utils-1.4.5</url> + </scm> + <reporting> + <plugins> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + </plugin> + </plugins> + </reporting> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5 new file mode 100644 index 00000000..905f70a9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.md5 @@ -0,0 +1 @@ +fccab705018ed5559df9f8e815b79aaa
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1 new file mode 100644 index 00000000..247cd943 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1 @@ -0,0 +1 @@ +0bdc8a7fbce7d9007a93d289a029b43e1196d85c
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom new file mode 100644 index 00000000..bc94e24b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom @@ -0,0 +1,273 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus</artifactId> + <packaging>pom</packaging> + <name>Plexus</name> + <version>1.0.10</version> + <ciManagement> + <notifiers> + <notifier> + <type>mail</type> + <configuration> + <address>dev@plexus.codehaus.org</address> + </configuration> + </notifier> + <notifier> + <type>irc</type> + <configuration> + <host>irc.codehaus.org</host> + <port>6667</port> + <channel>#plexus</channel> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <inceptionYear>2001</inceptionYear> + <mailingLists> + <mailingList> + <name>Plexus User List</name> + <subscribe>http://xircles.codehaus.org/manage_email/user%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/user%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/user</archive> + </mailingList> + <mailingList> + <name>Plexus Developer List</name> + <subscribe>http://xircles.codehaus.org/manage_email/dev%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/dev%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/dev</archive> + </mailingList> + <mailingList> + <name>Plexus Announce List</name> + <subscribe>http://xircles.codehaus.org/manage_email/announce%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/announce%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/announce</archive> + </mailingList> + <mailingList> + <name>Plexus Commit List</name> + <subscribe>http://xircles.codehaus.org/manage_email/scm%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/scm%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/scm</archive> + </mailingList> + </mailingLists> + <issueManagement> + <system>JIRA</system> + <url>http://jira.codehaus.org/browse/PLX</url> + </issueManagement> + + <distributionManagement> + <repository> + <id>codehaus.org</id> + <name>Plexus Central Repository</name> + <url>dav:https://dav.codehaus.org/repository/plexus</url> + </repository> + <snapshotRepository> + <id>codehaus.org</id> + <name>Plexus Central Development Repository</name> + <url>dav:https://dav.codehaus.org/snapshots.repository/plexus</url> + </snapshotRepository> + <site> + <id>codehaus.org</id> + <url>dav:https://dav.codehaus.org/plexus</url> + </site> + </distributionManagement> + <repositories> + <repository> + <id>codehaus.snapshots</id> + <name>Codehaus Snapshot Development Repository</name> + <url>http://snapshots.repository.codehaus.org</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> + + <developers> + <developer> + <id>jvanzyl</id> + <name>Jason van Zyl</name> + <email>jason@maven.org</email> + <roles> + <role>Developer</role> + <role>Release Manager</role> + </roles> + </developer> + <developer> + <id>kaz</id> + <name>Pete Kazmier</name> + <email /> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>jtaylor</id> + <name>James Taylor</name> + <email>james@jamestaylor.org</email> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>dandiep</id> + <name>Dan Diephouse</name> + <email>dan@envoisolutions.com</email> + <organization>Envoi solutions</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>kasper</id> + <name>Kasper Nielsen</name> + <email>apache@kav.dk</email> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>bwalding</id> + <name>Ben Walding</name> + <email>bwalding@codehaus.org</email> + <organization>Walding Consulting Services</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>mhw</id> + <name>Mark Wilkinson</name> + <email>mhw@kremvax.net</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>michal</id> + <name>Michal Maczka</name> + <email>mmaczka@interia.pl</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>evenisse</id> + <name>Emmanuel Venisse</name> + <email>evenisse@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Trygve Laugstol</name> + <id>trygvis</id> + <email>trygvis@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Kenney Westerhof</name> + <id>kenney</id> + <email>kenney@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Carlos Sanchez</name> + <id>carlos</id> + <email>carlos@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Brett Porter</name> + <id>brett</id> + <email>brett@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>John Casey</name> + <id>jdcasey</id> + <email>jdcasey@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Andrew Williams</name> + <id>handyande</id> + <email>andy@handyande.co.uk</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Rahul Thakur</name> + <id>rahul</id> + <email>rahul.thakur.xdev@gmail.com</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Joakim Erdfelt</name> + <id>joakime</id> + <email>joakim@erdfelt.com</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Olivier Lamy</name> + <id>olamy</id> + <email>olamy@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/pom/tags/plexus-1.0.10</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/pom/tags/plexus-1.0.10</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/pom/tags/plexus-1.0.10</url> + </scm> + <organization> + <name>Codehaus</name> + <url>http://www.codehaus.org/</url> + </organization> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.4</source> + <target>1.4</target> + </configuration> + </plugin> + </plugins> + <extensions> + <extension> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-webdav</artifactId> + <version>1.0-beta-2</version> + </extension> + </extensions> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.md5 new file mode 100644 index 00000000..7ae43d7e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.md5 @@ -0,0 +1 @@ +6ab958c91424c0d7c3a2cc861867905e
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1 new file mode 100644 index 00000000..8ed366f9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1 @@ -0,0 +1 @@ +039c3f6a3cbe1f9e7b4a3309d9d7062b6e390fa7
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom new file mode 100644 index 00000000..28ee5744 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom @@ -0,0 +1,308 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus</artifactId> + <packaging>pom</packaging> + <name>Plexus</name> + <version>1.0.11</version> + <ciManagement> + <notifiers> + <notifier> + <type>mail</type> + <configuration> + <address>dev@plexus.codehaus.org</address> + </configuration> + </notifier> + <notifier> + <type>irc</type> + <configuration> + <host>irc.codehaus.org</host> + <port>6667</port> + <channel>#plexus</channel> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <inceptionYear>2001</inceptionYear> + <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> + <mailingLists> + <mailingList> + <name>Plexus User List</name> + <subscribe>http://xircles.codehaus.org/manage_email/user%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/user%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/user</archive> + </mailingList> + <mailingList> + <name>Plexus Developer List</name> + <subscribe>http://xircles.codehaus.org/manage_email/dev%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/dev%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/dev</archive> + </mailingList> + <mailingList> + <name>Plexus Announce List</name> + <subscribe>http://xircles.codehaus.org/manage_email/announce%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/announce%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/announce</archive> + </mailingList> + <mailingList> + <name>Plexus Commit List</name> + <subscribe>http://xircles.codehaus.org/manage_email/scm%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/scm%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/scm</archive> + </mailingList> + </mailingLists> + <issueManagement> + <system>JIRA</system> + <url>http://jira.codehaus.org/browse/PLX</url> + </issueManagement> + + <distributionManagement> + <repository> + <id>codehaus.org</id> + <name>Plexus Central Repository</name> + <url>dav:https://dav.codehaus.org/repository/plexus</url> + </repository> + <snapshotRepository> + <id>codehaus.org</id> + <name>Plexus Central Development Repository</name> + <url>dav:https://dav.codehaus.org/snapshots.repository/plexus</url> + </snapshotRepository> + <site> + <id>codehaus.org</id> + <url>dav:https://dav.codehaus.org/plexus</url> + </site> + </distributionManagement> + <repositories> + <repository> + <id>codehaus.snapshots</id> + <name>Codehaus Snapshot Development Repository</name> + <url>http://snapshots.repository.codehaus.org</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> + + <developers> + <developer> + <id>jvanzyl</id> + <name>Jason van Zyl</name> + <email>jason@maven.org</email> + <roles> + <role>Developer</role> + <role>Release Manager</role> + </roles> + </developer> + <developer> + <id>kaz</id> + <name>Pete Kazmier</name> + <email /> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>jtaylor</id> + <name>James Taylor</name> + <email>james@jamestaylor.org</email> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>dandiep</id> + <name>Dan Diephouse</name> + <email>dan@envoisolutions.com</email> + <organization>Envoi solutions</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>kasper</id> + <name>Kasper Nielsen</name> + <email>apache@kav.dk</email> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>bwalding</id> + <name>Ben Walding</name> + <email>bwalding@codehaus.org</email> + <organization>Walding Consulting Services</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>mhw</id> + <name>Mark Wilkinson</name> + <email>mhw@kremvax.net</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>michal</id> + <name>Michal Maczka</name> + <email>mmaczka@interia.pl</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>evenisse</id> + <name>Emmanuel Venisse</name> + <email>evenisse@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Trygve Laugstol</name> + <id>trygvis</id> + <email>trygvis@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Kenney Westerhof</name> + <id>kenney</id> + <email>kenney@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Carlos Sanchez</name> + <id>carlos</id> + <email>carlos@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Brett Porter</name> + <id>brett</id> + <email>brett@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>John Casey</name> + <id>jdcasey</id> + <email>jdcasey@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Andrew Williams</name> + <id>handyande</id> + <email>andy@handyande.co.uk</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Rahul Thakur</name> + <id>rahul</id> + <email>rahul.thakur.xdev@gmail.com</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Joakim Erdfelt</name> + <id>joakime</id> + <email>joakim@erdfelt.com</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Olivier Lamy</name> + <id>olamy</id> + <email>olamy@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/pom/trunk/</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/pom/trunk/</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/pom/trunk/</url> + </scm> + <organization> + <name>Codehaus</name> + <url>http://www.codehaus.org/</url> + </organization> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.4</source> + <target>1.4</target> + </configuration> + </plugin> + <!-- + <plugin> + <artifactId>maven-remote-resources-plugin</artifactId> + <version>1.0-alpha-2</version> + <executions> + <execution> + <goals> + <goal>process</goal> + </goals> + <configuration> + <resourceBundles> + <resourceBundle>org.apache:apache-jar-resource-bundle:1.1.1-SNAPSHOT</resourceBundle> + </resourceBundles> + </configuration> + </execution> + </executions> + </plugin> + --> + </plugins> + <extensions> + <extension> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-webdav</artifactId> + <version>1.0-beta-2</version> + </extension> + </extensions> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <goals>deploy</goals> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.md5 new file mode 100644 index 00000000..2cabbba0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.md5 @@ -0,0 +1 @@ +bdf8dcfe0877af604f7e19e9ffdf260b
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1 new file mode 100644 index 00000000..1ba2b3af --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1 @@ -0,0 +1 @@ +4693d4512d50c5159bef1c49def1d2690a327c30
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom new file mode 100644 index 00000000..2cf5d569 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom @@ -0,0 +1,205 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus</artifactId> + <packaging>pom</packaging> + <name>Plexus</name> + <version>1.0.4</version> + <ciManagement> + <notifiers> + <notifier> + <type>mail</type> + <configuration> + <address>dev@plexus.codehaus.org</address> + </configuration> + </notifier> + <notifier> + <type>irc</type> + <configuration> + <host>irc.codehaus.org</host> + <port>6667</port> + <channel>#plexus</channel> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <inceptionYear>2001</inceptionYear> + <mailingLists> + <mailingList> + <name>Plexus Developer List</name> + <subscribe>http://lists.codehaus.org/mailman/listinfo/plexus-dev</subscribe> + <unsubscribe>http://lists.codehaus.org/mailman/listinfo/plexus-dev</unsubscribe> + <archive>http://lists.codehaus.org/pipermail/plexus-dev/</archive> + </mailingList> + </mailingLists> + + <distributionManagement> + <repository> + <id>repo1</id> + <name>Maven Central Repository</name> + <url>scp://repo1.maven.org/home/projects/maven/repository-staging/to-ibiblio/maven2</url> + </repository> + <snapshotRepository> + <id>snapshots</id> + <name>Maven Central Development Repository</name> + <url>scp://repo1.maven.org/home/projects/maven/repository-staging/snapshots/maven2</url> + </snapshotRepository> + </distributionManagement> + <repositories> + <repository> + <id>snapshots</id> + <name>Maven Snapshot Development Repository</name> + <url>http://snapshots.maven.codehaus.org/maven2</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>snapshots-plugins</id> + <name>Maven Snapshot Plugins Development Repository</name> + <url>http://snapshots.maven.codehaus.org/maven2</url> + <releases> + <enabled>false</enabled> + </releases> + </pluginRepository> + </pluginRepositories> + + <developers> + <developer> + <id>jvanzyl</id> + <name>Jason van Zyl</name> + <email>jason@zenplex.com</email> + <organization>Zenplex</organization> + <roles> + <role>Developer</role> + <role>Release Manager</role> + </roles> + </developer> + <developer> + <id>kaz</id> + <name>Pete Kazmier</name> + <email></email> + <organization></organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>jtaylor</id> + <name>James Taylor</name> + <email>james@jamestaylor.org</email> + <organization></organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>dandiep</id> + <name>Dan Diephouse</name> + <email>dan@envoisolutions.com</email> + <organization>Envoi solutions</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>kasper</id> + <name>Kasper Nielsen</name> + <email>apache@kav.dk</email> + <organization></organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>bwalding</id> + <name>Ben Walding</name> + <email>bwalding@codehaus.org</email> + <organization>Walding Consulting Services</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>mhw</id> + <name>Mark Wilkinson</name> + <email>mhw@kremvax.net</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>michal</id> + <name>Michal Maczka</name> + <email>mmaczka@interia.pl</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>evenisse</id> + <name>Emmanuel Venisse</name> + <email>evenisse@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Trygve Laugstøl</name> + <id>trygvis</id> + <email>trygvis@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Kenney Westerhof</name> + <id>kenney</id> + <email>kenney@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <scm> + <connection>scm:svn:svn://svn.codehaus.org/plexus/scm/trunk/</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/trunk</developerConnection> + </scm> + <organization> + <name>Codehaus</name> + <url>http://www.codehaus.org/</url> + </organization> + <modules> + <module>plexus-appserver</module> + <module>plexus-archetypes</module> + <module>plexus-components</module> + <module>plexus-component-factories</module> + <module>plexus-containers</module> + <module>plexus-logging</module> + <module>plexus-maven-plugin</module> + <module>plexus-services</module> + <module>plexus-tools</module> + <module>plexus-utils</module> + </modules> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <tagBase>https://svn.codehaus.org/plexus/tags</tagBase> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.md5 new file mode 100644 index 00000000..ec5562d8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.md5 @@ -0,0 +1 @@ +2e97f3a7666e337ce5d2d98b9c384cae
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1 new file mode 100644 index 00000000..456d5347 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1 @@ -0,0 +1 @@ +06f66b2f7d2eef1d805c11bca91c89984cda4137
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom new file mode 100644 index 00000000..cba2014f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom @@ -0,0 +1,259 @@ +<?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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus</artifactId> + <packaging>pom</packaging> + <name>Plexus</name> + <version>1.0.8</version> + <ciManagement> + <notifiers> + <notifier> + <type>mail</type> + <configuration> + <address>dev@plexus.codehaus.org</address> + </configuration> + </notifier> + <notifier> + <type>irc</type> + <configuration> + <host>irc.codehaus.org</host> + <port>6667</port> + <channel>#plexus</channel> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <inceptionYear>2001</inceptionYear> + <mailingLists> + <mailingList> + <name>Plexus Developer List</name> + <subscribe>http://lists.codehaus.org/mailman/listinfo/plexus-dev</subscribe> + <unsubscribe>http://lists.codehaus.org/mailman/listinfo/plexus-dev</unsubscribe> + <archive>http://lists.codehaus.org/pipermail/plexus-dev/</archive> + </mailingList> + </mailingLists> + <issueManagement> + <system>JIRA</system> + <url>http://jira.codehaus.org/browse/PLX</url> + </issueManagement> + + <distributionManagement> + <repository> + <id>codehaus.org</id> + <name>Plexus Central Repository</name> + <url>dav:https://dav.codehaus.org/repository/plexus</url> + </repository> + <snapshotRepository> + <id>codehaus.org</id> + <name>Plexus Central Development Repository</name> + <url>dav:https://dav.codehaus.org/snapshots.repository/plexus</url> + </snapshotRepository> + <site> + <id>codehaus.org</id> + <url>dav:https://dav.codehaus.org/plexus</url> + </site> + </distributionManagement> + <repositories> + <repository> + <id>apache-snapshots</id> + <name>Snapshot repository</name> + <url>http://people.apache.org/maven-snapshot-repository</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + <repository> + <id>codehaus-snapshots</id> + <name>Codehaus Snapshot Development Repository</name> + <url>http://snapshots.repository.codehaus.org</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>codehaus-snapshots</id> + <name>Codehaus Snapshot Development Repository</name> + <url>http://snapshots.repository.codehaus.org</url> + <releases> + <enabled>false</enabled> + </releases> + </pluginRepository> + </pluginRepositories> + + <developers> + <developer> + <id>jvanzyl</id> + <name>Jason van Zyl</name> + <email>jason@maven.org</email> + <roles> + <role>Developer</role> + <role>Release Manager</role> + </roles> + </developer> + <developer> + <id>kaz</id> + <name>Pete Kazmier</name> + <email></email> + <organization></organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>jtaylor</id> + <name>James Taylor</name> + <email>james@jamestaylor.org</email> + <organization></organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>dandiep</id> + <name>Dan Diephouse</name> + <email>dan@envoisolutions.com</email> + <organization>Envoi solutions</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>kasper</id> + <name>Kasper Nielsen</name> + <email>apache@kav.dk</email> + <organization></organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>bwalding</id> + <name>Ben Walding</name> + <email>bwalding@codehaus.org</email> + <organization>Walding Consulting Services</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>mhw</id> + <name>Mark Wilkinson</name> + <email>mhw@kremvax.net</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>michal</id> + <name>Michal Maczka</name> + <email>mmaczka@interia.pl</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>evenisse</id> + <name>Emmanuel Venisse</name> + <email>evenisse@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Trygve Laugstol</name> + <id>trygvis</id> + <email>trygvis@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Kenney Westerhof</name> + <id>kenney</id> + <email>kenney@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Carlos Sanchez</name> + <id>carlos</id> + <email>carlos@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Brett Porter</name> + <id>brett</id> + <email>brett@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>John Casey</name> + <id>jdcasey</id> + <email>jdcasey@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/trunk/</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/trunk</developerConnection> + </scm> + <organization> + <name>Codehaus</name> + <url>http://www.codehaus.org/</url> + </organization> + <modules> + <!-- + + Until the bug is fixed in Maven which is pulling in the trunk to the + appserver build. + <module>plexus-appserver</module> + --> + <module>plexus-archetypes</module> + <module>plexus-examples</module> + <module>plexus-components</module> + <module>plexus-component-factories</module> + <module>plexus-containers</module> + <module>plexus-logging</module> + <module>plexus-maven-plugin</module> + <module>plexus-tools</module> + <module>plexus-utils</module> + </modules> + <build> + <extensions> + <extension> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-webdav</artifactId> + <version>1.0-beta-1</version> + </extension> + </extensions> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <tagBase>https://svn.codehaus.org/plexus/tags</tagBase> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.md5 new file mode 100644 index 00000000..e0d40fcd --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.md5 @@ -0,0 +1 @@ +2da4039a1c4c959c75d3e6126f2029cf
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1 new file mode 100644 index 00000000..5234d563 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1 @@ -0,0 +1 @@ +9e7c8432829962afe796b32587c1bfa841a317d5
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom new file mode 100644 index 00000000..f6fca7c8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom @@ -0,0 +1,257 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus</artifactId> + <packaging>pom</packaging> + <name>Plexus</name> + <version>1.0.9</version> + <ciManagement> + <notifiers> + <notifier> + <type>mail</type> + <configuration> + <address>dev@plexus.codehaus.org</address> + </configuration> + </notifier> + <notifier> + <type>irc</type> + <configuration> + <host>irc.codehaus.org</host> + <port>6667</port> + <channel>#plexus</channel> + </configuration> + </notifier> + </notifiers> + </ciManagement> + <inceptionYear>2001</inceptionYear> + <mailingLists> + <mailingList> + <name>Plexus User List</name> + <subscribe>http://xircles.codehaus.org/manage_email/user%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/user%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/user</archive> + </mailingList> + <mailingList> + <name>Plexus Developer List</name> + <subscribe>http://xircles.codehaus.org/manage_email/dev%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/dev%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/dev</archive> + </mailingList> + <mailingList> + <name>Plexus Announce List</name> + <subscribe>http://xircles.codehaus.org/manage_email/announce%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/announce%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/announce</archive> + </mailingList> + <mailingList> + <name>Plexus Commit List</name> + <subscribe>http://xircles.codehaus.org/manage_email/scm%40plexus.codehaus.org</subscribe> + <unsubscribe>http://xircles.codehaus.org/manage_email/scm%40plexus.codehaus.org</unsubscribe> + <archive>http://archive.plexus.codehaus.org/scm</archive> + </mailingList> + </mailingLists> + <issueManagement> + <system>JIRA</system> + <url>http://jira.codehaus.org/browse/PLX</url> + </issueManagement> + + <distributionManagement> + <repository> + <id>codehaus.org</id> + <name>Plexus Central Repository</name> + <url>dav:https://dav.codehaus.org/repository/plexus</url> + </repository> + <snapshotRepository> + <id>codehaus.org</id> + <name>Plexus Central Development Repository</name> + <url>dav:https://dav.codehaus.org/snapshots.repository/plexus</url> + </snapshotRepository> + <site> + <id>codehaus.org</id> + <url>dav:https://dav.codehaus.org/plexus</url> + </site> + </distributionManagement> + <repositories> + <repository> + <id>apache-snapshots</id> + <name>Snapshot repository</name> + <url>http://people.apache.org/maven-snapshot-repository</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + <repository> + <id>codehaus-snapshots</id> + <name>Codehaus Snapshot Development Repository</name> + <url>http://snapshots.repository.codehaus.org</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>codehaus-snapshots</id> + <name>Codehaus Snapshot Development Repository</name> + <url>http://snapshots.repository.codehaus.org</url> + <releases> + <enabled>false</enabled> + </releases> + </pluginRepository> + </pluginRepositories> + + <developers> + <developer> + <id>jvanzyl</id> + <name>Jason van Zyl</name> + <email>jason@maven.org</email> + <roles> + <role>Developer</role> + <role>Release Manager</role> + </roles> + </developer> + <developer> + <id>kaz</id> + <name>Pete Kazmier</name> + <email /> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>jtaylor</id> + <name>James Taylor</name> + <email>james@jamestaylor.org</email> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>dandiep</id> + <name>Dan Diephouse</name> + <email>dan@envoisolutions.com</email> + <organization>Envoi solutions</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>kasper</id> + <name>Kasper Nielsen</name> + <email>apache@kav.dk</email> + <organization /> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>bwalding</id> + <name>Ben Walding</name> + <email>bwalding@codehaus.org</email> + <organization>Walding Consulting Services</organization> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>mhw</id> + <name>Mark Wilkinson</name> + <email>mhw@kremvax.net</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>michal</id> + <name>Michal Maczka</name> + <email>mmaczka@interia.pl</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <id>evenisse</id> + <name>Emmanuel Venisse</name> + <email>evenisse@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Trygve Laugstol</name> + <id>trygvis</id> + <email>trygvis@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Kenney Westerhof</name> + <id>kenney</id> + <email>kenney@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Carlos Sanchez</name> + <id>carlos</id> + <email>carlos@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Brett Porter</name> + <id>brett</id> + <email>brett@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>John Casey</name> + <id>jdcasey</id> + <email>jdcasey@codehaus.org</email> + <roles> + <role>Developer</role> + </roles> + </developer> + <developer> + <name>Andrew Williams</name> + <id>handyande</id> + <email>andy@handyande.co.uk</email> + <roles> + <role>Developer</role> + </roles> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + <scm> + <connection>scm:svn:http://svn.codehaus.org/plexus/pom/tags/plexus-1.0.9</connection> + <developerConnection>scm:svn:https://svn.codehaus.org/plexus/pom/tags/plexus-1.0.9</developerConnection> + <url>http://fisheye.codehaus.org/browse/plexus/pom/tags/plexus-1.0.9</url> + </scm> + <organization> + <name>Codehaus</name> + <url>http://www.codehaus.org/</url> + </organization> + <build> + <extensions> + <extension> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-webdav</artifactId> + <version>1.0-beta-1</version> + </extension> + </extensions> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.md5 new file mode 100644 index 00000000..3910bf8b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.md5 @@ -0,0 +1 @@ +acf338e422e5c0d9c6242e4f21e63dc9
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1 new file mode 100644 index 00000000..df40a701 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1 @@ -0,0 +1 @@ +89d241b1e5ee6a72d3dd95d9eb90f635deebcdb2
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/repo-marker.txt b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/repo-marker.txt new file mode 100644 index 00000000..14a481e1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/extension/test-extension-repo/repo-marker.txt @@ -0,0 +1 @@ +This is a marker file to allow the repository to be found in the classpath.
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/lifecycle/LifecycleExecutorTest.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/lifecycle/LifecycleExecutorTest.xml new file mode 100644 index 00000000..ebbbf791 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/lifecycle/LifecycleExecutorTest.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plexus> + <components> + <component> + <role>org.apache.maven.project.ProjectBuildingHelper</role> + <implementation>org.apache.maven.project.EmptyProjectBuildingHelper</implementation> + </component> + </components> +</plexus> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/lifecycle/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/lifecycle/pom.xml new file mode 100644 index 00000000..fb2f91c3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/lifecycle/pom.xml @@ -0,0 +1,628 @@ +<?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-parent</artifactId> + <version>11</version> + <relativePath>../pom/maven/pom.xml</relativePath> + </parent> + <groupId>org.apache.maven</groupId> + <artifactId>maven</artifactId> + <version>3.0-SNAPSHOT</version> + <packaging>pom</packaging> + <name>Apache Maven</name> + <description>Maven is a project development management and + comprehension tool. Based on the concept of a project object model: + builds, dependency management, documentation creation, site + publication, and distribution publication are all controlled from + the declarative file. Maven can be extended by plugins to utilise a + number of other development tools for reporting or the build + process. + </description> + <url>http://maven.apache.org/</url> + <inceptionYear>2001</inceptionYear> + <properties> + <classWorldsVersion>1.3</classWorldsVersion> + <commonsCliVersion>1.0</commonsCliVersion> + <!-- + + Do not update this, Doxia will be decoupled completely from 3.x and someone can + create a rendering engine for it if they like when the release stabilizes. JVZ + + --> + <doxiaVersion>1.0-alpha-9</doxiaVersion> + <easyMockVersion>1.2_Java1.3</easyMockVersion> + <junitVersion>3.8.1</junitVersion> + <plexusVersion>1.0-beta-3.0.7-SNAPSHOT</plexusVersion> + <plexusInteractivityVersion>1.0-alpha-6</plexusInteractivityVersion> + <plexusInterpolationVersion>1.1</plexusInterpolationVersion> + <plexusPluginManagerVersion>1.0-alpha-1</plexusPluginManagerVersion> + <plexusUtilsVersion>1.5.8</plexusUtilsVersion> + <plexusJetty6Version>1.6</plexusJetty6Version> + <plexusWebdavVersion>1.0</plexusWebdavVersion> + <wagonVersion>1.0-beta-4</wagonVersion> + <modelBuilderVersion>1.7-SNAPSHOT</modelBuilderVersion> + <mercuryVersion>1.0-alpha-6-SNAPSHOT</mercuryVersion> + <mercuryMp3Version>1.0-alpha-1</mercuryMp3Version> + <securityDispatcherVersion>1.2</securityDispatcherVersion> + <woodstoxVersion>3.2.6</woodstoxVersion> + <modelloVersion>1.0.1-SNAPSHOT</modelloVersion> + <jxpathVersion>1.3</jxpathVersion> + </properties> + <issueManagement> + <system>jira</system> + <url>http://jira.codehaus.org/browse/MNG</url> + </issueManagement> + <mailingLists> + <mailingList> + <name>Maven Developer List</name> + <subscribe>dev-subscribe@maven.apache.org</subscribe> + <unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe> + <post>dev@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/dev@maven.apache.org/</otherArchive> + <otherArchive>http://www.nabble.com/Maven-Developers-f179.html</otherArchive> + <otherArchive>http://maven.dev.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven User List</name> + <subscribe>users-subscribe@maven.apache.org</subscribe> + <unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe> + <post>users@maven.apache.org</post> + <archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive> + <otherArchive>http://maven.users.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Issues List</name> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/issues@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Issues-f15573.html</otherArchive> + <otherArchive>http://maven.issues.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Commits List</name> + <subscribe>commits-subscribe@maven.apache.org</subscribe> + <unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/maven-commits</archive> + <otherArchives> + <otherArchive>http://www.mail-archive.com/commits@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Commits-f15575.html</otherArchive> + <otherArchive>http://maven.commits.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <!-- + duplication from parent pom - temporary until they inherit + properly + --> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/announce@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven-Announcements-f15617.html</otherArchive> + <otherArchive>http://maven.announce.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + <mailingList> + <name>Maven Notifications List</name> + <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> + <otherArchives> + <otherArchive>http://www.mail-archive.com/notifications@maven.apache.org</otherArchive> + <otherArchive>http://www.nabble.com/Maven---Notifications-f15574.html</otherArchive> + <otherArchive>http://maven.notifications.markmail.org/</otherArchive> + </otherArchives> + </mailingList> + </mailingLists> + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/maven/components/trunk</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/components/trunk</developerConnection> + <url>http://svn.apache.org/viewcvs.cgi/maven/components/trunk</url> + </scm> + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <version>${plexusVersion}</version> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + <goal>generate-test-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <tagBase>https://svn.apache.org/repos/asf/maven/components/tags</tagBase> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>${modelloVersion}</version> + <configuration> + <useJava5>true</useJava5> + </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> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>1.0.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.2-beta-2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.4-SNAPSHOT</version> + </plugin> + </plugins> + </pluginManagement> + </build> + <modules> + <module>maven-core</module> + <module>apache-maven</module> + <module>maven-model</module> + <module>maven-plugin-api</module> + <module>maven-project</module> + <module>maven-reporting-api</module> + <module>maven-project-builder</module> + <module>maven-mercury</module> + <module>maven-embedder</module> + <module>maven-toolchain</module> + <module>maven-compat</module> + <module>maven-repository</module> + <module>maven-repository-mercury</module> + </modules> + <!--start--> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junitVersion}</version> + <scope>test</scope> + </dependency> + </dependencies> + <dependencyManagement> + <!--end--> + <dependencies> + <!-- Maven Modules --> + <!--start--> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-mercury</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-lifecycle</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-reporting-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-profile</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-toolchain</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-embedder</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project-builder</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-repository</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> + <version>${project.version}</version> + </dependency> + <!--end--> + <!-- Plexus --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>${plexusUtilsVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>${plexusVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-annotations</artifactId> + <version>${plexusVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <version>${classWorldsVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <version>${plexusInterpolationVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interactivity-api</artifactId> + <version>${plexusInteractivityVersion}</version> + <exclusions> + <exclusion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <!-- Plexus test dependencies --> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-jetty6</artifactId> + <version>${plexusJetty6Version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.sonatype.spice</groupId> + <artifactId>plexus-webdav</artifactId> + <version>${plexusWebdavVersion}</version> + <scope>test</scope> + </dependency> + + <!-- Wagon --> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-provider-api</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-file</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh</artifactId> + <version>${wagonVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh-external</artifactId> + <version>${wagonVersion}</version> + </dependency> + <!-- Doxia --> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-sink-api</artifactId> + <version>${doxiaVersion}</version> + </dependency> + <!-- Maven Shared --> + <dependency> + <groupId>org.sonatype.spice</groupId> + <artifactId>model-builder</artifactId> + <version>${modelBuilderVersion}</version> + </dependency> + <dependency> + <groupId>org.codehaus.woodstox</groupId> + <artifactId>wstx-asl</artifactId> + <version>${woodstoxVersion}</version> + </dependency> + <!-- Commons --> + <dependency> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <version>${commonsCliVersion}</version> + <exclusions> + <exclusion> + <artifactId>commons-lang</artifactId> + <groupId>commons-lang</groupId> + </exclusion> + <exclusion> + <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-jxpath</groupId> + <artifactId>commons-jxpath</artifactId> + <version>${jxpathVersion}</version> + </dependency> + + <!-- Mercury --> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-artifact</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-external</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-plexus</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-virtual</artifactId> + <version>${mercuryVersion}</version> + </dependency> + <dependency> + <groupId>org.sonatype.mercury</groupId> + <artifactId>mercury-mp3-cli</artifactId> + <version>${mercuryMp3Version}</version> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + <version>${securityDispatcherVersion}</version> + </dependency> + + + <!-- Mercury test dependencies --> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-local-m2</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-repo-remote-m2</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-md-sat</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-util</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-transport-http</artifactId> + <version>${mercuryVersion}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.mercury</groupId> + <artifactId>mercury-transport-http</artifactId> + <version>${mercuryVersion}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-plugin-manager</artifactId> + <version>${plexusPluginManagerVersion}</version> + </dependency> + <!--start--> + <dependency> + <groupId>easymock</groupId> + <artifactId>easymock</artifactId> + <version>${easyMockVersion}</version> + <scope>test</scope> + </dependency> + <!--end--> + </dependencies> + <!--start--> + </dependencyManagement> + <!--end--> + <distributionManagement> + <site> + <id>apache.website</id> + <url>scp://people.apache.org/www/maven.apache.org/ref/${project.version}/</url> + </site> + </distributionManagement> + <profiles> + <profile> + <id>osgi</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>manifest</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- Needed for including the manifest, see MJAR-71 --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.1</version> + <configuration> + <archive> + <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> + </archive> + </configuration> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>release</id> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <inherited>false</inherited> + <configuration> + <descriptors> + <descriptor>src/main/assembly/src.xml</descriptor> + </descriptors> + <tarLongFileMode>gnu</tarLongFileMode> + <finalName>maven-${project.version}-src</finalName> + </configuration> + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>strict</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0-alpha-3</version> + <executions> + <execution> + <id>enforce-jdk-15</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireJavaVersion> + <version>1.5</version> + </requireJavaVersion> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/plugin/PluginManagerTest.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/plugin/PluginManagerTest.xml new file mode 100644 index 00000000..ebbbf791 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/plugin/PluginManagerTest.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plexus> + <components> + <component> + <role>org.apache.maven.project.ProjectBuildingHelper</role> + <implementation>org.apache.maven.project.EmptyProjectBuildingHelper</implementation> + </component> + </components> +</plexus> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml new file mode 100644 index 00000000..e052489b --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/AbstractMavenProjectTestCase.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plexus> + <components> + <component> + <role>org.apache.maven.lifecycle.LifeCyclePluginAnalyzer</role> + <implementation>org.apache.maven.lifecycle.EmptyLifecyclePluginAnalyzer</implementation> + </component> + </components> +</plexus> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/PomConstructionTest.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/PomConstructionTest.xml new file mode 100644 index 00000000..e3c3ab34 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/PomConstructionTest.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plexus> + <components> + <component> + <role>org.apache.maven.lifecycle.LifeCyclePluginAnalyzer</role> + <implementation>org.apache.maven.lifecycle.EmptyLifecyclePluginAnalyzer</implementation> + </component> + <component> + <role>org.apache.maven.project.ProjectBuildingHelper</role> + <implementation>org.apache.maven.project.EmptyProjectBuildingHelper</implementation> + </component> + </components> +</plexus> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromFile/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromFile/pom.xml new file mode 100644 index 00000000..c8a8b85f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromFile/pom.xml @@ -0,0 +1,8 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.tests</groupId> + <artifactId>build-from-file</artifactId> + <version>1</version> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromRepo/tests/project-caching/1/project-caching-1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromRepo/tests/project-caching/1/project-caching-1.pom new file mode 100644 index 00000000..d4211765 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromRepo/tests/project-caching/1/project-caching-1.pom @@ -0,0 +1,8 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>tests</groupId> + <artifactId>project-caching</artifactId> + <version>1</version> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromRepo/tests/project-caching/maven-metadata-local.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromRepo/tests/project-caching/maven-metadata-local.xml new file mode 100644 index 00000000..a608b4f8 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildFromRepo/tests/project-caching/maven-metadata-local.xml @@ -0,0 +1,11 @@ +<metadata> + <groupId>tests</groupId> + <artifactId>project-caching</artifactId> + <versioning> + <release>1</release> + <latest>1</latest> + <versions> + <version>1</version> + </versions> + </versioning> +</metadata>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildModelLineage/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildModelLineage/pom.xml new file mode 100644 index 00000000..8f5154fc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/buildModelLineage/pom.xml @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>tests</groupId> + <artifactId>build-model-lineage</artifactId> + <version>1</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/childAndParent/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/childAndParent/child/pom.xml new file mode 100644 index 00000000..4d1d23ee --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/childAndParent/child/pom.xml @@ -0,0 +1,10 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>tests</groupId> + <artifactId>childAndParent-parent</artifactId> + <version>1</version> + </parent> + + <artifactId>childAndParent-child</artifactId> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/childAndParent/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/childAndParent/pom.xml new file mode 100644 index 00000000..164506fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/childAndParent/pom.xml @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>tests</groupId> + <artifactId>childAndParent-parent</artifactId> + <version>1</version> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/pom.xml new file mode 100644 index 00000000..9633029a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/project/workspace/resolveParentPom/pom.xml @@ -0,0 +1,10 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>tests</groupId> + <artifactId>resolve-parent-pom-parent</artifactId> + <version>1</version> + </parent> + + <artifactId>resolve-parent-pom</artifactId> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/settings/PomConstructionWithSettingsTest.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/settings/PomConstructionWithSettingsTest.xml new file mode 100644 index 00000000..c6769290 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/settings/PomConstructionWithSettingsTest.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plexus> + <components> + <component> + <role>org.apache.maven.lifecycle.LifecycleExecutor</role> + <implementation>org.apache.maven.project.EmptyLifecycleExecutor</implementation> + </component> + </components> +</plexus> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/global.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/global.xml new file mode 100644 index 00000000..cd9be74c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/global.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF8"?> + +<!-- +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. +--> + +<toolchains> + <toolchain> + <type>basic</type> + <configuration> + <global>true</global> + </configuration> + </toolchain> + <toolchain> + <type>rare</type> + <configuration> + <global>true</global> + </configuration> + </toolchain> +</toolchains>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks-extend.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks-extend.xml new file mode 100644 index 00000000..4fb00930 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks-extend.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF8"?> + +<!-- +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. +--> + +<toolchains> + <toolchain> + <type>jdk</type> + <provides> + <version>1.5</version> + <vendor>sun</vendor> + </provides> + <configuration> + <jdkHome>${env.JAVA_HOME}</jdkHome> + <toolsJar>lib/tools.jar</toolsJar> + </configuration> + </toolchain> + <toolchain> + <type>jdk</type> + <provides> + <version>1.6</version> + <vendor>sun</vendor> + </provides> + <configuration> + <jdkHome>${env.JAVA_HOME}</jdkHome> + <toolsJar>lib/classes.jar</toolsJar> + </configuration> + </toolchain> +</toolchains>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks-extra.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks-extra.xml new file mode 100644 index 00000000..35c32172 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks-extra.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF8"?> + +<!-- +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. +--> + +<toolchains> + <toolchain> + <type>jdk</type> + <provides> + <version>1.4</version> + <vendor>sun</vendor> + <!-- no id, so it's considered 'default' --> + </provides> + <configuration> + <jdkHome>${env.JAVA_HOME}</jdkHome> + </configuration> + </toolchain> + <toolchain> + <type>jdk</type> + <provides> + <version>1.7</version> + <vendor>ibm</vendor> + <id>ibm_17</id> + </provides> + <configuration> + <jdkHome>${env.JAVA_HOME}</jdkHome> + </configuration> + </toolchain> +</toolchains>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks.xml new file mode 100644 index 00000000..5233a338 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/model/toolchains-jdks.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF8"?> + +<!-- +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. +--> + +<toolchains> + <toolchain> + <type>jdk</type> + <provides> + <version>1.5</version> + <vendor>sun</vendor> + </provides> + <configuration> + <jdkHome>${env.JAVA_HOME}</jdkHome> + </configuration> + </toolchain> + <toolchain> + <type>jdk</type> + <provides> + <version>1.6</version> + <vendor>sun</vendor> + </provides> + <configuration> + <jdkHome>${env.JAVA_HOME}</jdkHome> + </configuration> + </toolchain> +</toolchains>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/user.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/user.xml new file mode 100644 index 00000000..d11181fc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/apache/maven/toolchain/user.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF8"?> + +<!-- +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. +--> + +<toolchains> + <toolchain> + <type>basic</type> + <configuration> + <user>true</user> + </configuration> + </toolchain> + <toolchain> + <type>rare</type> + <configuration> + <user>true</user> + </configuration> + </toolchain> +</toolchains>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar Binary files differnew file mode 100644 index 00000000..5c50e177 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1 new file mode 100644 index 00000000..28f6dbb5 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar.sha1 @@ -0,0 +1 @@ +fa632b7f1cb7c50963d0fb7d818ca93c75c10127
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom new file mode 100644 index 00000000..6cf90799 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?><project> + <parent> + <artifactId>plexus</artifactId> + <groupId>org.codehaus.plexus</groupId> + <version>1.0.4</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>plexus-utils</artifactId> + <name>Plexus Common Utilities</name> + <version>1.1</version> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/codehaus/plexus/util/FileBasedTestCase.java</exclude> + <exclude>**/Test*.java</exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + <distributionManagement> + <status>deployed</status> + </distributionManagement> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1 new file mode 100644 index 00000000..4dc64d4a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1 @@ -0,0 +1 @@ +15492ecd00920daca9ec15f6acd695b626621e5b
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/pom.xml new file mode 100644 index 00000000..cf4c29c0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/pom.xml @@ -0,0 +1,52 @@ +<!-- +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> + + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>2.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>Maven</name> + <inceptionYear>2001</inceptionYear> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + <version>2.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin</artifactId> + <version>2.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> + + <scm> + <connection>scm-connection</connection> + </scm> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/plugin-level-dep.pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/plugin-level-dep.pom.xml new file mode 100644 index 00000000..98873675 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/plugin-level-dep.pom.xml @@ -0,0 +1,24 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>testing</groupId> + <artifactId>plugin-level-dep</artifactId> + <packaging>jar</packaging> + <version>3.8.1</version> + + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${pom.version}</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom-interp.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom-interp.xml new file mode 100644 index 00000000..40fdb414 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom-interp.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <modelVersion>4.0.0</modelVersion> + + <groupId>org.test</groupId> + <artifactId>test-build-dynamism</artifactId> + <version>1</version> + + <build> + <sourceDirectory>/${project.groupId}/src/main/java</sourceDirectory> + <testSourceDirectory>/${pom.groupId}/src/test/java</testSourceDirectory> + <scriptSourceDirectory>/${groupId}/src/main/scripts</scriptSourceDirectory> + + <plugins> + <plugin> + <artifactId>my-plugin</artifactId> + <configuration> + <testOne>${project.groupId}</testOne> + <testTwo>${pom.groupId}</testTwo> + <testThree>${groupId}</testThree> + </configuration> + </plugin> + </plugins> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom-relative.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom-relative.xml new file mode 100644 index 00000000..bb22b3d0 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom-relative.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <modelVersion>4.0.0</modelVersion> + + <groupId>org.test</groupId> + <artifactId>test-build-dynamism</artifactId> + <version>1</version> + + <properties> + <myProperty>${pom.build.directory}</myProperty> + </properties> + + <build> + <resources> + <resource> + <directory>${pom.build.directory}/generated-resources/plexus</directory> + </resource> + </resources> + + <filters> + <filter>${pom.build.directory}/generated-filters.properties</filter> + </filters> + + <directory>target</directory> + + <sourceDirectory>src/main/java</sourceDirectory> + <testSourceDirectory>src/test/java</testSourceDirectory> + <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> + + <outputDirectory>${pom.build.directory}/classes</outputDirectory> + <testOutputDirectory>${pom.build.directory}/test-classes</testOutputDirectory> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom.xml new file mode 100644 index 00000000..37797f2e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/project-dynamism/pom.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <modelVersion>4.0.0</modelVersion> + + <groupId>org.test</groupId> + <artifactId>test-build-dynamism</artifactId> + <version>1</version> + + <properties> + <myProperty>${pom.build.directory}</myProperty> + </properties> + + <build> + <resources> + <resource> + <directory>${pom.build.directory}/generated-resources/plexus</directory> + </resource> + </resources> + + <filters> + <filter>${pom.build.directory}/generated-filters.properties</filter> + </filters> + + <directory>target</directory> + + <sourceDirectory>${pom.basedir}/src/main/java</sourceDirectory> + <testSourceDirectory>${pom.basedir}/src/test/java</testSourceDirectory> + <scriptSourceDirectory>${pom.basedir}/src/main/scripts</scriptSourceDirectory> + + <outputDirectory>${pom.build.directory}/classes</outputDirectory> + <testOutputDirectory>${pom.build.directory}/test-classes</testOutputDirectory> + </build> + +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/bad-dependency.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/bad-dependency.xml new file mode 100644 index 00000000..4b5424ae --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/bad-dependency.xml @@ -0,0 +1,27 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>test</groupId> + <artifactId>invalid</artifactId> + <version>0.0.1-SNAPSHOT</version> + + <repositories> + <repository> + <id>central</id> + <url>file:src/test/remote-repo</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <!-- groupId deliberately missing --> + <artifactId>b</artifactId> + <version>0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + </dependency> + </dependencies> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/bad-project.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/bad-project.xml new file mode 100644 index 00000000..e415318c --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/bad-project.xml @@ -0,0 +1,20 @@ +i want to be a <!-- +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. +--> + +POM!
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment-child.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment-child.xml new file mode 100644 index 00000000..ee2207ee --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment-child.xml @@ -0,0 +1,33 @@ +<!-- +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> + + <extend>project-which-needs-directory-alignment.xml</extend> + + <parent> + <groupId>maven</groupId> + <artifactId>project-which-needs-directory-alignment.xml</artifactId> + <version>1.0-beta-9</version> + </parent> + + <groupId>maven</groupId> + <artifactId>maven-foo</artifactId> + <version>1.0</version> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment.xml new file mode 100644 index 00000000..cefbcb04 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment.xml @@ -0,0 +1,135 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + <groupId>maven</groupId> + <artifactId>project-which-needs-directory-alignment</artifactId> + <name>Maven</name> + <version>1.0-beta-9</version> + <inceptionYear>2001</inceptionYear> + <description>Description</description> + <url>http://maven.apache.org/</url> + + <organization> + <name>Apache Software Foundation</name> + <url>http://apache.org/</url> + </organization> + + <scm> + <connection>anon-connection</connection> + <developerConnection>developer-connection</developerConnection> + <url>repository-url</url> + </scm> + + <mailingLists> + <mailingList> + <name>Maven User List</name> + <subscribe>subscribe</subscribe> + <unsubscribe>unsubscribe</unsubscribe> + <archive>archive</archive> + </mailingList> + </mailingLists> + + <developers> + <developer> + <name>Jason van Zyl</name> + <id>jvanzyl</id> + <email>jason@maven.org</email> + <organization>Zenplex</organization> + <roles> + <role>Founder</role> + <role>Release Manager</role> + </roles> + </developer> + </developers> + + <contributors> + <contributor> + <name>Martin van dem Bemt</name> + <email>mvdb@mvdb.com</email> + </contributor> + </contributors> + + <dependencies> + + <dependency> + <groupId>g1</groupId> + <artifactId>d1</artifactId> + <version>1.0</version> + </dependency> + + <dependency> + <groupId>g2</groupId> + <artifactId>d2</artifactId> + <version>2.0</version> + </dependency> + + <dependency> + <groupId>g3</groupId> + <artifactId>d3</artifactId> + </dependency> + + </dependencies> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>g3</groupId> + <artifactId>d3</artifactId> + <version>3.0</version> + </dependency> + </dependencies> + </dependencyManagement> + + <build> + <sourceDirectory>sourceDirectory</sourceDirectory> + <testSourceDirectory>unitTestSourceDirectory</testSourceDirectory> + <resources> + <resource> + <directory>src/test</directory> + <includes> + <include>**/*.xml</include> + </includes> + </resource> + </resources> + <testResources> + <testResource> + <directory>src/conf</directory> + <includes> + <include>*.xsd</include> + <include>*.dtd</include> + <include>*.mod</include> + <include>log4j.properties</include> + <include>driver.jelly</include> + <include>driver.properties</include> + </includes> + </testResource> + <testResource> + <directory>src/messages</directory> + <targetPath>org/apache/maven/messages</targetPath> + <includes> + <include>messages*.properties</include> + </includes> + </testResource> + </testResources> + </build> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/subproject/project-which-needs-directory-alignment-child.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/subproject/project-which-needs-directory-alignment-child.xml new file mode 100644 index 00000000..68775efc --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/base-directory-alignment/subproject/project-which-needs-directory-alignment-child.xml @@ -0,0 +1,29 @@ +<!-- +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> + + <extend>../project-which-needs-directory-alignment.xml</extend> + + <parent> + <groupId>maven</groupId> + <artifactId>project-which-needs-directory-alignment</artifactId> + <version>1.0-beta-9</version> + </parent> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/build-path-expression-pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/build-path-expression-pom.xml new file mode 100644 index 00000000..d7e296f4 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/build-path-expression-pom.xml @@ -0,0 +1,14 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.project.tests</groupId> + <artifactId>build-path-expression</artifactId> + <version>1</version> + <build> + <sourceDirectory>sources</sourceDirectory> + <resources> + <resource> + <directory>${project.build.sourceDirectory}</directory> + </resource> + </resources> + </build> +</project>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/build.properties b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/build.properties new file mode 100644 index 00000000..01626c39 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/build.properties @@ -0,0 +1,18 @@ +# 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. + +name = sarel diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child-which-inherits-from-super-model.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child-which-inherits-from-super-model.xml new file mode 100644 index 00000000..58cae23e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child-which-inherits-from-super-model.xml @@ -0,0 +1,28 @@ +<!-- +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. +--> + +<model> + <groupId>foo</groupId> + <artifactId>bar</artifactId> + <name>Babar</name> + <version>4.5</version> + + <!-- Build element should be inherited from the super model --> + +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child-with-bogus-parent.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child-with-bogus-parent.xml new file mode 100644 index 00000000..a072fc74 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child-with-bogus-parent.xml @@ -0,0 +1,29 @@ +<!-- +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. +--> + +<model> + + <extend>${basedir}/bogus.xml</extend> + + <parent> + <groupId>maven</groupId> + <artifactId>bogus</artifactId> + <version>1.0-beta-9</version> + </parent> +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child.xml new file mode 100644 index 00000000..a6d702ce --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/child.xml @@ -0,0 +1,33 @@ +<!-- +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. +--> + +<model> + + <extend>project.xml</extend> + + <parent> + <groupId>maven</groupId> + <artifactId>maven-project-test</artifactId> + <version>1.0-beta-9</version> + </parent> + + <artifactId>child-artifact</artifactId> + <groupId>maven</groupId> + <version>1.0-beta-9</version> +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/duplicate-plugins-merged-pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/duplicate-plugins-merged-pom.xml new file mode 100644 index 00000000..7383109f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/duplicate-plugins-merged-pom.xml @@ -0,0 +1,48 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>tests.project</groupId> + <artifactId>duplicate-plugin-defs-merged</artifactId> + <version>1</version> + + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <dependencies> + <dependency> + <groupId>group</groupId> + <artifactId>first</artifactId> + <version>1</version> + </dependency> + </dependencies> + <executions> + <execution> + <id>first</id> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <dependencies> + <dependency> + <groupId>group</groupId> + <artifactId>second</artifactId> + <version>1</version> + </dependency> + </dependencies> + <executions> + <execution> + <id>second</id> + <goals> + <goal>compile</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/fully-populated-child.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/fully-populated-child.xml new file mode 100644 index 00000000..61d6b672 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/fully-populated-child.xml @@ -0,0 +1,168 @@ +<?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. +--> + +<model> + <extend>project.xml</extend> + <parent> + <groupId>maven</groupId> + <artifactId>maven-project-test</artifactId> + <version>1.0-beta-9</version> + </parent> + <modelVersion>3</modelVersion> + <groupId>maven</groupId> + <artifactId>maven</artifactId> + <name>Maven</name> + <version>1.0-beta-9</version> + <inceptionYear>2001</inceptionYear> + <package>org.apache.maven</package> + <description>Description</description> + <shortDescription>shortDescription</shortDescription> + <url>http://maven.apache.org/</url> + <issueTrackingUrl>issueTrackingUrl</issueTrackingUrl> + <distributionManagement> + <repository> + <id>childDistributionRepositoryId</id> + <name>childDistributionRepositoryName</name> + <url>childDistributionRepository</url> + </repository> + <site> + <id>childSiteDistributionId</id> + <name>childSiteDistributionName</name> + <url>childSiteDistributionUrl</url> + </site> + </distributionManagement> + + <organization> + <name>Apache Software Foundation</name> + <url>http://apache.org/</url> + <logo>/images/jakarta-logo-blue.gif</logo> + </organization> + + <scm> + <connection>anon-connection</connection> + <developerConnection>developer-connection</developerConnection> + <url>repository-url</url> + </scm> + + <mailingLists> + <mailingList> + <name>Maven User List</name> + <subscribe>subscribe</subscribe> + <unsubscribe>unsubscribe</unsubscribe> + <archive>archive</archive> + </mailingList> + </mailingLists> + + <developers> + <developer> + <name>Jason van Zyl</name> + <id>jvanzyl</id> + <email>jason@maven.org</email> + <organization>Zenplex</organization> + <roles> + <role>Founder</role> + <role>Release Manager</role> + </roles> + </developer> + </developers> + + <contributors> + <contributor> + <name>Martin van dem Bemt</name> + <email>mvdb@mvdb.com</email> + </contributor> + </contributors> + + <dependencies> + + <dependency> + <groupId>g1</groupId> + <artifactId>d1</artifactId> + <version>1.0</version> + <url>d1-url</url> + </dependency> + + <dependency> + <groupId>g2</groupId> + <artifactId>d2</artifactId> + <version>2.0</version> + <url>d2-url</url> + </dependency> + + </dependencies> + + <build> + <nagEmailAddress>jason@maven.org</nagEmailAddress> + <sourceDirectory>/sourceDirectory</sourceDirectory> + <unitTestSourceDirectory>/unitTestSourceDirectory</unitTestSourceDirectory> + <unitTest> + <includes> + <include>**/*Test.java</include> + </includes> + <excludes> + <exclude>**/RepositoryTest.java</exclude> + <exclude>**/JAXPTest.java</exclude> + </excludes> + <resources> + <resource> + <directory>${basedir}/src/test</directory> + <includes> + <include>**/*.xml</include> + </includes> + </resource> + </resources> + </unitTest> + <resources> + <resource> + <directory>/src/conf</directory> + <includes> + <include>*.xsd</include> + <include>*.dtd</include> + <include>*.mod</include> + <include>log4j.properties</include> + <include>driver.jelly</include> + <include>driver.properties</include> + </includes> + </resource> + <resource> + <directory>/src/messages</directory> + <targetPath>org/apache/maven/messages</targetPath> + <includes> + <include>messages*.properties</include> + </includes> + </resource> + </resources> + </build> + + <reports> + <report>maven-jdepend-plugin</report> + <report>maven-checkstyle-plugin</report> + <report>maven-changelog-plugin</report> + <report>maven-file-activity-plugin</report> + <report>maven-developer-activity-plugin</report> + <report>maven-javadoc-plugin</report> + <report>maven-jxr-plugin</report> + <report>maven-junit-report-plugin</report> + <report>maven-tasklist-plugin</report> + <report>maven-jellydoc-plugin</report> + </reports> + +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml new file mode 100644 index 00000000..56bed2c9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/child/grandchild/pom.xml @@ -0,0 +1,10 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>grandchildtest</groupId> + <artifactId>child</artifactId> + <version>1</version> + </parent> + <artifactId>grandchild</artifactId> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/child/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/child/pom.xml new file mode 100644 index 00000000..0858c6d1 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/child/pom.xml @@ -0,0 +1,13 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>grandchildtest</groupId> + <artifactId>root-pom</artifactId> + <version>1</version> + </parent> + <artifactId>child</artifactId> + <packaging>pom</packaging> + <modules> + <module>grandchild</module> + </modules> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/pom.xml new file mode 100644 index 00000000..3b1ebd0e --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/grandchild-check/pom.xml @@ -0,0 +1,7 @@ +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>grandchildtest</groupId> + <artifactId>root-pom</artifactId> + <version>1</version> + <packaging>pom</packaging> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/import-scope-pom-resolves-from-property-based-repository.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/import-scope-pom-resolves-from-property-based-repository.xml new file mode 100644 index 00000000..4c29a3b9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/import-scope-pom-resolves-from-property-based-repository.xml @@ -0,0 +1,31 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>test</groupId> + <artifactId>imported-pom-found</artifactId> + <version>0.0.1-SNAPSHOT</version> + + <properties> + <repo.url>file:src/test/remote-repo</repo.url> + </properties> + + <repositories> + <repository> + <id>central</id> + <url>${repo.url}</url> + </repository> + </repositories> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>a</artifactId> + <version>0.1</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/modelsource/module01/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/modelsource/module01/pom.xml new file mode 100644 index 00000000..cfaf9e8f --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/modelsource/module01/pom.xml @@ -0,0 +1,12 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>test.readparent</groupId> + <artifactId>local-parent</artifactId> + <version>1.0</version> + </parent> + + <artifactId>module01</artifactId> +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/modelsource/pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/modelsource/pom.xml new file mode 100644 index 00000000..0fe29370 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/modelsource/pom.xml @@ -0,0 +1,13 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>test.readparent</groupId> + <artifactId>local-parent</artifactId> + <packaging>pom</packaging> + <version>1.0</version> + + <modules> + <module>module</module> + </modules> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/project.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/project.xml new file mode 100644 index 00000000..a9119714 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/project.xml @@ -0,0 +1,162 @@ +<?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. +--> + +<model> + <modelVersion>3</modelVersion> + <groupId>maven</groupId> + <artifactId>maven-project-test</artifactId> + <name>Maven</name> + <version>1.0-beta-9</version> + <inceptionYear>2001</inceptionYear> + <package>org.apache.maven</package> + <description>Description</description> + <shortDescription>shortDescription</shortDescription> + <url>http://maven.apache.org/</url> + <issueTrackingUrl>issueTrackingUrl</issueTrackingUrl> + <distributionManagement> + <repository> + <id>distributionRepositoryId</id> + <name>distributionRepositoryName</name> + <url>distributionRepository</url> + </repository> + <site> + <id>siteDistributionId</id> + <name>siteDistributionName</name> + <url>siteDistributionUrl</url> + </site> + </distributionManagement> + + <organization> + <name>Apache Software Foundation</name> + <url>http://apache.org/</url> + <logo>/images/jakarta-logo-blue.gif</logo> + </organization> + + <scm> + <connection>anon-connection</connection> + <developerConnection>developer-connection</developerConnection> + <url>repository-url</url> + </scm> + + <mailingLists> + <mailingList> + <name>Maven User List</name> + <subscribe>subscribe</subscribe> + <unsubscribe>unsubscribe</unsubscribe> + <archive>archive</archive> + </mailingList> + </mailingLists> + + <developers> + <developer> + <name>Jason van Zyl</name> + <id>jvanzyl</id> + <email>jason@maven.org</email> + <organization>Zenplex</organization> + <roles> + <role>Founder</role> + <role>Release Manager</role> + </roles> + </developer> + </developers> + + <contributors> + <contributor> + <name>Martin van dem Bemt</name> + <email>mvdb@mvdb.com</email> + </contributor> + </contributors> + + <dependencies> + + <dependency> + <groupId>g1</groupId> + <artifactId>d1</artifactId> + <version>1.0</version> + <url>d1-url</url> + </dependency> + + <dependency> + <groupId>g2</groupId> + <artifactId>d2</artifactId> + <version>2.0</version> + <url>d2-url</url> + </dependency> + + </dependencies> + + <build> + <nagEmailAddress>jason@maven.org</nagEmailAddress> + <sourceDirectory>/sourceDirectory</sourceDirectory> + <unitTestSourceDirectory>/unitTestSourceDirectory</unitTestSourceDirectory> + <unitTest> + <includes> + <include>**/*Test.java</include> + </includes> + <excludes> + <exclude>**/RepositoryTest.java</exclude> + <exclude>**/JAXPTest.java</exclude> + </excludes> + <resources> + <resource> + <directory>${basedir}/src/test</directory> + <includes> + <include>**/*.xml</include> + </includes> + </resource> + </resources> + </unitTest> + <resources> + <resource> + <directory>/src/conf</directory> + <includes> + <include>*.xsd</include> + <include>*.dtd</include> + <include>*.mod</include> + <include>log4j.properties</include> + <include>driver.jelly</include> + <include>driver.properties</include> + </includes> + </resource> + <resource> + <directory>/src/messages</directory> + <targetPath>org/apache/maven/messages</targetPath> + <includes> + <include>messages*.properties</include> + </includes> + </resource> + </resources> + </build> + + <reports> + <report>maven-jdepend-plugin</report> + <report>maven-checkstyle-plugin</report> + <report>maven-changelog-plugin</report> + <report>maven-file-activity-plugin</report> + <report>maven-developer-activity-plugin</report> + <report>maven-javadoc-plugin</report> + <report>maven-jxr-plugin</report> + <report>maven-junit-report-plugin</report> + <report>maven-tasklist-plugin</report> + <report>maven-jellydoc-plugin</report> + </reports> + +</model> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/versionless-managed-dependency.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/versionless-managed-dependency.xml new file mode 100644 index 00000000..40bf2955 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/projects/versionless-managed-dependency.xml @@ -0,0 +1,24 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>test</groupId> + <artifactId>versionless-managed-dependency.xml</artifactId> + <version>0.0.1-SNAPSHOT</version> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>a</artifactId> + </dependency> + </dependencies> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.its</groupId> + <artifactId>a</artifactId> + </dependency> + </dependencies> + </dependencyManagement> + +</project> diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/jars/maven-test-b-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/jars/maven-test-b-1.0.jar Binary files differnew file mode 100644 index 00000000..9ff33b6d --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/jars/maven-test-b-1.0.jar diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/jars/maven-test-b-1.0.jar.md5 b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/jars/maven-test-b-1.0.jar.md5 new file mode 100644 index 00000000..a8406fd7 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/jars/maven-test-b-1.0.jar.md5 @@ -0,0 +1 @@ +a5c3b5cd0605bb7331d1846cdc14b13b diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/poms/maven-test-b-1.0.pom b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/poms/maven-test-b-1.0.pom new file mode 100644 index 00000000..ed5c2693 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/maven-test/poms/maven-test-b-1.0.pom @@ -0,0 +1,21 @@ +<model> + <groupId>maven-test</groupId> + <artifactId>maven-test-a</artifactId> + <packaging>jar</packaging> + <dependencies> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-b</artifactId> + <version>1.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>maven-test</groupId> + <artifactId>maven-test-z</artifactId> + <version>1.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + </dependencies> +</model>
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..b3da0186 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +remote
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar.snapshot-version b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar.snapshot-version new file mode 100644 index 00000000..c1c3c3e3 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-a-1.0-SNAPSHOT.jar.snapshot-version @@ -0,0 +1 @@ +20050101.101010
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..c2c027fe --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +local
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar.snapshot-version b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar.snapshot-version new file mode 100644 index 00000000..b2954fe9 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-b-1.0-SNAPSHOT.jar.snapshot-version @@ -0,0 +1 @@ +20030101.101010
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-c-1.0-SNAPSHOT.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-c-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..b3da0186 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-c-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +remote
\ No newline at end of file diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-c-1.0-SNAPSHOT.jar.snapshot-version b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-c-1.0-SNAPSHOT.jar.snapshot-version new file mode 100644 index 00000000..7c5f8a57 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-1/snapshot-test/jars/maven-snapshot-c-1.0-SNAPSHOT.jar.snapshot-version @@ -0,0 +1 @@ +20040101.101010 diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-2/maven-test/jars/maven-test-z-1.0.jar b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-2/maven-test/jars/maven-test-z-1.0.jar new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/remote-repo-2/maven-test/jars/maven-test-z-1.0.jar @@ -0,0 +1 @@ +foo diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/withActiveByDefaultProfile-pom.xml b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/withActiveByDefaultProfile-pom.xml new file mode 100644 index 00000000..95ee353a --- /dev/null +++ b/framework/src/maven/apache-maven-3.3.3/maven-core/src/test/resources/withActiveByDefaultProfile-pom.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- + 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> + + <groupId>maven</groupId> + <artifactId>maven-core</artifactId> + <version>2.0-SNAPSHOT</version> + + <name>Maven</name> + + <profiles> + <profile> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <id>test</id> + </profile> + </profiles> +</project> |