Skip to content
This repository was archived by the owner on Dec 2, 2023. It is now read-only.
This repository was archived by the owner on Dec 2, 2023. It is now read-only.

systemProperties approach works only in bootRun #4

Description

@xanscale

in profiles.gradle your first approach works only for bootRun task and not for build task.
any way to do for build ?

the second approach works but is a little deprecated

classes {
    doLast {
        def profile = 'spring.profiles.active=' + project.property('env')
        println 'Adding ' + profile
        new File("build/resources/main/application.properties").append('\n' + profile)
    }
}

PS i spend 2 days to do this. my first approach is to use sourcesets and put application.properties there. but i discover that gradle java plugin make jar only for main source set. why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions