Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {
}

dependencies {
implementation enforcedPlatform("io.quarkus:quarkus-bom:${quarkusVersion}")
implementation enforcedPlatform("${bom_groupId}:${bom_artifactId}:${bom_version}")
implementation 'io.quarkus:quarkus-resteasy'

testImplementation 'io.quarkus:quarkus-junit5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public boolean doCreateProject(final Map<String, Object> context) throws IOExcep
context.put(PROJECT_VERSION, version);
context.put(BOM_GROUP_ID, getBomGroupId());
context.put(BOM_ARTIFACT_ID, getBomArtifactId());
context.put(BOM_VERSION, getBomVersionForTemplate());
context.put(BOM_VERSION, getBomVersionForTemplate(getBuildFile().getPlatformBomVersionExpression()));
context.put(QUARKUS_VERSION, getQuarkusVersion());
context.put(SOURCE_TYPE, sourceType);
context.put(BUILD_FILE, getBuildFile());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public BuildFile(final ProjectWriter writer, BuildTool buildTool) {
this.buildTool = buildTool;
}

public abstract String getPlatformBomVersionExpression();

protected void write(String fileName, String content) throws IOException {
writer.write(fileName, content);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public GradleBuildFile(ProjectWriter writer) {
super(writer, BuildTool.GRADLE);
}

@Override
public String getPlatformBomVersionExpression() {
return "${quarkusVersion}";
}

@Override
public void close() throws IOException {
write(SETTINGS_GRADLE_PATH, getModel().getSettingsContent());
Expand Down Expand Up @@ -255,9 +260,5 @@ public void setSettingsContent(String settingsContent) {
public void setBuildContent(String buildContent) {
this.buildContent = buildContent;
}

public void setPropertiesContent(Properties propertiesContent) {
this.propertiesContent = propertiesContent;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ private void initModel() throws IOException {
}
}

@Override
public String getPlatformBomVersionExpression() {
return MojoUtils.QUARKUS_VERSION_PROPERTY;
}

@Override
public void close() throws IOException {
if(getModel() == null) {
Expand Down Expand Up @@ -117,7 +122,7 @@ private void addBom() throws IOException {
Dependency bom = new Dependency();
bom.setGroupId(getBomGroupId());
bom.setArtifactId(getBomArtifactId());
bom.setVersion(getBomVersionForTemplate());
bom.setVersion(getBomVersionForTemplate(getPlatformBomVersionExpression()));
bom.setType("pom");
bom.setScope("import");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ public static String getBomVersion() {
return getPlatformDescriptor().getBomVersion();
}

public static String getBomVersionForTemplate() {
public static String getBomVersionForTemplate(String defaultValue) {
final String v = getBomVersion();
if(v.equals(getQuarkusVersion())) {
// this might not always work but at this point we're assuming the bom is coming from Quarkus itself
return QUARKUS_VERSION_PROPERTY;
return defaultValue;
}
return v;
}
Expand Down