瀏覽代碼

Prevent source jars from being included in the gradle 'default' configuration and thus being included as dependencies in war files etc.

Luke Taylor 15 年之前
父節點
當前提交
d704a3bb4a
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      gradle/maven.gradle

+ 6 - 0
gradle/maven.gradle

@@ -14,6 +14,12 @@ artifacts {
     archives sourceJar
 }
 
+// Remove the archive configuration from the runtime configuration, so that anything added to archives
+// (such as the source jar) is no longer included in the runtime classpath
+configurations.default.extendsFrom = [configurations.runtime] as Set
+// Add the main jar into the default configuration
+artifacts { 'default' jar }
+
 dependencies {
     deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE"
 }