Closed jndietz closed 1 year ago
I apologize for the lack of response to this. I missed it.
Take a look at https://docs.spring.io/spring-boot/docs/1.3.x/reference/html/using-boot-build-systems.html#using-boot-maven-parent-pom vs https://docs.spring.io/spring-boot/docs/1.3.x/reference/html/using-boot-build-systems.html#using-boot-maven-without-a-parent. I think you are combining the two approaches. You should either inherit from the parent or use dependencyManagement
, but not both (unless I've misunderstod).
However, the conflict is in spring-boot-dependencies
, which uses the groovy.version
property on the groovy-bom
dependency. This seems to workaround the issue.
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<type>pom</type>
<version>${groovy.version}</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-bom</artifactId>
<type>pom</type>
<version>${groovy.version}</version>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<type>pom</type>
<version>2.4.9</version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
I'm not sure why, but using
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-bom</artifactId>
</exclusion>
</exclusions>
doesn't work. Only dependencyManagement
works, regardless of whether inheriting from the parent.
Closing stale issue. Please leave a comment if you'd like it reopened.
I have a
pom.xml
like this:However, when I run
mvn verify
, I get the following error in my IntelliJ console:Of course it fails, because it is trying to use Groovy 2.5.14 to compile tests that use Groovy 3.0+
I'm not sure how to fix this. My
mvn dependency:tree
output looks like this. I can't figure out where, or how it is being pulled transitively. It was coming in fromtransaction-site-util
, but I have that excluded from the build.Even after deleting the
groovy
artifact from my local.m2
folder, maven downloads version 2.5.14 from my private repo again!IntelliJ is likely just using whatever maven tells it... so it's also showing like this:
Generating a new project with Spring Initializr of course works fine, and it compiles with Groovy 3.0.10. This is happening in my CI pipeline, too, so it seems related to some configuration here and not my local environment specifically.