本文整理了Java中org.apache.maven.model.Profile.getProperties()
方法的一些代码示例,展示了Profile.getProperties()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile.getProperties()
方法的具体详情如下:
包路径:org.apache.maven.model.Profile
类名称:Profile
方法名:getProperties
暂无
代码示例来源:origin: org.apache.maven/maven-project
public void inject( Profile profile, Model model )
{
model.setDependencies( injectDependencies( profile.getDependencies(), model.getDependencies() ) );
injectModules( profile, model );
model.setRepositories( ModelUtils.mergeRepositoryLists( profile.getRepositories(), model.getRepositories() ) );
model.setPluginRepositories( ModelUtils.mergeRepositoryLists( profile.getPluginRepositories(), model
.getPluginRepositories() ) );
injectReporting( profile, model );
injectDependencyManagement( profile, model );
injectDistributionManagement( profile, model );
injectBuild( profile, model );
Properties props = new Properties();
props.putAll( model.getProperties() );
props.putAll( profile.getProperties() );
model.setProperties( props );
}
代码示例来源:origin: apache/maven
if ( ( profile.getProperties() != null ) && ( profile.getProperties().size() > 0 ) )
for ( Iterator iter = profile.getProperties().keySet().iterator(); iter.hasNext(); )
String value = (String) profile.getProperties().get( key );
serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
代码示例来源:origin: apache/maven
for ( Profile profile : activeExternalProfiles )
profileProps.putAll( profile.getProperties() );
代码示例来源:origin: apache/maven
profile.setProperties( modelProfile.getProperties() );
代码示例来源:origin: takari/polyglot-maven
if ( ( profile.getProperties() != null ) && ( profile.getProperties().size() > 0 ) )
for ( Iterator iter = profile.getProperties().keySet().iterator(); iter.hasNext(); )
String value = (String) profile.getProperties().get( key );
serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
代码示例来源:origin: takari/polyglot-maven
properties( profile.getProperties() );
代码示例来源:origin: io.teecube.t3/t3-common
private String getPropertyValueInOriginalModel(Model originalModel, String propertyName, List<org.apache.maven.model.Profile> activeProfiles) {
if (originalModel == null || propertyName == null) return null;
String result = originalModel.getProperties().getProperty(propertyName);
if (result == null && activeProfiles != null) {
for (org.apache.maven.model.Profile profile : originalModel.getProfiles()) {
if (activeProfiles.contains(profile)) {
result = profile.getProperties().getProperty(propertyName);
}
}
}
return result;
}
代码示例来源:origin: org.commonjava.maven.ext/pom-manipulation-common
private static Properties searchProfiles( MavenSessionHandler session, Project p )
{
final Properties result = new Properties();
ProfileUtils.getProfiles( session, p.getModel() ).forEach( pr -> result.putAll( pr.getProperties() ) );
return result;
}
代码示例来源:origin: cecom/pomutils
public Properties getProfileProperties(String profileId) {
if (profileId == null) {
throw new IllegalArgumentException("profileId is null");
}
for (Profile profile : getRawModel().getProfiles()) {
if (profileId.equals(profile.getId())) {
return profile.getProperties();
}
}
return new Properties();
}
代码示例来源:origin: mojohaus/flatten-maven-plugin
public void injectProfile( Model model, Profile profile, ModelBuildingRequest request,
ModelProblemCollector problems )
{
List<String> activeProfileIds = request.getActiveProfileIds();
if ( activeProfileIds.contains( profile.getId() ) )
{
Properties merged = new Properties();
merged.putAll( model.getProperties() );
merged.putAll( profile.getProperties() );
model.setProperties( merged );
}
}
};
代码示例来源:origin: org.codehaus.mojo/properties-maven-plugin
/** {@inheritDoc} */
public void execute()
throws MojoExecutionException
{
validateOutputFile();
List<?> list = getProject().getActiveProfiles();
if ( getLog().isInfoEnabled() )
{
getLog().debug( list.size() + " profile(s) active" );
}
Properties properties = new Properties();
for ( Iterator<?> iter = list.iterator(); iter.hasNext(); )
{
Profile profile = (Profile) iter.next();
if ( profile.getProperties() != null )
{
properties.putAll( profile.getProperties() );
}
}
writeProperties( properties, getOutputFile() );
}
}
代码示例来源:origin: mojohaus/properties-maven-plugin
/** {@inheritDoc} */
public void execute()
throws MojoExecutionException
{
validateOutputFile();
List<?> list = getProject().getActiveProfiles();
if ( getLog().isInfoEnabled() )
{
getLog().debug( list.size() + " profile(s) active" );
}
Properties properties = new Properties();
for ( Iterator<?> iter = list.iterator(); iter.hasNext(); )
{
Profile profile = (Profile) iter.next();
if ( profile.getProperties() != null )
{
properties.putAll( profile.getProperties() );
}
}
writeProperties( properties, getOutputFile() );
}
}
代码示例来源:origin: io.teecube.t3/t3-site-enhancer
Properties properties = profile.getProperties();
if (properties == null) {
properties = new Properties();
代码示例来源:origin: com.buschmais.jqassistant.plugin/jqassistant.plugin.maven3
/**
* Adds information about defined profile.
*
* @param pomDescriptor
* The descriptor for the current POM.
* @param model
* The Maven Model.
* @param scannerContext
* The scanner context.
*/
private void addProfiles(MavenPomDescriptor pomDescriptor, Model model, ScannerContext scannerContext) {
List<Profile> profiles = model.getProfiles();
Store store = scannerContext.getStore();
for (Profile profile : profiles) {
MavenProfileDescriptor mavenProfileDescriptor = store.create(MavenProfileDescriptor.class);
pomDescriptor.getProfiles().add(mavenProfileDescriptor);
mavenProfileDescriptor.setId(profile.getId());
addProperties(mavenProfileDescriptor, profile.getProperties(), store);
addModules(mavenProfileDescriptor, profile.getModules(), store);
addPlugins(mavenProfileDescriptor, profile.getBuild(), scannerContext);
addManagedPlugins(mavenProfileDescriptor, profile.getBuild(), scannerContext);
addManagedDependencies(mavenProfileDescriptor, profile.getDependencyManagement(), scannerContext, ProfileManagesDependencyDescriptor.class);
addProfileDependencies(mavenProfileDescriptor, profile.getDependencies(), scannerContext);
addActivation(mavenProfileDescriptor, profile.getActivation(), store);
}
}
代码示例来源:origin: org.apache.maven.plugins/maven-shade-plugin
/**
* Method updateProfile
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile( Profile value, String xmlTag, Counter counter, Element element )
{
Element root = element;
Counter innerCount = new Counter( counter.getDepth() + 1 );
findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), "default" );
// updateActivation( value.getActivation(), "activation", innerCount, root);
updateBuildBase( value.getBuild(), "build", innerCount, root );
findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" );
iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" );
iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" );
iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" );
findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() );
updateReporting( value.getReporting(), "reporting", innerCount, root );
updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root );
updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root );
findAndReplaceProperties( innerCount, root, "properties", value.getProperties() );
} // -- void updateProfile(Profile, String, Counter, Element)
代码示例来源:origin: org.apache.felix/maven-bundle-plugin
/**
* Method updateProfile
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile( Profile value, String xmlTag, Counter counter, Element element )
{
Element root = element;
Counter innerCount = new Counter( counter.getDepth() + 1 );
findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), "default" );
// updateActivation( value.getActivation(), "activation", innerCount, root);
updateBuildBase( value.getBuild(), "build", innerCount, root );
findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" );
iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" );
iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" );
iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" );
findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() );
updateReporting( value.getReporting(), "reporting", innerCount, root );
updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root );
updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root );
findAndReplaceProperties( innerCount, root, "properties", value.getProperties() );
} // -- void updateProfile(Profile, String, Counter, Element)
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-maven-embedder
/**
* Method updateProfile.
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
{
Element root = element;
Counter innerCount = new Counter(counter.getDepth() + 1);
findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
updateActivation( value.getActivation(), "activation", innerCount, root);
updateBuildBase( value.getBuild(), "build", innerCount, root);
findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module");
iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository");
iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository");
iterateDependency(innerCount, root, value.getDependencies(),"dependencies","dependency");
findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom)value.getReports());
updateReporting( value.getReporting(), "reporting", innerCount, root);
updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root);
updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root);
findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
} //-- void updateProfile(Profile, String, Counter, Element)
代码示例来源:origin: org.jboss.forge.addon/maven-impl
/**
* Method updateProfile.
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
{
Element root = element;
Counter innerCount = new Counter(counter.getDepth() + 1);
findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
updateActivation(value.getActivation(), "activation", innerCount, root);
updateBuildBase(value.getBuild(), "build", innerCount, root);
findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module");
iterateRepository(innerCount, root, value.getRepositories(), "repositories", "repository");
iterateRepository(innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository");
iterateDependency(innerCount, root, value.getDependencies(), "dependencies", "dependency");
findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom) value.getReports());
updateReporting(value.getReporting(), "reporting", innerCount, root);
updateDependencyManagement(value.getDependencyManagement(), "dependencyManagement", innerCount, root);
updateDistributionManagement(value.getDistributionManagement(), "distributionManagement", innerCount, root);
findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
} // -- void updateProfile(Profile, String, Counter, Element)
代码示例来源:origin: org.codehaus.mevenide/nb-mvn-embedder
/**
* Method updateProfile
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
{
Element root = element;
Counter innerCount = new Counter(counter.getDepth() + 1);
findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
updateActivation( value.getActivation(), "activation", innerCount, root);
updateBuildBase( value.getBuild(), "build", innerCount, root);
findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module");
iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository");
iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository");
iterateDependency(innerCount, root, value.getDependencies(),"dependencies","dependency");
findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom)value.getReports());
updateReporting( value.getReporting(), "reporting", innerCount, root);
updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root);
updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root);
findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
} //-- void updateProfile(Profile, String, Counter, Element)
代码示例来源:origin: apache/maven-archetype
/**
* Method updateProfile.
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateProfile( Profile value, String xmlTag, Counter counter, Element element )
{
Element root = element;
Counter innerCount = new Counter( counter.getDepth() + 1 );
findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), null );
updateActivation( value.getActivation(), "activation", innerCount, root );
updateBuildBase( value.getBuild(), "build", innerCount, root );
findAndReplaceSimpleLists( innerCount, root, value.getModules(), "modules", "module" );
iterateRepository( innerCount, root, value.getRepositories(), "repositories", "repository" );
iterateRepository( innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository" );
iterateDependency( innerCount, root, value.getDependencies(), "dependencies", "dependency" );
findAndReplaceXpp3DOM( innerCount, root, "reports", (Xpp3Dom) value.getReports() );
updateReporting( value.getReporting(), "reporting", innerCount, root );
updateDependencyManagement( value.getDependencyManagement(), "dependencyManagement", innerCount, root );
updateDistributionManagement( value.getDistributionManagement(), "distributionManagement", innerCount, root );
findAndReplaceProperties( innerCount, root, "properties", value.getProperties() );
} // -- void updateProfile(Profile, String, Counter, Element)
内容来源于网络,如有侵权,请联系作者删除!