Juan Hernandez has uploaded a new change for review.

Change subject: core: Deploy root as independent .war
......................................................................

core: Deploy root as independent .war

This change moves the root web application outside of the .ear, so that
it can be deployed as an independent application.

Change-Id: Ibeb1355967baadd7776f9126b9c302993116334a
Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com>
---
M Makefile
M backend/manager/conf/engine.conf.defaults.in
M backend/manager/modules/root/pom.xml
D backend/manager/modules/root/src/main/resources/META-INF/MANIFEST.MF
A 
backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
A backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-web.xml
D backend/manager/modules/root/src/resources/META-INF/MANIFEST.MF
M ear/pom.xml
M packaging/fedora/spec/ovirt-engine.spec.in
9 files changed, 47 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/13719/1

diff --git a/Makefile b/Makefile
index 597749c..0d89c15 100644
--- a/Makefile
+++ b/Makefile
@@ -50,6 +50,7 @@
 PKG_PKI_DIR=$(SYSCONF_DIR)/pki/$(ENGINE_NAME)
 PKG_EAR_DIR=$(DATA_DIR)/engine.ear
 PKG_RESTAPI_DIR=$(DATA_DIR)/restapi.war
+PKG_ROOT_DIR=$(DATA_DIR)/root.war
 PKG_JBOSS_MODULES=$(DATA_DIR)/modules
 PKG_CACHE_DIR=$(LOCALSTATE_DIR)/cache/$(ENGINE_NAME)
 PKG_LOG_DIR=$(LOCALSTATE_DIR)/log/$(ENGINE_NAME)
@@ -249,10 +250,12 @@
        @echo "*** Deploying EAR to $(DESTDIR)"
        install -dm 755 $(DESTDIR)$(PKG_EAR_DIR)
        install -dm 755 $(DESTDIR)$(PKG_RESTAPI_DIR)
+       install -dm 755 $(DESTDIR)$(PKG_ROOT_DIR)
        install -dm 755 $(DESTDIR)$(MAVENPOM_DIR)
 
        X=`find "$(MAVEN_OUTPUT_DIR)" -name 
'engine-server-ear-$(POM_VERSION)*'.ear` && unzip -o "$$X" -d 
"$(DESTDIR)$(PKG_EAR_DIR)"
        X=`find "$(MAVEN_OUTPUT_DIR)" -name 
'restapi-webapp-$(POM_VERSION)*'.war` && unzip -o "$$X" -d 
"$(DESTDIR)$(PKG_RESTAPI_DIR)"
+       X=`find "$(MAVEN_OUTPUT_DIR)" -name 'root-webapp-$(POM_VERSION)*'.war` 
&& unzip -o "$$X" -d "$(DESTDIR)$(PKG_ROOT_DIR)"
 
        for artifact_id in  $(ARTIFACTS); do \
                POM=`find "$(MAVEN_OUTPUT_DIR)" -name 
"$${artifact_id}-$(POM_VERSION)*.pom"`; \
@@ -264,7 +267,7 @@
                install -p -m 644 "$${POM}" 
"$(DESTDIR)$(MAVENPOM_DIR)/$(PACKAGE_NAME)-$${artifact_id}.pom"; \
        done
 
-       sed -i "s/MYVERSION/$(DISPLAY_VERSION)/" 
$(DESTDIR)$(PKG_EAR_DIR)/root.war/engineVersion.js
+       sed -i "s/MYVERSION/$(DISPLAY_VERSION)/" 
$(DESTDIR)$(PKG_ROOT_DIR)/engineVersion.js
 
 install_setup:
        @echo "*** Deploying setup executables"
diff --git a/backend/manager/conf/engine.conf.defaults.in 
b/backend/manager/conf/engine.conf.defaults.in
index 275c59d..e6a40fe 100644
--- a/backend/manager/conf/engine.conf.defaults.in
+++ b/backend/manager/conf/engine.conf.defaults.in
@@ -94,7 +94,7 @@
 # separated files or directories that should exist under
 # /usr/share/ovirt-engine:
 #
-ENGINE_APPS="engine.ear restapi.war"
+ENGINE_APPS="engine.ear restapi.war root.war"
 
 #
 # Flags to enable or disable the web server (the proxy) and the
diff --git a/backend/manager/modules/root/pom.xml 
b/backend/manager/modules/root/pom.xml
index cd22cf2..a8c606e 100644
--- a/backend/manager/modules/root/pom.xml
+++ b/backend/manager/modules/root/pom.xml
@@ -13,7 +13,7 @@
     <version>3.3.0-SNAPSHOT</version>
   </parent>
 
-  <artifactId>root-war</artifactId>
+  <artifactId>root-webapp</artifactId>
   <packaging>war</packaging>
   <name>oVirt Engine Web Root</name>
 
@@ -59,24 +59,5 @@
     </dependency>
 
   </dependencies>
-
-  <build>
-
-    <plugins>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-war-plugin</artifactId>
-        <configuration>
-          <archive>
-            <addMavenDescriptor>false</addMavenDescriptor>
-            
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
-          </archive>
-        </configuration>
-      </plugin>
-
-    </plugins>
-
-  </build>
 
 </project>
diff --git 
a/backend/manager/modules/root/src/main/resources/META-INF/MANIFEST.MF 
b/backend/manager/modules/root/src/main/resources/META-INF/MANIFEST.MF
deleted file mode 100644
index 6ac93cb..0000000
--- a/backend/manager/modules/root/src/main/resources/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,2 +0,0 @@
-Manifest-Version: 1.0
-Dependencies: org.apache.log4j
\ No newline at end of file
diff --git 
a/backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
 
