2016-07-29 6 views
8

私はとしたいAMAuthN.propertiesをビルド済みのjarから除外します。このファイルは、コンパイル済みのjarファイルのルートフォルダに表示され続けます。ファイルは、プロジェクトフォルダのルートに対して、AMAuthN\src\main\resources\AMAuthN.propertiesにあります。ありがとう!Gradle - ファイルをjarでパッケージ化しないように除外

apply plugin: 'java' 
apply plugin: 'eclipse' 

version = '1.0' 
sourceCompatibility = 1.6 
targetCompatibility = 1.6 

test { 
    testLogging { 
     showStandardStreams = true 
    } 
} 

// Create a single Jar with all dependencies 
jar { 
    manifest { 
     attributes 'Implementation-Title': 'Gradle Jar File Example', 
      'Implementation-Version': version, 
      'Main-Class': 'com.axa.openam' 
    } 

    baseName = project.name 

    from { 
     configurations.compile.collect { 
      it.isDirectory() ? it : zipTree(it) 
     } 
    } 
} 

// Get dependencies from Maven central repository 
repositories { 
    mavenCentral() 
} 

// Project dependencies 
dependencies { 
    compile 'com.google.code.gson:gson:2.5' 
    testCompile 'junit:junit:4.12' 
} 

答えて

11

あなたは私の最後に働くことを知っているようなものを試すことができます。 build.gradleJAR定義にを追加すると、が除外されます。例:一つの使用以上のものを除くため

jar {  
    exclude('your thing')  
} 
+2

: ''瓶 –

+0

良い点{( 'thing1'、 'thing2')を除外}、同様の論理的意味があります。 – SomeStudent

関連する問題