/** {@inheritDoc} */ public String getScope() { return artifact.getScope(); }
public String getScope() { return parent.getScope(); }
/** {@inheritDoc} */ public String getScope() { return artifact.getScope(); }
public String getScope() { return parent.getScope(); }
public void manageArtifactScope( Artifact artifact, Artifact replacement ) { // only show msg if a change is actually taking place if ( !replacement.getScope().equals( artifact.getScope() ) ) { String msg = indent + artifact + " (applying artifactScope: " + replacement.getScope() + ")"; logger.debug( msg ); } }
public void manageArtifactSystemPath( Artifact artifact, Artifact replacement ) { // only show msg if a change is actually taking place if ( !replacement.getScope().equals( artifact.getScope() ) ) { String msg = indent + artifact + " (applying system path: " + replacement.getFile() + ")"; logger.debug( msg ); } }
public void includeArtifact( Artifact artifact ) { logger.debug( indent + artifact + " (selected for " + artifact.getScope() + ")" ); }
public void updateScopeCurrentPom( Artifact artifact, String ignoredScope ) { logger.debug( indent + artifact + " (not setting artifactScope to: " + ignoredScope + "; local artifactScope " + artifact.getScope() + " wins)" ); // TODO better way than static? this might hide messages in a reactor if ( !ignoredArtifacts.contains( artifact ) ) { logger.warn( "\n\tArtifact " + artifact + " retains local artifactScope '" + artifact.getScope() + "' overriding broader artifactScope '" + ignoredScope + "'\n" + "\tgiven by a dependency. If this is not intended, modify or remove the local artifactScope.\n" ); ignoredArtifacts.add( artifact ); } }
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; }
@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 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 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; }
private static int artifactHashCode( Artifact a ) { int result = 17; result = 31 * result + a.getGroupId().hashCode(); result = 31 * result + a.getArtifactId().hashCode(); result = 31 * result + a.getType().hashCode(); if ( a.getVersion() != null ) { result = 31 * result + a.getVersion().hashCode(); } result = 31 * result + ( a.getClassifier() != null ? a.getClassifier().hashCode() : 0 ); result = 31 * result + ( a.getScope() != null ? a.getScope().hashCode() : 0 ); result = 31 * result + ( a.getDependencyFilter() != null ? a.getDependencyFilter().hashCode() : 0 ); result = 31 * result + ( a.isOptional() ? 1 : 0 ); return result; }
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; }
public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler ) { super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type, classifier, artifactHandler, parent.isOptional() ); setDependencyTrail( Collections.singletonList( parent.getId() ) ); this.parent = parent; if ( getId().equals( parent.getId() ) ) { throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parent.getType(), "An attached artifact must have a different ID than its corresponding main artifact." ); } }
public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler ) { super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type, classifier, artifactHandler, parent.isOptional() ); setDependencyTrail( Collections.singletonList( parent.getId() ) ); this.parent = parent; if ( getId().equals( parent.getId() ) ) { throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parent.getType(), "An attached artifact must have a different ID" + " than its corresponding main artifact." ); } }
private static boolean artifactEquals( Artifact a1, Artifact a2 ) { if ( a1 == a2 ) { return true; } return eq( a1.getGroupId(), a2.getGroupId() ) && eq( a1.getArtifactId(), a2.getArtifactId() ) && eq( a1.getType(), a2.getType() ) && eq( a1.getVersion(), a2.getVersion() ) && eq( a1.getClassifier(), a2.getClassifier() ) && eq( a1.getScope(), a2.getScope() ) && eq( a1.getDependencyFilter(), a2.getDependencyFilter() ) && a1.isOptional() == a2.isOptional(); }
/** * Returns whether or not a the report can be generated. * * @return <code>true</code> if the report can be generated; otherwise * <code>false</code> */ @Override public boolean canGenerateReport() { populateSettings(); boolean isCapable = false; for (Artifact a : getProject().getArtifacts()) { if (!getArtifactScopeExcluded().passes(a.getScope())) { isCapable = true; break; } } return isCapable; }
private Artifact createDependencyArtifact( Dependency dependency, Artifact owner, Artifact pom ) throws ArtifactMetadataRetrievalException { try { String inheritedScope = ( owner != null ) ? owner.getScope() : null; ArtifactFilter inheritedFilter = ( owner != null ) ? owner.getDependencyFilter() : null; return createDependencyArtifact( repositorySystem, dependency, inheritedScope, inheritedFilter ); } catch ( InvalidVersionSpecificationException e ) { throw new ArtifactMetadataRetrievalException( "Invalid version for dependency " + dependency.getManagementKey() + ": " + e.getMessage(), e, pom ); } }