简体   繁体   中英

Replace Build Artifact with build.gradle in Intellij IDEA

I have Intellij IDEA's "Build Artifact" configured properly to generate an executable JAR containing resources, MANIFEST.MF,compiled classes, etc. But isn't Gradle supposed to manage that? I'm going to eventually need to use features in building that JAR that are unavailable from the Build Artifact GUI. How do I port the Build Artifact configs to a gradle.build file instead?

I see in IDEA > File > Settings... > Build, Execution, Deployment > Buld Tools > Gradle > [] Delegate IDE build/run actions to gradle, but that checkbox is disabled despite my project module having a build.gradle . And I'm not sure that feature does what I want.

IDE will not create jar artifacts automatically based on build.gradle files.

If you want to configure some specific aspects of artifacts from gradle scripts consider using gradle-idea-ext-plugin . See Artifacts DSL section of the plugin's documentation.

Add JAR Gradle-Task to your Run or Debug Configuration:

在此处输入图片说明

You'll find your JAR artifact in project's folder: Test/build/libs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM