本文整理了Java中org.apache.maven.artifact.Artifact.addMetadata()
方法的一些代码示例,展示了Artifact.addMetadata()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Artifact.addMetadata()
方法的具体详情如下:
包路径:org.apache.maven.artifact.Artifact
类名称:Artifact
方法名:addMetadata
暂无
代码示例来源:origin: org.apache.maven/maven-project
/** {@inheritDoc} */
public void addMetadata( ArtifactMetadata metadata )
{
artifact.addMetadata( metadata );
}
代码示例来源:origin: apache/maven
/** {@inheritDoc} */
public void addMetadata( ArtifactMetadata metadata )
{
artifact.addMetadata( metadata );
}
代码示例来源:origin: apache/maven
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
{
ArtifactMetadata metadata = createMetadata( artifact );
artifact.addMetadata( metadata );
}
代码示例来源:origin: apache/maven
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
ArtifactRepository localRepository )
{
ArtifactMetadata metadata = createMetadata( artifact );
artifact.addMetadata( metadata );
}
代码示例来源:origin: apache/maven
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
{
if ( artifact.isSnapshot() )
{
Snapshot snapshot = new Snapshot();
snapshot.setLocalCopy( true );
RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact, snapshot );
artifact.addMetadata( metadata );
}
}
代码示例来源:origin: apache/maven
artifact.addMetadata( new SnapshotArtifactRepositoryMetadata( artifact, snapshot ) );
代码示例来源:origin: apache/maven
artifact.addMetadata( metadata );
代码示例来源:origin: apache/maven
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
ArtifactRepository localRepository )
throws ArtifactDeploymentException
{
if ( artifact.isSnapshot() )
{
Snapshot snapshot = new Snapshot();
snapshot.setTimestamp( getDeploymentTimestamp() );
// we update the build number anyway so that it doesn't get lost. It requires the timestamp to take effect
try
{
int buildNumber = resolveLatestSnapshotBuildNumber( artifact, localRepository, remoteRepository );
snapshot.setBuildNumber( buildNumber + 1 );
}
catch ( RepositoryMetadataResolutionException e )
{
throw new ArtifactDeploymentException( "Error retrieving previous build number for artifact '"
+ artifact.getDependencyConflictId() + "': " + e.getMessage(), e );
}
RepositoryMetadata metadata = new SnapshotArtifactRepositoryMetadata( artifact, snapshot );
artifact.setResolvedVersion(
constructVersion( metadata.getMetadata().getVersioning(), artifact.getBaseVersion() ) );
artifact.addMetadata( metadata );
}
}
代码示例来源:origin: apache/maven
artifact.addMetadata( new SnapshotArtifactRepositoryMetadata( artifact, snapshot ) );
artifact.addMetadata( new ArtifactRepositoryMetadata( artifact, versioning ) );
代码示例来源:origin: org.apache.maven.plugins/maven-gpg-plugin
public void addMetadata( ArtifactMetadata metadata )
{
delegate.addMetadata( metadata );
}
代码示例来源:origin: org.codehaus.mevenide/nb-mvn-embedder
public void addMetadata(ArtifactMetadata metadata) {
original.addMetadata(metadata);
}
代码示例来源:origin: de.saumya.mojo/gem-maven-plugin
public void addMetadata(final ArtifactMetadata metadata) {
this.artifact.addMetadata(metadata);
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-maven-embedder
public void addMetadata(ArtifactMetadata metadata) {
original.addMetadata(metadata);
}
代码示例来源:origin: torquebox/jruby-maven-plugins
public void addMetadata(final ArtifactMetadata metadata) {
this.artifact.addMetadata(metadata);
}
代码示例来源:origin: io.takari.maven.plugins/takari-lifecycle-plugin
@Override
protected void executeMojo() throws MojoExecutionException {
Artifact projectArtifact = project.getArtifact();
Versioning versioning = new Versioning();
versioning.setLatest(projectArtifact.getVersion());
versioning.updateTimestamp();
ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata(projectArtifact, versioning);
projectArtifact.addMetadata(metadata);
GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata(project.getGroupId());
groupMetadata.addPluginMapping(getGoalPrefix(), project.getArtifactId(), project.getName());
projectArtifact.addMetadata(groupMetadata);
}
代码示例来源:origin: takari/takari-lifecycle
@Override
protected void executeMojo() throws MojoExecutionException {
Artifact projectArtifact = project.getArtifact();
Versioning versioning = new Versioning();
versioning.setLatest(projectArtifact.getVersion());
versioning.updateTimestamp();
ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata(projectArtifact, versioning);
projectArtifact.addMetadata(metadata);
GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata(project.getGroupId());
groupMetadata.addPluginMapping(getGoalPrefix(), project.getArtifactId(), project.getName());
projectArtifact.addMetadata(groupMetadata);
}
代码示例来源:origin: org.apache.maven.plugins/maven-plugin-plugin
/** {@inheritDoc} */
public void execute()
throws MojoExecutionException
{
if ( skip )
{
getLog().warn( "Execution skipped" );
return;
}
Artifact projectArtifact = project.getArtifact();
Versioning versioning = new Versioning();
versioning.setLatest( projectArtifact.getVersion() );
versioning.updateTimestamp();
ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( projectArtifact, versioning );
projectArtifact.addMetadata( metadata );
GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata( project.getGroupId() );
groupMetadata.addPluginMapping( getGoalPrefix(), project.getArtifactId(), project.getName() );
projectArtifact.addMetadata( groupMetadata );
}
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
@Override
public void deploy(MavenEmbedder embedder, ArtifactRepository deploymentRepository, TaskListener listener) throws MavenEmbedderException, IOException, ComponentLookupException, ArtifactDeploymentException {
ArtifactHandlerManager handlerManager = embedder.lookup(ArtifactHandlerManager.class);
ArtifactFactory factory = embedder.lookup(ArtifactFactory.class);
PrintStream logger = listener.getLogger();
boolean maven3orLater = MavenUtil.maven3orLater(parent.getModuleSetBuild().getMavenVersionUsed());
if (!deploymentRepository.isUniqueVersion() && maven3orLater) {
logger.println("uniqueVersion == false is not anymore supported in maven 3");
((WrappedArtifactRepository) deploymentRepository).setUniqueVersion( true );
}
Artifact main = mainArtifact.toArtifact(handlerManager,factory,parent);
if(!isPOM())
main.addMetadata(new ProjectArtifactMetadata(main,pomArtifact.getFile(parent)));
// deploy the main artifact. This also deploys the POM
logger.println(Messages.MavenArtifact_DeployingMainArtifact(main.getFile().getName()));
deployMavenArtifact( main, deploymentRepository, embedder );
for (MavenArtifact aa : attachedArtifacts) {
Artifact a = aa.toArtifact(handlerManager,factory, parent);
logger.println(Messages.MavenArtifact_DeployingAttachedArtifact(a.getFile().getName()));
deployMavenArtifact( a, deploymentRepository, embedder );
}
}
代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin
artifact.addMetadata( metadata );
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
/**
* Installs the artifact to the local Maven repository.
*/
public void install(MavenEmbedder embedder) throws MavenEmbedderException, IOException, ComponentLookupException, ArtifactInstallationException {
ArtifactHandlerManager handlerManager = embedder.lookup(ArtifactHandlerManager.class);
ArtifactInstaller installer = embedder.lookup(ArtifactInstaller.class);
ArtifactFactory factory = embedder.lookup(ArtifactFactory.class);
Artifact main = mainArtifact.toArtifact(handlerManager,factory,parent);
if(!isPOM())
main.addMetadata(new ProjectArtifactMetadata(main,pomArtifact.getFile(parent)));
installer.install(mainArtifact.getFile(parent),main,embedder.getLocalRepository());
for (MavenArtifact aa : attachedArtifacts)
installer.install(aa.getFile(parent),aa.toArtifact(handlerManager,factory,parent),embedder.getLocalRepository());
}
内容来源于网络,如有侵权,请联系作者删除!