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

Specify release flag to build on newer JDKs #2609

Open
wants to merge 5 commits into
base: integration
Choose a base branch
from

Conversation

ctubbsii
Copy link
Collaborator

  • Add maven.compiler.release option to force correct cross-compilation to Java 11 when building with a JDK newer than 11, such as JDK 17
  • Remove unnecessary java source, target, and encoding config from plugins when those are already specified by properties
  • Fix submodule for core/in-memory-accumulo to point to in-memory-accumulo's main branch instead of the one being developed for the accumulo4 branch
  • Also fix the license name for Apache-2.0 (the recommended name is the SPDX name) and drop .txt from the license URL

@ctubbsii
Copy link
Collaborator Author

It looks like the checks failed because my user doesn't have permission to read from the package repository on GitHub. I'm not sure how to fix that.

But, I did test this using JDK 17 with mvn -Pdev -Ddeploy -Dtar clean package -DskipTests

@ctubbsii ctubbsii force-pushed the support-builds-with-jdk17-and-newer branch from 5725f6b to 9aa7475 Compare October 12, 2024 00:56
* Add maven.compiler.release option to force correct cross-compilation
  to Java 11 when building with a JDK newer than 11, such as JDK 17
* Remove unnecessary java source, target, and encoding config from
  plugins when those are already specified by properties
* Fix submodule for core/in-memory-accumulo to point to
  in-memory-accumulo's main branch instead of the one being developed
  for the accumulo4 branch
* Also fix the license name for Apache-2.0 (the recommended name is the
  SPDX name) and drop .txt from the license URL
@ctubbsii ctubbsii force-pushed the support-builds-with-jdk17-and-newer branch from 9aa7475 to e7a0a59 Compare October 12, 2024 01:42
@ctubbsii
Copy link
Collaborator Author

ctubbsii commented Oct 12, 2024

I force-pushed a few times to try to re-trigger the tests. I couldn't figure out how to get the tests to work in the pull request. I ran the tests manually in my own repo, with it's own local secrets for reading the dependencies from the package repository for the build. Those results are at: https://github.com/ctubbsii/datawave/actions/runs/11301797381

* Update spotbugs-maven-plugin
* Configure javadoc doclint to 'all,-missing' to prevent noise from
  missing javadocs
* Fix javadoc issues about the use of uppercase header elements, which
  breaks the standard conventions of html5 that carried over from XHTML
  days, which was case-sensitive (and because uppercase looks ugly)
* Also fix a few other places where uppercase html5 was used, and remove
  an out-of-place closing paragraph element (that also used uppercase)
* Demote `<h1>` tags to `<h2>` in javadoc comments because javadoc
  reserves `<h1>` for its own generated headers
* Remove redundant items in POMs
* Fix spotbugs issues regarding unnecessary boxing/unboxing primitives
@ctubbsii
Copy link
Collaborator Author

I tried to include a few quality issues that were interfering with a clean build with spotbugs, and other things enabled that are activated in the GitHub Actions checks, but I was unable to fix everything, because there are similar quality problems with maven-compiler-plugin, and spotbugs, in some of the microservice dependencies, and it's not clear to me how to get a clean build here without first making commits to those other projects and deploying changes to them (which I'm not prepared to do today... but maybe I can submit some PRs later to fix those... it's kind of hard because there's so many and I don't know where to begin).

@ctubbsii
Copy link
Collaborator Author

Okay, I spent a bit more time with this. With these changes, I was able to get the command mvn -Pdev,examples,assemble,spotbugs,dist,deploy-ws clean verify -DskipTests to finish successfully. This is similar to the build executed by the tests.yml GitHub Actions workflow. However, the only way I could actually get this to work is if I made similar changes in the microservices-parent POM and a few others, and then update the <parent> tags of all those that depend on those updated POMs to use the SNAPSHOT version I edited, rather than the published one in the package repo.

This required changing 79 of the 128 pom.xml files I found in this project spanning 27 separate repos that were linked as submodules (which seems like a lot to me for a simple set of changes). Is there an easier way to make changes, or is this complexity inherent to the project's chosen build structure? If I want to make subsequent PRs to fix all the repos pointed to by the submodules, what is the preferred order for submitting those PRs, so that they can be available for the other repos?

@@ -358,7 +358,7 @@ final public QueryNode Clause(CharSequence field) throws ParseException {
if (boost != null) {
float f = (float) 1.0;
try {
f = Float.valueOf(boost.image).floatValue();
f = Float.parseFloat(boost.image);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spotbugs issue was found with the updated spotbugs plugin. However, it appears that this file is generated code that has been checked in to the repository. Is this file frequently re-generated and clobbered, or is it okay to make these fixes here? Would the code-generation utilities generate better (non-buggy) code if it were updated? Where is that code generator executed?

@foster33
Copy link
Collaborator

I force-pushed a few times to try to re-trigger the tests. I couldn't figure out how to get the tests to work in the pull request. I ran the tests manually in my own repo, with it's own local secrets for reading the dependencies from the package repository for the build. Those results are at: https://github.com/ctubbsii/datawave/actions/runs/11301797381

AFAIK checks do not work with PRs based off of a fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants