Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ publishing.publications.withType(MavenPublication) {
dependency {
delegate.groupId('org.springframework.boot')
delegate.artifactId('spring-boot-maven-plugin')
delegate.version('${project.version}')
delegate.version('${version}')
Copy link
Member

Choose a reason for hiding this comment

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

gradle publishToMavenLocal generates the following for me:

<dependencies>
            <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-maven-plugin</artifactId>
              <version>${version}</version>
            </dependency>
          </dependencies>

I believe it should generate the following:

<dependencies>
            <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-maven-plugin</artifactId>
              <version>2.3.0.BUILD-SNAPSHOT</version>
            </dependency>
          </dependencies>

Copy link
Member

Choose a reason for hiding this comment

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

The following will work:

delegate.version("${project.version}")

This aligns with how the parent version is configured earlier in the same build.gradle file:

parent {
	delegate.groupId("${project.group}")
	delegate.artifactId("spring-boot-dependencies")
	delegate.version("${project.version}")
}

The change can be verified with the following command:

./gradlew spring-boot-project:spring-boot-starters:spring-boot-starter-parent:generatePom

This will write the generated pom to spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build/publications/maven/pom-default.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wilkinsona If I'm understanding you correctly does that mean this PR is simply not needed?

Copy link
Member

Choose a reason for hiding this comment

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

No, I think it's still needed, but in a modified form. We currently have '${project.version}'. We need "${project.version}" instead. Note the use of " rather than '.

}
}
executions {
Expand Down