2016-07-29 5 views
8

Я хочу исключитьAMAuthN.properties из встроенной банки. Этот файл продолжает отображаться в корневой папке скомпилированной банки. Файл находится по адресу AMAuthN\src\main\resources\AMAuthN.properties относительно корня папки проекта. Благодаря!Gradle - Исключить файл из упаковки в банку

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.gradle по определению JAR введите исключить из поля. Пример:

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

за исключением более чем одна вещь использования: 'баночку {исключить ('thing1', 'thing2')}' –

+0

хорошая точка, имеет логический смысл, а также. – SomeStudent

Смежные вопросы