Class DefaultArchetypeArtifactManager

  • All Implemented Interfaces:
    ArchetypeArtifactManager, org.codehaus.plexus.logging.LogEnabled

    @Named
    @Singleton
    public class DefaultArchetypeArtifactManager
    extends org.codehaus.plexus.logging.AbstractLogEnabled
    implements ArchetypeArtifactManager
    • Field Detail

      • downloader

        @Inject
        private Downloader downloader
      • pomManager

        @Inject
        private PomManager pomManager
      • archetypeCache

        private java.util.Map<java.lang.String,​java.io.File> archetypeCache
    • Constructor Detail

      • DefaultArchetypeArtifactManager

        public DefaultArchetypeArtifactManager()
    • Method Detail

      • getArchetypeFile

        public java.io.File getArchetypeFile​(java.lang.String groupId,
                                             java.lang.String artifactId,
                                             java.lang.String version,
                                             java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories,
                                             org.eclipse.aether.RepositorySystemSession repositorySystemSession)
                                      throws UnknownArchetype
        Specified by:
        getArchetypeFile in interface ArchetypeArtifactManager
        Throws:
        UnknownArchetype
      • getArchetypePom

        public org.apache.maven.model.Model getArchetypePom​(java.io.File jar)
                                                     throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
                                                            UnknownArchetype,
                                                            java.io.IOException
        Specified by:
        getArchetypePom in interface ArchetypeArtifactManager
        Throws:
        org.codehaus.plexus.util.xml.pull.XmlPullParserException
        UnknownArchetype
        java.io.IOException
      • exists

        public boolean exists​(java.lang.String archetypeGroupId,
                              java.lang.String archetypeArtifactId,
                              java.lang.String archetypeVersion,
                              java.util.List<org.eclipse.aether.repository.RemoteRepository> remoteRepositories,
                              org.eclipse.aether.RepositorySystemSession repositorySystemSession)
        Specified by:
        exists in interface ArchetypeArtifactManager
      • getPostGenerationScript

        public java.lang.String getPostGenerationScript​(java.io.File archetypeFile)
                                                 throws UnknownArchetype
        Description copied from interface: ArchetypeArtifactManager
        Get the archetype file's post-generation script content, read as UTF-8 content.
        Specified by:
        getPostGenerationScript in interface ArchetypeArtifactManager
        Parameters:
        archetypeFile - the archetype file
        Returns:
        the archetype file's post-generation script content or null if there is no script in the archetype
        Throws:
        UnknownArchetype
      • getArchetype

        private java.io.File getArchetype​(java.lang.String archetypeGroupId,
                                          java.lang.String archetypeArtifactId,
                                          java.lang.String archetypeVersion)
      • setArchetype

        private void setArchetype​(java.lang.String archetypeGroupId,
                                  java.lang.String archetypeArtifactId,
                                  java.lang.String archetypeVersion,
                                  java.io.File archetype)
      • isFileSetArchetype

        private boolean isFileSetArchetype​(java.util.zip.ZipFile zipFile)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • isOldArchetype

        private boolean isOldArchetype​(java.util.zip.ZipFile zipFile)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • loadFileSetArchetypeDescriptor

        private ArchetypeDescriptor loadFileSetArchetypeDescriptor​(java.util.zip.ZipFile zipFile)
                                                            throws java.io.IOException,
                                                                   org.codehaus.plexus.util.xml.pull.XmlPullParserException
        Throws:
        java.io.IOException
        org.codehaus.plexus.util.xml.pull.XmlPullParserException
      • loadOldArchetypeDescriptor

        private ArchetypeDescriptor loadOldArchetypeDescriptor​(java.util.zip.ZipFile zipFile)
                                                        throws java.io.IOException,
                                                               org.codehaus.plexus.util.xml.pull.XmlPullParserException
        Throws:
        java.io.IOException
        org.codehaus.plexus.util.xml.pull.XmlPullParserException
      • getArchetypeDescriptorReader

        private java.io.Reader getArchetypeDescriptorReader​(java.util.zip.ZipFile zipFile)
                                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getOldArchetypeDescriptorReader

        private java.io.Reader getOldArchetypeDescriptorReader​(java.util.zip.ZipFile zipFile)
                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getDescriptorReader

        private java.io.Reader getDescriptorReader​(java.util.zip.ZipFile zipFile,
                                                   java.lang.String descriptor)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • searchEntry

        private java.util.zip.ZipEntry searchEntry​(java.util.zip.ZipFile zipFile,
                                                   java.lang.String searchString)