mirror of https://github.com/apache/maven.git
o Added <properties/> for profiles configured in the pom.xml
o Split ModelNormalizationUtils into two utility classes in the maven-profile and maven-settings projects, to be used for converting Profile instances from the settings.xml and profiles.xml into maven-model instances. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@190344 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d2e1f3c975
commit
1fc7419f03
|
@ -226,7 +226,7 @@
|
|||
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivationCalculator</role>
|
||||
<role>org.apache.maven.profiless.activation.ProfileActivationCalculator</role>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
@ -236,8 +236,8 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivationCalculator</role>
|
||||
<implementation>org.apache.maven.profile.activation.ProfileActivationCalculator</implementation>
|
||||
<role>org.apache.maven.profiless.activation.ProfileActivationCalculator</role>
|
||||
<implementation>org.apache.maven.profiless.activation.ProfileActivationCalculator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -245,9 +245,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiless.activation.ProfileActivator</role>
|
||||
<role-hint>always-on</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.AlwaysOnProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiless.activation.AlwaysOnProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -255,9 +255,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiless.activation.ProfileActivator</role>
|
||||
<role-hint>jdk-prefix</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.JdkPrefixProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiless.activation.JdkPrefixProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -265,9 +265,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiless.activation.ProfileActivator</role>
|
||||
<role-hint>system-property</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.SystemPropertyProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiless.activation.SystemPropertyProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -275,9 +275,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiless.activation.ProfileActivator</role>
|
||||
<role-hint>explicit-listing</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.ExplicitListingProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiless.activation.ExplicitListingProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
|
|
@ -24,13 +24,13 @@ import org.apache.maven.execution.MavenExecutionResponse;
|
|||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.lifecycle.LifecycleExecutionException;
|
||||
import org.apache.maven.lifecycle.LifecycleExecutor;
|
||||
import org.apache.maven.model.ModelNormalizationUtils;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.monitor.event.EventDispatcher;
|
||||
import org.apache.maven.monitor.event.MavenEvents;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.profile.AlwaysOnActivation;
|
||||
import org.apache.maven.profiles.AlwaysOnActivation;
|
||||
import org.apache.maven.profiles.MavenProfilesBuilder;
|
||||
import org.apache.maven.profiles.ProfilesConversionUtils;
|
||||
import org.apache.maven.profiles.ProfilesRoot;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.MavenProjectBuilder;
|
||||
|
@ -41,6 +41,7 @@ import org.apache.maven.settings.Mirror;
|
|||
import org.apache.maven.settings.Proxy;
|
||||
import org.apache.maven.settings.Server;
|
||||
import org.apache.maven.settings.Settings;
|
||||
import org.apache.maven.settings.SettingsConversionUtils;
|
||||
import org.apache.maven.usability.ErrorDiagnoser;
|
||||
import org.codehaus.plexus.PlexusConstants;
|
||||
import org.codehaus.plexus.PlexusContainer;
|
||||
|
@ -335,7 +336,7 @@ public class DefaultMaven
|
|||
{
|
||||
org.apache.maven.settings.Profile rawProfile = (org.apache.maven.settings.Profile) it.next();
|
||||
|
||||
Profile profile = ModelNormalizationUtils.convertFromSettingsProfile( rawProfile );
|
||||
Profile profile = SettingsConversionUtils.convertFromSettingsProfile( rawProfile );
|
||||
|
||||
if( settingsActiveProfileIds.contains( rawProfile.getId() ) )
|
||||
{
|
||||
|
@ -358,7 +359,7 @@ public class DefaultMaven
|
|||
{
|
||||
org.apache.maven.profiles.Profile rawProfile = (org.apache.maven.profiles.Profile) it.next();
|
||||
|
||||
externalProfiles.add( ModelNormalizationUtils.convertFromProfileXmlProfile( rawProfile ) );
|
||||
externalProfiles.add( ProfilesConversionUtils.convertFromProfileXmlProfile( rawProfile ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.apache.maven.monitor.event.DefaultEventDispatcher;
|
|||
import org.apache.maven.monitor.event.DefaultEventMonitor;
|
||||
import org.apache.maven.monitor.event.EventDispatcher;
|
||||
import org.apache.maven.plugin.Mojo;
|
||||
import org.apache.maven.profile.activation.ProfileActivationUtils;
|
||||
import org.apache.maven.profiles.activation.ProfileActivationUtils;
|
||||
import org.apache.maven.reactor.ReactorException;
|
||||
import org.apache.maven.settings.MavenSettingsBuilder;
|
||||
import org.apache.maven.settings.Settings;
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* @author jdcasey
|
||||
* @version $Id$
|
||||
* @version $Id: DefaultMavenSettingsBuilder.java 189510 2005-06-08 03:27:43Z jdcasey $
|
||||
*/
|
||||
public class DefaultMavenSettingsBuilder
|
||||
extends AbstractLogEnabled
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* @author jdcasey
|
||||
* @version $Id$
|
||||
* @version $Id: MavenSettingsBuilder.java 189510 2005-06-08 03:27:43Z jdcasey $
|
||||
*/
|
||||
public interface MavenSettingsBuilder
|
||||
{
|
||||
|
|
|
@ -2362,6 +2362,18 @@
|
|||
<type>BuildBase</type>
|
||||
</association>
|
||||
</field>
|
||||
<field>
|
||||
<name>properties</name>
|
||||
<version>4.0.0</version>
|
||||
<description><![CDATA[
|
||||
Properties used to fill in plugin configuration when this profile is active
|
||||
]]></description>
|
||||
<type>Properties</type>
|
||||
<association xml.mapStyle="inline">
|
||||
<type>String</type>
|
||||
<multiplicity>*</multiplicity>
|
||||
</association>
|
||||
</field>
|
||||
</fields>
|
||||
<codeSegments>
|
||||
<codeSegment>
|
||||
|
@ -2370,7 +2382,6 @@
|
|||
// We don't want this to be parseable...it's sort of 'hidden'
|
||||
// default source for this profile is in the pom itself.
|
||||
private String source = "pom";
|
||||
private Properties properties = new Properties();
|
||||
|
||||
public void setSource( String source )
|
||||
{
|
||||
|
@ -2386,16 +2397,6 @@
|
|||
{
|
||||
return "Profile {id: " + getId() + ", source: " + getSource() + "}";
|
||||
}
|
||||
|
||||
public void setProperties( Properties properties )
|
||||
{
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public Properties getProperties()
|
||||
{
|
||||
return properties;
|
||||
}
|
||||
]]></code>
|
||||
</codeSegment>
|
||||
</codeSegments>
|
||||
|
|
|
@ -8,11 +8,26 @@
|
|||
<artifactId>maven-profile</artifactId>
|
||||
<name>Maven Profile Model</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-container-default</artifactId>
|
||||
<version>1.0-alpha-4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
package org.apache.maven.profiles;
|
||||
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.ActivationProperty;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.model.Repository;
|
||||
import org.apache.maven.profiles.AlwaysOnActivation;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
public class ProfilesConversionUtils
|
||||
{
|
||||
|
||||
private ProfilesConversionUtils()
|
||||
{
|
||||
}
|
||||
|
||||
public static Profile convertFromProfileXmlProfile( org.apache.maven.profiles.Profile profileXmlProfile )
|
||||
{
|
||||
Profile profile = new Profile();
|
||||
|
||||
profile.setId( profileXmlProfile.getId() );
|
||||
|
||||
profile.setSource( "profiles.xml" );
|
||||
|
||||
org.apache.maven.profiles.Activation profileActivation = profileXmlProfile.getActivation();
|
||||
|
||||
if ( profileActivation != null )
|
||||
{
|
||||
Activation activation = new Activation();
|
||||
|
||||
activation.setJdk( profileActivation.getJdk() );
|
||||
|
||||
org.apache.maven.profiles.ActivationProperty profileProp = profileActivation.getProperty();
|
||||
|
||||
if ( profileProp != null )
|
||||
{
|
||||
ActivationProperty prop = new ActivationProperty();
|
||||
|
||||
prop.setName( profileProp.getName() );
|
||||
prop.setValue( profileProp.getValue() );
|
||||
|
||||
activation.setProperty( prop );
|
||||
}
|
||||
|
||||
profile.setActivation( activation );
|
||||
}
|
||||
else
|
||||
{
|
||||
profile.setActivation( new AlwaysOnActivation() );
|
||||
}
|
||||
|
||||
profile.setProperties( profileXmlProfile.getProperties() );
|
||||
|
||||
List repos = profileXmlProfile.getRepositories();
|
||||
if ( repos != null )
|
||||
{
|
||||
for ( Iterator it = repos.iterator(); it.hasNext(); )
|
||||
{
|
||||
profile
|
||||
.addRepository( convertFromProfileXmlRepository( (org.apache.maven.profiles.Repository) it.next() ) );
|
||||
}
|
||||
}
|
||||
|
||||
List pluginRepos = profileXmlProfile.getPluginRepositories();
|
||||
if ( pluginRepos != null )
|
||||
{
|
||||
for ( Iterator it = pluginRepos.iterator(); it.hasNext(); )
|
||||
{
|
||||
profile.addPluginRepository( convertFromProfileXmlRepository( (org.apache.maven.profiles.Repository) it
|
||||
.next() ) );
|
||||
}
|
||||
}
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
private static Repository convertFromProfileXmlRepository( org.apache.maven.profiles.Repository profileXmlRepo )
|
||||
{
|
||||
Repository repo = new Repository();
|
||||
|
||||
repo.setId( profileXmlRepo.getId() );
|
||||
repo.setLayout( profileXmlRepo.getLayout() );
|
||||
repo.setName( profileXmlRepo.getName() );
|
||||
repo.setSnapshotPolicy( profileXmlRepo.getSnapshotPolicy() );
|
||||
repo.setUrl( profileXmlRepo.getUrl() );
|
||||
|
||||
return repo;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile;
|
||||
package org.apache.maven.profiles;
|
||||
|
||||
import org.apache.maven.model.Activation;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.profile.AlwaysOnActivation;
|
||||
import org.apache.maven.profiles.AlwaysOnActivation;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2005 The Apache Software Foundation.
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.apache.maven.model.Profile;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.apache.maven.model.Profile;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.Profile;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.Profile;
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.apache.maven.model.Profile;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.profile.activation;
|
||||
package org.apache.maven.profiles.activation;
|
||||
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.ActivationProperty;
|
|
@ -33,7 +33,7 @@ import org.apache.maven.model.Plugin;
|
|||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.model.Repository;
|
||||
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
|
||||
import org.apache.maven.profile.activation.ProfileActivationCalculator;
|
||||
import org.apache.maven.profiles.activation.ProfileActivationCalculator;
|
||||
import org.apache.maven.project.artifact.MavenMetadataSource;
|
||||
import org.apache.maven.project.inheritance.ModelInheritanceAssembler;
|
||||
import org.apache.maven.project.injection.ModelDefaultsInjector;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
|
||||
</requirement>
|
||||
<requirement>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivationCalculator</role>
|
||||
<role>org.apache.maven.profiles.activation.ProfileActivationCalculator</role>
|
||||
</requirement>
|
||||
</requirements>
|
||||
</component>
|
||||
|
@ -62,8 +62,8 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivationCalculator</role>
|
||||
<implementation>org.apache.maven.profile.activation.ProfileActivationCalculator</implementation>
|
||||
<role>org.apache.maven.profiles.activation.ProfileActivationCalculator</role>
|
||||
<implementation>org.apache.maven.profiles.activation.ProfileActivationCalculator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -71,9 +71,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiles.activation.ProfileActivator</role>
|
||||
<role-hint>always-on</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.AlwaysOnProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiles.activation.AlwaysOnProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -81,9 +81,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiles.activation.ProfileActivator</role>
|
||||
<role-hint>jdk-prefix</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.JdkPrefixProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiles.activation.JdkPrefixProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -91,9 +91,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiles.activation.ProfileActivator</role>
|
||||
<role-hint>system-property</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.SystemPropertyProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiles.activation.SystemPropertyProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
@ -101,9 +101,9 @@
|
|||
|
|
||||
-->
|
||||
<component>
|
||||
<role>org.apache.maven.profile.activation.ProfileActivator</role>
|
||||
<role>org.apache.maven.profiles.activation.ProfileActivator</role>
|
||||
<role-hint>explicit-listing</role-hint>
|
||||
<implementation>org.apache.maven.profile.activation.ExplicitListingProfileActivator</implementation>
|
||||
<implementation>org.apache.maven.profiles.activation.ExplicitListingProfileActivator</implementation>
|
||||
</component>
|
||||
<!--
|
||||
|
|
||||
|
|
|
@ -8,11 +8,26 @@
|
|||
<artifactId>maven-settings</artifactId>
|
||||
<name>Maven Local Settings Model</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-container-default</artifactId>
|
||||
<version>1.0-alpha-4-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>1.0-alpha-3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package org.apache.maven.model;
|
||||
package org.apache.maven.settings;
|
||||
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.model.Repository;
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.ActivationProperty;
|
||||
import org.apache.maven.profile.AlwaysOnActivation;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.apache.maven.model.Repository;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -25,13 +24,9 @@ import java.util.List;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
public final class ModelNormalizationUtils
|
||||
public final class SettingsConversionUtils
|
||||
{
|
||||
|
||||
private ModelNormalizationUtils()
|
||||
{
|
||||
}
|
||||
|
||||
public static Profile convertFromSettingsProfile( org.apache.maven.settings.Profile settingsProfile )
|
||||
{
|
||||
Profile profile = new Profile();
|
||||
|
@ -86,66 +81,6 @@ public final class ModelNormalizationUtils
|
|||
return profile;
|
||||
}
|
||||
|
||||
public static Profile convertFromProfileXmlProfile( org.apache.maven.profiles.Profile profileXmlProfile )
|
||||
{
|
||||
Profile profile = new Profile();
|
||||
|
||||
profile.setId( profileXmlProfile.getId() );
|
||||
|
||||
profile.setSource( "profiles.xml" );
|
||||
|
||||
org.apache.maven.profiles.Activation profileActivation = profileXmlProfile.getActivation();
|
||||
|
||||
if ( profileActivation != null )
|
||||
{
|
||||
Activation activation = new Activation();
|
||||
|
||||
activation.setJdk( profileActivation.getJdk() );
|
||||
|
||||
org.apache.maven.profiles.ActivationProperty profileProp = profileActivation.getProperty();
|
||||
|
||||
if ( profileProp != null )
|
||||
{
|
||||
ActivationProperty prop = new ActivationProperty();
|
||||
|
||||
prop.setName( profileProp.getName() );
|
||||
prop.setValue( profileProp.getValue() );
|
||||
|
||||
activation.setProperty( prop );
|
||||
}
|
||||
|
||||
profile.setActivation( activation );
|
||||
}
|
||||
else
|
||||
{
|
||||
profile.setActivation( new AlwaysOnActivation() );
|
||||
}
|
||||
|
||||
profile.setProperties( profileXmlProfile.getProperties() );
|
||||
|
||||
List repos = profileXmlProfile.getRepositories();
|
||||
if ( repos != null )
|
||||
{
|
||||
for ( Iterator it = repos.iterator(); it.hasNext(); )
|
||||
{
|
||||
profile
|
||||
.addRepository( convertFromSettingsRepository( (org.apache.maven.settings.Repository) it.next() ) );
|
||||
}
|
||||
}
|
||||
|
||||
List pluginRepos = profileXmlProfile.getPluginRepositories();
|
||||
if ( pluginRepos != null )
|
||||
{
|
||||
for ( Iterator it = pluginRepos.iterator(); it.hasNext(); )
|
||||
{
|
||||
profile.addPluginRepository( convertFromSettingsRepository( (org.apache.maven.settings.Repository) it
|
||||
.next() ) );
|
||||
}
|
||||
}
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
private static Repository convertFromSettingsRepository( org.apache.maven.settings.Repository settingsRepo )
|
||||
{
|
||||
Repository repo = new Repository();
|
||||
|
@ -159,17 +94,4 @@ public final class ModelNormalizationUtils
|
|||
return repo;
|
||||
}
|
||||
|
||||
private static Repository convertFromProfileXmlRepository( org.apache.maven.profiles.Repository profileXmlRepo )
|
||||
{
|
||||
Repository repo = new Repository();
|
||||
|
||||
repo.setId( profileXmlRepo.getId() );
|
||||
repo.setLayout( profileXmlRepo.getLayout() );
|
||||
repo.setName( profileXmlRepo.getName() );
|
||||
repo.setSnapshotPolicy( profileXmlRepo.getSnapshotPolicy() );
|
||||
repo.setUrl( profileXmlRepo.getUrl() );
|
||||
|
||||
return repo;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue