public Artifact createProjectArtifact( String groupId, String artifactId, String metaVersionId ) { return artifactFactory.createProjectArtifact( groupId, artifactId, metaVersionId ); }
pomArtifact = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getScope() );
repositorySystem.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getScope() );
private Artifact getStandaloneArtifact() { final String version = getPluginInformation().getVersion(); return artifactFactory.createProjectArtifact(GROUP_ID, ARTIFACT_ID, version); }
private Artifact getStandaloneArtifact() { final String version = getPluginInformation().getVersion(); return artifactFactory.createProjectArtifact(GROUP_ID, ARTIFACT_ID, version); }
private void copyPoms( Artifact artifact ) throws MojoExecutionException { Artifact pomArtifact = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion() ); File pomFile = new File( localRepository.getBasedir(), localRepository.pathOf( pomArtifact ) ); if ( pomFile.isFile() ) { copyArtifact( pomFile, pomArtifact ); copyParentPoms( pomFile ); } }
/** * {@inheritDoc} */ public ModelSource resolveModel( String groupId, String artifactId, String version ) { File pomFile = reactorModelPool.find(groupId, artifactId, version); if ( pomFile == null ) { Artifact pomArtifact = this.artifactFactory.createProjectArtifact( groupId, artifactId, version ); pomArtifact = this.localRepository.find( pomArtifact ); pomFile = pomArtifact.getFile(); } return new FileModelSource( pomFile ); }
public File resolve( Artifact artifact ) throws PathResolutionException { MavenProject project; try { Artifact dummy = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); project = projectBuilder.buildFromRepository( dummy, remoteRepositories, localRepository ); } catch ( ProjectBuildingException e ) { throw new PathResolutionException( "Cannot build project for artifact: " + artifact + ". Reason: " + e.getMessage(), e ); } String prefix = project.getProperties().getProperty( "prefix" ); List valueSources = new ArrayList(); valueSources.add( new ObjectBasedValueSource( project ) ); valueSources.add( new MapBasedValueSource( project.getProperties() ) ); valueSources.add( new MapBasedValueSource( System.getProperties() ) ); RegexBasedInterpolator interpolator = new RegexBasedInterpolator( valueSources ); prefix = interpolator.interpolate( prefix, "project|pom" ); log.debug( "Prefix for project: " + project.getId() + " is: " + prefix ); return new File( prefix ); }
private String resolveVersion(final Product product) throws MojoExecutionException { String version = product.getVersion(); if (isBlank(version)) { version = Artifact.RELEASE_VERSION; } if(Artifact.RELEASE_VERSION.equals(version) || Artifact.LATEST_VERSION.equals(version)) { ProductArtifact productArtifact = getArtifact(); Artifact warArtifact = artifactFactory.createProjectArtifact(productArtifact.getGroupId(), productArtifact.getArtifactId(), version); version = product.getArtifactRetriever().getLatestStableVersion(warArtifact); } return version; }
public Artifact createProjectArtifact(String groupId, String artifactId, String version) { return createFromOriginal(original.createProjectArtifact(checkValue(groupId), checkValue(artifactId), checkVersion(version))); }
public Artifact createProjectArtifact(String groupId, String artifactId, String version) { return createFromOriginal(original.createProjectArtifact(checkValue(groupId), checkValue(artifactId), checkVersion(version))); }
public Artifact createProjectArtifact(String groupId, String artifactId, String version, String scope) { return createFromOriginal(original.createProjectArtifact(checkValue(groupId), checkValue(artifactId), checkVersion(version), scope)); }
public Artifact createProjectArtifact(String groupId, String artifactId, String version, String scope) { return createFromOriginal(original.createProjectArtifact(checkValue(groupId), checkValue(artifactId), checkVersion(version), scope)); }
protected String getStableProductVersion(AbstractProductHandler handler, Product ctx) throws MojoExecutionException { ProductArtifact artifact = handler.getArtifact(); if(null == artifact) { return ""; } Artifact warArtifact = artifactFactory.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), "LATEST"); return ctx.getArtifactRetriever().getLatestStableVersion(warArtifact); }
protected String getStableDataVersion(AbstractProductHandler handler, Product ctx) throws MojoExecutionException { ProductArtifact artifact = handler.getTestResourcesArtifact(); if(null == artifact) { return ""; } Artifact warArtifact = artifactFactory.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), "LATEST"); return ctx.getArtifactRetriever().getLatestStableVersion(warArtifact); }
private Artifact getNewArtifact( Model companyModel ) { String v = companyModel.getVersion(); String newVersion; if ( v != null ) { DefaultArtifactVersion version = new DefaultArtifactVersion( v ); newVersion = String.valueOf( version.getMajorVersion() + 1 ); } else { newVersion = "1"; } companyModel.setVersion( newVersion ); return artifactFactory.createProjectArtifact( companyModel.getGroupId(), companyModel.getArtifactId(), newVersion ); }
protected String getStableProductVersion(AbstractProductHandler handler, Product ctx) throws MojoExecutionException { ProductArtifact artifact = handler.getArtifact(); if(null == artifact) { return ""; } Artifact warArtifact = artifactFactory.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), "LATEST"); return ctx.getArtifactRetriever().getLatestStableVersion(warArtifact); }
protected String getStableDataVersion(AbstractProductHandler handler, Product ctx) throws MojoExecutionException { ProductArtifact artifact = handler.getTestResourcesArtifact(); if(null == artifact) { return ""; } Artifact warArtifact = artifactFactory.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), "LATEST"); return ctx.getArtifactRetriever().getLatestStableVersion(warArtifact); }
@Override protected final File extractApplication(Product ctx, File homeDir) throws MojoExecutionException { ProductArtifact defaults = getArtifact(); ProductArtifact artifact = new ProductArtifact( firstNotNull(ctx.getGroupId(), defaults.getGroupId()), firstNotNull(ctx.getArtifactId(), defaults.getArtifactId()), firstNotNull(ctx.getVersion(), defaults.getVersion())); //check for a stable version if needed if(Artifact.RELEASE_VERSION.equals(artifact.getVersion()) || Artifact.LATEST_VERSION.equals(artifact.getVersion())) { log.info("determining latest stable product version..."); Artifact warArtifact = artifactFactory.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()); String stableVersion = ctx.getArtifactRetriever().getLatestStableVersion(warArtifact); log.info("using latest stable product version: " + stableVersion); artifact.setVersion(stableVersion); ctx.setVersion(stableVersion); } // Copy the webapp war to target return goals.copyWebappWar(ctx.getId(), getBaseDirectory(ctx), artifact); }
@Override protected final File extractApplication(Product ctx, File homeDir) throws MojoExecutionException { ProductArtifact defaults = getArtifact(); ProductArtifact artifact = new ProductArtifact( firstNotNull(ctx.getGroupId(), defaults.getGroupId()), firstNotNull(ctx.getArtifactId(), defaults.getArtifactId()), firstNotNull(ctx.getVersion(), defaults.getVersion())); //check for a stable version if needed if(Artifact.RELEASE_VERSION.equals(artifact.getVersion()) || Artifact.LATEST_VERSION.equals(artifact.getVersion())) { log.info("determining latest stable product version..."); Artifact warArtifact = artifactFactory.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()); String stableVersion = ctx.getArtifactRetriever().getLatestStableVersion(warArtifact); log.info("using latest stable product version: " + stableVersion); artifact.setVersion(stableVersion); ctx.setVersion(stableVersion); } // Copy the webapp war to target return goals.copyWebappWar(ctx.getId(), getBaseDirectory(ctx), artifact); }