本文整理汇总了Java中org.apache.maven.artifact.ArtifactUtils.versionlessKey方法的典型用法代码示例。如果您正苦于以下问题:Java ArtifactUtils.versionlessKey方法的具体用法?Java ArtifactUtils.versionlessKey怎么用?Java ArtifactUtils.versionlessKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.artifact.ArtifactUtils
的用法示例。
在下文中一共展示了ArtifactUtils.versionlessKey方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ReactorReader
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
public ReactorReader( Map<String, MavenProject> reactorProjects )
{
projectsByGAV = reactorProjects;
projectsByGA = new HashMap<String, List<MavenProject>>( reactorProjects.size() * 2 );
for ( MavenProject project : reactorProjects.values() )
{
String key = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );
List<MavenProject> projects = projectsByGA.get( key );
if ( projects == null )
{
projects = new ArrayList<MavenProject>( 1 );
projectsByGA.put( key, projects );
}
projects.add( project );
}
repository = new WorkspaceRepository( "reactor", new HashSet<String>( projectsByGAV.keySet() ) );
}
示例2: findVersions
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
public List<String> findVersions( Artifact artifact )
{
String key = ArtifactUtils.versionlessKey( artifact.getGroupId(), artifact.getArtifactId() );
List<MavenProject> projects = projectsByGA.get( key );
if ( projects == null || projects.isEmpty() )
{
return Collections.emptyList();
}
List<String> versions = new ArrayList<String>();
for ( MavenProject project : projects )
{
if ( find( project, artifact ) != null )
{
versions.add( project.getVersion() );
}
}
return Collections.unmodifiableList( versions );
}
示例3: createFileSystemServer
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
/**
* Creates a file system server from an artifact store.
*
* @param artifactStore the artifact store to serve.
* @return the file system server.
*/
protected FileSystemServer createFileSystemServer( ArtifactStore artifactStore )
{
return new FileSystemServer( ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ),
Math.max( 0, Math.min( port, 65535 ) ),
new AutoDigestFileSystem( new ArtifactStoreFileSystem( artifactStore ) ),
getSettingsServletPath() );
}
示例4: toString
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
public String toString()
{
return ( usePluginRepositories ? "plugin:" : "artifact:" ) + ArtifactUtils.versionlessKey( artifact );
}
示例5: logUpdates
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
private void logUpdates( Map updates, String section )
{
List withUpdates = new ArrayList();
List usingCurrent = new ArrayList();
Iterator i = updates.values().iterator();
while ( i.hasNext() )
{
ArtifactVersions versions = (ArtifactVersions) i.next();
String left = " " + ArtifactUtils.versionlessKey( versions.getArtifact() ) + " ";
final String current;
ArtifactVersion latest;
if ( versions.isCurrentVersionDefined() )
{
current = versions.getCurrentVersion().toString();
latest = versions.getNewestUpdate( UpdateScope.ANY, Boolean.TRUE.equals( allowSnapshots ) );
}
else
{
ArtifactVersion newestVersion = versions.getNewestVersion( versions.getArtifact().getVersionRange(),
Boolean.TRUE.equals( allowSnapshots ) );
current = versions.getArtifact().getVersionRange().toString();
latest = newestVersion == null
? null
: versions.getNewestUpdate( newestVersion, UpdateScope.ANY, Boolean.TRUE.equals( allowSnapshots ) );
if ( latest != null && ArtifactVersions.isVersionInRange( latest,
versions.getArtifact().getVersionRange() ) )
{
latest = null;
}
}
String right = " " + ( latest == null ? current : current + " -> " + latest.toString() );
List t = latest == null ? usingCurrent : withUpdates;
if ( right.length() + left.length() + 3 > INFO_PAD_SIZE )
{
t.add( left + "..." );
t.add( StringUtils.leftPad( right, INFO_PAD_SIZE ) );
}
else
{
t.add( StringUtils.rightPad( left, INFO_PAD_SIZE - right.length(), "." ) + right );
}
}
if ( isVerbose() && usingCurrent.isEmpty() && !withUpdates.isEmpty() )
{
getLog().info( "No dependencies in " + section + " are using the newest version." );
getLog().info( "" );
}
else if ( isVerbose() && !usingCurrent.isEmpty() )
{
getLog().info( "The following dependencies in " + section + " are using the newest version:" );
i = usingCurrent.iterator();
while ( i.hasNext() )
{
getLog().info( (String) i.next() );
}
getLog().info( "" );
}
if ( withUpdates.isEmpty() && !usingCurrent.isEmpty() )
{
getLog().info( "No dependencies in " + section + " have newer versions." );
getLog().info( "" );
}
else if ( !withUpdates.isEmpty() )
{
getLog().info( "The following dependencies in " + section + " have newer versions:" );
i = withUpdates.iterator();
while ( i.hasNext() )
{
getLog().info( (String) i.next() );
}
getLog().info( "" );
}
}
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:75,代码来源:DisplayDependencyUpdatesMojo.java
示例6: detectJavaBootClasspath
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
private boolean detectJavaBootClasspath( String javaExecutable )
throws MojoFailureException, MojoExecutionException
{
getLog().info( "Attempting to auto-detect the boot classpath for " + javaExecutable );
Iterator i = pluginArtifacts.iterator();
Artifact javaBootClasspathDetector = null;
while ( i.hasNext() && javaBootClasspathDetector == null )
{
Artifact candidate = (Artifact) i.next();
if ( StringUtils.equals( jbcpdGroupId, candidate.getGroupId() )
&& StringUtils.equals( jbcpdArtifactId, candidate.getArtifactId() ) && candidate.getFile() != null
&& candidate.getFile().isFile() )
{
javaBootClasspathDetector = candidate;
}
}
if ( javaBootClasspathDetector == null )
{
if ( skipIfNoJavaHome )
{
getLog().warn( "Skipping signature generation as could not find boot classpath detector ("
+ ArtifactUtils.versionlessKey( jbcpdGroupId, jbcpdArtifactId ) + ")." );
return false;
}
throw new MojoFailureException( "Could not find boot classpath detector ("
+ ArtifactUtils.versionlessKey( jbcpdGroupId, jbcpdArtifactId )
+ ")." );
}
try
{
if ( !detectJavaClasspath( javaBootClasspathDetector, javaExecutable ) )
{
return false;
}
}
catch ( CommandLineException e )
{
throw new MojoExecutionException( e.getLocalizedMessage(), e );
}
return true;
}
示例7: formatLocationInPom
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
private static String formatLocationInPom( Dependency dependency )
{
return "Dependency: " + ArtifactUtils.versionlessKey( dependency.getGroupId(), dependency.getArtifactId() );
}
示例8: getProjectKey
import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
private static String getProjectKey( MavenProject project )
{
return ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );
}