GuvnorM2Repository { public String getPomText(final String path) { ArtifactRepository repository = this.getArtifactRepository(ArtifactRepositoryService.GLOBAL_M2_REPO_NAME); final File file = new File(repository.getRootDir(), path); final String normalizedPath = file.toPath().normalize().toString(); if (isJar(normalizedPath) || isKJar(normalizedPath)) { return loadPomFromJar(file); } else if (isDeployedPom(normalizedPath)) { return loadPom(file); } else { throw new RuntimeException("Not a valid jar, kjar or pom file: " + path); } } GuvnorM2Repository(); @Inject  GuvnorM2Repository(ArtifactRepositoryService factory); @PostConstruct void init(); String getM2RepositoryDir(String repositoryName); String getM2RepositoryRootDir(String repositoryName); String getRepositoryURL(String repositoryName); void deployArtifact(final InputStream jarStream,
                               final GAV gav,
                               final boolean includeAdditionalRepositories); void deployArtifact(final InputStream jarStream,
                               final GAV gav,
                               final boolean includeAdditionalRepositories,
                               final Predicate<ArtifactRepository> filter); void deployPom(final InputStream pomStream,
                          final GAV gav); void deployParentPom(final GAV gav); Collection<File> listFiles(); List<File> listFiles(final String filters); List<File> listFiles(final String filters,
                                List<String> fileFormats); List<Artifact> listArtifacts(final String filters,
                                        List<String> fileFormats); String getPomText(final String path); String getKModuleText(final String path); String getKieDeploymentDescriptorText(final String path); GAV loadGAVFromJar(final String jarPath); static String loadPomFromJar(final InputStream jarInputStream); static String loadPomPropertiesFromJar(final InputStream jarInputStream); String generatePOM(final GAV gav); static String generatePomProperties(final GAV gav); String getPomXmlPath(final GAV gav); String getPomPropertiesPath(final GAV gav); String generateParentPOM(final GAV gav); boolean containsArtifact(final GAV gav); boolean containsArtifact(final GAV gav,
                                    final Predicate<ArtifactRepository> filter); File getArtifactFileFromRepository(final GAV gav);  }
@Test public void testGetPomTextVerifiesPath() { repo.getPomText("dir/name.pom"); repo.getPomText("dir/name.kjar"); repo.getPomText("dir/name.jar"); exception.expect(RuntimeException.class); repo.getPomText("dir/name.foo"); }