make things more friendly to non-standard settings and local-repo locations.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@612658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-01-17 00:37:19 +00:00
parent c1b1ff061e
commit e5c11f67c1
10 changed files with 38 additions and 30 deletions

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportAggregatedMojoFailureException-maven-plugin</artifactId> <artifactId>testReportAggregatedMojoFailureException-maven-plugin</artifactId>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportAttemptToOverrideUneditableMojoParameter-maven-plugin</artifactId> <artifactId>testReportAttemptToOverrideUneditableMojoParameter-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>test-maven-ext-plugin</artifactId> <artifactId>test-maven-ext-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportErrorFormulatingBuildPlan-maven-plugin</artifactId> <artifactId>testReportErrorFormulatingBuildPlan-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,21 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId> <artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId>
<packaging>maven-plugin</packaging> <packaging>maven-plugin</packaging>
<version>1</version> <version>1</version>
<!-- <!--
<prerequisites> <prerequisites>
<maven>10</maven> <maven>10</maven>
</prerequisites> </prerequisites>
--> -->
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,21 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId> <artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId>
<packaging>maven-plugin</packaging> <packaging>maven-plugin</packaging>
<version>1</version> <version>1</version>
<!-- <!--
<prerequisites> <prerequisites>
<maven>10</maven> <maven>10</maven>
</prerequisites> </prerequisites>
--> -->
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,21 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId> <artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId>
<packaging>maven-plugin</packaging> <packaging>maven-plugin</packaging>
<version>1</version> <version>1</version>
<!-- <!--
<prerequisites> <prerequisites>
<maven>10</maven> <maven>10</maven>
</prerequisites> </prerequisites>
--> -->
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportMissingRequiredMojoParameter-maven-plugin</artifactId> <artifactId>testReportMissingRequiredMojoParameter-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project> <?xml version='1.0' encoding='UTF-8'?>
<project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.errortest</groupId> <groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportMojoExecutionException-maven-plugin</artifactId> <artifactId>testReportMojoExecutionException-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version> <version>2.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -22,6 +22,8 @@ package org.apache.maven.profiles.activation;
import org.apache.maven.model.Activation; import org.apache.maven.model.Activation;
import org.apache.maven.model.Profile; import org.apache.maven.model.Profile;
import java.io.File;
import java.io.IOException;
import java.util.Properties; import java.util.Properties;
import junit.framework.TestCase; import junit.framework.TestCase;
@ -38,21 +40,15 @@ public class FileProfileActivatorTest
private FileProfileActivator activator = new FileProfileActivator(); private FileProfileActivator activator = new FileProfileActivator();
public void testFileActivationProfile() public void testFileActivationProfile()
throws ProfileActivationException throws ProfileActivationException, IOException
{ {
org.apache.maven.model.ActivationFile activationFile = new org.apache.maven.model.ActivationFile(); org.apache.maven.model.ActivationFile activationFile = new org.apache.maven.model.ActivationFile();
// make an educated guess at the repository location... File tempFile = File.createTempFile( "FileProfileActivatorTest.", ".txt" );
String repoLocation = System.getProperty( "maven.repo.local", "${user.home}/.m2/repository" ); tempFile.deleteOnExit();
repoLocation = repoLocation.replace( '\\', '/' );
if ( repoLocation.endsWith( "/" ) )
{
repoLocation = repoLocation.substring( 0, repoLocation.length() - 1 );
}
// Assume that junit exists // Assume that junit exists
activationFile.setExists( repoLocation + "/junit/junit/3.8.1/junit-3.8.1.jar" ); activationFile.setExists( tempFile.getAbsolutePath() );
Activation fileActivation = new Activation(); Activation fileActivation = new Activation();
fileActivation.setFile( activationFile ); fileActivation.setFile( activationFile );