This solution is valid if you don´t want to compile these packages, but if you want to compile them and exclude from your JAR you could use
// tag::jar[]
jar {
exclude('mi/package/excluded/**')
exclude('mi/package/excluded2/**')
}
// end::jar[]
More Related Contents:
- How to add local .jar file dependency to build.gradle file?
- Is it possible to declare a variable in Gradle usable in Java?
- Gradle does not find tools.jar
- Gradle proxy configuration
- Gradle – What is a non-zero exit value and how do I fix it?
- Jersey stopped working with InjectionManagerFactory not found
- Android Library Gradle release JAR
- Peer not authenticated while importing Gradle project in eclipse
- How to download older google play services?
- How do I add a new sourceset to Gradle?
- Could not find method compile() for arguments Gradle
- Manifest merger failed error
- Building an uberjar with Gradle
- How to build a docker container for a Java application
- How can I resolve the error “The minCompileSdk (31) specified in a dependency’s AAR metadata” in native Java or Kotlin? [duplicate]
- Gradle – no main manifest attribute
- How can I add a linked source folder in Android Studio?
- Android studio – Failed to complete gradle execution – error in opening zip file
- “The filename or extension is too long error” using gradle
- Android studio – Failed to find target android-18
- Logging while testing through Gradle
- Gradle sync failed: Unable to find method
- Multiple dex files define /BuildConfig, can’t find the cause:
- How to give System property to my test via Gradle and -D
- Building with Intellij 2017.2 /out directory duplicates files in /build directory
- How to run Gradle test when all tests are UP-TO-DATE?
- Gradle – FatJar – Could not find or load main class
- Android Studio 3.0 DexArchiveBuilderException
- Run cucumber test with cached dependencies and plugins on gradle
- How to start Spring Boot app in Spock Integration Test