Gradle processResources - file contains $ character

前端 未结 1 1660
逝去的感伤
逝去的感伤 2021-01-13 04:16

How can you execute gradle processResources on files that contain $ characters without escaping the $ in the files?


I ha

1条回答
  •  孤城傲影
    2021-01-13 04:31

    JB Nizet's comment provided valuable insight. The problem was indeed due to the usage of expand() (although not immediately visible since it was located in an allProjects() script in the parent project). The reason why expand() was added in the first place was the desire to populate the info.build.* properties in the application.properties file (so that they are available through Spring Boot's info endpoint).


    Solution: Use filesMatching() to only expand() selected files. The following snippet solved the specific problem related to Spring Boot:

    processResources {
        filesMatching('application.properties') {
            expand(project.properties)
        }
    }
    

    0 讨论(0)
提交回复
热议问题