Class GuvnorM2Repository


  • @ApplicationScoped
    public class GuvnorM2Repository
    extends Object
    • Constructor Detail

      • GuvnorM2Repository

        public GuvnorM2Repository()
    • Method Detail

      • getM2RepositoryDir

        public String getM2RepositoryDir​(String repositoryName)
      • getM2RepositoryRootDir

        public String getM2RepositoryRootDir​(String repositoryName)
      • getRepositoryURL

        public String getRepositoryURL​(String repositoryName)
      • deployArtifact

        public void deployArtifact​(InputStream jarStream,
                                   org.guvnor.common.services.project.model.GAV gav,
                                   boolean includeAdditionalRepositories)
      • deployArtifact

        public void deployArtifact​(InputStream jarStream,
                                   org.guvnor.common.services.project.model.GAV gav,
                                   boolean includeAdditionalRepositories,
                                   Predicate<ArtifactRepository> filter)
      • deployPom

        public void deployPom​(InputStream pomStream,
                              org.guvnor.common.services.project.model.GAV gav)
      • deployParentPom

        public void deployParentPom​(org.guvnor.common.services.project.model.GAV gav)
      • listFiles

        public Collection<File> listFiles()
        Finds files within the repository.
        Returns:
        an collection of java.io.File with the matching files
      • listFiles

        public List<File> listFiles​(String filters)
        Finds files within the repository with the given filters.
        Parameters:
        filters - filter to apply when finding files. The filter is used to create a wildcard matcher, ie., "*filter*.*", in which "*" is to represent a multiple wildcard characters.
        Returns:
        an collection of java.io.File with the matching files
      • listFiles

        public List<File> listFiles​(String filters,
                                    List<String> fileFormats)
        Finds files within the repository with the given filters and formats.
        Parameters:
        filters - filter to apply when finding files. The filter is used to create a wildcard matcher, ie., "*filter*.*", in which "*" is to represent a multiple wildcard characters.
        fileFormats - file formats to apply when finding files, ie., [ "jar", "kjar" ].
        Returns:
        an collection of java.io.File with the matching files
      • listArtifacts

        public List<org.eclipse.aether.artifact.Artifact> listArtifacts​(String filters,
                                                                        List<String> fileFormats)
      • getArtifacts

        protected Collection<org.eclipse.aether.artifact.Artifact> getArtifacts​(List<String> wildcards)
      • getKModuleText

        public String getKModuleText​(String path)
      • getKieDeploymentDescriptorText

        public String getKieDeploymentDescriptorText​(String path)
      • loadFileTextFromJar

        protected static String loadFileTextFromJar​(File jarFile,
                                                    String path,
                                                    String fileName)
      • loadGAVFromJar

        public org.guvnor.common.services.project.model.GAV loadGAVFromJar​(String jarPath)
      • loadPomFromJar

        public static String loadPomFromJar​(InputStream jarInputStream)
      • loadPomPropertiesFromJar

        public static String loadPomPropertiesFromJar​(InputStream jarInputStream)
      • toFileName

        protected String toFileName​(org.guvnor.common.services.project.model.GAV gav,
                                    String fileName)
      • generatePOM

        public String generatePOM​(org.guvnor.common.services.project.model.GAV gav)
      • generatePomProperties

        public static String generatePomProperties​(org.guvnor.common.services.project.model.GAV gav)
      • getPomXmlPath

        public String getPomXmlPath​(org.guvnor.common.services.project.model.GAV gav)
      • getPomPropertiesPath

        public String getPomPropertiesPath​(org.guvnor.common.services.project.model.GAV gav)
      • generateParentPOM

        public String generateParentPOM​(org.guvnor.common.services.project.model.GAV gav)
      • containsArtifact

        public boolean containsArtifact​(org.guvnor.common.services.project.model.GAV gav)
      • containsArtifact

        public boolean containsArtifact​(org.guvnor.common.services.project.model.GAV gav,
                                        Predicate<ArtifactRepository> filter)
      • getArtifactFileFromRepository

        public File getArtifactFileFromRepository​(org.guvnor.common.services.project.model.GAV gav)