Add classpath in manifest using Gradle

前端 未结 9 1647
醉话见心
醉话见心 2020-12-01 02:51

I would like my Gradle build script to add the complete Classpath to the manifest file contained in JAR file created after the build.

Example:

Manife         


        
9条回答
  •  悲哀的现实
    2020-12-01 03:29

    Found a solution on Gradle's forum:

    jar {
      manifest {
        attributes(
          "Class-Path": configurations.compile.collect { it.getName() }.join(' '))
      }
    }
    

    Source: Manifest with Classpath in Jar Task for Subprojects

提交回复
热议问题