Created
January 27, 2014 11:57
-
-
Save stephanos/8647374 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def IDEA_MODULE_NAME = 'mymodule' | |
def IDEA_ARTIFACT_NAME = 'myproject' | |
def artifactManager = xmlFile.asNode().component.find { it.@name == 'ArtifactManager' } as Node | |
if (artifactManager) { | |
Node artifact = artifactManager.artifact.find { it.@type == 'exploded-war' } | |
if (artifact) | |
artifactManager.remove(artifact) | |
} else { | |
artifactManager = xmlFile.asNode().appendNode('component', [name: 'ArtifactManager']); | |
} | |
def artifact = new NodeBuilder().artifact(type: 'exploded-war', 'build-on-make': "true", name: "$IDEA_ARTIFACT_NAME") { | |
'output-path'("\$PROJECT_DIR\$/$IDEA_BUILD_APP_DIR") | |
root(id: 'root') { | |
element(id: 'directory', name: 'WEB-INF') { | |
element(id: 'directory', name: 'classes') { | |
element(id: 'module-output', name: IDEA_MODULE_NAME) | |
} | |
element(id: 'directory', name: 'lib') { | |
this.project.configurations.runtime.each { | |
element(id: 'file-copy', path: it) | |
} | |
} | |
} | |
element(id: 'javaee-facet-resources', facet: "$IDEA_MODULE_NAME/web/Web") | |
} | |
} | |
artifactManager.append artifact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment