This commit is contained in:
Jason van Zyl 2009-04-27 00:16:42 +00:00
parent a14dd02e93
commit aafe040406
43 changed files with 171 additions and 3496 deletions

View File

@ -74,19 +74,6 @@
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
</dependency>
<!--Mercury MP3-->
<dependency>
<groupId>org.sonatype.mercury</groupId>
<artifactId>mercury-mp3-cli</artifactId>
</dependency>
<dependency>
<!--
FIXME: org.sonatype.mercury:mercury-mp3:1.0-alpha-1:pom depends on a snapshot version of mercury-event.
-->
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-event</artifactId>
<version>${mercuryVersion}</version>
</dependency>
</dependencies>
<build>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<nodeConfig>
<containers>
<container>
<id>apache-maven</id>
<version>3.0-SNAPSHOT</version>
<type>maven</type>
<distribution>
<name>org.apache.maven:maven-distribution:3.0-SNAPSHOT:bin:zip</name>
</distribution>
<dependencies>
<dependency>
<name>org.apache.maven:maven-core:3.0-SNAPSHOT</name>
</dependency>
</dependencies>
</container>
</containers>
</nodeConfig>

View File

@ -1,191 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<lockDownList>
<dependencies>
<dependency>
<name>org.apache.maven:maven-core:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-lifecycle:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-reporting-api:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.doxia:doxia-sink-api:1.0-alpha-9::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-model:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-compat:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.wagon:wagon-provider-api:1.0-beta-4::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-plugin-api:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-container-default:1.0-beta-3.0.5::jar</name>
</dependency>
<dependency>
<name>org.apache.xbean:xbean-reflect:3.4::jar</name>
</dependency>
<dependency>
<name>asm:asm:2.2.3::jar</name>
</dependency>
<dependency>
<name>asm:asm-commons:2.2.3::jar</name>
</dependency>
<dependency>
<name>asm:asm-tree:2.2.3::jar</name>
</dependency>
<dependency>
<name>log4j:log4j:1.2.12::jar</name>
</dependency>
<dependency>
<name>commons-logging:commons-logging-api:1.1::jar</name>
</dependency>
<dependency>
<name>com.google.code.google-collections:google-collect:snapshot-20080530::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-project:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-project-builder:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>commons-cli:commons-cli:1.0::jar</name>
</dependency>
<dependency>
<name>commons-logging:commons-logging:1.0::jar</name>
</dependency>
<dependency>
<name>commons-lang:commons-lang:1.0::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-interpolation:1.1::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-utils:1.5.6::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-classworlds:1.3::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-component-annotations:1.0-beta-3.0.5::jar</name>
</dependency>
<dependency>
<name>junit:junit:3.8.2::jar</name>
</dependency>
<dependency>
<name>org.sonatype.plexus:plexus-plugin-manager:1.0-alpha-1::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-plexus:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-repo-remote-m2:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-repo-api:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-transport-http:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.mortbay.jetty:jetty-client:6.1.12::jar</name>
</dependency>
<dependency>
<name>org.mortbay.jetty:jetty-sslengine:6.1.12::jar</name>
</dependency>
<dependency>
<name>org.mortbay.jetty:jetty:6.1.12::jar</name>
</dependency>
<dependency>
<name>org.mortbay.jetty:jetty-util:6.1.12::jar</name>
</dependency>
<dependency>
<name>org.mortbay.jetty:servlet-api-2.5:6.1.12::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-transport-api:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-repo-local-m2:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-repo-virtual:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-repo-cache-fs:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-md-sat:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.sat4j:org.sat4j.core:2.0.4::jar</name>
</dependency>
<dependency>
<name>org.sat4j:org.sat4j.pb:2.0.4::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-md-shared:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-util:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-crypto-basic:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>bouncycastle:bcprov-jdk15:140::jar</name>
</dependency>
<dependency>
<name>bouncycastle:bcpg-jdk15:140::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-crypto-api:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-event:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-logging:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.slf4j:slf4j-jdk14:1.5.3::jar</name>
</dependency>
<dependency>
<name>org.slf4j:slf4j-api:1.5.3::jar</name>
</dependency>
<dependency>
<name>org.apache.maven:maven-mercury:3.0-SNAPSHOT::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-artifact:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.apache.maven.mercury:mercury-external:1.0.0-alpha-2::jar</name>
</dependency>
<dependency>
<name>org.codehaus.plexus:plexus-lang:1.1::jar</name>
</dependency>
<dependency>
<name>org.sonatype.spice:model-builder:1.3::jar</name>
</dependency>
<dependency>
<name>org.codehaus.woodstox:wstx-asl:3.2.6::jar</name>
</dependency>
<dependency>
<name>stax:stax-api:1.0.1::jar</name>
</dependency>
</dependencies>
</lockDownList>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<nodeConfig>
<containers>
<container>
<id>apache-maven</id>
<version>3.0-SNAPSHOT</version>
<type>maven</type>
<distribution>
<name>org.apache.maven:maven-distribution:3.0-SNAPSHOT:bin:zip</name>
</distribution>
<dependencies>
<dependency>
<name>org.apache.maven:maven-core:3.0-SNAPSHOT</name>
</dependency>
</dependencies>
</container>
</containers>
</nodeConfig>

View File

@ -60,12 +60,6 @@ under the License.
<exclude>org.apache.maven.mercury:mercury-crypto-basic</exclude>
</excludes>
</dependencySet>
<dependencySet>
<outputDirectory>bin/.cd/bin</outputDirectory>
<includes>
<include>org.sonatype.mercury:mercury-mp3-cli</include>
</includes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>

View File

@ -167,7 +167,7 @@ END SNIPPET: ant-bootstrap -->
<modello file="maven-plugin-api/src/main/mdo/lifecycle.mdo"/>
<modello file="maven-model-builder/src/main/mdo/profiles.mdo"/>
<modello file="maven-core/src/main/mdo/settings.mdo"/>
<modello file="maven-toolchain/src/main/mdo/toolchains.xml"/>
<modello file="maven-toolchain/src/main/mdo/toolchains.mdo"/>
<modello file="maven-compat/src/main/mdo/metadata.mdo"/>
</target>

View File

@ -18,11 +18,8 @@
<artifactId>maven</artifactId>
<version>3.0-SNAPSHOT</version>
</parent>
<artifactId>maven-core</artifactId>
<name>Maven Core</name>
<dependencies>
<!-- Maven -->
<dependency>
@ -73,22 +70,6 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-plugin-manager</artifactId>
</dependency>
<dependency>
<!--
NOTE: This is originally a transitive dependency of plexus-plugin-manager. However, unless we specify this
artifact as a direct dependency of ourselves, Maven's project sorter will not detect the (indirect) dependency
of maven-core on maven-mercury. Proper detection of this dependency is crucial to ensure that maven-mercury is
built before maven-core. Otherwise, Maven would query the repos instead of the reactor cache for maven-mercury
when building maven-core, happily using out-dated snapshots and potentially failing the build.
-->
<groupId>org.apache.maven</groupId>
<artifactId>maven-mercury</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-sec-dispatcher</artifactId>
@ -96,6 +77,7 @@
<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -9,15 +9,8 @@ import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Extension;
import org.apache.maven.model.Model;
import org.apache.maven.model.ProjectUri;
import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Configuration;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.component.repository.ComponentDescriptor;
import org.sonatype.plexus.plugin.manager.PlexusPluginManager;
import org.sonatype.plexus.plugin.manager.PluginMetadata;
import org.sonatype.plexus.plugin.manager.PluginResolutionRequest;
import org.sonatype.plexus.plugin.manager.PluginResolutionResult;
/**
* This listener has two parts: the collection of the extension elements which happens during POM construction,
@ -36,8 +29,8 @@ public class BuildExtensionListener
@Configuration(value = "true")
private boolean inBuild = true;
@Requirement
PlexusPluginManager pluginManager;
//@Requirement
//PlexusPluginManager pluginManager;
private List<Extension> buildExtensions = new ArrayList<Extension>();
@ -69,6 +62,7 @@ public class BuildExtensionListener
for ( Extension be : buildExtensions )
{
/*
PluginResolutionRequest request = new PluginResolutionRequest()
.setPluginMetadata( new PluginMetadata( be.getGroupId(), be.getArtifactId(), be.getVersion() ) )
.addLocalRepository( session.getRequest().getLocalRepositoryPath() )
@ -90,6 +84,7 @@ public class BuildExtensionListener
{
e.printStackTrace();
}
*/
}
}

