Search in sources :

Example 1 with MojoRule

use of org.apache.maven.plugin.testing.MojoRule in project jib by google.

the class TestRepository method before.

@Override
protected void before() throws ComponentLookupException, URISyntaxException, MalformedURLException {
    MojoRule testHarness = new MojoRule();
    ArtifactRepositoryFactory artifactRepositoryFactory = testHarness.lookup(ArtifactRepositoryFactory.class);
    artifactResolver = testHarness.lookup(ArtifactResolver.class);
    jarHandler = testHarness.lookup(ArtifactHandlerManager.class).getArtifactHandler("jar");
    testLocalRepo = artifactRepositoryFactory.createArtifactRepository("test", Resources.getResource(TEST_M2).toURI().toURL().toString(), new DefaultRepositoryLayout(), null, null);
}
Also used : MojoRule(org.apache.maven.plugin.testing.MojoRule) ArtifactRepositoryFactory(org.apache.maven.artifact.repository.ArtifactRepositoryFactory) DefaultRepositoryLayout(org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout) ArtifactResolver(org.apache.maven.artifact.resolver.ArtifactResolver)

Example 2 with MojoRule

use of org.apache.maven.plugin.testing.MojoRule in project jib by GoogleContainerTools.

the class TestRepository method before.

@Override
protected void before() throws ComponentLookupException, URISyntaxException, MalformedURLException {
    MojoRule testHarness = new MojoRule();
    ArtifactRepositoryFactory artifactRepositoryFactory = testHarness.lookup(ArtifactRepositoryFactory.class);
    artifactResolver = testHarness.lookup(ArtifactResolver.class);
    jarHandler = testHarness.lookup(ArtifactHandlerManager.class).getArtifactHandler("jar");
    testLocalRepo = artifactRepositoryFactory.createArtifactRepository("test", Resources.getResource(TEST_M2).toURI().toURL().toString(), new DefaultRepositoryLayout(), null, null);
}
Also used : MojoRule(org.apache.maven.plugin.testing.MojoRule) ArtifactRepositoryFactory(org.apache.maven.artifact.repository.ArtifactRepositoryFactory) DefaultRepositoryLayout(org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout) ArtifactResolver(org.apache.maven.artifact.resolver.ArtifactResolver)

Aggregations

ArtifactRepositoryFactory (org.apache.maven.artifact.repository.ArtifactRepositoryFactory)2 DefaultRepositoryLayout (org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout)2 ArtifactResolver (org.apache.maven.artifact.resolver.ArtifactResolver)2 MojoRule (org.apache.maven.plugin.testing.MojoRule)2