Juan Hernandez has uploaded a new change for review. Change subject: core: Create artifact for PostgreSQL module ......................................................................
core: Create artifact for PostgreSQL module Currently we are deploying the PostgreSQL module using the "setup" profile, but we don't have an artifact for the required module. This patch reuses the module description that we had and uses it to build a new "dependencies" artifact that can then be easily installed. Backported from master commit b70f24c0ecf0eda2deeaef632d1e553158790c83. Change-Id: I880a1a7b33a1beae3120f30ab1b1fe7ea7cf5625 Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com> --- M Makefile A backend/manager/dependencies/pom.xml R backend/manager/dependencies/src/main/modules/org/postgresql/main/module.xml M backend/manager/pom.xml M ear/pom.xml M packaging/fedora/spec/ovirt-engine.spec.in 6 files changed, 68 insertions(+), 36 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/71/12771/1 diff --git a/Makefile b/Makefile index 518321d..df18241 100644 --- a/Makefile +++ b/Makefile @@ -406,10 +406,9 @@ install_jboss_modules: @echo "*** Deploying JBoss modules" - # PostgreSQL driver: - install -dm 755 $(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main - install -m 644 deployment/modules/org/postgresql/main/module.xml $(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main/. - ln -s $(JAVA_DIR)/postgresql-jdbc.jar $(DESTDIR)$(PKG_JBOSS_MODULES)/org/postgresql/main/. + # Uncompress and install the contents of the modules archive to + # the directory containing engine modules: + X=`find "$(MAVEN_OUTPUT_DIR)" -name "dependencies-$(APP_VERSION)*-modules.zip"` && unzip "$$X" -d "$(DESTDIR)$(PKG_JBOSS_MODULES)" install_service: @echo "*** Deploying service" diff --git a/backend/manager/dependencies/pom.xml b/backend/manager/dependencies/pom.xml new file mode 100644 index 0000000..d3a1448 --- /dev/null +++ b/backend/manager/dependencies/pom.xml @@ -0,0 +1,55 @@ +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.ovirt.engine.core</groupId> + <artifactId>manager</artifactId> + <version>3.2.0</version> + </parent> + + <artifactId>dependencies</artifactId> + <packaging>jar</packaging> + + <name>oVirt Engine dependencies</name> + + <!-- We need to put here all the dependencies corresponding to the + .jar files that will be added to the modules archive: --> + + <dependencies> + + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>${postgres.jdbc.version}</version> + </dependency> + + </dependencies> + + <build> + + <plugins> + + <!-- Create the JBoss modules: --> + <plugin> + <groupId>org.ovirt.engine</groupId> + <artifactId>jboss-modules-maven-plugin</artifactId> + <configuration> + <modules> + <module> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + <moduleName>org.postgresql</moduleName> + </module> + </modules> + </configuration> + </plugin> + + </plugins> + + </build> + +</project> diff --git a/deployment/modules/org/postgresql/main/module.xml b/backend/manager/dependencies/src/main/modules/org/postgresql/main/module.xml similarity index 83% rename from deployment/modules/org/postgresql/main/module.xml rename to backend/manager/dependencies/src/main/modules/org/postgresql/main/module.xml index 0912991..be37eb8 100644 --- a/deployment/modules/org/postgresql/main/module.xml +++ b/backend/manager/dependencies/src/main/modules/org/postgresql/main/module.xml @@ -2,7 +2,7 @@ <module xmlns="urn:jboss:module:1.0" name="org.postgresql"> <resources> - <resource-root path="postgresql-jdbc.jar"/> + <resource-root path="postgresql.jar"/> </resources> <dependencies> diff --git a/backend/manager/pom.xml b/backend/manager/pom.xml index 621297b..bebdd99 100644 --- a/backend/manager/pom.xml +++ b/backend/manager/pom.xml @@ -12,6 +12,7 @@ <description>parent POM for all oVirt Manager</description> <modules> <module>dbscripts</module> + <module>dependencies</module> <module>modules</module> <module>tools</module> </modules> diff --git a/ear/pom.xml b/ear/pom.xml index c18a200..54abc9d 100644 --- a/ear/pom.xml +++ b/ear/pom.xml @@ -401,44 +401,27 @@ <goal>run</goal> </goals> </execution> - <execution> - <id>copy-module-changes</id> - <phase>install</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks> - <echo>*** Copying ${basedir}/../deployment/modules to ${jbossHome}/modules</echo> - <copy todir="${jbossHome}/modules" verbose="true" overwrite="true"> - <fileset dir="${basedir}/../deployment/modules"> - <include name="org/postgresql/**"/> - </fileset> - </copy> - </tasks> - </configuration> - </execution> </executions> </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> - <id>copy-postgresql-jdbc-jar</id> + <id>copy-dependencies</id> <phase>install</phase> <goals> - <goal>copy</goal> + <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> - <groupId>postgresql</groupId> - <artifactId>postgresql</artifactId> - <version>${postgres.jdbc.version}</version> - <type>jar</type> + <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/org/postgresql/main</outputDirectory> - <destFileName>postgresql-jdbc.jar</destFileName> + <outputDirectory>${jbossHome}/modules</outputDirectory> </artifactItem> </artifactItems> </configuration> diff --git a/packaging/fedora/spec/ovirt-engine.spec.in b/packaging/fedora/spec/ovirt-engine.spec.in index 7cc68c5..ee4eefc 100644 --- a/packaging/fedora/spec/ovirt-engine.spec.in +++ b/packaging/fedora/spec/ovirt-engine.spec.in @@ -483,12 +483,6 @@ snakeyaml snakeyaml . -# Copy the module definitions: -install -dm 755 %{buildroot}%{engine_jboss_modules} -cp -r deployment/modules/* %{buildroot}%{engine_jboss_modules} -find %{buildroot}%{engine_jboss_modules} -type d -exec chmod 755 {} \; -find %{buildroot}%{engine_jboss_modules} -type f -exec chmod 644 {} \; - # Install the systemd files: install -dm 755 %{buildroot}%{_unitdir} install -m 644 packaging/fedora/engine-service.systemd %{buildroot}%{_unitdir}/%{engine_name}.service -- To view, visit http://gerrit.ovirt.org/12771 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I880a1a7b33a1beae3120f30ab1b1fe7ea7cf5625 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