merge 399346:399356 from branch

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@399359 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2006-05-03 17:16:49 +00:00
parent d9829a2585
commit cbc5035902
10 changed files with 280 additions and 0 deletions

View File

@ -0,0 +1,113 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it2002</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>subproject</module>
<module>subproject2</module>
</modules>
<dependencies>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-6</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots</id>
<url>http://snapshots.maven.codehaus.org/maven2</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>test</id>
<url>file:../target/test-repo</url>
</repository>
<snapshotRepository>
<id>test-snaps</id>
<url>file:../target/test-repo</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:cvs:ext:${user.name}@localhost:${project.file.parentFile.parentFile}/target/cvsroot:project</connection>
<tag>p1</tag>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/conf</directory>
</resource>
</resources>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.0-beta-1</version>
</plugin>
</plugins>
</reporting>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-beta-1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
<version>2.0-beta-1</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>env-test</id>
<activation>
<property>
<name>env</name>
<value>test</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</dependency>
</dependencies>
<properties>
<testName>testValue</testName>
</properties>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,17 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.it2002</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>project-sub1</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,9 @@
package org.apache.maven.it2002;
public class Thing
{
public static final String ROLE = Thing.class.getName();
private String type;
}

View File

@ -0,0 +1,8 @@
<component-set>
<components>
<component>
<role>org.apache.maven.it2002.Thing</role>
<implementation>org.apache.maven.it2002.Thing</implementation>
</component>
</components>
</component-set>

View File

@ -0,0 +1,20 @@
package org.apache.maven.it2002;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.codehaus.plexus.PlexusTestCase;
public class ContainerDependentTest extends PlexusTestCase
{
public void testOne() throws Exception
{
ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE );
assertNotNull( resolver );
Thing thing = (Thing) lookup( Thing.ROLE );
assertNotNull( thing );
}
}

View File

@ -0,0 +1,29 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.it2002</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>project-sub2</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven.it2002</groupId>
<artifactId>project-sub1</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,9 @@
package org.apache.maven.it2002;
public class Thing
{
public static final String ROLE = Thing.class.getName();
private String type;
}

View File

@ -0,0 +1,8 @@
<component-set>
<components>
<component>
<role>org.apache.maven.it2002.Thing</role>
<implementation>org.apache.maven.it2002.Thing</implementation>
</component>
</components>
</component-set>

View File

@ -0,0 +1,20 @@
package org.apache.maven.it2002;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.codehaus.plexus.PlexusTestCase;
public class ContainerDependentTest extends PlexusTestCase
{
public void testOne() throws Exception
{
ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE );
assertNotNull( resolver );
Thing thing = (Thing) lookup( Thing.ROLE );
assertNotNull( thing );
}
}

View File

@ -0,0 +1,47 @@
#!/bin/bash
rm -Rf target
mkdir target
dir=`readlink -f ${PWD}`
if [ "$1" == "windows" ]; then
dir=`cygpath -m $dir`
echo setting dir to $dir
fi
export CVSROOT=:ext:localhost:$dir/target/cvsroot
cvs init
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
cd cvs-project
cvs import -I '.svn' -m "import." project ASF INIT
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
cd ..
cd target
cvs co -d project.checkout project
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
(
cd project.checkout
cat pom.xml | sed "s#\${project.file.parentFile.parentFile}#$dir#g" >tmp
mv tmp pom.xml
cvs ci -m 'update scm' pom.xml
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
rm -Rf target
mvn clean install
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
mvn -DgenerateReleasePoms=true -e release:prepare -Denv=test -B -Dtag=test-tag
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
mvn -DreleasePom=release-pom.xml -e release:perform -Denv=test
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
)