-
Notifications
You must be signed in to change notification settings - Fork 320
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
Tycho 3 and Java toolchain #2216
Comments
my main question about toolchains is:
|
I believe that this option is too complex and would basically limit you to use only what's available in Tycho 2.7.
That's probably the better option forward.
For plain Maven project (with packaging-type jar) this magic should happen in the maven-toolchain-plugin: From #2210 (comment)
Tycho can auto-magically selects the corresponding Toolchain based on the BREE/osgi.ee requirement of a bundle, when using the tycho-compiler-plugin:useJDK configuration parameter. Regarding the locations of the actual JVM, please see: https://github.com/actions/setup-java/#install-multiple-jdks The setup-java action can even create a toolchains file on the fly, but I have not yet checked if that is suitable: In Jenkins you could do something like the following. You only have to ensure that the env-variable names match the names used in the toolchain.xml
|
@HannesWell but the Maven documentation mentions that you need to use a maven toolchain plugin, and I haven't found that in the SWT repository. Please, remember that in some projects (packaging jar) the tycho-compiler-plugin is not used and the default maven-compiler-plugin is used. |
That's probably because in the SWT repo there are not jar-typed projects.
Then for xtext we probably need to configure both, tycho-compiler-plugin:useJDK and the maven-toolchain-plugin. I have not yet used the latter myself so cannot yet provide any more details in that regard yet. In general it is often a good idea to only require toolchains in the CI activated in a corresponding Maven profile. This allows local builds without the need to set up toolchains on a computer. Then just the release option of the compiler is used, which is often not that bad. Using toolchains you can just be more confident. @LorenzoBettini do you plan to provide a PR to do the migration to Tycho 3? Alternativly I can offer to work that out? |
@HannesWell I cannot work on that right now. If you are willing to work on that I can follow. Of course, first, you can only try on GitHub Actions, then we'll deal with Jenkins. First, let's hear from @cdietrich : do you think we can give it a try? |
sure. give it a try. |
Great, I have started to work on it. I'll provide a draft as soon. |
@HannesWell #2214 has been merged |
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/integration-test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216 Signed-off-by: Hannes Wellmann <[email protected]>
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216 Signed-off-by: Hannes Wellmann <[email protected]>
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216
Created #2223 with the current state of the work, which should be quite complete besides the failures that have to be fixed. |
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes #2216
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216 Co-authored-by: Lorenzo Bettini <[email protected]>
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216 Co-authored-by: Lorenzo Bettini <[email protected]>
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216 Signed-off-by: Hannes Wellmann <[email protected]>
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes eclipse-xtext#2216 Co-authored-by: Lorenzo Bettini <[email protected]> Signed-off-by: Hannes Wellmann <[email protected]>
General guide for Maven toolchains: https://maven.apache.org/guides/mini/guide-using-toolchains.html Using the Maven-Toolchain-Plugin and its 'toolchain' goal the maven-compiler-plugin is configured to use a JDK from the toolchain that matches the specified release version. Configure the Tycho-Compiler-Plugin to use the JDK in the toolchain that matches the Bundle-RequiredExecutionEnvironment: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-compiler-plugin/compile-mojo.html#useJDK Configure the Maven-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jdkToolchain Configure the Tycho-Surefire-Plugin to use a specific JDK version from the toolchain to launch a test runtime: https://tycho.eclipseprojects.io/doc/3.0.4/tycho-surefire-plugin/test-mojo.html#useJDK About the toolchains.xml generated by the setup-java Github action and the exported JAVA_HOME_ environment variables: - https://github.com/actions/setup-java/#install-multiple-jdks - https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Modifying-Maven-Toolchains Fixes #2216
If we switch to Tycho 3 we must use Java 17.
If we want to use Java 11 for building and testing there are basically two options:
tycho-version
property is overridden on the command lineThe text was updated successfully, but these errors were encountered: