Juan Hernandez has uploaded a new change for review. Change subject: core: Add support for annotation indexes ......................................................................
core: Add support for annotation indexes This change modifies the maven plugin that generates JBoss modules so that it creates annotation indexes. For each .jar file inside the module a new -jandex.jar file will be created. These annotations indexes speed up the deployment of the applications and are required in order to allow the deployment of EJBs inside JBoss modules, otherwise they are silently ignored. Change-Id: Ia81a36189cd529ba0c1b1085d7c1d784cc45c8f9 Signed-off-by: Juan Hernandez <[email protected]> --- M build-tools-root/jboss-modules-maven-plugin/pom.xml M build-tools-root/jboss-modules-maven-plugin/src/main/java/org/ovirt/engine/build/ModulesMojo.java 2 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/12/13712/1 diff --git a/build-tools-root/jboss-modules-maven-plugin/pom.xml b/build-tools-root/jboss-modules-maven-plugin/pom.xml index 47969bb..2e09a31 100644 --- a/build-tools-root/jboss-modules-maven-plugin/pom.xml +++ b/build-tools-root/jboss-modules-maven-plugin/pom.xml @@ -68,6 +68,12 @@ <version>3.0</version> </dependency> + <dependency> + <groupId>org.jboss</groupId> + <artifactId>jandex</artifactId> + <version>1.0.3.Final</version> + </dependency> + </dependencies> <build> diff --git a/build-tools-root/jboss-modules-maven-plugin/src/main/java/org/ovirt/engine/build/ModulesMojo.java b/build-tools-root/jboss-modules-maven-plugin/src/main/java/org/ovirt/engine/build/ModulesMojo.java index 6707978..32ac130 100644 --- a/build-tools-root/jboss-modules-maven-plugin/src/main/java/org/ovirt/engine/build/ModulesMojo.java +++ b/build-tools-root/jboss-modules-maven-plugin/src/main/java/org/ovirt/engine/build/ModulesMojo.java @@ -17,6 +17,8 @@ import org.apache.maven.project.MavenProjectHelper; import org.codehaus.plexus.archiver.zip.ZipArchiver; import org.codehaus.plexus.util.FileUtils; +import org.jboss.jandex.Indexer; +import org.jboss.jandex.JarIndexer; @Mojo(name = "jboss-modules", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyCollection = ResolutionScope.COMPILE) public class ModulesMojo extends AbstractMojo { @@ -50,6 +52,13 @@ */ @Parameter(property = "modules") private List<Module> modules; + + /** + * This parameter indicates if the generated modules should include also + * annotation indexes. + */ + @Parameter(property = "generateJandex", defaultValue="true") + private boolean generateJandex; /** * The temporary directory where modules will be stored. @@ -179,6 +188,20 @@ "to \"" + artifactTo.getAbsolutePath() + "\"", exception); } + + // Create the annotation index for the artifact: + if (generateJandex) { + getLog().info("Creating annotations index for \"" + artifactTo + "\""); + try { + JarIndexer.createJarIndex(artifactTo, new Indexer(), false, true, false); + } + catch (IOException exception) { + throw new MojoExecutionException( + "Can't generate annotations index for \"" + + artifactTo.getAbsolutePath() + "\".", + exception); + } + } } } -- To view, visit http://gerrit.ovirt.org/13712 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia81a36189cd529ba0c1b1085d7c1d784cc45c8f9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
