mitreid-connect / OpenID-Connect-Java-Spring-Server

An OpenID Connect reference implementation in Java on the Spring platform.
Other
1.47k stars 767 forks source link

Build failure on Java11+ #1575

Open jricher opened 2 years ago

jricher commented 2 years ago

When trying to build on Java11+, the following error occurs when building the openid-connect-server-webapp module:

[ERROR] Failed to execute goal ro.isdc.wro4j:wro4j-maven-plugin:1.10.1:run (default) on project openid-connect-server-webapp: Execution default of goal ro.isdc.wro4j:wro4j-maven-plugin:1.10.1:run failed: Plugin ro.isdc.wro4j:wro4j-maven-plugin:1.10.1 or one of its dependencies could not be resolved: Failed to collect dependencies for ro.isdc.wro4j:wro4j-maven-plugin:jar:1.10.1 (): Could not resolve version conflict among [ro.isdc.wro4j:wro4j-maven-plugin:jar:1.10.1 -> ro.isdc.wro4j:wro4j-extensions:jar:1.10.1 -> org.webjars.npm:jshint:jar:2.11.0 -> org.webjars.npm:minimatch:jar:[3.0.2,3.1), ro.isdc.wro4j:wro4j-maven-plugin:jar:1.10.1 -> ro.isdc.wro4j:wro4j-extensions:jar:1.10.1 -> org.webjars.npm:jshint:jar:2.11.0 -> org.webjars.npm:cli:jar:[1.0.0,1.1) -> org.webjars.npm:glob:jar:[7.1.1,8) -> org.webjars.npm:minimatch:jar:[3.1.1,4)] -> [Help 1]
chirontt commented 2 years ago

Similar issue has been reported in the wro4j project: wro4j/wro4j#1129

The above issue also mentioned a fix by dropping the wro4j version back to 1.9.0. I've tried this older wro4j version with this project and the build now works fine for me.

chirontt commented 2 years ago

Alternatively, instead of reverting the wro4j version back to 1.9.0, it can keep the latest version (1.10.1) but with an exclusion on the wro4j-maven-plugin's dependencies to exclude the conflicting org.webjars.npm:minimatch, i.e.

                <plugin>
                    <groupId>ro.isdc.wro4j</groupId>
                    <artifactId>wro4j-maven-plugin</artifactId>
                    <version>1.10.1</version>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>ro.isdc.wro4j</groupId>
                            <artifactId>wro4j-extensions</artifactId>
                            <version>1.10.1</version>
                            <exclusions>
                                <exclusion>
                                    <groupId>org.webjars.npm</groupId>
                                    <artifactId>minimatch</artifactId>
                                </exclusion>
                            </exclusions>
                        </dependency>
                    </dependencies>
                </plugin>

With the above change, openid-connect-server-webapp now compiles fine with JDK11, and no problem in running the resulting webapp with mvn jetty:run-war command.