本文整理汇总了Java中org.apache.maven.model.Prerequisites类的典型用法代码示例。如果您正苦于以下问题:Java Prerequisites类的具体用法?Java Prerequisites怎么用?Java Prerequisites使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Prerequisites类属于org.apache.maven.model包,在下文中一共展示了Prerequisites类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRequiredMavenVersion
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
private String getRequiredMavenVersion( MavenProject mavenProject, String defaultValue )
{
ArtifactVersion requiredMavenVersion = null;
while ( mavenProject != null )
{
final Prerequisites prerequisites = mavenProject.getPrerequisites();
final String mavenVersion = prerequisites == null ? null : prerequisites.getMaven();
if ( mavenVersion != null )
{
final ArtifactVersion v = new DefaultArtifactVersion( mavenVersion );
if ( requiredMavenVersion == null || requiredMavenVersion.compareTo( v ) < 0 )
{
requiredMavenVersion = v;
}
}
mavenProject = mavenProject.getParent();
}
return requiredMavenVersion == null ? defaultValue : requiredMavenVersion.toString();
}
示例2: writePrerequisites
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
private void writePrerequisites(Prerequisites prerequisites, String tagName, XmlSerializer serializer)
throws java.io.IOException {
serializer.startTag(NAMESPACE, tagName);
flush(serializer);
StringBuffer b = b(serializer);
int start = b.length();
if ((prerequisites.getMaven() != null) && !prerequisites.getMaven().equals("2.0")) {
writeValue(serializer, "maven", prerequisites.getMaven(), prerequisites);
}
serializer.endTag(NAMESPACE, tagName).flush();
logLocation(prerequisites, "", start, b.length());
}
示例3: updatePrerequisites
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
/**
* Method updatePrerequisites
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updatePrerequisites( Prerequisites value, String xmlTag, Counter counter, Element element )
{
boolean shouldExist = value != null;
Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
Counter innerCount = new Counter( counter.getDepth() + 1 );
findAndReplaceSimpleElement( innerCount, root, "maven", value.getMaven(), "2.0" );
}
}
示例4: mergePrerequisites_Maven
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
protected void mergePrerequisites_Maven( Prerequisites target, Prerequisites source, boolean sourceDominant,
Map<Object, Object> context )
{
String src = source.getMaven();
if ( src != null )
{
if ( sourceDominant || target.getMaven() == null )
{
target.setMaven( src );
target.setLocation( "maven", source.getLocation( "maven" ) );
}
}
}
示例5: guessBestMaven
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
private File guessBestMaven(RunConfig clonedConfig, InputOutput ioput) {
MavenProject mp = clonedConfig.getMavenProject();
if (mp != null) {
if (mp.getPrerequisites() != null) {
Prerequisites pp = mp.getPrerequisites();
String ver = pp.getMaven();
if (ver != null) {
return checkAvailability(ver, null, ioput);
}
}
String value = PluginPropertyUtils.getPluginPropertyBuildable(clonedConfig.getMavenProject(), Constants.GROUP_APACHE_PLUGINS, "maven-enforcer-plugin", "enforce", new PluginPropertyUtils.ConfigurationBuilder<String>() {
@Override
public String build(Xpp3Dom configRoot, ExpressionEvaluator eval) {
if(configRoot != null) {
Xpp3Dom rules = configRoot.getChild("rules");
if (rules != null) {
Xpp3Dom rmv = rules.getChild("requireMavenVersion");
if (rmv != null) {
Xpp3Dom v = rmv.getChild("version");
if (v != null) {
return v.getValue();
}
}
}
}
return null;
}
});
if (value != null) {
if (value.contains("[") || value.contains("(")) {
try {
VersionRange vr = VersionRange.createFromVersionSpec(value);
return checkAvailability(null, vr, ioput);
} catch (InvalidVersionSpecificationException ex) {
Exceptions.printStackTrace(ex);
}
} else {
return checkAvailability(value, null, ioput);
}
}
}
return null;
}
示例6: getPrerequisites
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
public Prerequisites getPrerequisites()
{
return null;
}
示例7: replacePrerequisite
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
@Override
public Prerequisites replacePrerequisite( Prerequisites prerequisites )
{
return prerequisites;
}
示例8: visitPrerequisite
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
@Override
public void visitPrerequisite( Prerequisites prerequisites )
{
}
示例9: get
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
@Override
public Prerequisites get( Model model )
{
return model.getPrerequisites();
}
示例10: set
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
@Override
public void set( Model model, Prerequisites value )
{
model.setPrerequisites( value );
}
示例11: getPrerequisites
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
public Prerequisites getPrerequisites()
{
return getModel().getPrerequisites();
}
示例12: mergePrerequisites
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
protected void mergePrerequisites( Prerequisites target, Prerequisites source, boolean sourceDominant,
Map<Object, Object> context )
{
mergePrerequisites_Maven( target, source, sourceDominant, context );
}
示例13: getPrerequisites
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
@Override
public Prerequisites getPrerequisites() {
return getDelegate().getPrerequisites();
}
示例14: replacePrerequisite
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
Prerequisites replacePrerequisite( Prerequisites prerequisites );
示例15: visitPrerequisite
import org.apache.maven.model.Prerequisites; //导入依赖的package包/类
void visitPrerequisite( Prerequisites prerequisites );