mirror of https://github.com/apache/maven.git
Test for setting profile properties.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@760229 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a31c1a381
commit
5233029d4e
|
@ -3,6 +3,7 @@ package org.apache.maven.settings;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
|
||||
|
@ -39,10 +40,10 @@ public class PomConstructionWithSettingsTest
|
|||
mavenProjectBuilder = (DefaultMavenProjectBuilder) lookup( MavenProjectBuilder.class );
|
||||
}
|
||||
|
||||
public void testA() throws Exception
|
||||
public void testSettingsNoPom() throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "settings-no-pom" );
|
||||
System.out.println(pom.getDomainModel().asString());
|
||||
assertEquals( "local-profile-prop-value", pom.getValue( "properties/local-profile-prop" ) );
|
||||
}
|
||||
|
||||
private PomTestWrapper buildPom( String pomPath )
|
||||
|
@ -63,6 +64,16 @@ public class PomConstructionWithSettingsTest
|
|||
profileManager.addProfile( profile );
|
||||
}
|
||||
|
||||
List<String> settingsActiveProfileIds = settings.getActiveProfiles();
|
||||
|
||||
if ( settingsActiveProfileIds != null )
|
||||
{
|
||||
for ( String profileId : settingsActiveProfileIds )
|
||||
{
|
||||
profileManager.getProfileActivationContext().setActive( profileId );
|
||||
}
|
||||
}
|
||||
|
||||
ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
|
||||
config.setLocalRepository(new DefaultArtifactRepository("default", "", new DefaultRepositoryLayout()));
|
||||
|
||||
|
|
Loading…
Reference in New Issue