The war artifacts in a Gradle project don't exactly follow the Gradle definitions?

已回答

Hi,

It appears that when I create a war in my build.gradle file that IntelliJ tries to create a similar war (and exploded war) in it's "Build Artifacts ..." list in project settings. But what's strange to me is that these IntelliJ artifacts don't create exactly the same war file, though they seem to be trying to. For example, if I change the war archive name in build.gradle, then that name change is reflected in IntelliJ's wars, but if I add some code the `war { }` task to copy some more files to the war, then things get very weird... IntelliJ's war also gets the extra files, but in a screwed up way where it also gets some duplicates.  So it's obviously not just running the gradle task, or it would be the exact same. It's as if it looked at this code and tried to mimic it without simply running the gradle task. Is that what it's doing?  

Rob

war {
   FileTree tree = fileTree("../WebAppJS/build").include("**/*.js")
   Set<File> files = tree.files
   into ("/js") {
      from(files)
   }
   archiveName "wildfly.war"  
}

 

 

0

请先登录再写评论。