@Service(value="artifactConverter#legacy-to-default") public class LegacyToDefaultConverter extends Object implements ArtifactConverter
Modifier and Type | Field and Description |
---|---|
private org.apache.maven.artifact.factory.ArtifactFactory |
artifactFactory |
private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager |
artifactHandlerManager |
private List<? extends org.codehaus.plexus.digest.Digester> |
digesters
List <Digester |
private DigesterUtils |
digesterUtils |
private boolean |
dryrun |
private boolean |
force |
private PlexusSisuBridge |
plexusSisuBridge |
private org.apache.maven.model.converter.ModelConverter |
translator |
private Map<org.apache.maven.artifact.Artifact,List<String>> |
warnings |
Constructor and Description |
---|
LegacyToDefaultConverter() |
Modifier and Type | Method and Description |
---|---|
private void |
addWarning(org.apache.maven.artifact.Artifact artifact,
String message) |
void |
clearWarnings()
Clear the list of warning messages.
|
void |
convert(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.artifact.repository.ArtifactRepository targetRepository)
Convert an provided artifact, and place it into the destination repository.
|
private boolean |
copyArtifact(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.artifact.repository.ArtifactRepository targetRepository,
FileTransaction transaction) |
private boolean |
copyPom(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.artifact.repository.ArtifactRepository targetRepository,
FileTransaction transaction) |
private org.apache.maven.artifact.repository.metadata.Metadata |
createBaseMetadata(org.apache.maven.artifact.Artifact artifact) |
private boolean |
doRelocation(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.model.v3_0_0.Model v3Model,
org.apache.maven.artifact.repository.ArtifactRepository repository,
FileTransaction transaction) |
org.apache.maven.artifact.factory.ArtifactFactory |
getArtifactFactory() |
org.apache.maven.artifact.handler.manager.ArtifactHandlerManager |
getArtifactHandlerManager() |
private String |
getDigesterFileExtension(org.codehaus.plexus.digest.Digester digester)
File extension for checksums
TODO should be moved to plexus-digester ?
|
List<? extends org.codehaus.plexus.digest.Digester> |
getDigesters() |
org.apache.maven.model.converter.ModelConverter |
getTranslator() |
Map<org.apache.maven.artifact.Artifact,List<String>> |
getWarnings()
Get the map of accumulated warnings for the conversion.
|
void |
initialize() |
boolean |
isDryrun() |
boolean |
isForce() |
private org.apache.maven.artifact.repository.metadata.Metadata |
readMetadata(File file) |
void |
setArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory) |
void |
setArtifactHandlerManager(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager) |
void |
setDigesters(List<org.codehaus.plexus.digest.Digester> digesters) |
void |
setDryrun(boolean dryrun) |
void |
setForce(boolean force) |
void |
setTranslator(org.apache.maven.model.converter.ModelConverter translator) |
private boolean |
testChecksums(org.apache.maven.artifact.Artifact artifact,
File file) |
private void |
updateMetadata(org.apache.maven.artifact.repository.metadata.RepositoryMetadata artifactMetadata,
org.apache.maven.artifact.repository.ArtifactRepository targetRepository,
org.apache.maven.artifact.repository.metadata.Metadata newMetadata,
FileTransaction transaction) |
private boolean |
validateMetadata(org.apache.maven.artifact.Artifact artifact) |
private boolean |
validateMetadata(org.apache.maven.artifact.repository.metadata.Metadata metadata,
org.apache.maven.artifact.repository.metadata.RepositoryMetadata repositoryMetadata,
org.apache.maven.artifact.Artifact artifact) |
private boolean |
verifyChecksum(File file,
String fileName,
org.codehaus.plexus.digest.Digester digester,
org.apache.maven.artifact.Artifact artifact,
String key) |
private void |
writeRelocationPom(String groupId,
String artifactId,
String version,
String newGroupId,
String newArtifactId,
String newVersion,
String message,
org.apache.maven.artifact.repository.ArtifactRepository repository,
FileTransaction transaction) |
@Inject private PlexusSisuBridge plexusSisuBridge
@Inject private DigesterUtils digesterUtils
private org.apache.maven.model.converter.ModelConverter translator
private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager
private boolean force
private boolean dryrun
public LegacyToDefaultConverter()
@PostConstruct public void initialize() throws PlexusSisuBridgeException
PlexusSisuBridgeException
public void convert(org.apache.maven.artifact.Artifact artifact, org.apache.maven.artifact.repository.ArtifactRepository targetRepository) throws ArtifactConversionException
ArtifactConverter
convert
in interface ArtifactConverter
artifact
- the artifact to convert.targetRepository
- the respository to send the artifact to.ArtifactConversionException
private boolean copyPom(org.apache.maven.artifact.Artifact artifact, org.apache.maven.artifact.repository.ArtifactRepository targetRepository, FileTransaction transaction) throws ArtifactConversionException
ArtifactConversionException
private boolean testChecksums(org.apache.maven.artifact.Artifact artifact, File file) throws IOException
IOException
private boolean verifyChecksum(File file, String fileName, org.codehaus.plexus.digest.Digester digester, org.apache.maven.artifact.Artifact artifact, String key) throws IOException
IOException
private String getDigesterFileExtension(org.codehaus.plexus.digest.Digester digester)
private boolean copyArtifact(org.apache.maven.artifact.Artifact artifact, org.apache.maven.artifact.repository.ArtifactRepository targetRepository, FileTransaction transaction) throws ArtifactConversionException
ArtifactConversionException
private org.apache.maven.artifact.repository.metadata.Metadata createBaseMetadata(org.apache.maven.artifact.Artifact artifact)
private org.apache.maven.artifact.repository.metadata.Metadata readMetadata(File file) throws ArtifactConversionException
ArtifactConversionException
private boolean validateMetadata(org.apache.maven.artifact.Artifact artifact) throws ArtifactConversionException
ArtifactConversionException
private boolean validateMetadata(org.apache.maven.artifact.repository.metadata.Metadata metadata, org.apache.maven.artifact.repository.metadata.RepositoryMetadata repositoryMetadata, org.apache.maven.artifact.Artifact artifact)
private void updateMetadata(org.apache.maven.artifact.repository.metadata.RepositoryMetadata artifactMetadata, org.apache.maven.artifact.repository.ArtifactRepository targetRepository, org.apache.maven.artifact.repository.metadata.Metadata newMetadata, FileTransaction transaction) throws ArtifactConversionException
ArtifactConversionException
private boolean doRelocation(org.apache.maven.artifact.Artifact artifact, org.apache.maven.model.v3_0_0.Model v3Model, org.apache.maven.artifact.repository.ArtifactRepository repository, FileTransaction transaction) throws IOException
IOException
private void writeRelocationPom(String groupId, String artifactId, String version, String newGroupId, String newArtifactId, String newVersion, String message, org.apache.maven.artifact.repository.ArtifactRepository repository, FileTransaction transaction) throws IOException
IOException
private void addWarning(org.apache.maven.artifact.Artifact artifact, String message)
public void clearWarnings()
ArtifactConverter
clearWarnings
in interface ArtifactConverter
public Map<org.apache.maven.artifact.Artifact,List<String>> getWarnings()
ArtifactConverter
getWarnings
in interface ArtifactConverter
Map
<Artifact
, String
> warning messages.public List<? extends org.codehaus.plexus.digest.Digester> getDigesters()
public void setDigesters(List<org.codehaus.plexus.digest.Digester> digesters)
public org.apache.maven.model.converter.ModelConverter getTranslator()
public void setTranslator(org.apache.maven.model.converter.ModelConverter translator)
public org.apache.maven.artifact.factory.ArtifactFactory getArtifactFactory()
public void setArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory)
public org.apache.maven.artifact.handler.manager.ArtifactHandlerManager getArtifactHandlerManager()
public void setArtifactHandlerManager(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager)
public boolean isForce()
public void setForce(boolean force)
public boolean isDryrun()
public void setDryrun(boolean dryrun)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.