Java Code Examples for org.apache.maven.artifact.Artifact#isSnapshot()

The following examples show how to use org.apache.maven.artifact.Artifact#isSnapshot() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DependencyFactory.java    From appassembler with MIT License 5 votes vote down vote up
/**
 * Used by AssembleMojo and JavaServiceWrapperDaemonGenerator.
 * @param artifact {@link Artifact}
 * @param layout {@link ArtifactRepositoryLayout}
 * @param useTimestampInSnapshotFileName timestamp or not.
 * @param outputFileNameMapping The name mapping.
 * @return the dependency.
 */
public static Dependency create(Artifact artifact, ArtifactRepositoryLayout layout,
                                boolean useTimestampInSnapshotFileName, String outputFileNameMapping)
{
    Dependency dependency = create( artifact, layout, outputFileNameMapping );

    if ( artifact.isSnapshot() && !useTimestampInSnapshotFileName )
    {
        dependency.setRelativePath( ArtifactUtils.pathBaseVersionOf( layout, artifact ) );
    }

    return dependency;
}
 
Example 2
Source File: EnforceVersionsMojo.java    From gitflow-helper-maven-plugin with Apache License 2.0 5 votes vote down vote up
private Set<String> getSnapshotPluginDeps() {
    Set<String> snapshotPluginDeps = new HashSet<>();
    for (Artifact plugin : project.getPluginArtifacts()) {
        if (plugin.isSnapshot()) {
            if (allowGitflowPluginSnapshot && plugin.getGroupId().equals("com.e-gineering") && plugin.getArtifactId().equals("gitflow-helper-maven-plugin")) {
                getLog().warn("SNAPSHOT com.e-gineering:gitflow-helper-maven-plugin detected. Allowing for this build.");
                continue;
            }
            getLog().debug("SNAPSHOT plugin dependency found: " + plugin.toString());
            snapshotPluginDeps.add(plugin.toString());
        }
    }

    return snapshotPluginDeps;
}
 
Example 3
Source File: SnapshotDependencySkipper.java    From pgpverify-maven-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public boolean shouldSkipArtifact(Artifact artifact) {
    return artifact.isSnapshot();
}