mirror of https://github.com/apache/maven.git
o Completed manual wiring
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@965431 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
85ef559859
commit
ce6ae6e8cf
|
@ -109,7 +109,7 @@ public class DefaultModelBuilderFactory
|
|||
protected ProfileActivator[] newProfileActivators()
|
||||
{
|
||||
return new ProfileActivator[] { new JdkVersionProfileActivator(), new OperatingSystemProfileActivator(),
|
||||
new PropertyProfileActivator(), new FileProfileActivator() };
|
||||
new PropertyProfileActivator(), new FileProfileActivator().setPathTranslator( newPathTranslator() ) };
|
||||
}
|
||||
|
||||
protected UrlNormalizer newUrlNormalizer()
|
||||
|
|
|
@ -48,6 +48,12 @@ public class FileProfileActivator
|
|||
@Requirement
|
||||
private PathTranslator pathTranslator;
|
||||
|
||||
public FileProfileActivator setPathTranslator( PathTranslator pathTranslator )
|
||||
{
|
||||
this.pathTranslator = pathTranslator;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
|
||||
{
|
||||
Activation activation = profile.getActivation();
|
||||
|
|
|
@ -48,6 +48,7 @@ public class DefaultModelBuilderFactoryTest
|
|||
ModelBuildingResult result = builder.build( request );
|
||||
assertNotNull( result );
|
||||
assertNotNull( result.getEffectiveModel() );
|
||||
assertEquals( "activated", result.getEffectiveModel().getProperties().get( "profile.file" ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ under the License.
|
|||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>test</id>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
|
@ -66,5 +66,16 @@ under the License.
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>file</id>
|
||||
<activation>
|
||||
<file>
|
||||
<exists>simple.xml</exists>
|
||||
</file>
|
||||
</activation>
|
||||
<properties>
|
||||
<profile.file>activated</profile.file>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
Loading…
Reference in New Issue