Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove quarkus-bom-deployment deprecated in 1.6.0.Final #10714

Merged
merged 1 commit into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
57 changes: 0 additions & 57 deletions bom/deployment/pom.xml

This file was deleted.

2 changes: 1 addition & 1 deletion build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<!-- Quarkus Extensions Dependencies are coming from quarkus-bom-deployment (that also imports quarkus-bom) -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom-deployment</artifactId>
<artifactId>quarkus-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class CreateExtensionMojo extends AbstractMojo {
static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("@\\{([^\\}]+)\\}");

static final String PLATFORM_DEFAULT_GROUP_ID = "io.quarkus";
static final String PLATFORM_DEFAULT_ARTIFACT_ID = "quarkus-bom-deployment";
static final String PLATFORM_DEFAULT_ARTIFACT_ID = "quarkus-bom";

static final String COMPILER_PLUGIN_VERSION_PROP = "compiler-plugin.version";
static final String COMPILER_PLUGIN_VERSION_POM_EXPR = "${" + COMPILER_PLUGIN_VERSION_PROP + "}";
Expand All @@ -106,13 +106,13 @@ public class CreateExtensionMojo extends AbstractMojo {
File basedir;

/**
* The {@code groupId} of the Quarkus platform's BOM containing deployment dependencies.
* The {@code groupId} of the Quarkus platform BOM.
*/
@Parameter(property = "platformGroupId", defaultValue = PLATFORM_DEFAULT_GROUP_ID)
String platformGroupId;

/**
* The {@code artifactId} of the Quarkus platform's BOM containing deployment dependencies.
* The {@code artifactId} of the Quarkus platform BOM.
*/
@Parameter(property = "platformArtifactId", defaultValue = PLATFORM_DEFAULT_ARTIFACT_ID)
String platformArtifactId;
Expand Down Expand Up @@ -385,25 +385,14 @@ public class CreateExtensionMojo extends AbstractMojo {

/**
* Path relative to {@link #basedir} pointing at a {@code pom.xml} file containing the BOM (Bill of Materials) that
* manages runtime extension artifacts. If set, the newly created Runtime module will be added to
* {@code <dependencyManagement>} section of this bom; otherwise the newly created Runtime module will not be added
* manages extension artifacts. If set, the newly created runtime and deployment modules will be added to
* {@code <dependencyManagement>} section of this bom; otherwise the newly created modules will not be added
* to any BOM.
*
* @since 0.21.0
* @since 1.7.0.Final
*/
@Parameter(property = "quarkus.runtimeBomPath")
Path runtimeBomPath;

/**
* Path relative to {@link #basedir} pointing at a {@code pom.xml} file containing the BOM (Bill of Materials) that
* manages deployment time extension artifacts. If set, the newly created Deployment module will be added to
* {@code <dependencyManagement>} section of this bom; otherwise the newly created Deployment module will not be
* added to any BOM.
*
* @since 0.21.0
*/
@Parameter(property = "quarkus.deploymentBomPath")
Path deploymentBomPath;
@Parameter(property = "bomPath")
Path bomPath;

/**
* A version for the entries added to the runtime BOM (see {@link #runtimeBomPath}) and to the deployment BOM (see
Expand Down Expand Up @@ -560,16 +549,10 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}
}

if (runtimeBomPath != null) {
runtimeBomPath = basedir.toPath().resolve(runtimeBomPath);
if (!Files.exists(runtimeBomPath)) {
throw new MojoFailureException("runtimeBomPath does not exist: " + runtimeBomPath);
}
}
if (deploymentBomPath != null) {
deploymentBomPath = basedir.toPath().resolve(deploymentBomPath);
if (!Files.exists(deploymentBomPath)) {
throw new MojoFailureException("deploymentBomPath does not exist: " + deploymentBomPath);
if (bomPath != null) {
bomPath = basedir.toPath().resolve(bomPath);
if (!Files.exists(bomPath)) {
throw new MojoFailureException("runtimeBomPath does not exist: " + bomPath);
}
}

Expand Down Expand Up @@ -659,26 +642,24 @@ public void execute() throws MojoExecutionException, MojoFailureException {
addModules(rootPom.toPath(), templateParams, rootModel);
}

if (runtimeBomPath != null) {
if (bomPath != null) {
getLog().info(
String.format("Adding [%s] to dependencyManagement in [%s]", templateParams.artifactId,
runtimeBomPath));
bomPath));
List<PomTransformer.Transformation> transformations = new ArrayList<PomTransformer.Transformation>();
transformations
.add(Transformation.addManagedDependency(templateParams.groupId, templateParams.artifactId,
templateParams.bomEntryVersion));
for (Gavtcs gavtcs : templateParams.additionalRuntimeDependencies) {
getLog().info(String.format("Adding [%s] to dependencyManagement in [%s]", gavtcs, runtimeBomPath));
getLog().info(String.format("Adding [%s] to dependencyManagement in [%s]", gavtcs, bomPath));
transformations.add(Transformation.addManagedDependency(gavtcs));
}
pomTransformer(runtimeBomPath).transform(transformations);
}
if (deploymentBomPath != null) {
final String aId = templateParams.artifactId + "-deployment";
getLog().info(String.format("Adding [%s] to dependencyManagement in [%s]", aId, deploymentBomPath));
pomTransformer(deploymentBomPath)
.transform(Transformation.addManagedDependency(templateParams.groupId, aId,
templateParams.bomEntryVersion));
getLog().info(String.format("Adding [%s] to dependencyManagement in [%s]", aId, bomPath));
transformations.add(Transformation.addManagedDependency(templateParams.groupId, aId,
templateParams.bomEntryVersion));

pomTransformer(bomPath).transform(transformations);
}
if (itestParentPath != null) {
generateItest(cfg, templateParams);
Expand Down Expand Up @@ -854,7 +835,7 @@ private TemplateParams getTemplateParams(Model basePom) throws MojoExecutionExce
templateParams.javaPackageBase = javaPackageBase != null ? javaPackageBase
: getJavaPackage(templateParams.groupId, javaPackageInfix, artifactId);
templateParams.additionalRuntimeDependencies = getAdditionalRuntimeDependencies();
templateParams.runtimeBomPathSet = runtimeBomPath != null;
templateParams.runtimeBomPathSet = bomPath != null;
return templateParams;
}

Expand Down Expand Up @@ -1061,24 +1042,10 @@ static String artifactIdBase(String artifactId) {
}
}

public void setRuntimeBomPath(String runtimeBomPath) {
this.runtimeBomPath = Paths.get(runtimeBomPath);
}

public void setDeploymentBomPath(String deploymentBomPath) {
this.deploymentBomPath = Paths.get(deploymentBomPath);
}

public void setItestParentPath(String itestParentPath) {
this.itestParentPath = Paths.get(itestParentPath);
}

private void debug(String format, Object... args) {
if (getLog().isDebugEnabled()) {
getLog().debug(String.format(format, args));
}
}

public static class TemplateParams {
String grandParentRelativePath;
String grandParentVersion;
Expand Down
3 changes: 1 addition & 2 deletions extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@
<artifactIdPrefix>quarkus-</artifactIdPrefix>
<namePrefix xml:space="preserve">Quarkus - </namePrefix>
<quarkusVersion>@{project.version}</quarkusVersion>
<runtimeBomPath>../bom/runtime/pom.xml</runtimeBomPath>
<deploymentBomPath>../bom/deployment/pom.xml</deploymentBomPath>
<bomPath>../bom/application/pom.xml</runtimeBomPath>
<itestParentPath>../integration-tests/pom.xml</itestParentPath>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

dependencies {
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}-deployment:${quarkusPlatformVersion}")
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
implementation 'io.quarkus:quarkus-core-deployment'
implementation project(":runtime")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static CreateExtensionMojo initMojo(final Path projectDir) throws IOExce
if (deps != null && !deps.isEmpty()) {
Dependency deploymentBom = null;
for (Dependency dep : deps) {
if (dep.getArtifactId().equals("quarkus-bom-deployment") && dep.getGroupId().equals("io.quarkus")) {
if (dep.getArtifactId().equals("quarkus-bom") && dep.getGroupId().equals("io.quarkus")) {
deploymentBom = dep;
}
}
Expand Down Expand Up @@ -140,7 +140,7 @@ void createExtensionUnderExistingPomWithAdditionalRuntimeDependencies() throws M
final CreateExtensionMojo mojo = initMojo(createProjectFromTemplate("create-extension-pom"));
mojo.artifactId = "my-project-(add-to-bom)";
mojo.assumeManaged = false;
mojo.runtimeBomPath = Paths.get("boms/runtime/pom.xml");
mojo.bomPath = Paths.get("bom/pom.xml");
mojo.additionalRuntimeDependencies = Arrays.asList("org.example:example-1:1.2.3",
"org.acme:acme-@{quarkus.artifactIdBase}:@{$}{acme.version}");
mojo.execute();
Expand Down Expand Up @@ -171,8 +171,7 @@ void createExtensionUnderExistingPomCustomGrandParent() throws MojoExecutionExce
mojo.grandParentRelativePath = "../pom.xml";
mojo.templatesUriBase = "file:templates";

mojo.runtimeBomPath = Paths.get("boms/runtime/pom.xml");
mojo.deploymentBomPath = Paths.get("boms/deployment/pom.xml");
mojo.bomPath = Paths.get("bom/pom.xml");
mojo.execute();
assertTreesMatch(
Paths.get("src/test/resources/expected/create-extension-pom-with-grand-parent"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<groupId>org.acme</groupId>
<artifactId>grand-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>runtime-bom</artifactId>
<artifactId>bom</artifactId>
<packaging>pom</packaging>

<dependencyManagement>
Expand All @@ -28,6 +28,11 @@
<artifactId>acme-add-to-bom</artifactId>
<version>${acme.version}</version>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>my-project-add-to-bom-deployment</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<quarkus.version>0.19.0</quarkus.version>
<quarkus.version>1.6.0.Final</quarkus.version>
<rest-assured.version>3.3.0</rest-assured.version>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
</properties>
Expand All @@ -21,7 +21,7 @@
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom-deployment</artifactId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<groupId>org.acme</groupId>
<artifactId>grand-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>runtime-bom</artifactId>
<artifactId>bom</artifactId>
<packaging>pom</packaging>

<dependencyManagement>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<quarkus.version>0.19.0</quarkus.version>
<quarkus.version>1.6.0.Final</quarkus.version>
<rest-assured.version>3.3.0</rest-assured.version>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
</properties>
Expand All @@ -21,7 +21,7 @@
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom-deployment</artifactId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<groupId>org.acme</groupId>
<artifactId>grand-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>runtime-bom</artifactId>
<artifactId>bom</artifactId>
<packaging>pom</packaging>

<dependencyManagement>
Expand Down
Loading