View File

@ -23,6 +23,7 @@ public class BuildExtensionListenerTest
public void testBuildExtensionListener()
throws Exception
{
/*
BuildExtensionListener listener = (BuildExtensionListener) lookup( MavenModelEventListener.class, "extensions" );
Extension extension = new Extension();
@ -54,7 +55,9 @@ public class BuildExtensionListenerTest
// Now we should be able to find the extension.
lookup( Wagon.class, "dav" );
}
*/
}
private MavenSession newMavenSession()
throws CycleDetectedException, DuplicateProjectException

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven</artifactId>
<version>3.0-SNAPSHOT</version>
</parent>
<artifactId>maven-mercury</artifactId>
<name>Maven Mercury</name>
<dependencies>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-artifact</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-external</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-repo-local-m2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-repo-remote-m2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-md-sat</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-transport-http</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-transport-http</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<executions>
<execution>
<goals>
<goal>generate-metadata</goal>
<goal>generate-test-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,157 +0,0 @@
package org.apache.maven.mercury;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES 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.List;
import java.util.Map;
import org.apache.maven.mercury.artifact.ArtifactMetadata;
import org.apache.maven.mercury.builder.api.DependencyProcessor;
import org.apache.maven.mercury.builder.api.DependencyProcessorException;
import org.apache.maven.mercury.builder.api.MetadataReader;
import org.apache.maven.mercury.builder.api.MetadataReaderException;
import org.apache.maven.model.DomainModel;
import org.apache.maven.model.ProcessorContext;
import org.apache.maven.model.interpolator.DefaultInterpolator;
import org.apache.maven.model.interpolator.InterpolatorProperty;
import org.apache.maven.model.interpolator.PomInterpolatorTag;
import org.codehaus.plexus.component.annotations.Component;
/**
*
* Maven supplied plexus component that implements POM dependency processing for Mercury
*
* @author Shane Isbell
* @version $Id$
*
*/
@Component( role=DependencyProcessor.class, hint="maven" )
public class MavenDependencyProcessor
implements DependencyProcessor
{
/**
* Over-ride this method to change how dependencies are obtained
*/
public List<ArtifactMetadata> getDependencies( ArtifactMetadata bmd, MetadataReader mdReader, Map system,
Map user )
throws MetadataReaderException, DependencyProcessorException
{
if ( bmd == null )
{
throw new IllegalArgumentException( "bmd: null" );
}
if ( mdReader == null )
{
throw new IllegalArgumentException( "mdReader: null" );
}
List<InterpolatorProperty> interpolatorProperties = createInterpolatorProperties(system, user);
List<DomainModel> domainModels = new ArrayList<DomainModel>();
try
{
// MavenDomainModel superPom =
// new MavenDomainModel(MavenDependencyProcessor.class.getResourceAsStream( "pom-4.0.0.xml" ));
// domainModels.add(superPom);
byte[] superBytes = mdReader.readMetadata( bmd );
if ( superBytes == null || superBytes.length < 1 )
{
throw new DependencyProcessorException( "cannot read metadata for " + bmd.getGAV() );
}
MavenDomainModel domainModel = new MavenDomainModel( superBytes );
domainModel.setMostSpecialized(true);
domainModels.add( domainModel );
/*TODO: Profiles
Collection<ModelContainer> activeProfiles = domainModel.getActiveProfileContainers( interpolatorProperties );
for ( ModelContainer mc : activeProfiles )
{
domainModels.add( new MavenDomainModel( transformProfiles( mc.getProperties() ) ) );
}
*/
List<DomainModel> parentModels = getParentsOfDomainModel( domainModel, mdReader );
if ( parentModels == null )
{
throw new DependencyProcessorException( "cannot read parent for " + bmd.getGAV() );
}
domainModels.addAll( parentModels );
}
catch ( IOException e )
{
throw new MetadataReaderException( "Failed to create domain model. Message = " + e.getMessage(), e );
}
try {
return new MavenDomainModel(new DefaultInterpolator().interpolateDomainModel(ProcessorContext.build(domainModels, null),
interpolatorProperties)).getDependencyMetadata();
} catch (IOException e) {
throw new DependencyProcessorException();
}
}
protected final List<InterpolatorProperty> createInterpolatorProperties(Map system, Map user)
{
List<InterpolatorProperty> interpolatorProperties = new ArrayList<InterpolatorProperty>();
interpolatorProperties.add( new InterpolatorProperty( "${mavenVersion}", "3.0-SNAPSHOT",
PomInterpolatorTag.EXECUTION_PROPERTIES.name() ) );
if ( system != null )
{
interpolatorProperties.addAll(
InterpolatorProperty.toInterpolatorProperties( system, PomInterpolatorTag.EXECUTION_PROPERTIES.name() ) );
}
if ( user != null )
{
interpolatorProperties.addAll(
InterpolatorProperty.toInterpolatorProperties( user, PomInterpolatorTag.USER_PROPERTIES.name() ) );
}
return interpolatorProperties;
}
protected final List<DomainModel> getParentsOfDomainModel( MavenDomainModel domainModel, MetadataReader mdReader )
throws IOException, MetadataReaderException, DependencyProcessorException
{
List<DomainModel> domainModels = new ArrayList<DomainModel>();
if ( domainModel.hasParent() )
{
byte[] b = mdReader.readMetadata( domainModel.getParentMetadata() );
if ( b == null || b.length < 1 )
{
throw new DependencyProcessorException( "cannot read metadata for " + domainModel.getParentMetadata() );
}
MavenDomainModel parentDomainModel = new MavenDomainModel( b );
domainModels.add( parentDomainModel );
domainModels.addAll( getParentsOfDomainModel( parentDomainModel, mdReader ) );
}
return domainModels;
}
}

View File

@ -1,125 +0,0 @@
package org.apache.maven.mercury;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES 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.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.maven.mercury.artifact.ArtifactMetadata;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Exclusion;
import org.apache.maven.model.Parent;
import org.apache.maven.model.PomClassicDomainModel;
public final class MavenDomainModel
extends PomClassicDomainModel
{
private ArtifactMetadata parentMetadata;
/**
* Constructor
*
* @throws IOException if there is a problem constructing the model
*/
public MavenDomainModel( byte[] bytes )
throws IOException
{
super( new ByteArrayInputStream( bytes ) );
}
public MavenDomainModel(PomClassicDomainModel model)
throws IOException
{
super(model.getModel());
}
public boolean hasParent()
{
return getParentMetadata() != null;
}
public List<ArtifactMetadata> getDependencyMetadata()
{
List<ArtifactMetadata> metadatas = new ArrayList<ArtifactMetadata>();
for(Dependency d: model.getDependencies())
{
ArtifactMetadata metadata = new ArtifactMetadata();
metadata.setArtifactId(d.getArtifactId());
metadata.setClassifier(d.getClassifier());
metadata.setGroupId(d.getGroupId());
metadata.setScope( (d.getScope() == null) ? "runtime" : d.getScope());
metadata.setVersion(d.getVersion());
metadata.setOptional(d.isOptional());
if( "test-jar".equals( d.getType() ) )
{
metadata.setType( "jar" );
metadata.setClassifier( "tests" );
}
else
{
metadata.setType( d.getType() );
}
List<ArtifactMetadata> exclusions = new ArrayList<ArtifactMetadata>();
for( Exclusion e : d.getExclusions() )
{
ArtifactMetadata md = new ArtifactMetadata();
md.setArtifactId(e.getArtifactId());
md.setGroupId(e.getGroupId());
exclusions.add(md);
}
metadata.setExclusions(exclusions);
metadatas.add(metadata);
}
return metadatas;
}
public ArtifactMetadata getParentMetadata()
{
if(parentMetadata == null)
{
Parent parent = model.getParent();
if(parent != null)
{
parentMetadata = new ArtifactMetadata();
parentMetadata.setArtifactId( parent.getArtifactId() );
parentMetadata.setVersion( parent.getVersion() );
parentMetadata.setGroupId( parent.getGroupId() );
}
}
return (parentMetadata != null) ? copyArtifactBasicMetadata( parentMetadata ) : null;
}
private ArtifactMetadata copyArtifactBasicMetadata( ArtifactMetadata metadata )
{
ArtifactMetadata amd = new ArtifactMetadata();
amd.setArtifactId( metadata.getArtifactId() );
amd.setGroupId( metadata.getGroupId() );
amd.setVersion( metadata.getVersion() );
return amd;
}
}

