1and1 / go-maven-poller

GoCD plugin that polls Maven repositories including Artifactory and Nexus
Other
9 stars 8 forks source link

Fix building for JDK 16 #25

Closed sfuhrm closed 3 years ago

sfuhrm commented 3 years ago

JDK 16 build is breaking because of problems with PowerMock:

Tests in error: 
  com.oneandone.go.plugin.maven.client.RepositoryClientTest: PowerMock internal error: Should never throw exception at this level
  testGetArtifactLocation(com.oneandone.go.plugin.maven.util.MavenArtifactFilesTest): Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @60e5db1d
  testGetPomLocation(com.oneandone.go.plugin.maven.util.MavenArtifactFilesTest): Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @60e5db1d
  testGetModel(com.oneandone.go.plugin.maven.util.MavenArtifactFilesTest): Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to unnamed module @60e5db1d

This is probably related to https://github.com/powermock/powermock/issues/1094

sfuhrm commented 3 years ago

Build works now with JDK 17. The command line options in the surefire plugin are not pretty, but they are better than changing away from PowerMock.