Skip to content

Use applicationName as a convention for the boot Distribution's baseName #12232

@DanielThomas

Description

@DanielThomas

Configuring the applicationName should result in the distribution directory changing, however setting applicationName = 'foo' in a project called spring-boot results in this structure:

.
├── build
│   ├── bootScripts
│   │   ├── foo
│   │   └── foo.bat
│   ├── install
│   │   └── spring-boot-boot
│   │       ├── bin
│   │       │   ├── foo
│   │       │   └── foo.bat
│   │       └── lib
│   │           └── spring-boot.jar
│   ├── libs
│   │   └── spring-boot.jar
│   └── tmp
│       └── bootJar
│           └── MANIFEST.MF
└── build.gradle

Note the install/spring-boot-boot directory, I'd expect install/foo-boot in this case. I can workaround the problem by using:

project.afterEvaluate {
    project.distributions {
        boot {
            baseName = "${project.distributions.main.baseName}-boot"
        }
    }
}

FWIW, this is what the DistributionPlugin does:

https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/java/org/gradle/api/distribution/plugins/DistributionPlugin.java#L81-L86

We ran into this while adding a Spring Boot application plugin variant to our ospackage plugin:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions