configuring gradle generated artifact

Answered

Is there a way to add a custom gradle scope to the IDEA generated artifact? In my build.gradle file, I add the gradle scope to the idea "compile" scope.

idea {

    module {

         scopes.COMPILE.plus += [configurations.server]

    }

}

 

IntelliJ recognizes this and correctly adds the "configurations.server" scope dependencies to the module. Is there a way to add these dependencies to the generated artifact or to have intelliJ not overwrite the artifact when resyncing? I currently have to manually add them everytime I resync with gradle.

4 comments
Comment actions Permalink

Does the same artifact (but created by gradle task) contain these dependencies?

0
Comment actions Permalink

No. Is there a task I could make the dependencies be added to the artifact? I only want them added in idea, not when I build the artifact outside of idea.

0
Comment actions Permalink

you can add additional gradle task with included dependencies, related artifact in IntelliJ will be available after the import:

e.g.

task fatWar(type: War) {
archiveName = 'web_fat.war'
classpath configurations.server
}

 

0
Comment actions Permalink

ah, thanks. now I just need to figure out how to get the subProject server configuration dependencies added to the war

0

Please sign in to leave a comment.