Juan Hernandez has uploaded a new change for review. Change subject: core: Add JBoss modules for libraries ......................................................................
core: Add JBoss modules for libraries This patch creates JBoss modules for the common, compat, dal, utils, tooks and searchbackend libraries. Backported from master commit 81742e0fd1d0fb1626f84d0b92f46e0cd65ab581. Change-Id: I02aa0591bfe372c72d724d6cb1ca448a06dc2197 Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com> --- M Makefile M backend/manager/modules/common/pom.xml A backend/manager/modules/common/src/main/modules/org/ovirt/engine/core/common/main/module.xml M backend/manager/modules/compat/pom.xml A backend/manager/modules/compat/src/main/modules/org/ovirt/engine/core/compat/main/module.xml M backend/manager/modules/dal/pom.xml A backend/manager/modules/dal/src/main/modules/org/ovirt/engine/core/dal/main/module.xml M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/BackendApplication.java M backend/manager/modules/restapi/webapp/pom.xml M backend/manager/modules/searchbackend/pom.xml A backend/manager/modules/searchbackend/src/main/modules/org/ovirt/engine/core/searchbackend/main/module.xml M backend/manager/modules/utils/pom.xml M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EngineEJBUtilsStrategy.java A backend/manager/modules/utils/src/main/modules/org/ovirt/engine/core/utils/main/module.xml M backend/manager/tools/pom.xml A backend/manager/tools/src/main/modules/org/ovirt/engine/core/tools/main/module.xml M ear/pom.xml M ear/src/main/resources/META-INF/MANIFEST.MF M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GwtDynamicHostPageServlet.java M packaging/fedora/spec/ovirt-engine.spec.in M pom.xml 22 files changed, 307 insertions(+), 159 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/73/12773/1 diff --git a/Makefile b/Makefile index df18241..881b4da 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,6 @@ DATA_DIR=$(DATAROOT_DIR)/$(ENGINE_NAME) MAVENPOM_DIR=$(DATAROOT_DIR)/maven-poms JAVA_DIR=$(DATAROOT_DIR)/java -PKG_JAVA_DIR=$(JAVA_DIR)/$(ENGINE_NAME) PKG_SYSCONF_DIR=$(SYSCONF_DIR)/$(ENGINE_NAME) PKG_PKI_DIR=$(SYSCONF_DIR)/pki/$(ENGINE_NAME) PKG_EAR_DIR=$(DATA_DIR)/engine.ear @@ -89,22 +88,6 @@ searchbackend \ utils \ vdsbroker \ - $(NULL) - -# avoid duplicate jars, remove 1st component -# link to 2nd component -# no convention yet... -OWN_JAR_FIXUPS = \ - $(PKG_EAR_DIR)/engine-bll,bll \ - $(PKG_EAR_DIR)/engine-genericapi,genericapi \ - $(PKG_EAR_DIR)/engine-scheduler,scheduler \ - $(PKG_EAR_DIR)/lib/engine-common,common \ - $(PKG_EAR_DIR)/lib/engine-compat,compat \ - $(PKG_EAR_DIR)/lib/engine-dal,dal \ - $(PKG_EAR_DIR)/lib/engine-tools,tools \ - $(PKG_EAR_DIR)/lib/engine-utils,utils \ - $(PKG_EAR_DIR)/lib/engine-vdsbroker,vdsbroker \ - $(PKG_EAR_DIR)/lib/searchbackend,searchbackend \ $(NULL) # Don't use any of the bultin rules, in particular don't use the rule @@ -249,7 +232,6 @@ install_artifacts: @echo "*** Deploying EAR to $(DESTDIR)" install -dm 755 $(DESTDIR)$(PKG_EAR_DIR) - install -dm 755 $(DESTDIR)$(PKG_JAVA_DIR) install -dm 755 $(DESTDIR)$(MAVENPOM_DIR) X=`find "$(MAVEN_OUTPUT_DIR)" -name engine-server-ear-$(APP_VERSION).ear` && unzip "$$X" -d "$(DESTDIR)$(PKG_EAR_DIR)" @@ -262,16 +244,6 @@ fi; \ JAR=`echo "$${POM}" | sed 's/\.pom/.jar/'`; \ install -p -m 644 "$${POM}" "$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-$${artifact_id}.pom"; \ - [ -f "$${JAR}" ] && install -p -m 644 "$${JAR}" "$(DESTDIR)$(PKG_JAVA_DIR)/$${artifact_id}.jar"; \ - done - - # Replace jar files in the ear with links to their actuals - # locations - for jar_line in $(OWN_JAR_FIXUPS); do \ - path=`echo $${jar_line} | sed 's/,.*//'`; \ - jar=`echo $${jar_line} | sed 's/.*,//'`; \ - rm -rf "$(DESTDIR)$${path}"*.jar; \ - ln -s "$(PKG_JAVA_DIR)/$${jar}.jar" "$(DESTDIR)$${path}.jar"; \ done install_setup: @@ -406,9 +378,9 @@ install_jboss_modules: @echo "*** Deploying JBoss modules" - # Uncompress and install the contents of the modules archive to + # Uncompress and install the contents of the modules archives to # the directory containing engine modules: - X=`find "$(MAVEN_OUTPUT_DIR)" -name "dependencies-$(APP_VERSION)*-modules.zip"` && unzip "$$X" -d "$(DESTDIR)$(PKG_JBOSS_MODULES)" + find "$(MAVEN_OUTPUT_DIR)" -name "*-$(APP_VERSION)*-modules.zip" -exec unzip {} -d "$(DESTDIR)$(PKG_JBOSS_MODULES)" \; install_service: @echo "*** Deploying service" diff --git a/backend/manager/modules/common/pom.xml b/backend/manager/modules/common/pom.xml index 8167f40..cd9e7a2 100644 --- a/backend/manager/modules/common/pom.xml +++ b/backend/manager/modules/common/pom.xml @@ -90,6 +90,13 @@ <fail>true</fail> </configuration> </plugin> + + <!-- Create the JBoss module: --> + <plugin> + <groupId>org.ovirt.engine</groupId> + <artifactId>jboss-modules-maven-plugin</artifactId> + </plugin> + </plugins> </build> </project> diff --git a/backend/manager/modules/common/src/main/modules/org/ovirt/engine/core/common/main/module.xml b/backend/manager/modules/common/src/main/modules/org/ovirt/engine/core/common/main/module.xml new file mode 100644 index 0000000..59f830b --- /dev/null +++ b/backend/manager/modules/common/src/main/modules/org/ovirt/engine/core/common/main/module.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<module xmlns="urn:jboss:module:1.0" name="org.ovirt.engine.core.common"> + + <resources> + <resource-root path="common.jar"/> + </resources> + + <dependencies> + <module name="javax.api"/> + <module name="javax.validation.api"/> + <module name="org.ovirt.engine.core.compat"/> + <module name="org.ovirt.engine.core.dependencies"/> + </dependencies> + +</module> diff --git a/backend/manager/modules/compat/pom.xml b/backend/manager/modules/compat/pom.xml index 406ebed..ab6fc6a 100644 --- a/backend/manager/modules/compat/pom.xml +++ b/backend/manager/modules/compat/pom.xml @@ -26,6 +26,13 @@ </execution> </executions> </plugin> + + <!-- Create the JBoss module: --> + <plugin> + <groupId>org.ovirt.engine</groupId> + <artifactId>jboss-modules-maven-plugin</artifactId> + </plugin> + </plugins> </build> diff --git a/backend/manager/modules/compat/src/main/modules/org/ovirt/engine/core/compat/main/module.xml b/backend/manager/modules/compat/src/main/modules/org/ovirt/engine/core/compat/main/module.xml new file mode 100644 index 0000000..cc52a86 --- /dev/null +++ b/backend/manager/modules/compat/src/main/modules/org/ovirt/engine/core/compat/main/module.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<module xmlns="urn:jboss:module:1.0" name="org.ovirt.engine.core.compat"> + + <resources> + <resource-root path="compat.jar"/> + </resources> + + <dependencies> + <module name="javax.api"/> + <module name="org.apache.commons.logging"/> + <module name="org.ovirt.engine.core.dependencies"/> + </dependencies> + +</module> diff --git a/backend/manager/modules/dal/pom.xml b/backend/manager/modules/dal/pom.xml index 8032e96..bf15cad 100644 --- a/backend/manager/modules/dal/pom.xml +++ b/backend/manager/modules/dal/pom.xml @@ -180,6 +180,13 @@ </excludes> </configuration> </plugin> + + <!-- Create the JBoss module: --> + <plugin> + <groupId>org.ovirt.engine</groupId> + <artifactId>jboss-modules-maven-plugin</artifactId> + </plugin> + </plugins> </build> <profiles> diff --git a/backend/manager/modules/dal/src/main/modules/org/ovirt/engine/core/dal/main/module.xml b/backend/manager/modules/dal/src/main/modules/org/ovirt/engine/core/dal/main/module.xml new file mode 100644 index 0000000..6beea8c --- /dev/null +++ b/backend/manager/modules/dal/src/main/modules/org/ovirt/engine/core/dal/main/module.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<module xmlns="urn:jboss:module:1.0" name="org.ovirt.engine.core.dal"> + + <resources> + <resource-root path="dal.jar"/> + </resources> + + <dependencies> + <module name="javax.api"/> + <module name="org.apache.commons.lang"/> + <module name="org.ovirt.engine.core.common"/> + <module name="org.ovirt.engine.core.compat"/> + <module name="org.ovirt.engine.core.dependencies"/> + <module name="org.ovirt.engine.core.utils"/> + </dependencies> + +</module> diff --git a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/BackendApplication.java b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/BackendApplication.java index 5c6d243..ff5649c 100644 --- a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/BackendApplication.java +++ b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/BackendApplication.java @@ -101,7 +101,7 @@ // Lookup the backend bean: try { Context initial = new InitialContext(); - backend = (BackendLocal) initial.lookup("java:global/engine/engine-bll/Backend!org.ovirt.engine.core.common.interfaces.BackendLocal"); + backend = (BackendLocal) initial.lookup("java:global/engine/bll/Backend!org.ovirt.engine.core.common.interfaces.BackendLocal"); } catch (Exception exception) { logger.error("Can't find reference to backend bean.", exception); diff --git a/backend/manager/modules/restapi/webapp/pom.xml b/backend/manager/modules/restapi/webapp/pom.xml index 0416305..49835cf 100644 --- a/backend/manager/modules/restapi/webapp/pom.xml +++ b/backend/manager/modules/restapi/webapp/pom.xml @@ -38,10 +38,10 @@ already included as references in the manifest (note that the web.xml file is included regardless of this configuration): --> <packagingIncludes> - WEB-INF/lib/interface-common-jaxrs-*.jar, - WEB-INF/lib/restapi-definition-*.jar, - WEB-INF/lib/restapi-jaxrs-*.jar, - WEB-INF/lib/restapi-types-*.jar, + WEB-INF/lib/interface-common-jaxrs.jar, + WEB-INF/lib/restapi-definition.jar, + WEB-INF/lib/restapi-jaxrs.jar, + WEB-INF/lib/restapi-types.jar, </packagingIncludes> </configuration> diff --git a/backend/manager/modules/searchbackend/pom.xml b/backend/manager/modules/searchbackend/pom.xml index 47ebddd..9fb4f08 100644 --- a/backend/manager/modules/searchbackend/pom.xml +++ b/backend/manager/modules/searchbackend/pom.xml @@ -57,6 +57,13 @@ </execution> </executions> </plugin> + + <!-- Create the JBoss module: --> + <plugin> + <groupId>org.ovirt.engine</groupId> + <artifactId>jboss-modules-maven-plugin</artifactId> + </plugin> + </plugins> </build> diff --git a/backend/manager/modules/searchbackend/src/main/modules/org/ovirt/engine/core/searchbackend/main/module.xml b/backend/manager/modules/searchbackend/src/main/modules/org/ovirt/engine/core/searchbackend/main/module.xml new file mode 100644 index 0000000..56ed52a --- /dev/null +++ b/backend/manager/modules/searchbackend/src/main/modules/org/ovirt/engine/core/searchbackend/main/module.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<module xmlns="urn:jboss:module:1.0" name="org.ovirt.engine.core.searchbackend"> + + <resources> + <resource-root path="searchbackend.jar"/> + </resources> + + <dependencies> + <module name="javax.api"/> + <module name="org.apache.commons.logging"/> + <module name="org.ovirt.engine.core.common"/> + <module name="org.ovirt.engine.core.compat"/> + <module name="org.ovirt.engine.core.dependencies"/> + <module name="org.ovirt.engine.core.utils"/> + </dependencies> + +</module> diff --git a/backend/manager/modules/utils/pom.xml b/backend/manager/modules/utils/pom.xml index 78fb469..0ec3127 100644 --- a/backend/manager/modules/utils/pom.xml +++ b/backend/manager/modules/utils/pom.xml @@ -158,6 +158,13 @@ </excludes> </configuration> </plugin> + + <!-- Create the JBoss module: --> + <plugin> + <groupId>org.ovirt.engine</groupId> + <artifactId>jboss-modules-maven-plugin</artifactId> + </plugin> + </plugins> </build> <profiles> diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EngineEJBUtilsStrategy.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EngineEJBUtilsStrategy.java index f4333ad..5659d31 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EngineEJBUtilsStrategy.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EngineEJBUtilsStrategy.java @@ -13,13 +13,13 @@ @Override protected void addJNDIBeans() { - addBeanJNDIName(BeanType.BACKEND, ENGINE_CONTEXT_PREFIX.concat("engine-bll/Backend")); - addBeanJNDIName(BeanType.SCHEDULER, ENGINE_CONTEXT_PREFIX.concat("engine-scheduler/Scheduler")); + addBeanJNDIName(BeanType.BACKEND, ENGINE_CONTEXT_PREFIX.concat("bll/Backend")); + addBeanJNDIName(BeanType.SCHEDULER, ENGINE_CONTEXT_PREFIX.concat("scheduler/Scheduler")); addBeanJNDIName(BeanType.USERS_DOMAINS_CACHE, - ENGINE_CONTEXT_PREFIX.concat("engine-bll/UsersDomainsCacheManagerService")); - addBeanJNDIName(BeanType.VDS_EVENT_LISTENER, ENGINE_CONTEXT_PREFIX.concat("engine-bll/VdsEventListener")); - addBeanJNDIName(BeanType.LOCK_MANAGER, ENGINE_CONTEXT_PREFIX.concat("engine-bll/LockManager")); - addBeanJNDIName(BeanType.EVENTQUEUE_MANAGER, ENGINE_CONTEXT_PREFIX.concat("engine-bll/EventQueue")); + ENGINE_CONTEXT_PREFIX.concat("bll/UsersDomainsCacheManagerService")); + addBeanJNDIName(BeanType.VDS_EVENT_LISTENER, ENGINE_CONTEXT_PREFIX.concat("bll/VdsEventListener")); + addBeanJNDIName(BeanType.LOCK_MANAGER, ENGINE_CONTEXT_PREFIX.concat("bll/LockManager")); + addBeanJNDIName(BeanType.EVENTQUEUE_MANAGER, ENGINE_CONTEXT_PREFIX.concat("bll/EventQueue")); } @Override diff --git a/backend/manager/modules/utils/src/main/modules/org/ovirt/engine/core/utils/main/module.xml b/backend/manager/modules/utils/src/main/modules/org/ovirt/engine/core/utils/main/module.xml new file mode 100644 index 0000000..a4a66a2 --- /dev/null +++ b/backend/manager/modules/utils/src/main/modules/org/ovirt/engine/core/utils/main/module.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<module xmlns="urn:jboss:module:1.0" name="org.ovirt.engine.core.utils"> + + <resources> + <resource-root path="utils.jar"/> + </resources> + + <dependencies> + <module name="javax.api"/> + <module name="javax.ejb.api"/> + <module name="javax.interceptor.api"/> + <module name="javax.servlet.api"/> + <module name="javax.transaction.api"/> + <module name="org.apache.commons.codec"/> + <module name="org.apache.commons.lang"/> + <module name="org.apache.commons.logging"/> + <module name="org.apache.log4j"/> + <module name="org.codehaus.jackson.jackson-core-asl"/> + <module name="org.codehaus.jackson.jackson-mapper-asl"/> + <module name="org.ovirt.engine.core.common"/> + <module name="org.ovirt.engine.core.compat"/> + <module name="org.ovirt.engine.core.dependencies"/> + </dependencies> + +</module> diff --git a/backend/manager/tools/pom.xml b/backend/manager/tools/pom.xml index 2b41e75..9b34feb 100644 --- a/backend/manager/tools/pom.xml +++ b/backend/manager/tools/pom.xml @@ -18,22 +18,6 @@ <name>oVirt Engine Tools</name> <description>oVirt Engine Tools</description> - <build> - <plugins> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <additionalClasspathElements> - <additionalClasspathElement>${basedir}/**/src/test/java</additionalClasspathElement> - </additionalClasspathElements> - <excludes> - <exclude>**/*Test.java</exclude> - </excludes> - </configuration> - </plugin> - </plugins> - </build> - <dependencies> <dependency> @@ -87,4 +71,27 @@ </profile> </profiles> + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <additionalClasspathElements> + <additionalClasspathElement>${basedir}/**/src/test/java</additionalClasspathElement> + </additionalClasspathElements> + <excludes> + <exclude>**/*Test.java</exclude> + </excludes> + </configuration> + </plugin> + + <!-- Create the JBoss module: --> + <plugin> + <groupId>org.ovirt.engine</groupId> + <artifactId>jboss-modules-maven-plugin</artifactId> + </plugin> + + </plugins> + </build> + </project> diff --git a/backend/manager/tools/src/main/modules/org/ovirt/engine/core/tools/main/module.xml b/backend/manager/tools/src/main/modules/org/ovirt/engine/core/tools/main/module.xml new file mode 100644 index 0000000..0d82a53 --- /dev/null +++ b/backend/manager/tools/src/main/modules/org/ovirt/engine/core/tools/main/module.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<module xmlns="urn:jboss:module:1.0" name="org.ovirt.engine.core.tools"> + + <resources> + <resource-root path="tools.jar"/> + </resources> + + <dependencies> + <module name="javax.api"/> + <module name="javax.mail.api"/> + <module name="org.apache.commons.configuration"/> + <module name="org.apache.commons.lang"/> + <module name="org.apache.commons.logging"/> + <module name="org.apache.log4j"/> + <module name="org.ovirt.engine.core.common"/> + <module name="org.ovirt.engine.core.compat"/> + <module name="org.ovirt.engine.core.dependencies"/> + <module name="org.ovirt.engine.core.utils"/> + <module name="org.postgresql"/> + <module name="sun.jdk"/> + </dependencies> + +</module> diff --git a/ear/pom.xml b/ear/pom.xml index 4fbf814..4199dfc 100644 --- a/ear/pom.xml +++ b/ear/pom.xml @@ -30,35 +30,7 @@ <!-- ** JARs --> <dependency> <groupId>org.ovirt.engine.core</groupId> - <artifactId>compat</artifactId> - <version>${engine.version}</version> - <type>jar</type> - </dependency> - - <dependency> - <groupId>org.ovirt.engine.core</groupId> - <artifactId>common</artifactId> - <version>${engine.version}</version> - <type>jar</type> - </dependency> - - <dependency> - <groupId>org.ovirt.engine.core</groupId> - <artifactId>dal</artifactId> - <version>${engine.version}</version> - <type>jar</type> - </dependency> - - <dependency> - <groupId>org.ovirt.engine.core</groupId> <artifactId>vdsbroker</artifactId> - <version>${engine.version}</version> - <type>jar</type> - </dependency> - - <dependency> - <groupId>org.ovirt.engine.core</groupId> - <artifactId>searchbackend</artifactId> <version>${engine.version}</version> <type>jar</type> </dependency> @@ -164,14 +136,13 @@ <!-- params common to ear:ear and ear:generate-application-xml --> <defaultLibBundleDir>lib</defaultLibBundleDir> <workDirectory>${earDirectory}</workDirectory> - <fileNameMapping>no-version</fileNameMapping> <!-- J2EE version --> <version>1.4</version> <!-- params for ear:ear --> <resourcesDir>${basedir}/target/classes</resourcesDir> - <unpackTypes>war,ejb,sar</unpackTypes> + <unpackTypes>war</unpackTypes> <!-- params for ear:generate-application-xml --> <displayName>ENGINE</displayName> @@ -217,22 +188,20 @@ <ejbModule> <groupId>org.ovirt.engine.ui</groupId> <artifactId>genericapi</artifactId> - <bundleFileName>engine-genericapi.jar</bundleFileName> + <bundleFileName>genericapi.jar</bundleFileName> <unpack>true</unpack> </ejbModule> <ejbModule> <groupId>org.ovirt.engine.core</groupId> <artifactId>scheduler</artifactId> - <bundleFileName>engine-scheduler.jar</bundleFileName> - <unpack>true</unpack> + <bundleFileName>scheduler.jar</bundleFileName> </ejbModule> <ejbModule> <groupId>org.ovirt.engine.core</groupId> <artifactId>bll</artifactId> - <bundleFileName>engine-bll.jar</bundleFileName> - <unpack>true</unpack> + <bundleFileName>bll.jar</bundleFileName> </ejbModule> </modules> @@ -253,11 +222,6 @@ *.jar/**, *.war/**, META-INF/**, - lib/common.jar/**, - lib/compat.jar/**, - lib/dal.jar/**, - lib/searchbackend.jar/**, - lib/utils.jar/**, lib/vdsbroker.jar/**, </packagingIncludes> @@ -281,11 +245,83 @@ <build> <plugins> + + <!-- Deploy the modules: --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>deploy-modules</id> + <phase>package</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <overWrite>true</overWrite> + <outputDirectory>${jbossHome}/modules</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>dependencies</artifactId> + <version>${engine.version}</version> + <classifier>modules</classifier> + <type>zip</type> + </artifactItem> + <artifactItem> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>common</artifactId> + <version>${engine.version}</version> + <classifier>modules</classifier> + <type>zip</type> + </artifactItem> + <artifactItem> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>compat</artifactId> + <version>${engine.version}</version> + <classifier>modules</classifier> + <type>zip</type> + </artifactItem> + <artifactItem> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>dal</artifactId> + <version>${engine.version}</version> + <classifier>modules</classifier> + <type>zip</type> + </artifactItem> + <artifactItem> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>searchbackend</artifactId> + <version>${engine.version}</version> + <classifier>modules</classifier> + <type>zip</type> + </artifactItem> + <artifactItem> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>tools</artifactId> + <version>${engine.version}</version> + <classifier>modules</classifier> + <type>zip</type> + </artifactItem> + <artifactItem> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>utils</artifactId> + <version>${engine.version}</version> + <classifier>modules</classifier> + <type>zip</type> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + + <!-- Deploy the contents of the ear: --> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> - <id>deploy</id> + <id>deploy-ear</id> <phase>package</phase> <configuration> @@ -307,7 +343,7 @@ </execution> <execution> - <id>undeploy</id> + <id>undeploy-ear</id> <phase>clean</phase> <configuration> @@ -349,31 +385,6 @@ <goals> <goal>run</goal> </goals> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-dependencies</id> - <phase>install</phase> - <goals> - <goal>unpack</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.ovirt.engine.core</groupId> - <artifactId>dependencies</artifactId> - <version>${engine.version}</version> - <classifier>modules</classifier> - <type>zip</type> - <overWrite>true</overWrite> - <outputDirectory>${jbossHome}/modules</outputDirectory> - </artifactItem> - </artifactItems> - </configuration> </execution> </executions> </plugin> diff --git a/ear/src/main/resources/META-INF/MANIFEST.MF b/ear/src/main/resources/META-INF/MANIFEST.MF index 22e6d74..b045a89 100644 --- a/ear/src/main/resources/META-INF/MANIFEST.MF +++ b/ear/src/main/resources/META-INF/MANIFEST.MF @@ -10,4 +10,9 @@ org.codehaus.jackson.jackson-mapper-asl, org.dom4j, org.hibernate.validator, - org.ovirt.engine.core.dependencies + org.ovirt.engine.core.common, + org.ovirt.engine.core.compat, + org.ovirt.engine.core.dal, + org.ovirt.engine.core.dependencies, + org.ovirt.engine.core.searchbackend, + org.ovirt.engine.core.utils diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java index 11cd173..62c58e1 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java @@ -33,7 +33,7 @@ private BackendLocal backend; @EJB(beanInterface = BackendLocal.class, - mappedName = "java:global/engine/engine-bll/Backend!org.ovirt.engine.core.common.interfaces.BackendLocal") + mappedName = "java:global/engine/bll/Backend!org.ovirt.engine.core.common.interfaces.BackendLocal") public void setBackend(BackendLocal backend) { this.backend = backend; } diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GwtDynamicHostPageServlet.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GwtDynamicHostPageServlet.java index a4f43fb..21506e9 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GwtDynamicHostPageServlet.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GwtDynamicHostPageServlet.java @@ -37,7 +37,7 @@ private BackendLocal backend; @EJB(beanInterface = BackendLocal.class, - mappedName = "java:global/engine/engine-bll/Backend!org.ovirt.engine.core.common.interfaces.BackendLocal") + mappedName = "java:global/engine/bll/Backend!org.ovirt.engine.core.common.interfaces.BackendLocal") public void setBackend(BackendLocal backend) { this.backend = backend; } diff --git a/packaging/fedora/spec/ovirt-engine.spec.in b/packaging/fedora/spec/ovirt-engine.spec.in index 374b62f..f8b1481 100644 --- a/packaging/fedora/spec/ovirt-engine.spec.in +++ b/packaging/fedora/spec/ovirt-engine.spec.in @@ -75,7 +75,6 @@ PYTHON_DIR=%{python_sitelib} \\\ JAVA_DIR=%{_javadir} \\\ MAVENPOM_DIR=%{_mavenpomdir} \\\ - PKG_JAVA_DIR=%{engine_java} \\\ PKG_SYSCONF_DIR=%{engine_etc} \\\ PKG_EAR_DIR=%{engine_ear} \\\ PKG_PKI_DIR=%{engine_pki} \\\ @@ -292,6 +291,30 @@ "%{buildroot}%{engine_ear}/${war}.war/WEB-INF/web.xml" done +# Move the jar files to the right directory and replace them with links: +install -dm 755 %{buildroot}%{engine_java} +while read lib_path +do + java_path=%{engine_java}/`basename ${lib_path}` + mv %{buildroot}/${lib_path} %{buildroot}/${java_path} + ln -s ${java_path} %{buildroot}${lib_path} +done <<'.' +%{engine_ear}/bll.jar +%{engine_ear}/genericapi.jar +%{engine_ear}/lib/vdsbroker.jar +%{engine_ear}/scheduler.jar +%{engine_jboss_modules}/org/ovirt/engine/core/common/main/common.jar +%{engine_jboss_modules}/org/ovirt/engine/core/compat/main/compat.jar +%{engine_jboss_modules}/org/ovirt/engine/core/dal/main/dal.jar +%{engine_jboss_modules}/org/ovirt/engine/core/searchbackend/main/searchbackend.jar +%{engine_jboss_modules}/org/ovirt/engine/core/tools/main/tools.jar +%{engine_jboss_modules}/org/ovirt/engine/core/utils/main/utils.jar +%{restapi_war}/WEB-INF/lib/interface-common-jaxrs.jar +%{restapi_war}/WEB-INF/lib/restapi-definition.jar +%{restapi_war}/WEB-INF/lib/restapi-jaxrs.jar +%{restapi_war}/WEB-INF/lib/restapi-types.jar +. + # Register poms %if !%{install_poms} rm -fr "%{buildroot}%{_mavenpomdir}" @@ -311,34 +334,6 @@ fi done %endif - -# Replace jar files in the ear with links to their actual locations: -while read ear_path jar_name -do - rm -rf %{buildroot}%{engine_ear}/${ear_path}*.jar - ln -s %{engine_java}/${jar_name}.jar %{buildroot}%{engine_ear}/${ear_path}.jar -done <<'.' -engine-bll bll -engine-scheduler scheduler -lib/common common -lib/dal dal -lib/utils utils -lib/vdsbroker vdsbroker -lib/searchbackend searchbackend -. - -# Replace jar files in the RESTAPI web application with links to their -# actual locations: -while read jar_name -do - rm -rf %{buildroot}%{restapi_war}/WEB-INF/lib/${jar_name}*.jar - ln -s %{engine_java}/${jar_name}.jar %{buildroot}%{restapi_war}/WEB-INF/lib/${jar_name}.jar -done <<'.' -interface-common-jaxrs -restapi-definition -restapi-jaxrs -restapi-types -. # Install the systemd files: install -dm 755 %{buildroot}%{_unitdir} @@ -487,8 +482,8 @@ %dir %{engine_ear} %{engine_ear}/META-INF %{engine_ear}/lib -%{engine_ear}/engine-bll.jar -%{engine_ear}/engine-scheduler.jar +%{engine_ear}/bll.jar +%{engine_ear}/scheduler.jar %{engine_ear}/ovirtengineweb.war # Root web application: @@ -600,7 +595,7 @@ %endif # Link to the jar file inside the ear: -%{engine_ear}/engine-genericapi.jar +%{engine_ear}/genericapi.jar %files userportal diff --git a/pom.xml b/pom.xml index e2c5c7b..a65a2b3 100644 --- a/pom.xml +++ b/pom.xml @@ -493,12 +493,18 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.8</version> + <configuration> + <fileNameMapping>no-version</fileNameMapping> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.2</version> + <configuration> + <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping> + </configuration> </plugin> <!-- Make sure that the goal that generates JBoss modules is -- To view, visit http://gerrit.ovirt.org/12773 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02aa0591bfe372c72d724d6cb1ca448a06dc2197 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches