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>
<groupId>org.apache.maven.errortest</groupId>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportAttemptToOverrideUneditableMojoParameter-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>test-maven-ext-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportErrorFormulatingBuildPlan-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1</version>
<!--
<!--
<prerequisites>
<maven>10</maven>
</prerequisites>
-->
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1</version>
<!--
<!--
<prerequisites>
<maven>10</maven>
</prerequisites>
-->
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportIncompatibleMavenVersionForExtensionPlugin-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1</version>
<!--
<!--
<prerequisites>
<maven>10</maven>
</prerequisites>
-->
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportMissingRequiredMojoParameter-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<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>
<groupId>org.apache.maven.errortest</groupId>
<artifactId>testReportMojoExecutionException-maven-plugin</artifactId>
@ -8,7 +9,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.0</version>
</dependency>
</dependencies>
<build>

View File

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