Java 类org.apache.maven.model.Prerequisites 实例源码

项目:versions-maven-plugin    文件:DisplayPluginUpdatesMojo.java   
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();
}
项目:versions-maven-plugin-svn-clone    文件:DisplayPluginUpdatesMojo.java   
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();
}
项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
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());
}
项目:apache-maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * 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" );
    }
}
项目:maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * 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" );
    }
}
项目:oceano    文件:ModelMerger.java   
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" ) );
        }
    }
}
项目:incubator-netbeans    文件:MavenCommandLineExecutor.java   
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;
}
项目:Pogamut3    文件:DependencyProjectStub.java   
public Prerequisites getPrerequisites()
{
    return null;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public Prerequisites replacePrerequisite( Prerequisites prerequisites )
{
    return prerequisites;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitPrerequisite( Prerequisites prerequisites )
{
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public Prerequisites get( Model model )
{
    return model.getPrerequisites();
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public void set( Model model, Prerequisites value )
{
    model.setPrerequisites( value );
}
项目:oceano    文件:MavenProject.java   
public Prerequisites getPrerequisites()
{
    return getModel().getPrerequisites();
}
项目:oceano    文件:ModelMerger.java   
protected void mergePrerequisites( Prerequisites target, Prerequisites source, boolean sourceDominant,
                                   Map<Object, Object> context )
{
    mergePrerequisites_Maven( target, source, sourceDominant, context );
}
项目:jwrapper-maven-plugin    文件:MavenProjectDelegate.java   
@Override
public Prerequisites getPrerequisites() {
    return getDelegate().getPrerequisites();
}
项目:xmvn    文件:ModelVisitor.java   
Prerequisites replacePrerequisite( Prerequisites prerequisites );
项目:xmvn    文件:ModelVisitor.java   
void visitPrerequisite( Prerequisites prerequisites );