Search in sources :

Example 1 with ExtendedM2RepoService

use of org.guvnor.m2repo.backend.server.ExtendedM2RepoService in project kie-wb-common by kiegroup.

the class BuilderTestBase method setUpGuvnorM2Repo.

protected void setUpGuvnorM2Repo() {
    Bean m2RepoServiceBean = (Bean) beanManager.getBeans(ExtendedM2RepoService.class).iterator().next();
    CreationalContext cc = beanManager.createCreationalContext(m2RepoServiceBean);
    ExtendedM2RepoService m2RepoService = (ExtendedM2RepoService) beanManager.getReference(m2RepoServiceBean, ExtendedM2RepoService.class, cc);
    String m2RepoURL = m2RepoService.getRepositoryURL(null);
    // Deploy a 1.0 version of guvnor-m2repo-dependency-example1-snapshot kjar
    GAV gav = new GAV("org.kie.workbench.common.services.builder.tests", "dependency-test1", "1.0");
    InputStream is = this.getClass().getResourceAsStream("/dependency-test1-1.0.jar");
    m2RepoService.deployJarInternal(is, gav);
    // Deploy a SNAPSHOT version of guvnor-m2repo-dependency-example1-snapshot kjar
    GAV gav2 = new GAV("org.kie.workbench.common.services.builder.tests", "dependency-test1-snapshot", "1.0-SNAPSHOT");
    InputStream is2 = this.getClass().getResourceAsStream("/dependency-test1-snapshot-1.0-SNAPSHOT.jar");
    m2RepoService.deployJarInternal(is2, gav2);
}
Also used : CreationalContext(javax.enterprise.context.spi.CreationalContext) InputStream(java.io.InputStream) GAV(org.guvnor.common.services.project.model.GAV) Bean(javax.enterprise.inject.spi.Bean) ExtendedM2RepoService(org.guvnor.m2repo.backend.server.ExtendedM2RepoService)

Aggregations

InputStream (java.io.InputStream)1 CreationalContext (javax.enterprise.context.spi.CreationalContext)1 Bean (javax.enterprise.inject.spi.Bean)1 GAV (org.guvnor.common.services.project.model.GAV)1 ExtendedM2RepoService (org.guvnor.m2repo.backend.server.ExtendedM2RepoService)1