本文整理了Java中org.sonatype.aether.artifact.Artifact.getProperty()
方法的一些代码示例,展示了Artifact.getProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Artifact.getProperty()
方法的具体详情如下:
包路径:org.sonatype.aether.artifact.Artifact
类名称:Artifact
方法名:getProperty
[英]Gets the specified property.
[中]获取指定的属性。
代码示例来源:origin: org.sonatype.aether/aether-api
private static String getLocalPathInfo( Artifact artifact, RemoteRepository repository )
{
String localPath = ( artifact != null ) ? artifact.getProperty( "localPath", null ) : null;
if ( localPath != null && repository == null )
{
return " at specified path " + localPath;
}
else
{
return "";
}
}
代码示例来源:origin: sonatype/sonatype-aether
private static String getLocalPathInfo( Artifact artifact, RemoteRepository repository )
{
String localPath = ( artifact != null ) ? artifact.getProperty( "localPath", null ) : null;
if ( localPath != null && repository == null )
{
return " at specified path " + localPath;
}
else
{
return "";
}
}
代码示例来源:origin: org.sonatype.aether/org.motechproject.aether-api
private static String getLocalPathInfo( Artifact artifact, RemoteRepository repository )
{
String localPath = ( artifact != null ) ? artifact.getProperty( "localPath", null ) : null;
if ( localPath != null && repository == null )
{
return " at specified path " + localPath;
}
else
{
return "";
}
}
代码示例来源:origin: sonatype/sonatype-aether
public String getProperty( String key, String defaultValue )
{
return delegate.getProperty( key, defaultValue );
}
代码示例来源:origin: org.sonatype.aether/aether-impl
private boolean isLackingDescriptor( Artifact artifact )
{
return artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ) != null;
}
代码示例来源:origin: org.eclipse.proviso/proviso-spi
public String getProperty( String key, String defaultValue )
{
return delegate.getProperty( key, defaultValue );
}
代码示例来源:origin: sonatype/sonatype-aether
private boolean isLackingDescriptor( Artifact artifact )
{
return artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ) != null;
}
代码示例来源:origin: sonatype/sonatype-aether
public boolean traverseDependency( Dependency dependency )
{
String prop = dependency.getArtifact().getProperty( ArtifactProperties.INCLUDES_DEPENDENCIES, "" );
return !Boolean.parseBoolean( prop );
}
代码示例来源:origin: org.sonatype.tycho.p2/p2-publisher
private Map<String, String> createNamespaceMap( final Artifact artifact )
{
final Map<String, String> namespace = new HashMap<String, String>();
namespace.putAll( globalProperties );
namespace.put( "maven:id", Utils.p2Id( id, artifact ) );
namespace.put( "maven:fullId", Utils.fullArtifactId( artifact ) );
namespace.put( "maven:p2ArtifactId", Utils.conflictArtifactId( artifact ) );
namespace.put( "maven:groupId", artifact.getGroupId() );
namespace.put( "maven:groupIdAsDirectory", artifact.getGroupId().replace( '.', '/' ) );
namespace.put( "maven:artifactId", artifact.getArtifactId() );
namespace.put( "maven:version", artifact.getBaseVersion() );
namespace.put( "maven:type", artifact.getProperty( "type", "[void]" ) );
namespace.put( "maven:extension", artifact.getExtension() );
if ( artifact.getClassifier() != null )
{
namespace.put( "maven:classifier", artifact.getClassifier() );
}
else
{
namespace.put( "maven:classifier", "[void]" );
}
namespace.put( "maven:osgiVersion", Utils.toOsgiVersion( artifact.getBaseVersion(), timestamp ) );
namespace.put( "maven:buildVersion", Utils.toBuildVersion( artifact.getBaseVersion(), timestamp ) );
if ( artifact.getFile() != null )
{
namespace.put( "maven:fileName", artifact.getFile().getName() );
}
return namespace;
}
代码示例来源:origin: org.sonatype.sisu.assembler/sisu-assembler
static Map<String, String> createNamespaceMap( final Artifact artifact, final String timestamp,
final Map<String, String> parentNamespace )
{
final Map<String, String> namespace = new HashMap<String, String>();
namespace.putAll( parentNamespace );
namespace.put( "maven:id", conflictArtifactId( artifact ) );
namespace.put( "maven:fullId", fullArtifactId( artifact ) );
namespace.put( "maven:groupId", artifact.getGroupId() );
namespace.put( "maven:groupIdAsDirectory", artifact.getGroupId().replace( '.', '/' ) );
namespace.put( "maven:artifactId", artifact.getArtifactId() );
namespace.put( "maven:version", artifact.getBaseVersion() );
namespace.put( "maven:type", artifact.getProperty( "type", "[void]" ) );
namespace.put( "maven:extension", artifact.getExtension() );
if ( artifact.getClassifier() != null )
{
namespace.put( "maven:classifier", artifact.getClassifier() );
}
else
{
namespace.put( "maven:classifier", "[void]" );
}
namespace.put( "maven:osgiVersion", toOsgiVersion( artifact.getBaseVersion(), timestamp ) );
namespace.put( "maven:buildVersion", toBuildVersion( artifact.getBaseVersion(), timestamp ) );
namespace.put( "maven:fileName", nameOf( artifact ) );
namespace.put( "maven:versionlessFileName", versionlessNameOf( artifact ) );
return namespace;
}
代码示例来源:origin: org.sonatype.aether/aether-impl
public List<ArtifactResult> resolveArtifacts( RepositorySystemSession session,
Collection<? extends ArtifactRequest> requests )
throws ArtifactResolutionException
{
SyncContext syncContext = syncContextFactory.newInstance( session, false );
try
{
Collection<Artifact> artifacts = new ArrayList<Artifact>( requests.size() );
for ( ArtifactRequest request : requests )
{
if ( request.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null )
{
continue;
}
artifacts.add( request.getArtifact() );
}
syncContext.acquire( artifacts, null );
return resolve( session, requests );
}
finally
{
syncContext.release();
}
}
代码示例来源:origin: sonatype/sonatype-aether
String localPath = managedDependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null );
if ( localPath != null && !managedLocalPaths.containsKey( key ) )
代码示例来源:origin: sonatype/sonatype-aether
public List<ArtifactResult> resolveArtifacts( RepositorySystemSession session,
Collection<? extends ArtifactRequest> requests )
throws ArtifactResolutionException
{
SyncContext syncContext = syncContextFactory.newInstance( session, false );
try
{
Collection<Artifact> artifacts = new ArrayList<Artifact>( requests.size() );
for ( ArtifactRequest request : requests )
{
if ( request.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null )
{
continue;
}
artifacts.add( request.getArtifact() );
}
syncContext.acquire( artifacts, null );
return resolve( session, requests );
}
finally
{
syncContext.release();
}
}
代码示例来源:origin: sonatype/sonatype-aether
&& dependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null )
代码示例来源:origin: com.simpligility.org.apache.maven.shared/maven-dependency-tree
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() );
}
代码示例来源:origin: org.eclipse.hudson.main/maven3-eventspy-3.0
public static ArtifactDTO convertAetherArtifact(final Artifact artifact) {
checkNotNull(artifact);
MavenCoordinatesDTO coordinates = new MavenCoordinatesDTO()
.withGroupId( artifact.getGroupId() )
.withArtifactId( artifact.getArtifactId() )
.withType( artifact.getExtension() )
.withVersion( artifact.getBaseVersion() )
.withExpandedMetaVersion( artifact.getVersion() )
.withClassifier( artifact.getClassifier() )
.normalize();
String type = artifact.getProperty( "type", "undefined" );
ArtifactDTO artifactDto = new ArtifactDTO()
.withCoordinates( coordinates )
.withType( type );
return artifactDto;
}
}
代码示例来源:origin: org.jvnet.hudson.main/maven3-eventspy-3.0
public static ArtifactDTO convertAetherArtifact(final Artifact artifact) {
checkNotNull(artifact);
MavenCoordinatesDTO coordinates = new MavenCoordinatesDTO()
.withGroupId( artifact.getGroupId() )
.withArtifactId( artifact.getArtifactId() )
.withType( artifact.getExtension() )
.withVersion( artifact.getBaseVersion() )
.withExpandedMetaVersion( artifact.getVersion() )
.withClassifier( artifact.getClassifier() )
.normalize();
String type = artifact.getProperty( "type", "undefined" );
ArtifactDTO artifactDto = new ArtifactDTO()
.withCoordinates( coordinates )
.withType( type );
return artifactDto;
}
}
代码示例来源:origin: sonatype/sonatype-aether
String localPath = artifact.getProperty( ArtifactProperties.LOCAL_PATH, null );
if ( localPath != null )
代码示例来源:origin: org.sonatype.aether/aether-impl
String localPath = artifact.getProperty( ArtifactProperties.LOCAL_PATH, null );
if ( localPath != null )
内容来源于网络,如有侵权,请联系作者删除!