-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Adds a dependency on the latest version of ehcache at the time of writing which references an invalid version of JAXB internally which is unavailable on most modern JDKs.
- Loading branch information
Showing
5 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
protobuf-maven-plugin/src/it/gh-299-ehcache-jaxb-resolution-failure/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Copyright (C) 2023 - 2024, Ashley Scopes. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
invoker.goals = clean package |
95 changes: 95 additions & 0 deletions
95
protobuf-maven-plugin/src/it/gh-299-ehcache-jaxb-resolution-failure/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2023 - 2024, Ashley Scopes. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>protobuf-maven-plugin-parent</artifactId> | ||
<version>@project.version@</version> | ||
<relativePath>../../../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<groupId>gh-299-ehcache-jaxb-resolution-failure</groupId> | ||
<artifactId>gh-299-ehcache-jaxb-resolution-failure</artifactId> | ||
|
||
<properties> | ||
<protobuf.version>4.27.2</protobuf.version> | ||
<ehcache.version>3.10.8</ehcache.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.protobuf</groupId> | ||
<artifactId>protobuf-java</artifactId> | ||
<version>${protobuf.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<!-- This version of ehcache pulls in an invalid system-path JAXB dependency that does not | ||
exist on newer JDKs. In GH-299, we were erroneously trying to resolve that dependency, | ||
despite it only being marked with the `runtime' scope, which we should have been | ||
ignoring. | ||
If this build succeeds, it means we no longer have an issue with this specific dependency | ||
and that GH-299 has been fixed. --> | ||
<groupId>org.ehcache</groupId> | ||
<artifactId>ehcache</artifactId> | ||
<version>${ehcache.version}</version> | ||
<classifier>jakarta</classifier> | ||
|
||
<exclusions> | ||
<exclusion> | ||
<!-- This points to blocked repositories. --> | ||
<groupId>org.glassfish.jaxb</groupId> | ||
<artifactId>jaxb-runtime</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
|
||
<configuration> | ||
<protocVersion>${protobuf.version}</protocVersion> | ||
</configuration> | ||
|
||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
21 changes: 21 additions & 0 deletions
21
protobuf-maven-plugin/src/it/gh-299-ehcache-jaxb-resolution-failure/selector.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (C) 2023 - 2024, Ashley Scopes. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
if ("uname -o".execute().text =~ /Android.*/) { | ||
println("Skipping test as it uses incompatible binaries for Android") | ||
return false | ||
} else { | ||
return true | ||
} |
27 changes: 27 additions & 0 deletions
27
.../it/gh-299-ehcache-jaxb-resolution-failure/src/main/protobuf/org/example/helloworld.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Copyright (C) 2023 - 2024, Ashley Scopes. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
syntax = "proto3"; | ||
|
||
option java_multiple_files = true; | ||
option java_package = "org.example.helloworld"; | ||
|
||
package org.example.helloworld; | ||
|
||
message GreetingRequest { | ||
string name = 1; | ||
} | ||
|
32 changes: 32 additions & 0 deletions
32
protobuf-maven-plugin/src/it/gh-299-ehcache-jaxb-resolution-failure/test.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) 2023 - 2024, Ashley Scopes. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import java.nio.file.Path | ||
|
||
import static org.assertj.core.api.Assertions.assertThat | ||
|
||
Path expectedClass = basedir.toPath().toAbsolutePath().resolve("target") | ||
.resolve("classes") | ||
.resolve("org") | ||
.resolve("example") | ||
.resolve("helloworld") | ||
.resolve("GreetingRequest.class") | ||
|
||
// Verify compilation succeeded. | ||
assertThat(expectedClass) | ||
.isRegularFile() | ||
|
||
return true |