Skip to content

Commit

Permalink
ASSETS-35923 create .cloudmanager/java-version for cloud projects, mi…
Browse files Browse the repository at this point in the history
…n jdk11 (#1175)

* create .cloudmanager/java-version for cloud projects, min jdk11
* revert change to maven-release.yml
* set maven-compiler-plugin release=11 configuration to match min jdk11

---------

Co-authored-by: Dirk Rudolph <drudolph@adobe.com>
  • Loading branch information
adamcin and Buuhuu committed Mar 12, 2024
1 parent 4cc5eb3 commit 72a123a
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@
</properties>
</profile>
<profile>
<id>it-java8</id>
<activation>
<jdk>[1.8,11)</jdk>
</activation>
<properties>
<archetype.test.projectsDirectory>${project.build.testOutputDirectory}/projects-1_8</archetype.test.projectsDirectory>
</properties>
</profile>
<profile>
<!-- This is the release profile. -->
<id>release</id>
Expand Down
11 changes: 11 additions & 0 deletions src/main/archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,17 @@
<requireMavenVersion>
<version>[3.3.9,)</version>
</requireMavenVersion>
#if ( $aemVersion == "cloud")
<requireJavaVersion>
<message>Maven must be executed with a Java 11 JRE or higher.</message>
<version>11</version>
</requireJavaVersion>
#else
<requireJavaVersion>
<message>Maven must be executed with a Java 8 JRE or higher.</message>
<version>1.8.0</version>
</requireJavaVersion>
#end
</rules>
</configuration>
</execution>
Expand All @@ -162,8 +169,12 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
#if ( $aemVersion == "cloud")
<release>11</release>
#else
<source>1.8</source>
<target>1.8</target>
#end
</configuration>
</plugin>
</plugins>
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/META-INF/archetype-post-generate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ if (aemVersion == "cloud") {
}
println "Using AEM as a Cloud Service SDK version: " + sdkVersion
rootPom.text = rootPom.text.replaceAll('SDK_VERSION', sdkVersion.toString())
def cloudManagerDir = new File(rootDir, ".cloudmanager");
assert cloudManagerDir.mkdir();
new File(cloudManagerDir, "java-version").write("11");
}

buildContentSkeleton(uiContentPackage, uiAppsPackage, singleCountry, appId, language, country)
Expand Down Expand Up @@ -259,7 +262,7 @@ if (includeForms == "y" || includeFormsenrollment == "y" || includeFormscommunic
}
println "Using AEM Forms as a Cloud Service SDK version: " + sdkFormsVersion
rootPom.text = rootPom.text.replaceAll('SDK_FORMS_VERSION', sdkFormsVersion.toString())

}

// if config.publish folder ends up empty, remove it, otherwise the filevault-package-maven-plugin will throw
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/basic
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/basic-6.5.0
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/cif
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/forms-basic-6.5.0
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/frontend-angular
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/frontend-angular-ssr
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/frontend-general
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/frontend-react
1 change: 1 addition & 0 deletions src/test/resources/projects-1_8/frontend-react-ssr

0 comments on commit 72a123a

Please sign in to comment.