View File

@ -1,147 +0,0 @@
package org.apache.maven.mercury;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.maven.mercury.artifact.ArtifactMetadata;
import org.apache.maven.mercury.metadata.DependencyBuilder;
import org.apache.maven.mercury.metadata.DependencyBuilderFactory;
import org.apache.maven.mercury.repository.api.MetadataResults;
import org.apache.maven.mercury.repository.api.Repository;
import org.apache.maven.mercury.repository.api.RepositoryReader;
import org.apache.maven.mercury.repository.local.m2.LocalRepositoryM2;
import org.apache.maven.mercury.repository.remote.m2.RemoteRepositoryM2;
import org.apache.maven.mercury.transport.api.Server;
import org.apache.maven.mercury.util.FileUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
*
*
* @author Oleg Gusakov
* @version $Id$
*
*/
public class MavenDependencyProcessorTest
{
LocalRepositoryM2 _localRepo;
RemoteRepositoryM2 _remoteRepo;
File _localRepoFile;
static final String _remoteRepoDir = "./target/test-classes/repo";
File _remoteRepoFile;
static final String _remoteRepoUrlPrefix = "http://localhost:";
static final String _remoteRepoUrlSufix = "/maven2";
// HttpTestServer _jetty;
int _port;
DependencyBuilder _depBuilder;
/**
* @throws java.lang.Exception
*/
@Before
public void setUp()
throws Exception
{
MavenDependencyProcessor dp = new MavenDependencyProcessor();
_localRepoFile = File.createTempFile( "maven-mercury-", "-test-repo" );
FileUtil.delete( _localRepoFile );
_localRepoFile.mkdirs();
_localRepoFile.deleteOnExit();
_localRepo = new LocalRepositoryM2( "localRepo", _localRepoFile, dp );
_remoteRepoFile = new File( _remoteRepoDir );
// _jetty = new HttpTestServer( _remoteRepoFile, _remoteRepoUrlSufix );
// FIXME 2009-02-12 Oleg: disabling not to mess with jetty server. Will move to Mercury ITs
// _jetty.start();
// _port = _jetty.getPort();
Server server = new Server( "testRemote", new URL(_remoteRepoUrlPrefix + _port + _remoteRepoUrlSufix) );
_remoteRepo = new RemoteRepositoryM2( server, dp );
ArrayList<Repository> repos = new ArrayList<Repository>(2);
repos.add( _localRepo );
repos.add( _remoteRepo );
_depBuilder = DependencyBuilderFactory.create( DependencyBuilderFactory.JAVA_DEPENDENCY_MODEL, repos, null, null, null );
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown()
throws Exception
{
// if( _jetty != null )
// {
// FIXME 2009-02-12 Oleg: disabling not to mess with jetty server. Will move to Mercury ITs
// _jetty.stop();
// _jetty.destroy();
//
// System.out.println( "Jetty on :" + _port + " destroyed\n<========\n\n" );
// }
}
@Test
public void testDummy()
throws Exception
{
}
/**
* Test method for {@link org.apache.maven.mercury.MavenDependencyProcessor#getDependencies(org.apache.maven.mercury.artifact.ArtifactMetadata, org.apache.maven.mercury.builder.api.MetadataReader, java.util.Map, java.util.Map)}.
*/
public void testMavenVersion()
throws Exception
{
RepositoryReader rr = _remoteRepo.getReader();
String gav = "org.apache.maven.plugins:maven-dependency-plugin:2.0";
ArtifactMetadata bmd = new ArtifactMetadata( gav );
ArrayList<ArtifactMetadata> query = new ArrayList<ArtifactMetadata>(1);
query.add( bmd );
MetadataResults res = rr.readDependencies( query );
assertNotNull( res );
assertFalse( res.hasExceptions() );
assertTrue( res.hasResults() );
List<ArtifactMetadata> deps = res.getResult( bmd );
assertNotNull( deps );
assertFalse( deps.isEmpty() );
System.out.println(deps);
for( ArtifactMetadata md : deps )
if( "${maven.version}".equals( md.getVersion() ) )
fail( "dependency has unresolved variable: "+md.toString() );
}
}

View File

@ -1,113 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/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>4</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>The 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>
<properties>
<organization.logo>http://www.apache.org/images/asf_logo_wide.gif</organization.logo>
</properties>
<!--
<build>
<plugins>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<configuration>
<artifacts>
<artifact>org.apache:apache-distribution-resources:1.0-SNAPSHOT</artifact>
</artifacts>
</configuration>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
-->
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/tags/apache-4</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/tags/apache-4</developerConnection>
<url>http://svn.apache.org/viewvc/maven/pom/tags/apache-4</url>
</scm>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<versioning>
<latest>4</latest>
<release>4</release>
<versions>
<version>4</version>
</versions>
<lastUpdated>20080122220618</lastUpdated>
</versioning>
</metadata>

View File

@ -1,670 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>4</version>
<relativePath>../asf/pom.xml</relativePath>
</parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>7</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/MNG</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>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scp://people.apache.org/www/maven.apache.org</url>
</site>
</distributionManagement>
<build>
<plugins>
<!-- We want to package up license resources in the JARs produced -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.0-alpha-6</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<resourceBundles>
<resourceBundle>org.apache:apache-jar-resource-bundle:1.3</resourceBundle>
</resourceBundles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.4</source>
<target>1.4</target>
</configuration>
</plugin>
<!-- START SNIPPET: release-plugin-configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-6</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>
<!-- END SNIPPET: release-plugin-configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</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/j2se/1.4.2/docs/api</link>
<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://commons.apache.org/collections/apidocs-COLLECTIONS_3_0/</link>
<link>http://commons.apache.org/dbcp/apidocs/</link>
<link>http://commons.apache.org/fileupload/apidocs/</link>
<link>http://commons.apache.org/httpclient/apidocs/</link>
<link>http://commons.apache.org/logging/apidocs/</link>
<link>http://commons.apache.org/pool/apidocs/</link>
<link>http://junit.sourceforge.net/javadoc/</link>
<link>http://logging.apache.org/log4j/1.2/apidocs/</link>
<link>http://jakarta.apache.org/regexp/apidocs/</link>
<link>http://velocity.apache.org/engine/releases/velocity-1.5/apidocs/</link>
</links>
</configuration>
</plugin>
</plugins>
</reporting>
</profile>
<!-- START SNIPPET: release-profile -->
<profile>
<id>release</id>
<build>
<plugins>
<!-- We want to sign the artifact, the POM, and all attached artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.0-alpha-4</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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.3</version>
<configuration>
<altDeploymentRepository>${deploy.altRepository}</altDeploymentRepository>
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.0.3</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.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- END SNIPPET: release-profile -->
</profiles>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/tags/maven-parent-7</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/tags/maven-parent-7</developerConnection>
<url>http://svn.apache.org/viewvc/maven/pom/tags/maven-parent-7</url>
</scm>
<!-- Developers listed by PMC Chair, PMC, Committers, Contributers, all alphabetical-->
<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>aheritier</id>
<name>Arnaud Heritier</name>
<email>aheritier@apache.org</email>
<organization>OCTO Technology</organization>
<organizationUrl>http://www.octo.com</organizationUrl>
<roles>
<role>PMC Member</role>
</roles>
<timezone>+1</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>brianf</id>
<name>Brian Fox</name>
<email>brianf@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>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>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>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>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>jstrachan</id>
<name>James Strachan</name>
<roles>
<role>PMC Member</role>
</roles>
</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>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>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>ltheussl</id>
<name>Lukas Theussl</name>
<email>ltheussl@apache.org</email>
<organization>ASF</organization>
<roles>
<role>PMC Member</role>
</roles>
<timezone>+1</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>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>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>PMC Member</role>
</roles>
<timezone>-5</timezone>
</developer>
<developer>
<id>wsmoak</id>
<name>Wendy Smoak</name>
<email>wsmoak@apache.org</email>
<roles>
<role>PMC Member</role>
</roles>
<timezone>-7</timezone>
</developer>
<!--Committers-->
<developer>
<id>aramirez</id>
<name>Allan Q. Ramirez</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>baerrach</id>
<name>Barrie Treloar</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>bayard</id>
<name>Henri Yandell</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>bellingard</id>
<name>Fabrice Bellingard</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>chrisjs</id>
<name>Chris Stevenson</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>dantran</id>
<name>Dan Tran</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>dblevins</id>
<name>David Blevins</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>dfabulich</id>
<name>Daniel Fabulich</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>dkulp</id>
<name>Daniel Kulp</name>
<email>dkulp@apache.org</email>
<organization>IONA</organization>
<roles>
<role>Committer</role>
</roles>
<timezone>-5</timezone>
</developer>
<developer>
<id>dlr</id>
<name>Daniel Rall</name>
<roles>
<role>Committer</role>
</roles>
</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>felipeal</id>
<name>Felipe Leme</name>
<roles>
<role>Committer</role>
</roles>
</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>hboutemy</id>
<name>Herve Boutemy</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>jjensen</id>
<name>Jeff Jensen</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>mkleint</id>
<name>Milos Kleint</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>oching</id>
<name>Maria Odea B. Ching</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>olamy</id>
<name>Olivier Lamy</name>
<email>olamy@apache.org</email>
<roles>
<role>Committer</role>
</roles>
<timezone>+1</timezone>
</developer>
<developer>
<id>pschneider</id>
<name>Patrick Schneider</name>
<email>pschneider@gmail.com</email>
<roles>
<role>Committer</role>
</roles>
<timezone>-6</timezone>
</developer>
<developer>
<id>rgoers</id>
<name>Ralph Goers</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>rinku</id>
<name>Rahul Thakur</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>shinobu</id>
<name>Shinobu Kuwai</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<developer>
<id>smorgrav</id>
<name>Torbjorn Eikli Smorgrav</name>
<roles>
<role>Committer</role>
</roles>
</developer>
<!--End Committers-->
</developers>
</project>

View File

@ -1 +0,0 @@
2426103263cbaf5519433f16bd98cdc31870a10a

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<versioning>
<latest>7</latest>
<release>7</release>
<versions>
<version>7</version>
</versions>
<lastUpdated>20080122220618</lastUpdated>
</versioning>
</metadata>

View File

@ -1,339 +0,0 @@
<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">
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
-->
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>10</version>
</parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Dependency Plugin</name>
<version>2.0</version>
<prerequisites>
<maven>2.0.3</maven>
</prerequisites>
<issueManagement>
<system>JIRA</system>
<url>http://jira.codehaus.org/browse/MDEP</url>
</issueManagement>
<developers>
<developer>
<id>brianf</id>
<name>Brian Fox</name>
<email>brianf@apache.org</email>
<roles>
<role>Lead Developer</role>
</roles>
<timezone>5</timezone>
</developer>
<developer>
<id>dtran</id>
<name>Dan T. Tran</name>
<email>dantran@gmail.com</email>
<organization>
</organization>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>jdcasey</id>
<name>John Casey</name>
<email>casey.john.d@gmail.com</email>
<organization>
</organization>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<maven.version>2.0.8</maven.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>enforce</goal>
</goals>
<id>ensure-no-container-api</id>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>org.codehaus.plexus:plexus-component-api</exclude>
</excludes>
<message>The new containers are not supported. You probably added a dependency that is missing the exclusions.</message>
</bannedDependencies>
<!-- <requirePluginVersions><banSnapshots>false</banSnapshots></requirePluginVersions>-->
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Need of more head space in order to run the unit tests !-->
<argLine>-Xmx256m</argLine>
<systemProperties>
<property>
<name>maven.home</name>
<value>${maven.home}</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-alpha-3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-6</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-tools</artifactId>
<version>1.0-alpha-3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<scope>test</scope>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>1.0-alpha-9</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.4.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>file-management</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-9-stable-1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-dependency-analyzer</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-dependency-tree</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-common-artifact-filters</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>1.0-alpha-1</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Dependencies for Analyze-report mojo -->
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-sink-api</artifactId>
<version>1.0-alpha-8</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
<version>1.0-alpha-8</version>
</dependency>
<!--
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-5</version>
</dependency>
-->
</dependencies>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-dependency-plugin-2.0</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-dependency-plugin-2.0</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/maven/plugins/tags/maven-dependency-plugin-2.0</url>
</scm>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versioning>
<latest>2.0</latest>
<release>2.0</release>
<versions>
<version>2.0</version>
</versions>
<lastUpdated>20080122220618</lastUpdated>
</versioning>
</metadata>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versioning>
<latest>2.0</latest>
<release>2.0</release>
<versions>
<version>2.0</version>
</versions>
<lastUpdated>20080122220618</lastUpdated>
</versioning>
</metadata>

View File

@ -1,185 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>7</version>
<relativePath>../pom/maven/pom.xml</relativePath>
</parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<packaging>pom</packaging>
<version>10</version>
<name>Maven Plugins</name>
<description>Maven Plugins</description>
<url>http://maven.apache.org/plugins/</url>
<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>
<otherArchives>
<otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive>
<otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive>
</otherArchives>
</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>
<!-- 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>
</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>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scp://people.apache.org/www/maven.apache.org/plugins/</url>
</site>
</distributionManagement>
<modules>
<module>maven-ant-plugin</module>
<module>maven-antrun-plugin</module>
<module>maven-assembly-plugin</module>
<module>maven-changelog-plugin</module>
<module>maven-changes-plugin</module>
<module>maven-checkstyle-plugin</module>
<module>maven-clean-plugin</module>
<module>maven-compiler-plugin</module>
<module>maven-dependency-plugin</module>
<module>maven-deploy-plugin</module>
<module>maven-doap-plugin</module>
<module>maven-docck-plugin</module>
<module>maven-ear-plugin</module>
<module>maven-eclipse-plugin</module>
<module>maven-ejb-plugin</module>
<module>maven-gpg-plugin</module>
<module>maven-help-plugin</module>
<module>maven-idea-plugin</module>
<module>maven-install-plugin</module>
<module>maven-invoker-plugin</module>
<module>maven-jar-plugin</module>
<module>maven-javadoc-plugin</module>
<module>maven-one-plugin</module>
<module>maven-plugin-plugin</module>
<module>maven-pmd-plugin</module>
<module>maven-project-info-reports-plugin</module>
<module>maven-rar-plugin</module>
<module>maven-remote-resources-plugin</module>
<module>maven-repository-plugin</module>
<module>maven-resources-plugin</module>
<module>maven-site-plugin</module>
<module>maven-source-plugin</module>
<module>maven-stage-plugin</module>
<module>maven-verifier-plugin</module>
<module>maven-war-plugin</module>
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-plugins-10</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-plugins-10</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/maven/plugins/tags/maven-plugins-10</url>
</scm>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<tagBase>https://svn.apache.org/repos/asf/maven/plugins/tags</tagBase>
</configuration>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-5</version>
<configuration>
<stagingSiteURL>scp://people.apache.org/www/maven.apache.org/plugins/${artifactId}-${version}</stagingSiteURL>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>ciProfile</id>
<activation>
<property>
<name>enableCiProfile</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-docck-plugin</artifactId>
<version>1.0-beta-2</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
</plugin>
</plugins>
</reporting>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?><metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<versioning>
<latest>10</latest>
<release>10</release>
<versions>
<version>10</version>
</versions>
<lastUpdated>20080122220618</lastUpdated>
</versioning>
</metadata>

View File

@ -160,14 +160,22 @@ public class DefaultMavenProjectBuilder
}
domainModel = ProcessorContext.mergeProfilesIntoModel( externalProfiles, domainModel );
}
catch ( IOException e )
{
throw new ProjectBuildingException("", "");
}
//Interpolation
MavenProject project = interpolateDomainModel( domainModel, configuration, pomFile );
//Interpolation & Management
MavenProject project;
try {
Model model = ProcessorContext.processManagementNodes(interpolateDomainModel( domainModel, configuration, pomFile ));
project = this.fromDomainModelToMavenProject(model, domainModel.getParentFile(), configuration, pomFile);
} catch (IOException e) {
throw new ProjectBuildingException("", "");
}
project.setActiveProfiles( projectProfiles );
Build build = project.getBuild();
@ -269,7 +277,14 @@ public class DefaultMavenProjectBuilder
{
throw new ProjectBuildingException("", "");
}
project = interpolateDomainModel( domainModel, configuration, artifact.getFile() );
try {
Model model = ProcessorContext.processManagementNodes(interpolateDomainModel( domainModel, configuration, artifact.getFile() ));
project = this.fromDomainModelToMavenProject(model, domainModel.getParentFile(), configuration, artifact.getFile());
} catch (IOException e) {
throw new ProjectBuildingException("", "");
}
project.setActiveProfiles( projectProfiles );
artifact.setFile( artifact.getFile() );
project.setVersion( artifact.getVersion() );
@ -368,7 +383,7 @@ public class DefaultMavenProjectBuilder
return new MavenProjectBuildingResult( project, result );
}
private MavenProject interpolateDomainModel( PomClassicDomainModel domainModel, ProjectBuilderConfiguration config, File projectDescriptor )
private Model interpolateDomainModel( PomClassicDomainModel domainModel, ProjectBuilderConfiguration config, File projectDescriptor )
throws ProjectBuildingException
{
Model model;
@ -403,9 +418,15 @@ public class DefaultMavenProjectBuilder
throw new ProjectBuildingException(projectId, "", projectDescriptor, e);
}
return model;
}
private MavenProject fromDomainModelToMavenProject(Model model, File parentFile, ProjectBuilderConfiguration config, File projectDescriptor)
throws InvalidProjectModelException, IOException
{
MavenProject project;
String projectId = safeVersionlessKey( model.getGroupId(), model.getArtifactId() );
try
{
project = new MavenProject( model, repositorySystem, this, config );
@ -415,7 +436,7 @@ public class DefaultMavenProjectBuilder
Artifact projectArtifact = repositorySystem.createArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(), null, project.getPackaging() );
project.setArtifact( projectArtifact );
project.setParentFile( domainModel.getParentFile() );
project.setParentFile( parentFile );
}
catch ( InvalidRepositoryException e )
@ -423,7 +444,7 @@ public class DefaultMavenProjectBuilder
throw new InvalidProjectModelException( projectId, e.getMessage(), projectDescriptor, e );
}
return project;
return project;
}
private PomClassicDomainModel build( String projectId, File pomFile, ProjectBuilderConfiguration projectBuilderConfiguration )
@ -544,7 +565,7 @@ public class DefaultMavenProjectBuilder
{
for ( String s : (List<String>) validationResult.getMessages() )
{
logger.info( s );
logger.error( s );
}
throw new InvalidProjectModelException( projectId, "Failed to validate POM", pomFile, validationResult );
}

