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

Chore: Allow running tests with OpenJDK 11 and 15: bump Groovy and Junit dependencies #173

Merged
merged 3 commits into from Jan 7, 2021
Merged

Conversation

dduportal
Copy link
Contributor

This PR allows executing the library's unit tests (mvn clean test) when you have a recent OpenJDK (11 or 15).

It involves bumping the Groovy dependency (and associated compiler sub-dependencies) to 3.x (instead of 2.x), as well as Junit to 5.x.

Please note that the pom.xml is still specifying a compile target as 1.8 as before of course.

Signed-off-by: dduportal <damien.duportal@gmail.com>
Signed-off-by: dduportal <damien.duportal@gmail.com>
Signed-off-by: dduportal <damien.duportal@gmail.com>
@dduportal dduportal requested a review from a team as a code owner January 5, 2021 15:30
Copy link

@markjacksonfishing markjacksonfishing left a comment

Choose a reason for hiding this comment

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

/lgtm

</properties>

<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy.version}</version>
<!-- Type pom replaces the über "groovy-all.jar", for version 3+ -->
<type>pom</type>
Copy link
Member

Choose a reason for hiding this comment

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

do we still need this groovy dependency? or should we be specifying just the actual groovy jar? seems weird to depend on a pom artifact?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea if it is required or not. On 1 side it might be right as this dependency is not mentionned in https://github.com/jenkinsci/JenkinsPipelineUnit#add-to-your-project-as-test-dependency .
On the other, my knowledge is not sufficient enough how to make this work without this 😱

It looks like that the groovy-all (e.g. the Eclipse Groovy Compiler) is not the only solution: https://docs.groovy-lang.org/latest/html/documentation/tools-groovyc.html#section-groovyeclipse . But it is recommended when there is a joint Java-Groovy compilation, which should be the case for shared library if I understand correctly the src/** usage is that right?
=> If this assumption is valid, then https://github.com/groovy/groovy-eclipse/wiki/Groovy-Eclipse-Maven-plugin is to be used, but there is no mention of groovy-all in this doc. So I don't really know 🤷🏾‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I guess if it works

Copy link
Contributor

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Should do the job. Would be nice to add it to the Pipeline though

@dduportal dduportal merged commit b2d0ff8 into jenkins-infra:master Jan 7, 2021
@dduportal dduportal deleted the chore/groovy-upgrade branch January 7, 2021 11:48
Comment on lines -49 to +52
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

@jglick jglick mentioned this pull request Jan 3, 2022
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.

None yet

5 participants