/** {@inheritDoc} */ public ArtifactHandler getArtifactHandler() { return artifact.getArtifactHandler(); }
/** {@inheritDoc} */ public ArtifactHandler getArtifactHandler() { return artifact.getArtifactHandler(); }
@Deprecated public List<Artifact> getTestArtifacts() { List<Artifact> list = new ArrayList<>( getArtifacts().size() ); for ( Artifact a : getArtifacts() ) { // TODO classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { list.add( a ); } } return list; }
public List getTestArtifacts() { List list = new ArrayList( getArtifacts().size() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); // TODO: classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this // NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform // this check... // if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) || // Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) // { // list.add( a ); // } list.add( a ); } } return list; }
/** @deprecated we want to use the artifact method only, and ensure artifact.file is set correctly. */ @Deprecated public void install( String basedir, String finalName, Artifact artifact, ArtifactRepository localRepository ) throws ArtifactInstallationException { String extension = artifact.getArtifactHandler().getExtension(); File source = new File( basedir, finalName + "." + extension ); install( source, artifact, localRepository ); }
public List getSystemArtifacts() { List list = new ArrayList( getArtifacts().size() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); // TODO: classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { list.add( a ); } } } return list; }
/** * @deprecated we want to use the artifact method only, and ensure artifact.file is set * correctly. */ @Deprecated public void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository, ArtifactRepository localRepository ) throws ArtifactDeploymentException { String extension = artifact.getArtifactHandler().getExtension(); File source = new File( basedir, finalName + "." + extension ); deploy( source, artifact, deploymentRepository, localRepository ); }
@Deprecated public List<Artifact> getSystemArtifacts() { List<Artifact> list = new ArrayList<>( getArtifacts().size() ); for ( Artifact a : getArtifacts() ) { // TODO classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO let the scope handler deal with this if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { list.add( a ); } } } return list; }
public List getRuntimeArtifacts() { List list = new ArrayList( getArtifacts().size() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); // TODO: classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) { list.add( a ); } } } return list; }
public List getSystemClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList( getArtifacts().size() ); list.add( getBuild().getOutputDirectory() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { addArtifactPath( a, list ); } } } return list; }
@Deprecated public List<Artifact> getRuntimeArtifacts() { List<Artifact> list = new ArrayList<>( getArtifacts().size() ); for ( Artifact a : getArtifacts() ) { // TODO classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() // TODO let the scope handler deal with this && ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) ) { list.add( a ); } } return list; }
public String pathOf( Artifact artifact ) { ArtifactHandler artifactHandler = artifact.getArtifactHandler(); StringBuilder path = new StringBuilder( 128 ); path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() ); if ( artifact.hasClassifier() ) { path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() ); } if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 ) { path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() ); } return path.toString(); }
public List getCompileArtifacts() { List list = new ArrayList( getArtifacts().size() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); // TODO: classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { list.add( a ); } } } return list; }
public List getCompileClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList( getArtifacts().size() ); list.add( getBuild().getOutputDirectory() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { addArtifactPath( a, list ); } } } return list; }
public List getRuntimeClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList( getArtifacts().size() + 1 ); list.add( getBuild().getOutputDirectory() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) { File file = a.getFile(); if ( file == null ) { throw new DependencyResolutionRequiredException( a ); } list.add( file.getPath() ); } } } return list; }
public String pathOf( Artifact artifact ) { ArtifactHandler artifactHandler = artifact.getArtifactHandler(); StringBuilder path = new StringBuilder( 128 ); path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR ); path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR ); path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR ); path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() ); if ( artifact.hasClassifier() ) { path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() ); } if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 ) { path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() ); } return path.toString(); }
@Deprecated public List<Artifact> getCompileArtifacts() { List<Artifact> list = new ArrayList<>( getArtifacts().size() ); for ( Artifact a : getArtifacts() ) { // TODO classpath check doesn't belong here - that's the other method if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { list.add( a ); } } } return list; }
public List<String> getRuntimeClasspathElements() throws DependencyResolutionRequiredException { List<String> list = new ArrayList<>( getArtifacts().size() + 1 ); String d = getBuild().getOutputDirectory(); if ( d != null ) { list.add( d ); } for ( Artifact a : getArtifacts() ) { if ( a.getArtifactHandler().isAddedToClasspath() // TODO let the scope handler deal with this && ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) ) { addArtifactPath( a, list ); } } return list; }
public void attachArtifact( MavenProject project, File artifactFile, String artifactClassifier ) { Artifact projectArtifact = project.getArtifact(); Artifact artifact = new AttachedArtifact( projectArtifact, projectArtifact.getType(), artifactClassifier, projectArtifact.getArtifactHandler() ); artifact.setFile( artifactFile ); artifact.setResolved( true ); project.addAttachedArtifact( artifact ); }
public void attachArtifact( MavenProject project, File artifactFile, String artifactClassifier ) { Artifact projectArtifact = project.getArtifact(); Artifact artifact = new AttachedArtifact( projectArtifact, projectArtifact.getType(), artifactClassifier, projectArtifact.getArtifactHandler() ); artifact.setFile( artifactFile ); artifact.setResolved( true ); attachArtifact( project, artifact ); }