View File

@ -209,13 +209,15 @@ public class MavenMetadataSource
}
}
project = null;
throw new ArtifactMetadataRetrievalException(
"Cannot validate pom " + e.getMessage(), e );
}
catch ( ProjectBuildingException e )
{
handleInvalidOrMissingMavenPOM( artifact, e );
project = null;
throw new ArtifactMetadataRetrievalException(
"Cannot build project: " + e.getMessage(), e );
}

View File

@ -149,7 +149,7 @@ public class PomConstructionTest
System.out.println(pom.getDomainModel().asString());
}
*/
/*MNG- 4010*/
public void testDuplicateExclusionsDependency()
throws Exception
@ -885,6 +885,14 @@ public class PomConstructionTest
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
{
@ -892,7 +900,7 @@ public class PomConstructionTest
assertEquals(1, ( (List<?>) pom.getValue( "dependencies" ) ).size() );
assertEquals("4.4", pom.getValue("dependencies[1]/version") );
}
/** MNG-4034 */
public void testManagedProfileDependency()
throws Exception
@ -1401,7 +1409,32 @@ public class PomConstructionTest
{
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");
assertNull("Scope not null: " + scope, scope);
System.out.println(pom.getDomainModel().asString());
}
public void testDependencyScope()
throws Exception
{
PomTestWrapper pom = buildPom( "dependency-scope/sub" );
// System.out.println(pom.getDomainModel().asString());
}
//This will fail on a validation error if incorrect
public void testDependencyManagementWithInterpolation()
throws Exception
{
PomTestWrapper pom = buildPom( "dependency-management-with-interpolation/sub" );
}
private void assertPathSuffixEquals( String expected, Object actual )
{

View File

@ -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>

View File

@ -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>

View File

@ -0,0 +1,15 @@
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>p0</artifactId>
<groupId>maven</groupId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>maven-test</groupId>
<version>1.0</version>
<artifactId>a</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -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>

View File

@ -7,30 +7,12 @@
<version>1.0</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>maven-test</groupId>
<artifactId>t10-a</artifactId>
<version>1.0</version>
<scope>test</scope>
<version>2.0</version>
</dependency>
<dependency>
<groupId>maven-test</groupId>
<artifactId>t10-b</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>maven-test</groupId>
<artifactId>t10-c</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -15,17 +15,10 @@
</scm>
<dependencies>
<dependency>
<groupId>maven-test</groupId>
<artifactId>t10-a</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>maven-test</groupId>
<artifactId>t10-c</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,183 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven</artifactId>
<version>3.0-SNAPSHOT</version>
</parent>
<artifactId>maven-repository-mercury</artifactId>
<name>Mercury Repository implementation</name>
<description>Mercury implementation for the Maven Repository System</description>
<properties>
<mercury.version>1.0-alpha-7-SNAPSHOT</mercury.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository</artifactId>
<version>${project.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-legacy</artifactId>
<version>${project.version}</version>
</dependency>
-->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-mercury</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-external</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-util</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-md-sat</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-repo-api</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-repo-local-m2</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-repo-remote-m2</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-repo-virtual</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-artifact</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-plexus</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.mercury</groupId>
<artifactId>mercury-transport-http</artifactId>
<version>${mercury.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-jetty6</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonatype.spice</groupId>
<artifactId>plexus-webdav</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<executions>
<execution>
<goals>
<goal>generate-metadata</goal>
<goal>generate-test-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,394 +0,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.
*/
package org.apache.maven.repository.mercury;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.maven.artifact.Artifact;
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.artifact.resolver.filter.ExcludesArtifactFilter;
import org.apache.maven.artifact.resolver.filter.IncludesArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.mercury.artifact.ArtifactMetadata;
import org.apache.maven.mercury.artifact.ArtifactScopeEnum;
import org.apache.maven.mercury.artifact.MetadataTreeNode;
import org.apache.maven.mercury.builder.api.DependencyProcessor;
import org.apache.maven.mercury.repository.api.Repository;
import org.apache.maven.mercury.repository.local.m2.LocalRepositoryM2;
import org.apache.maven.mercury.repository.remote.m2.RemoteRepositoryM2;
import org.apache.maven.mercury.transport.api.Server;
import org.apache.maven.mercury.util.Util;
import org.apache.maven.repository.MavenArtifactMetadata;
import org.apache.maven.repository.MetadataGraph;
import org.apache.maven.repository.MetadataGraphNode;
/**
* @author Oleg Gusakov
* @version $Id$
*/
public class MercuryAdaptor
{
private static Map<String, Repository> _repos = Collections.synchronizedMap( new HashMap<String, Repository>() );
public static List<Repository> toMercuryRepos( ArtifactRepository localRepository,
List<?> remoteRepositories,
DependencyProcessor dependencyProcessor
)
{
if ( localRepository == null && Util.isEmpty( remoteRepositories ) )
return null;
int nRepos =
( localRepository == null ? 0 : 1 ) + ( Util.isEmpty( remoteRepositories ) ? 0 : remoteRepositories.size() );
Map<String, Repository> repos = new LinkedHashMap<String, Repository>(nRepos);
if ( localRepository != null )
{
String url = localRepository.getUrl();
LocalRepositoryM2 lr = (LocalRepositoryM2) _repos.get( url );
if( lr == null )
try
{
URI rootURI = new URI( url );
File localRepoDir = new File( rootURI );
lr = new LocalRepositoryM2( localRepository.getId(), localRepoDir, dependencyProcessor );
_repos.put( url, lr );
}
catch ( URISyntaxException e )
{
throw new IllegalArgumentException( e );
}
repos.put( url, lr );
}
if ( !Util.isEmpty( remoteRepositories ) )
{
for ( Object o : remoteRepositories )
{
String url;
String id;
if( ArtifactRepository.class.isAssignableFrom( o.getClass() ))
{
ArtifactRepository ar = (ArtifactRepository) o;
url = ar.getUrl();
id = ar.getId();
}
else if( org.apache.maven.model.Repository.class.isAssignableFrom( o.getClass() ))
{
org.apache.maven.model.Repository ar = (org.apache.maven.model.Repository) o;
url = ar.getUrl();
id = ar.getId();
}
else
throw new IllegalArgumentException( "found illegal class in the remote repository list - " + o.getClass().getName() );
RemoteRepositoryM2 rr = (RemoteRepositoryM2) _repos.get( url );
if( rr == null )
{
Server server;
try
{
server = new Server( id, new URL( url ) );
}
catch ( MalformedURLException e )
{
throw new IllegalArgumentException( e );
}
rr = new RemoteRepositoryM2( server, dependencyProcessor );
_repos.put( url, rr );
}
repos.put( url, rr );
}
}
List<Repository> res = new ArrayList<Repository>( repos.size() );
for( Entry<String, Repository> e : repos.entrySet() )
res.add( e.getValue() );
//System.out.println("Converted "+nRepos+" -> "+res.size());
//
return res;
}
private static void setInExClusion( ArtifactMetadata md, List<String> patterns, boolean inc )
{
if( Util.isEmpty( patterns ) )
return;
List<ArtifactMetadata> lusions = new ArrayList<ArtifactMetadata>( patterns.size() );
for( String pattern : patterns )
lusions.add( new ArtifactMetadata(pattern) );
if( inc )
md.setInclusions( lusions );
else
md.setExclusions( lusions );
}
public static ArtifactMetadata toMercuryMetadata( Artifact a )
{
ArtifactMetadata md = new ArtifactMetadata();
md.setGroupId( a.getGroupId() );
md.setArtifactId( a.getArtifactId() );
md.setVersion( a.getVersion() );
md.setType( a.getType() );
md.setScope( a.getScope() );
if( "test-jar".equals( a.getType() ) )
{
md.setType( "jar" );
md.setClassifier( "tests" );
}
ArtifactFilter af = a.getDependencyFilter();
if( af != null )
{
if( ExcludesArtifactFilter.class.isAssignableFrom( af.getClass() ) )
{
setInExClusion( md, ((ExcludesArtifactFilter)af).getPatterns(), false );
}
else if( IncludesArtifactFilter.class.isAssignableFrom( af.getClass() ) )
{
setInExClusion( md, ((IncludesArtifactFilter)af).getPatterns(), true );
}
}
return md;
}
public static Artifact toMavenArtifact( ArtifactFactory af, org.apache.maven.mercury.artifact.Artifact a )
{
boolean isTestJar = "test-jar".equals( a.getType() );
String type = isTestJar ? "jar" : a.getType();
String classifier = isTestJar ? "tests" : a.getType();
Artifact ma = classifier == null
? af.createArtifact( a.getGroupId(), a.getArtifactId(), a.getVersion(), a.getScope(), type )
: af.createArtifactWithClassifier( a.getGroupId(), a.getArtifactId(), a.getVersion(), type, classifier )
;
ma.setScope( a.getScope() );
ma.setFile( a.getFile() );
ma.setResolved( a.getFile() != null );
ma.setResolvedVersion( a.getVersion() );
return ma;
}
public static Artifact toMavenArtifact( ArtifactFactory af, org.apache.maven.mercury.artifact.ArtifactMetadata a )
{
boolean isTestJar = "test-jar".equals( a.getType() );
String type = isTestJar ? "jar" : a.getType();
String classifier = isTestJar ? "tests" : a.getType();
Artifact ma = classifier == null
? af.createArtifact( a.getGroupId(), a.getArtifactId(), a.getVersion(), a.getScope(), type )
: af.createArtifactWithClassifier( a.getGroupId(), a.getArtifactId(), a.getVersion(), type, classifier )
;
ma.setScope( a.getScope() );
return ma;
}
public static Artifact toMavenArtifact( ArtifactFactory af, String name )
{
return toMavenArtifact( af, new ArtifactMetadata(name) );
}
public static ArtifactMetadata toMercuryArtifactMetadata( MavenArtifactMetadata md )
{
ArtifactMetadata mmd = new ArtifactMetadata();
mmd.setGroupId( md.getGroupId() );
mmd.setArtifactId( md.getArtifactId() );
mmd.setVersion( md.getVersion() );
mmd.setClassifier( md.getClassifier() );
mmd.setType( md.getType() );
if( "test-jar".equals( md.getType() ) )
{
mmd.setType( "jar" );
mmd.setClassifier( "tests" );
}
return mmd;
}
public static MavenArtifactMetadata toMavenArtifactMetadata( ArtifactMetadata md )
{
MavenArtifactMetadata mmd = new MavenArtifactMetadata();
mmd.setGroupId( md.getGroupId() );
mmd.setArtifactId( md.getArtifactId() );
mmd.setVersion( md.getVersion() );
mmd.setClassifier( md.getClassifier() );
mmd.setType( md.getType() );
if( "test-jar".equals( md.getType() ) )
{
mmd.setType( "jar" );
mmd.setClassifier( "tests" );
}
return mmd;
}
public static MavenArtifactMetadata toMavenArtifactMetadata( Artifact md )
{
MavenArtifactMetadata mmd = new MavenArtifactMetadata();
mmd.setGroupId( md.getGroupId() );
mmd.setArtifactId( md.getArtifactId() );
mmd.setVersion( md.getVersion() );
mmd.setClassifier( md.getClassifier() );
mmd.setType( md.getType() );
if( "test-jar".equals( md.getType() ) )
{
mmd.setType( "jar" );
mmd.setClassifier( "tests" );
}
return mmd;
}
public static MetadataGraph resolvedTreeToGraph( MetadataTreeNode root )
{
if( root == null )
return null;
MetadataGraphNode entry = new MetadataGraphNode( toMavenArtifactMetadata( root.getMd() ) );
MetadataGraph graph = new MetadataGraph(entry);
graph.addNode( entry );
addKids( root, entry, graph );
return graph;
}
private static final void addKids( MetadataTreeNode tParent, MetadataGraphNode gParent, MetadataGraph graph )
{
if( !tParent.hasChildren() )
return;
for( MetadataTreeNode kid : tParent.getChildren() )
{
MavenArtifactMetadata mmd = toMavenArtifactMetadata( kid.getMd() );
MetadataGraphNode node = graph.findNode( mmd );
node.addIncident( gParent );
gParent.addIncident( node );
addKids( kid, node, graph );
}
}
/**
* @param reqArtifact
* @param isPlugin
* @param filter
* @return
*/
public static ArtifactScopeEnum extractScope( Artifact reqArtifact, boolean isPlugin, ArtifactFilter filter )
{
String scopeStr = reqArtifact.getScope(); //org.apache.maven.mercury.artifact.Artifact.SCOPE_COMPILE;
if( filter != null )
{
if( ScopeArtifactFilter.class.isAssignableFrom( filter.getClass() ) )
scopeStr = ((ScopeArtifactFilter)filter).getScope();
}
// if( "org.apache.maven.plugins:maven-remote-resources-plugin".equals(
// reqArtifact.getGroupId()+":"+reqArtifact.getArtifactId()
// )
// ) scopeStr = null;
// else if( isPlugin )
// scopeStr = org.apache.maven.mercury.artifact.Artifact.SCOPE_RUNTIME;
if( scopeStr != null )
{
if( org.apache.maven.mercury.artifact.Artifact.SCOPE_COMPILE.equals( scopeStr ) )
return ArtifactScopeEnum.compile;
else if( org.apache.maven.mercury.artifact.Artifact.SCOPE_TEST.equals( scopeStr ) )
return ArtifactScopeEnum.test;
else if( org.apache.maven.mercury.artifact.Artifact.SCOPE_PROVIDED.equals( scopeStr ) )
return ArtifactScopeEnum.provided;
else if( org.apache.maven.mercury.artifact.Artifact.SCOPE_RUNTIME.equals( scopeStr ) )
return ArtifactScopeEnum.runtime;
else if( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM.equals( scopeStr ) )
return ArtifactScopeEnum.runtime;
else if( org.apache.maven.mercury.artifact.Artifact.SCOPE_SYSTEM.equals( scopeStr ) )
return ArtifactScopeEnum.system;
}
return null;
}
public static Map<String,ArtifactMetadata> toMercuryVersionMap(Map<String,Artifact> map )
{
if( Util.isEmpty( map ) )
return null;
Map<String,ArtifactMetadata> res = new HashMap<String, ArtifactMetadata>( map.size() );
for( Entry<String, Artifact> e : map.entrySet() )
{
res.put( e.getKey(), toMercuryMetadata( e.getValue() ) );
}
return res;
}
}

View File

@ -1,295 +0,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.
*/
package org.apache.maven.repository.mercury;
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.factory.ArtifactFactory;
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.mercury.artifact.ArtifactMetadata;
import org.apache.maven.mercury.artifact.ArtifactQueryList;
import org.apache.maven.mercury.artifact.ArtifactScopeEnum;
import org.apache.maven.mercury.artifact.MetadataTreeNode;
import org.apache.maven.mercury.builder.api.DependencyProcessor;
import org.apache.maven.mercury.plexus.PlexusMercury;
import org.apache.maven.mercury.repository.api.Repository;
import org.apache.maven.mercury.repository.api.RepositoryException;
import org.apache.maven.mercury.util.Util;
import org.apache.maven.repository.LegacyRepositorySystem;
import org.apache.maven.repository.MetadataGraph;
import org.apache.maven.repository.MetadataResolutionRequest;
import org.apache.maven.repository.MetadataResolutionResult;
import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.lang.DefaultLanguage;
import org.codehaus.plexus.lang.Language;
/**
* @author Oleg Gusakov
* @version $Id$
*/
@Component( role = RepositorySystem.class, hint = "mercury" )
public class MercuryRepositorySystem
extends LegacyRepositorySystem
implements RepositorySystem
{
private static final Language LANG = new DefaultLanguage( MercuryRepositorySystem.class );
@Requirement( hint = "maven" )
DependencyProcessor _dependencyProcessor;
@Requirement
PlexusMercury _mercury;
@Requirement
ArtifactFactory _artifactFactory;
@Override
public ArtifactResolutionResult resolve( ArtifactResolutionRequest request )
{
if ( request == null )
throw new IllegalArgumentException( LANG.getMessage( "null.request" ) );
System.out.println("mercury: request for "+request.getArtifact()
+"("+request.getArtifactDependencies()+") repos="+request.getRemoteRepostories().size()
+" repos, map=" + request.getManagedVersionMap()
);
if ( request.getArtifact() == null )
throw new IllegalArgumentException( LANG.getMessage( "null.request.artifact" ) );
Map<String, ArtifactMetadata> versionMap = MercuryAdaptor.toMercuryVersionMap( (Map<String,Artifact>)request.getManagedVersionMap() );
ArtifactResolutionResult result = new ArtifactResolutionResult();
List<Repository> repos =
MercuryAdaptor.toMercuryRepos( request.getLocalRepository()
, request.getRemoteRepostories()
, _dependencyProcessor
);
try
{
long start = System.currentTimeMillis();
org.apache.maven.artifact.Artifact rootArtifact = request.getArtifact();
org.apache.maven.artifact.Artifact mavenPluginArtifact = rootArtifact;
Set<Artifact> artifacts = request.getArtifactDependencies();
boolean isPlugin = "maven-plugin".equals( rootArtifact.getType() );
ArtifactScopeEnum scope = MercuryAdaptor.extractScope( rootArtifact, isPlugin, request.getFilter() );
if( isPlugin )
rootArtifact = createArtifact( rootArtifact.getGroupId()
, rootArtifact.getArtifactId()
, rootArtifact.getVersion()
, rootArtifact.getScope()
, "jar"
);
ArtifactMetadata rootMd = MercuryAdaptor.toMercuryMetadata( rootArtifact );
org.apache.maven.artifact.Artifact root = null;
// copied from artifact resolver
if ( request.isResolveRoot() && rootArtifact.getFile() == null && Util.isEmpty( artifacts ) )
{
try
{
List<ArtifactMetadata> mercuryMetadataList = new ArrayList<ArtifactMetadata>(1);
mercuryMetadataList.add( rootMd );
List<org.apache.maven.mercury.artifact.Artifact> mercuryArtifactList =
_mercury.read( repos, mercuryMetadataList );
if( Util.isEmpty( mercuryArtifactList ) )
{
result.addErrorArtifactException( new ArtifactResolutionException( "scope="+scope, rootArtifact) );
return result;
}
root = isPlugin ? mavenPluginArtifact : rootArtifact;
org.apache.maven.mercury.artifact.Artifact a = mercuryArtifactList.get( 0 );
root.setFile( a.getFile() );
root.setResolved( true );
root.setResolvedVersion( a.getVersion() );
result.addArtifact( rootArtifact );
result.addRequestedArtifact( rootArtifact );
}
catch ( Exception e )
{
result.addMissingArtifact( request.getArtifact() );
return result;
}
}
if ( Util.isEmpty( artifacts ) )
{
return result;
}
List<ArtifactMetadata> mercuryMetadataList = null;
if ( Util.isEmpty( artifacts ) )
mercuryMetadataList = _mercury.resolve( repos, scope, rootMd );
else
{
List<ArtifactMetadata> query = new ArrayList<ArtifactMetadata>( artifacts.size() + 1 );
query.add( rootMd );
for( Artifact a : artifacts )
query.add( MercuryAdaptor.toMercuryMetadata( a ) );
mercuryMetadataList = _mercury.resolve( repos, scope, new ArtifactQueryList(query), null, null, versionMap );
}
List<org.apache.maven.mercury.artifact.Artifact> mercuryArtifactList =
_mercury.read( repos, mercuryMetadataList );
long diff = System.currentTimeMillis() - start;
if ( !Util.isEmpty( mercuryArtifactList ) )
{
for ( org.apache.maven.mercury.artifact.Artifact a : mercuryArtifactList )
{
if( a.getGroupId().equals( rootMd.getGroupId() ) && a.getArtifactId().equals( rootMd.getArtifactId() ) )
{ // root artifact processing
root = isPlugin ? mavenPluginArtifact : rootArtifact;
root.setFile( a.getFile() );
root.setResolved( true );
root.setResolvedVersion( a.getVersion() );
result.addArtifact( root );
result.addRequestedArtifact( root );
}
else
{
Artifact ma = MercuryAdaptor.toMavenArtifact( _artifactFactory, a );
result.addArtifact( ma );
result.addRequestedArtifact( ma );
}
}
System.out.println("mercury: resolved("+diff+") "+root+"("+scope+") as file "+root.getFile() );
//for( Artifact a: result.getArtifacts() )
//System.out.println("mercury dependency: "+a+" as file "+a.getFile() );
}
else
{
result.addMissingArtifact( rootArtifact );
System.out.println("mercury: missing artifact("+diff+") "+rootArtifact+"("+scope+")" );
}
}
catch ( RepositoryException e )
{
result.addErrorArtifactException( new ArtifactResolutionException( e.getMessage(), request.getArtifact(),
request.getRemoteRepostories() ) );
}
return result;
}
// public List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository,
// List<ArtifactRepository> remoteRepositories )
// throws ArtifactMetadataRetrievalException
// {
//
// List<Repository> repos =
// MercuryAdaptor.toMercuryRepos( localRepository, remoteRepositories, _dependencyProcessor );
//
// try
// {
// List<ArtifactBasicMetadata> vl = _mercury.readVersions( repos, MercuryAdaptor.toMercuryBasicMetadata( artifact ) );
//
// if( Util.isEmpty( vl ) )
// return null;
//
// List<ArtifactVersion> res = new ArrayList<ArtifactVersion>( vl.size() );
//
// for( ArtifactBasicMetadata bmd : vl )
// res.add( new DefaultArtifactVersion(bmd.getVersion()) );
//
// return res;
// }
// catch ( RepositoryException e )
// {
// throw new ArtifactMetadataRetrievalException(e);
// }
// }
public MetadataResolutionResult resolveMetadata( MetadataResolutionRequest request )
{
if ( request == null )
throw new IllegalArgumentException( LANG.getMessage( "null.request" ) );
if ( request.getArtifactMetadata() == null )
throw new IllegalArgumentException( LANG.getMessage( "null.request.artifact" ) );
List<Repository> repos =
MercuryAdaptor.toMercuryRepos( request.getLocalRepository()
, request.getRemoteRepostories()
, _dependencyProcessor
);
MetadataResolutionResult res = new MetadataResolutionResult();
ArtifactMetadata md = MercuryAdaptor.toMercuryArtifactMetadata( request.getArtifactMetadata() );
try
{
MetadataTreeNode root = _mercury.resolveAsTree( repos, ArtifactScopeEnum.valueOf( request.getScope() ), new ArtifactQueryList(md), null, null );
if( root != null )
{
MetadataGraph resTree = MercuryAdaptor.resolvedTreeToGraph( root );
res.setResolvedTree( resTree );
}
}
catch ( RepositoryException e )
{
res.addError( e );
}
return res;
}
}

View File

@ -1,21 +0,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.
#
null.request=null request - too bad
null.request.artifact=null artifact in the request - too bad

View File

@ -1,197 +0,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.
*/
package org.apache.maven.repository.mercury;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
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.mercury.util.FileUtil;
import org.apache.maven.repository.RepositorySystem;
import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
import org.codehaus.plexus.util.FileUtils;
import org.sonatype.plexus.webcontainer.ServletContainer;
/**
*
*
* @author Oleg Gusakov
* @version $Id$
*
*/
public abstract class AbstractMavenRepositorySystemTest
extends PlexusTestCase
{
File _localBase;
protected ArtifactRepository _localRepo;
File _remoteBase;
protected List<ArtifactRepository> _remoteRepos;
String _port = "32825"; // from src/test/plexus/webdav.xml
ArtifactFactory _artifactFactory;
protected RepositorySystem _mrs;
protected Startable _server;
@Override
protected void setUp()
throws Exception
{
super.setUp();
_remoteBase = new File("./target/remote-repo");
FileUtil.delete( _remoteBase );
FileUtil.unZip( getClassLoader().getResourceAsStream( "remoteRepo.jar" ), new File("target") );
assertTrue( _remoteBase.exists() );
// context comes from src/test/plexus/webdav.xml
ArtifactRepository remoteRepo = new DefaultArtifactRepository("remote", "http://localhost:"+_port+"/webdav", new DefaultRepositoryLayout() );
_remoteRepos = new ArrayList<ArtifactRepository>(1);
_remoteRepos.add( remoteRepo );
_localBase = new File("./target/local-repo");
FileUtil.delete( _localBase );
_localBase.mkdirs();
_localRepo = new DefaultArtifactRepository("local", _localBase.getCanonicalPath(), new DefaultRepositoryLayout() );
_artifactFactory = getContainer().lookup( ArtifactFactory.class );
_server = (Startable) getContainer().lookup( ServletContainer.class );
_server.start();
}
@Override
protected void tearDown()
throws Exception
{
super.tearDown();
if( _server != null )
_server.stop();
_server = null;
}
protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration )
{
URL url = getClassLoader().getResource( "webdav.xml" );
containerConfiguration.setContainerConfigurationURL( url );
}
private boolean checkExists( Collection<Artifact> arts, String name )
{
StringTokenizer st = new StringTokenizer( name, ":" );
String groupId = st.nextToken();
String artifactId = st.nextToken();
String version = st.nextToken();
for( Artifact a : arts )
if( groupId.equals( a.getGroupId() )
&& artifactId.equals( a.getArtifactId() )
&& version.equals( a.getVersion() )
)
return true;
return false;
}
public void testRetrieve() throws IOException
{
Artifact artifact = _artifactFactory.createArtifact( "asm", "asm-xml", "3.0", "compile", "jar" );
ArtifactResolutionRequest request = new ArtifactResolutionRequest();
request.setLocalRepository( _localRepo );
request.setRemoteRepostories( _remoteRepos );
request.setArtifact( artifact );
request.setResolveRoot( true );
ArtifactResolutionResult res = _mrs.resolve( request );
assertNotNull( res );
Set<Artifact> as = res.getArtifacts();
assertNotNull( as );
assertEquals( 4, as.size() );
assertTrue( checkExists( as, "asm:asm-xml:3.0" ) );
assertTrue( checkExists( as, "asm:asm-util:3.0" ) );
assertTrue( checkExists( as, "asm:asm-tree:3.0" ) );
assertTrue( checkExists( as, "asm:asm:3.0" ) );
assertFalse( checkExists( as, "asm:asm-parent:3.0" ) );
for( Artifact a : as )
{
assertTrue( a.getFile().exists() );
System.out.println( a.getFile().getCanonicalPath()+ " : "+ a.getFile().length()+" bytes");
}
}
// public void testRetrieveVersions() throws Exception
// {
// Artifact artifact = _artifactFactory.createArtifact( "asm", "asm", "[3.0,3.2)", "compile", "jar" );
//
// List<ArtifactVersion> res = _mrs.retrieveAvailableVersions( artifact, _localRepo, _remoteRepos );
//
// assertNotNull( res );
//
// assertEquals( 2, res.size() );
//
// assertTrue( res.contains( new DefaultArtifactVersion("3.0") ) );
//
// assertTrue( res.contains( new DefaultArtifactVersion("3.1") ) );
//
// }
}

View File

@ -1,100 +0,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.
*/
package org.apache.maven.repository.mercury;
<<<<<<< .working
=======
import java.io.IOException;
import java.util.Collection;
import java.util.Set;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.mercury.artifact.ArtifactMetadata;
import org.apache.maven.repository.AbstractMavenRepositorySystemTest;
>>>>>>> .merge-right.r767358
import org.apache.maven.repository.MavenArtifactMetadata;
import org.apache.maven.repository.MetadataGraph;
import org.apache.maven.repository.MetadataGraphNode;
import org.apache.maven.repository.MetadataResolutionRequest;
import org.apache.maven.repository.MetadataResolutionResult;
import org.apache.maven.repository.RepositorySystem;
/**
*
*
* @author Oleg Gusakov
* @version $Id$
*
*/
public class MercuryRepositorySystemTest
extends AbstractMavenRepositorySystemTest
{
protected void setUp()
throws Exception
{
super.setUp();
_mrs = getContainer().lookup( RepositorySystem.class, "mercury" );
}
public void testResolveTree()
throws IOException
{
MavenArtifactMetadata mad = MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-xml:3.0" ) );
MetadataResolutionRequest request = new MetadataResolutionRequest()
.setLocalRepository( _localRepo )
.setRemoteRepostories( _remoteRepos )
.setArtifactMetadata( mad )
.setAsResolvedTree( true )
.setScope( "compile" )
;
MetadataResolutionResult res = _mrs.resolveMetadata( request );
assertNotNull( res );
MetadataGraph resGraph = res.getResolvedTree();
assertNotNull( resGraph );
Collection<MetadataGraphNode> nodes = resGraph.getNodes();
assertNotNull( nodes );
assertEquals( 4, nodes.size() );
assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-xml:3.0" ) ) ) ) );
assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-util:3.0" ) ) ) ) );
assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-tree:3.0" ) ) ) ) );
assertTrue( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm:3.0" ) ) ) ) );
assertFalse( nodes.contains( new MetadataGraphNode( MercuryAdaptor.toMavenArtifactMetadata( new ArtifactMetadata( "asm:asm-parent:3.0" ) ) ) ) );
}
}

View File

@ -69,7 +69,7 @@
<version>1.0.0</version>
<packageWithVersion>false</packageWithVersion>
<models>
<model>src/main/mdo/toolchains.xml</model>
<model>src/main/mdo/toolchains.mdo</model>
</models>
</configuration>
</plugin>

View File

@ -23,7 +23,7 @@
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>maven-toolchains</id>
<id>toolchains</id>
<name>MavenToolchains</name>
<description><![CDATA[
@ -38,7 +38,7 @@
<class rootElement="true" xml.tagName="toolchains" xsd.compositor="sequence">
<name>PersistedToolchains</name>
<description><![CDATA[
The <code>&lt;project&gt;</code> element is the root of the descriptor.
The <code>&lt;toolchains&gt;</code> element is the root of the descriptor.
The following table lists all of the possible child elements.
]]></description>
<version>1.0.0+</version>

View File

@ -0,0 +1,17 @@
-----
Maven Toolchains
-----
Hervé Boutemy
-----
2009-04-26
-----
Maven Toolchains
This is strictly the model for Maven Toolchains, so really just plain objects.
The following are generated from this model:
* {{{apidocs/index.html}Java sources}} with Reader for the Xpp3 XML parser, to read <<<toolchains.xml>>> file
* A {{{toolchains.html}Descriptor Reference}}

73
pom.xml
View File

@ -157,7 +157,6 @@ under the License.
<module>maven-plugin-api</module>
<module>maven-project</module>
<module>maven-model-builder</module>
<module>maven-mercury</module>
<module>maven-embedder</module>
<module>maven-toolchain</module>
<module>maven-compat</module>
@ -186,11 +185,6 @@ under the License.
<dependencies>
<!-- Maven Modules -->
<!--bootstrap-start-comment-->
<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>
@ -373,78 +367,11 @@ under the License.
<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>