Search in sources :

Example 21 with TsArtifact

use of io.quarkus.bootstrap.resolver.TsArtifact in project quarkus by quarkusio.

the class BasicBuildFromWorkspaceModuleTest method composeApplication.

@Override
protected WorkspaceModule composeApplication() throws Exception {
    // Acme Quarkus extension
    final TsQuarkusExt acmeExt = new TsQuarkusExt("acme-ext");
    install(acmeExt);
    addToExpectedLib(acmeExt.getRuntime());
    // Acme Quarkus platform BOM
    final TsArtifact acmeBom = TsArtifact.pom("org.acme", "acme-bom", "1.0");
    acmeBom.addManagedDependency(platformDescriptor());
    acmeBom.addManagedDependency(platformProperties());
    acmeBom.addManagedDependency(new TsDependency(acmeExt.getRuntime()));
    install(acmeBom);
    final WorkspaceModule module = WorkspaceModule.builder().setModuleId(WorkspaceModuleId.of("org.acme", "acme-app", "1")).setModuleDir(mkdir("app-module")).setBuildDir(mkdir("target")).addArtifactSources(ArtifactSources.main(SourceDir.of(mkdir("app-module/main/java"), mkdir("main/classes")), SourceDir.of(mkdir("app-module/main/resources"), mkdir("main/classes")))).addArtifactSources(ArtifactSources.test(SourceDir.of(mkdir("app-module/test/java"), mkdir("test/classes")), SourceDir.of(mkdir("app-module/test/resources"), mkdir("test/classes")))).addDependencyConstraint(Dependency.pomImport(acmeBom.getGroupId(), acmeBom.getArtifactId(), acmeBom.getVersion())).addDependency(Dependency.of(acmeExt.getRuntime().getGroupId(), acmeExt.getRuntime().getArtifactId())).build();
    return module;
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt) WorkspaceModule(io.quarkus.bootstrap.workspace.WorkspaceModule) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 22 with TsArtifact

use of io.quarkus.bootstrap.resolver.TsArtifact in project quarkus by quarkusio.

the class DirectUserDepsOverrideTransitiveExtDepsTest method composeApplication.

@Override
protected TsArtifact composeApplication() {
    final TsArtifact common1 = TsArtifact.jar("common", "1");
    final TsQuarkusExt ext1 = new TsQuarkusExt("ext1");
    ext1.getRuntime().addDependency(common1);
    addToExpectedLib(ext1.getRuntime());
    final TsArtifact common2 = TsArtifact.jar("common", "2");
    final TsQuarkusExt ext2 = new TsQuarkusExt("ext2");
    ext2.getRuntime().addDependency(common2);
    addToExpectedLib(ext2.getRuntime());
    final TsArtifact common3 = TsArtifact.jar("common", "3");
    addToExpectedLib(common3);
    final TsArtifact appJar = TsArtifact.jar("app").addManagedDependency(platformDescriptor()).addManagedDependency(platformProperties()).addDependency(ext1).addDependency(common3).addDependency(ext2);
    return appJar;
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt)

Example 23 with TsArtifact

use of io.quarkus.bootstrap.resolver.TsArtifact in project quarkus by quarkusio.

the class DependencyTreeMojoTestBase method initRepo.

protected void initRepo() throws Exception {
    final TsQuarkusExt coreExt = new TsQuarkusExt("test-core-ext");
    app = TsArtifact.jar("test-app").addDependency(new TsArtifact(TsArtifact.DEFAULT_GROUP_ID, "artifact-with-classifier", "classifier", "jar", TsArtifact.DEFAULT_VERSION)).addDependency(new TsQuarkusExt("test-ext2").addDependency(new TsQuarkusExt("test-ext1").addDependency(coreExt))).addDependency(new TsDependency(TsArtifact.jar("optional"), true)).addDependency(new TsQuarkusExt("test-ext3").addDependency(coreExt)).addDependency(new TsDependency(TsArtifact.jar("provided"), "provided")).addDependency(new TsDependency(TsArtifact.jar("runtime"), "runtime")).addDependency(new TsDependency(TsArtifact.jar("test"), "test"));
    appModel = app.getPomModel();
    app.install(repoBuilder);
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 24 with TsArtifact

use of io.quarkus.bootstrap.resolver.TsArtifact in project quarkus by quarkusio.

the class ProvidedScopeDepsAreNotCollectedTestCase method setupDependencies.

@Override
protected void setupDependencies() {
    final TsArtifact notCollected = new TsArtifact("not-collected");
    // install(notCollected, false);
    final TsArtifact common1 = new TsArtifact("common", "1").addDependency(new TsDependency(notCollected, "provided"));
    install(common1, true);
    installAsDep(new TsArtifact("required-dep").addDependency(common1), true);
    installAsDep(new TsDependency(new TsArtifact("provided-dep").addDependency(new TsArtifact("common", "2")), "provided"), false);
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 25 with TsArtifact

use of io.quarkus.bootstrap.resolver.TsArtifact in project quarkus by quarkusio.

the class TestScopeIsNotAmongRuntimeDependenciesTestCase method setupDependencies.

@Override
protected void setupDependencies() {
    installAsDep(new TsDependency(new TsArtifact("required-dep-a"), "compile"), true);
    installAsDep(new TsDependency(new TsArtifact("required-dep-b"), "runtime"), true);
    installAsDep(new TsDependency(new TsArtifact("direct-test-dep").addDependency(new TsArtifact("common", "1").addDependency(new TsDependency(new TsArtifact("not-collected"), "test"))), "test"), false);
    final TsArtifact common = install(new TsArtifact("common", "2"), true);
    installAsDep(new TsArtifact("required-dep-c").addDependency(common), true);
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Aggregations

TsArtifact (io.quarkus.bootstrap.resolver.TsArtifact)30 TsDependency (io.quarkus.bootstrap.resolver.TsDependency)18 TsQuarkusExt (io.quarkus.bootstrap.resolver.TsQuarkusExt)13 ContentProvider (io.quarkus.bootstrap.resolver.TsArtifact.ContentProvider)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 WorkspaceModule (io.quarkus.bootstrap.workspace.WorkspaceModule)1 BufferedWriter (java.io.BufferedWriter)1 OutputStream (java.io.OutputStream)1 Properties (java.util.Properties)1 Activation (org.apache.maven.model.Activation)1 ActivationProperty (org.apache.maven.model.ActivationProperty)1 Dependency (org.apache.maven.model.Dependency)1 Profile (org.apache.maven.model.Profile)1