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

HSEARCH-3929 Use JDK11 by default when building Hibernate Search #2309

Merged
merged 18 commits into from Jun 17, 2020

Conversation

We already test this with a different test in the new codebase.
We will still produce Java 8 bytecode for the main artifacts.
So that we can re-use them in tests regardless of the bytecode target
of these tests.
…nkinsfile

Due to how the stashing/unstashing steps are displayed in Jenkins, the
previous name was confusing.
…on-default JDKs

E.g. don't re-build the engine: just use the one we built in
the default build.
Hopefully this will get rid of these warnings, which seem caused by
JQAssistant bundling an old version of ASM:

[WARNING] Cannot scan class '/org/hibernate/search/util/common/reflect/impl/ReflectionUtilsTest$16.class'.
java.lang.UnsupportedOperationException
    at org.objectweb.asm.ClassVisitor.visitNestHostExperimental (ClassVisitor.java:158)
    at org.objectweb.asm.ClassReader.accept (ClassReader.java:541)
    at org.objectweb.asm.ClassReader.accept (ClassReader.java:391)
    at com.buschmais.jqassistant.plugin.java.impl.scanner.ClassFileScannerPlugin$1.execute (ClassFileScannerPlugin.java:68)
    at com.buschmais.jqassistant.plugin.java.impl.scanner.ClassFileScannerPlugin$1.execute (ClassFileScannerPlugin.java:65)
    at com.buschmais.jqassistant.plugin.common.api.scanner.MD5DigestDelegate.digest (MD5DigestDelegate.java:79)
    at com.buschmais.jqassistant.plugin.java.impl.scanner.ClassFileScannerPlugin.scan (ClassFileScannerPlugin.java:65)
    at com.buschmais.jqassistant.plugin.java.impl.scanner.ClassFileScannerPlugin.scan (ClassFileScannerPlugin.java:27)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:116)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:85)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:60)
    at com.buschmais.jqassistant.plugin.common.api.scanner.AbstractContainerScannerPlugin.scan (AbstractContainerScannerPlugin.java:50)
    at com.buschmais.jqassistant.plugin.common.api.scanner.AbstractContainerScannerPlugin.scan (AbstractContainerScannerPlugin.java:29)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:116)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:85)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:60)
    at com.buschmais.jqassistant.plugin.maven3.impl.scanner.MavenProjectScannerPlugin.scanPath (MavenProjectScannerPlugin.java:326)
    at com.buschmais.jqassistant.plugin.maven3.impl.scanner.MavenProjectScannerPlugin.scanPath (MavenProjectScannerPlugin.java:297)
    at com.buschmais.jqassistant.plugin.maven3.impl.scanner.MavenProjectScannerPlugin.scanClassesDirectory (MavenProjectScannerPlugin.java:275)
    at com.buschmais.jqassistant.plugin.maven3.impl.scanner.MavenProjectScannerPlugin.scan (MavenProjectScannerPlugin.java:83)
    at com.buschmais.jqassistant.plugin.maven3.impl.scanner.MavenProjectScannerPlugin.scan (MavenProjectScannerPlugin.java:35)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:116)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:85)
    at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan (ScannerImpl.java:60)
    at com.buschmais.jqassistant.scm.maven.ScanMojo.execute (ScanMojo.java:101)
    at com.buschmais.jqassistant.scm.maven.AbstractModuleMojo$1.run (AbstractModuleMojo.java:21)
    at com.buschmais.jqassistant.scm.maven.AbstractMojo.execute (AbstractMojo.java:396)
    at com.buschmais.jqassistant.scm.maven.AbstractModuleMojo.execute (AbstractModuleMojo.java:24)
    at com.buschmais.jqassistant.scm.maven.AbstractMojo.execute (AbstractMojo.java:263)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Hopefully this will fix problems we're having with ECJ rejecting our
target/source parameters:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] [ecj] The compiler reported an error but has not written it to its logging
[ERROR] [ecj] The following line(s) might indicate the issue:
Compliance level '1.8' is incompatible with target level '11'. A compliance level '11' or better is required
1. This will make sure the application is built against the classes
   available in the standard library for the target version (8),
   not the ones available in the standard library for the version of the
   JDK we're using (11). E.g. using List.of() will trigger a compilation
   failure.
   See https://stackoverflow.com/a/43103038/6692043.
2. This will make the Eclipse compiler happy: it didn't agree with us
   setting -source 1.8 -target 11, because it needs the source to be
   greater than or equal to the target (javac doesn't have such
   requirement).
3. This will unfortunately allow the use of Java 9+ language features in
   tests. However, this shouldn't be a problem as we don't distribute
   test JARs. Also, the CI build will ultimately fail if we do that in
   integration tests, since the CI build compiles integration tests
   while targeting Java 8.
To get the releaseVersion configuration property.
…compiler

It seems it cannot handle automatic module names? Anyway, it fails to
resolve some modules, and the error message is buggy (it doesn't tell us
which module it failed to resolve). For example:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project hibernate-search-integrationtest-java-modules: Compilation failure: Compilation failure:
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/module-info.java:[14,11] Cannot bind message for problem (id: 1300) "{0} cannot be resolved to a module" with arguments: {}
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/module-info.java:[15,11] Cannot bind message for problem (id: 1300) "{0} cannot be resolved to a module" with arguments: {}
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/module-info.java:[16,11] Cannot bind message for problem (id: 1300) "{0} cannot be resolved to a module" with arguments: {}
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/module-info.java:[17,11] Cannot bind message for problem (id: 1300) "{0} cannot be resolved to a module" with arguments: {}
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/module-info.java:[20,11] Cannot bind message for problem (id: 1300) "{0} cannot be resolved to a module" with arguments: {}
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/module-info.java:[21,11] Cannot bind message for problem (id: 1300) "{0} cannot be resolved to a module" with arguments: {}
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/org/hibernate/search/integrationtest/java/module/config/MyElasticsearchAnalysisConfigurer.java:[9,8] The import org.hibernate.search.backend cannot be resolved
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/org/hibernate/search/integrationtest/java/module/config/MyElasticsearchAnalysisConfigurer.java:[10,8] The import org.hibernate.search.backend cannot be resolved
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/org/hibernate/search/integrationtest/java/module/config/MyElasticsearchAnalysisConfigurer.java:[12,59] ElasticsearchAnalysisConfigurer cannot be resolved to a type
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/org/hibernate/search/integrationtest/java/module/config/MyElasticsearchAnalysisConfigurer.java:[17,24] ElasticsearchAnalysisConfigurationContext cannot be resolved to a type
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/org/hibernate/search/integrationtest/java/module/service/AuthorService.java:[11,8] The import org.hibernate.Session cannot be resolved
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/org/hibernate/search/integrationtest/java/module/service/AuthorService.java:[12,8] The import org.hibernate.SessionFactory cannot be resolved
[ERROR] /mnt/jenkins-workdir/workspace/arch-personal-yoann_HSEARCH-3929/integrationtest/jdk/java-modules/src/main/java/org/hibernate/search/integrationtest/java/module/service/AuthorService.java:[13,8] The import org.hibernate.boot cannot be resolved

....
@sonarcloud
Copy link

sonarcloud bot commented Jun 17, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@yrodiere yrodiere merged commit 398ea54 into hibernate:master Jun 17, 2020
@yrodiere yrodiere deleted the HSEARCH-3929 branch July 3, 2020 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant