Skip to content

Commit

Permalink
Change camel-community.version default property to camel-community-ve…
Browse files Browse the repository at this point in the history
…rsion to match camel's property style
  • Loading branch information
cunningt authored and ppalaga committed Dec 5, 2024
1 parent 8235585 commit f248b4a
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 57 deletions.
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Use `mvn help:describe` to see the full set of parameters.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-package-maven-plugin</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down Expand Up @@ -142,11 +142,11 @@ mvn org.l2x6.cq:cq-camel-prod-maven-plugin:camel-prod-excludes -N
</plugin>
----

A version property `<camel-community.version>3.14.1</camel-community.version>` needs to be added to the pom.xml for the maven plugin to execute successfully.
A version property `<camel-community-version>3.14.1</camel-community-version>` needs to be added to the pom.xml for the maven plugin to execute successfully.

From CAMEL_SPRING_BOOT_HOME, camel-spring-boot-prod-excludes is used to comment out modules that should not be productized.

A version property `<camel-community.version>3.14.1</camel-community.version>` needs to be added to the pom.xml for the maven plugin to execute successfully.
A version property `<camel-community-version>3.14.1</camel-community-version>` needs to be added to the pom.xml for the maven plugin to execute successfully.

To invoke :

Expand Down Expand Up @@ -177,7 +177,7 @@ Configured in the pom.xml :
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-package-maven-plugin</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ enum CamelCommunityVersionStyle implements AnyVersionStyle {
CAMEL_COMMUNITY_VERSION {
@Override
public String getExpectedVersion(String literalVersion) {
return "${camel-community.version}";
return "${camel-community-version}";
}
},
LITERAL {
Expand Down Expand Up @@ -214,7 +214,7 @@ public String getExpectedVersion(String literalVersion) {
/**
* @since 2.11.0
*/
@Parameter(property = "cq.camelCommunityVersion", defaultValue = "${camel-community.version}")
@Parameter(property = "cq.camelCommunityVersion", defaultValue = "${camel-community-version}")
String camelCommunityVersion;

Map<String, VersionStyle> versionStylesByPath;
Expand Down Expand Up @@ -287,7 +287,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {

final Path rootPomPath = workRoot.resolve("pom.xml");
new PomTransformer(rootPomPath, charset, simpleElementWhitespace)
.transform(Transformation.addOrSetProperty("camel-community.version", camelCommunityVersion));
.transform(Transformation.addOrSetProperty("camel-community-version", camelCommunityVersion));

final MavenSourceTree initialTree = MavenSourceTree.of(rootPomPath, charset, Dependency::isVirtual);
final Predicate<Profile> profiles = ActiveProfiles.of();
Expand All @@ -301,7 +301,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
.transform(Transformation.setTextValue("/" +
PomTunerUtils.anyNs("plugin", "version") + "[.." + PomTunerUtils.anyNs("groupId")
+ "/text() = 'org.apache.camel']",
"${camel-community.version}"));
"${camel-community-version}"));
});

/* Make a copy of the originalFullTree */
Expand Down Expand Up @@ -385,7 +385,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
fullTree.unlinkModules(expandedIncludes, profiles, charset, simpleElementWhitespace,
(Set<String> unlinkModules) -> Transformation.commentModules(unlinkModules, MODULE_COMMENT));

/* Replace ${project.version} with ${camel-community.version} where necessary */
/* Replace ${project.version} with ${camel-community-version} where necessary */
final MavenSourceTree reducedTree = MavenSourceTree.of(rootPomPath, charset, Dependency::isVirtual);
reducedTree.getModulesByGa().values().forEach(module -> {
final List<Transformation> transformations = new ArrayList<>();
Expand Down Expand Up @@ -427,7 +427,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
.transform(Transformation.setTextValue("/" +
PomTunerUtils.anyNs("dependency", "version") + "[.." + PomTunerUtils.anyNs("artifactId")
+ "/text() = 'camel-buildtools']",
"${camel-community.version}"));
"${camel-community-version}"));
});

if (isChecking() && onCheckFailure != OnFailure.IGNORE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
.ifPresent(transformations::add);
});

