Hi to all,
I'm writing a custom packager to help my IT create ZIP archives from a
sum of jars/wars.
I could get the jars/wars but can't figure how to get the jars
required by wars (we didn't put them in WEB-INF/lib since we should
share them).
here is my actual code, how could I get jar dependencies from the WAR artifact ?
Thanks
---
/**
* Copy runtime wars
* @throws MojoExecutionException
*/
protected int copyWars() throws MojoExecutionException {
int count = 0;
try {
Set artifacts = project.getArtifacts();
for (Iterator iter = artifacts.iterator();
iter.hasNext();) {
Artifact artifact = (Artifact) iter.next();
ScopeArtifactFilter filter = new
ScopeArtifactFilter(
Artifact.SCOPE_RUNTIME);
if (!artifact.isOptional() &&
filter.include(artifact)
&&
"war".equals(artifact.getType())) {
FileUtils.copyFileToDirectory(artifact.getFile(),
warDirectory);
count++;
}
}
} catch (IOException e) {
throw new MojoExecutionException("Error copying wars",
e);
}
return (count);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]