public DefaultArtifact( String groupId, String artifactId, String version, String scope, String type, String classifier, ArtifactHandler artifactHandler ) { this( groupId, artifactId, VersionRange.createFromVersion( version ), scope, type, classifier, artifactHandler, false ); }
public DefaultArtifact( String groupId, String artifactId, String version, String scope, String type, String classifier, ArtifactHandler artifactHandler ) { this( groupId, artifactId, VersionRange.createFromVersion( version ), scope, type, classifier, artifactHandler, false ); }
private Artifact createArtifactX( String groupId, String artifactId, String version, String scope, String type, String classifier, String inheritedScope ) { VersionRange versionRange = null; if ( version != null ) { versionRange = VersionRange.createFromVersion( version ); } return createArtifactX( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope ); }
private Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type, String classifier, String inheritedScope ) { VersionRange versionRange = null; if ( version != null ) { versionRange = VersionRange.createFromVersion( version ); } return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope ); }
public Artifact create( MavenProject project ) { ArtifactHandler handler = getArtifactHandlerManager().getArtifactHandler( project.getPackaging() ); return new DefaultArtifact( project.getGroupId(), project.getArtifactId(), VersionRange.createFromVersion( project.getVersion() ), null, project.getPackaging(), null, handler, false ); }
public Artifact create( MavenProject project, String type, String classifier, boolean optional ) { ArtifactHandler handler = getArtifactHandlerManager().getArtifactHandler( type ); return new DefaultArtifact( project.getGroupId(), project.getArtifactId(), VersionRange.createFromVersion( project.getVersion() ), null, project.getPackaging(), null, handler, optional ); }
range = VersionRange.createFromVersion( artifact.getVersion() );
range = VersionRange.createFromVersion( artifact.getVersion() );
artifact.setVersionRange( VersionRange.createFromVersion( relocation.getVersion() ) ); project.setVersion( relocation.getVersion() );
artifact.setVersionRange( VersionRange.createFromVersion( relocation.getVersion() ) ); relocatedArtifact = artifact; project.setVersion( relocation.getVersion() );
/** * @param groupId * @param artifactId * @param version * @param scope * @param type * @param classifier * @return a <code>DefaultArtifact</code> instance for the given parameters * @throws IOException if any * @see #createArtifact(String, String, VersionRange, String, String, String, boolean) */ public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type, String classifier ) throws IOException { VersionRange vr = VersionRange.createFromVersion( version ); return createArtifact( groupId, artifactId, vr, scope, type, classifier, false ); }
if (pluginBundleIdentifierToPluginBundle.containsKey(pluginBundleIdentifier)) { if (strictDependencyChecking) { VersionRange versionRange = VersionRange.createFromVersion(dependency.getVersion()); String version = pluginBundleIdentifierToPluginBundle.get(pluginBundleIdentifier).getPluginBundleVersion().getVersion(); ArtifactVersion artifactVersion = new DefaultArtifactVersion(version);
/** * Sets the version range of the artifact to the specified version. * * @param version the version of the artifact. * @return a reference to this builder. */ public MavenArtifactBuilder withVersion(final String version) { this.versionRange = VersionRange.createFromVersion(version); return this; }
private VersionRange checkVersionRange(VersionRange range) { if (range == null) { return VersionRange.createFromVersion("unknown"); } return range; }
public DefaultArtifact( String groupId, String artifactId, String version, String scope, String type, String classifier, ArtifactHandler artifactHandler ) { this( groupId, artifactId, VersionRange.createFromVersion( version ), scope, type, classifier, artifactHandler, false ); }
private VersionRange checkVersionRange(VersionRange range) { if (range == null) { return VersionRange.createFromVersion("unknown"); } return range; }
public Artifact createDependency(final Artifact query) { assert query != null; return artifactFactory.createDependencyArtifact( query.getGroupId(), query.getArtifactId(), VersionRange.createFromVersion(query.getVersion()), "jar", null, Artifact.SCOPE_RUNTIME); }
private void addProvider(final SurefireBooter surefireBooter, final String provider, final String version, final Artifact filteredArtifact) throws ArtifactNotFoundException, ArtifactResolutionException { final Artifact providerArtifact = this.artifactFactory.createDependencyArtifact("org.apache.maven.surefire", provider, VersionRange.createFromVersion(version), "jar", null, Artifact.SCOPE_TEST); final ArtifactResolutionResult result = resolveArtifact(filteredArtifact, providerArtifact); for (final Object element : result.getArtifacts()) { final Artifact artifact = (Artifact) element; getLog().debug("Adding to surefire test classpath: " + artifact.getFile().getAbsolutePath()); surefireBooter.addSurefireClassPathUrl(artifact.getFile().getAbsolutePath()); } }
private File getArtifactFile(ArtifactRevisionIdentifier id, MavenProject mavenProject) { id = applyRelocation(id, mavenProject); org.apache.maven.artifact.Artifact mainArtifact = mavenProject.getArtifact(); //add classifier.. ArtifactHandler artifactHandler = new MyArtifactHandler(mainArtifact.getArtifactHandler()); mainArtifact = new DefaultArtifact(id.getArtifactIdentifier().getGroupId(), id.getArtifactIdentifier().getArtifactId(), VersionRange.createFromVersion(id.getVersion()), mainArtifact.getScope(), mainArtifact.getType(), id.getClassifier(), artifactHandler); String relativePath = localRepository.pathOf(mainArtifact); return new File(localRepository.getBasedir(), relativePath); }
private Artifact getDependencyArtifact( Dependency dep ) { org.sonatype.aether.artifact.Artifact artifact = dep.getArtifact(); return factory.createDependencyArtifact( artifact.getGroupId(), artifact.getArtifactId(), VersionRange.createFromVersion( artifact.getVersion() ), artifact.getProperty( "type", artifact.getExtension() ), artifact.getClassifier(), dep.getScope(), dep.isOptional() ); }