/** {@inheritDoc} */ public String getBaseVersion() { return artifact.getBaseVersion(); }
/** {@inheritDoc} */ public String getBaseVersion() { return artifact.getBaseVersion(); }
public String getBaseVersion() { return artifact.getBaseVersion(); }
public String getBaseVersion() { return parent.getBaseVersion(); }
public String getBaseVersion() { return artifact.getBaseVersion(); }
public String getBaseVersion() { return artifact.getBaseVersion(); }
public String getBaseVersion() { return parent.getBaseVersion(); }
public Object getKey() { return "snapshot " + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getBaseVersion(); }
public File getUnpackedLibFolder( Artifact artifact ) { return new File( unpackedLibsDirectory.getAbsolutePath(), getShortenedGroupId( artifact.getGroupId() ) + "_" + artifact.getArtifactId() + "_" + artifact.getBaseVersion() ); }
File getTouchfile( Artifact artifact ) { StringBuilder sb = new StringBuilder( 128 ); sb.append( artifact.getArtifactId() ); sb.append( '-' ).append( artifact.getBaseVersion() ); if ( artifact.getClassifier() != null ) { sb.append( '-' ).append( artifact.getClassifier() ); } sb.append( '.' ).append( artifact.getType() ).append( LAST_UPDATE_TAG ); return new File( artifact.getFile().getParentFile(), sb.toString() ); }
@SuppressWarnings("unchecked") private String getSaturnVersion(MavenProject project) throws MojoExecutionException { List<Artifact> artifacts = project.getRuntimeArtifacts(); if (artifacts != null && !artifacts.isEmpty()) { for (int i = 0; i < artifacts.size(); i++) { Artifact artifact = artifacts.get(i); if ("saturn-job-api".equals(artifact.getArtifactId())) { return artifact.getBaseVersion(); } } } throw new MojoExecutionException("cannot read the saturn-job-api dependency."); }
@SuppressWarnings("unchecked") private String getSaturnVersion(MavenProject project) throws MojoExecutionException { List<Artifact> artifacts = project.getRuntimeArtifacts(); if (artifacts != null && !artifacts.isEmpty()) { for (int i = 0; i < artifacts.size(); i++) { Artifact artifact = artifacts.get(i); if ("saturn-job-api".equals(artifact.getArtifactId())) { return artifact.getBaseVersion(); } } } throw new MojoExecutionException("cannot read the saturn-job-api dependency."); }
private ModelSource createStubModelSource( Artifact artifact ) { StringBuilder buffer = new StringBuilder( 1024 ); buffer.append( "<?xml version='1.0'?>" ); buffer.append( "<project>" ); buffer.append( "<modelVersion>4.0.0</modelVersion>" ); buffer.append( "<groupId>" ).append( artifact.getGroupId() ).append( "</groupId>" ); buffer.append( "<artifactId>" ).append( artifact.getArtifactId() ).append( "</artifactId>" ); buffer.append( "<version>" ).append( artifact.getBaseVersion() ).append( "</version>" ); buffer.append( "<packaging>" ).append( artifact.getType() ).append( "</packaging>" ); buffer.append( "</project>" ); return new StringModelSource( buffer, artifact.getId() ); }
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(); }
public void validate( PluginDescriptor pluginDescriptor ) { /* * NOTE: For plugins that depend on other plugin artifacts the plugin realm contains more than one plugin * descriptor. However, only the first descriptor is of interest. */ if ( !firstDescriptor ) { return; } firstDescriptor = false; if ( !pluginArtifact.getGroupId().equals( pluginDescriptor.getGroupId() ) ) { errors.add( "Plugin's descriptor contains the wrong group ID: " + pluginDescriptor.getGroupId() ); } if ( !pluginArtifact.getArtifactId().equals( pluginDescriptor.getArtifactId() ) ) { errors.add( "Plugin's descriptor contains the wrong artifact ID: " + pluginDescriptor.getArtifactId() ); } if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() ) ) { errors.add( "Plugin's descriptor contains the wrong version: " + pluginDescriptor.getVersion() ); } }
private Dependency createSystemScopeDependency( Artifact artifact, File location, String suffix ) { String artifactId = artifact.getArtifactId(); if ( suffix != null ) { artifactId += "_" + suffix; } final Dependency dependency = new Dependency(); dependency.setGroupId( artifact.getGroupId() ); dependency.setArtifactId( artifactId ); dependency.setVersion( artifact.getBaseVersion() ); dependency.setScope( Artifact.SCOPE_SYSTEM ); dependency.setSystemPath( location.getAbsolutePath() ); return dependency; }
public void transformForResolve( Artifact artifact, RepositoryRequest request ) throws ArtifactResolutionException { // Only select snapshots that are unresolved (eg 1.0-SNAPSHOT, not 1.0-20050607.123456) if ( artifact.isSnapshot() && artifact.getBaseVersion().equals( artifact.getVersion() ) ) { try { String version = resolveVersion( artifact, request ); artifact.updateVersion( version, request.getLocalRepository() ); } catch ( RepositoryMetadataResolutionException e ) { throw new ArtifactResolutionException( e.getMessage(), artifact, e ); } } }
if ( artifact.getVersion() != null ) clone.setBaseVersion( artifact.getBaseVersion() );
if ( artifact.getVersion() != null ) clone.setBaseVersion( artifact.getBaseVersion() );
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 ); } }