/* We do not productize camel test-infra - we need to set these to ${camel-community.version} */
/* We do not productize camel test-infra - we need to set these to ${camel-community-version} */
profile.getDependencies().stream()
.filter(dep -> "org.apache.camel".equals(dep.getGroupId().asConstant())
&& "test-jar".equals(dep.getType())
Expand All @@ -382,7 +382,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
final VersionStyle vs = versionStylesByPath.get(module.getPomPath());

transformations.add(Transformation.setDependencyVersion(profile.getId(),
"${camel-community.version}", Collections.singletonList(ga)));
"${camel-community-version}", Collections.singletonList(ga)));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ enum CqEdition {

public enum CamelEdition {
PRODUCT("${camel.version}"),
COMMUNITY("${camel-community.version}");
COMMUNITY("${camel-community-version}");

CamelEdition(String versionExpression) {
this.versionExpression = versionExpression;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ public void execute() throws MojoExecutionException, MojoFailureException {
/* Add some community props */
final ContainerElement props = context.getOrAddContainerElement("properties");

getLog().info("Adding to pom.xml: camel-community.version property");
props.addChildTextElementIfNeeded("camel-community.version",
getLog().info("Adding to pom.xml: camel-community-version property");
props.addChildTextElementIfNeeded("camel-community-version",
"${camel.major.minor}." + camelVersion.split("\\.")[2],
Comparator.comparing(Map.Entry::getKey, Comparators.before("camel.version")));

Expand Down Expand Up @@ -258,7 +258,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Adding to pom.xml: product module");
modules.addChildTextElement("module", "product");

/* Change the version of camel-build-tools under license-maven-plugin to camel-community.version */
/* Change the version of camel-build-tools under license-maven-plugin to camel-community-version */
final ContainerElement managedPlugins = context.getOrAddContainerElements("build", "pluginManagement",
"plugins");
final ContainerElement licensePlugin = managedPlugins.childElementsStream()
Expand All @@ -271,7 +271,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
final ContainerElement buildToolsDep = licensePlugin
.getOrAddChildContainerElement("dependencies")
.getOrAddChildContainerElement("dependency");
final String camelCommunityVersion = "${camel-community.version}";
final String camelCommunityVersion = "${camel-community-version}";
getLog().info("Setting version in pom.xml: camel-buildtools "
+ buildToolsDep.getChildContainerElement("version").get().getNode().getTextContent() + " -> "
+ camelCommunityVersion);
Expand Down Expand Up @@ -422,9 +422,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
.filter(gavtcs -> "camel-salesforce-maven-plugin".equals(gavtcs.getArtifactId())
|| "camel-servicenow-maven-plugin".equals(gavtcs.getArtifactId()))
.peek(gavtcs -> getLog()
.info("Updating " + gavtcs.getArtifactId() + " version to ${camel-community.version}"))
.info("Updating " + gavtcs.getArtifactId() + " version to ${camel-community-version}"))
.map(PomTransformer.NodeGavtcs::getNode)
.forEach(containerElement -> containerElement.setVersion("${camel-community.version}"));
.forEach(containerElement -> containerElement.setVersion("${camel-community-version}"));
});

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public void execute() {
.append("</groupId>\n <artifactId>")
.append(ga.getArtifactId())
.append("</artifactId>\n <version>")
.append(prodTransitiveGas.contains(ga) ? "${camel.version}" : "${camel-community.version}")
.append(prodTransitiveGas.contains(ga) ? "${camel.version}" : "${camel-community-version}")
.append("</version>\n </dependency>"));
throw new RuntimeException(sb.toString());
}
Expand Down
2 changes: 1 addition & 1 deletion prod-maven-plugin/src/test/expected/check-initial/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- Primary dependencies - maintained manually -->
<camel.major.minor>3.11</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
<camel.version>${camel.major.minor}.1-fuse1</camel.version>
<camel-community.version>${camel.major.minor}.1</camel-community.version>
<camel-community-version>${camel.major.minor}.1</camel-community-version>
<camel.docs.components.xref>${camel.major.minor}.x@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
<camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable branch on which our Antora docs depends -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- Primary dependencies - maintained manually -->
<camel.major.minor>3.11</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
<camel.version>${camel.major.minor}.1-fuse1</camel.version>
<camel-community.version>${camel.major.minor}.1</camel-community.version>
<camel-community-version>${camel.major.minor}.1</camel-community-version>
<camel.docs.components.xref>${camel.major.minor}.x@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
<camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable branch on which our Antora docs depends -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,32 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-direct</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-avro</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-asn1</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cloud</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-log</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>

<!--$ org.apache.camel.quarkus $-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- Primary dependencies - maintained manually -->
<camel.major.minor>3.11</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
<camel.version>${camel.major.minor}.1-fuse1</camel.version>
<camel-community.version>${camel.major.minor}.1</camel-community.version>
<camel-community-version>${camel.major.minor}.1</camel-community-version>
<camel.docs.components.xref>${camel.major.minor}.x@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
<camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable branch on which our Antora docs depends -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,32 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-direct</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-avro</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-asn1</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cloud</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-log</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>

<!--$ org.apache.camel.quarkus $-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- Primary dependencies - maintained manually -->
<camel.major.minor>3.11</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
<camel.version>${camel.major.minor}.1-fuse1</camel.version>
<camel-community.version>${camel.major.minor}.1</camel-community.version>
<camel-community-version>${camel.major.minor}.1</camel-community-version>
<camel.docs.components.xref>${camel.major.minor}.x@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
<camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable branch on which our Antora docs depends -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,32 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-direct</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-avro</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-asn1</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cloud</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-log</artifactId>
<version>${camel-community.version}</version>
<version>${camel-community-version}</version>
</dependency>

<!--$ org.apache.camel.quarkus $-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- Primary dependencies - maintained manually -->
<camel.major.minor>3.11</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
<camel.version>${camel.major.minor}.1-fuse1</camel.version>
<camel-community.version>${camel.major.minor}.1</camel-community.version>
<camel-community-version>${camel.major.minor}.1</camel-community-version>
<camel.docs.components.xref>${camel.major.minor}.x@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
<camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable branch on which our Antora docs depends -->

Expand Down
Loading

0 comments on commit f248b4a

Please sign in to comment.