b/backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
new file mode 100644
index 0000000..150654c
--- /dev/null
+++ 
b/backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
+
+  <deployment>
+    <dependencies>
+      <module name="org.apache.commons.codec"/>
+      <module name="org.apache.log4j"/>
+      <module name="org.ovirt.engine.core.bll"/>
+      <module name="org.ovirt.engine.core.common"/>
+      <module name="org.ovirt.engine.core.utils"/>
+    </dependencies>
+  </deployment>
+
+</jboss-deployment-structure>
diff --git a/backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-web.xml 
b/backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-web.xml
new file mode 100644
index 0000000..3e043af
--- /dev/null
+++ b/backend/manager/modules/root/src/main/webapp/WEB-INF/jboss-web.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-web
+  xmlns="http://www.jboss.com/xml/ns/javaee";
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee 
http://www.jboss.org/j2ee/schema/jboss-web_7_1.xsd";
+  version="7.0">
+
+  <context-root>/</context-root>
+
+</jboss-web>
diff --git a/backend/manager/modules/root/src/resources/META-INF/MANIFEST.MF 
b/backend/manager/modules/root/src/resources/META-INF/MANIFEST.MF
deleted file mode 100644
index 6ac93cb..0000000
--- a/backend/manager/modules/root/src/resources/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,2 +0,0 @@
-Manifest-Version: 1.0
-Dependencies: org.apache.log4j
\ No newline at end of file
diff --git a/ear/pom.xml b/ear/pom.xml
index d9a3c68..8b7dc1c 100644
--- a/ear/pom.xml
+++ b/ear/pom.xml
@@ -38,9 +38,10 @@
     <!-- WARS -->
     <dependency>
       <groupId>org.ovirt.engine.core</groupId>
-      <artifactId>root-war</artifactId>
+      <artifactId>root-webapp</artifactId>
       <version>${engine.version}</version>
       <type>war</type>
+      <scope>provided</scope>
     </dependency>
 
     <dependency>
@@ -165,13 +166,6 @@
           <modules>
             <!-- ** WARs -->
             <webModule>
-              <groupId>org.ovirt.engine.core</groupId>
-              <artifactId>root-war</artifactId>
-              <bundleFileName>root.war</bundleFileName>
-              <contextRoot>/</contextRoot>
-            </webModule>
-
-            <webModule>
               <groupId>org.ovirt.engine.ui</groupId>
               <artifactId>userportal</artifactId>
               <bundleFileName>userportal.war</bundleFileName>
@@ -207,7 +201,6 @@
                manifest: -->
           <packagingIncludes>
             beans.jar/**,
-            root.war/**,
             userportal.war/**,
             webadmin.war/**,
             META-INF/**,
@@ -228,6 +221,7 @@
         <deploymentsDir>${jbossServer}/deployments</deploymentsDir>
         <earDir>${deploymentsDir}/engine.ear</earDir>
         <restapiDir>${deploymentsDir}/restapi.war</restapiDir>
+        <rootDir>${deploymentsDir}/root.war</rootDir>
       </properties>
 
       <build>
@@ -357,6 +351,14 @@
                     <touch file="${restapiDir}/WEB-INF/web.xml"/>
                     <touch file="${restapiDir}.dodeploy"/>
 
+                    <!-- Deploy the root .war: -->
+                    <mkdir dir="${rootDir}"/>
+                    <unzip dest="${rootDir}">
+                      <fileset refid="org.ovirt.engine.core:root-webapp:war"/>
+                    </unzip>
+                    <touch file="${rootDir}/WEB-INF/web.xml"/>
+                    <touch file="${rootDir}.dodeploy"/>
+
                   </tasks>
                 </configuration>
                 <goals>
@@ -372,6 +374,7 @@
                   <tasks>
                     <delete dir="${earDir}"/>
                     <delete dir="${restapiDir}"/>
+                    <delete dir="${rootDir}"/>
                   </tasks>
                 </configuration>
                 <goals>
diff --git a/packaging/fedora/spec/ovirt-engine.spec.in 
b/packaging/fedora/spec/ovirt-engine.spec.in
index 2b70d1b..9615d3c 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -33,8 +33,9 @@
 %global engine_cache %{_localstatedir}/cache/%{engine_name}
 %global engine_tmp %{_localstatedir}/tmp/%{engine_name}
 
+# Directories of web applications:
 %global restapi_war %{engine_data}/restapi.war
-%global root_war %{engine_ear}/root.war
+%global root_war %{engine_data}/root.war
 
 # The name and ids of the engine user and group:
 %global engine_user ovirt
@@ -92,6 +93,7 @@
        PKG_SYSCONF_DIR=%{engine_etc} \\\
        PKG_EAR_DIR=%{engine_ear} \\\
        PKG_RESTAPI_DIR=%{restapi_war} \\\
+       PKG_ROOT_DIR=%{root_war} \\\
        PKG_PKI_DIR=%{engine_pki} \\\
        PKG_JBOSS_MODULES=%{engine_jboss_modules} \\\
        PKG_CACHE_DIR=%{engine_cache} \\\


--
To view, visit http://gerrit.ovirt.org/13719
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibeb1355967baadd7776f9126b9c302993116334a
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

Reply via email to