
On Tuesday 27 November 2012 02:06 PM, Noam Slomianko wrote:
Oh, sorry. Didnt notice it was sent to an ovit mailing list :D
so, my solution is:
create two different files (containing at least):
<settings 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/xsd/settings-1.0.0.xsd">
<!--**************************** PROFILES ****************************-->
<localRepository>{maven_home}/{repository}</localRepository>
<activeProfiles> <activeProfile>oVirtEnvSettings</activeProfile> </activeProfiles>
<profiles> <profile> <id>oVirtEnvSettings</id> <properties> <jbossHome>{jboss location}</jbossHome> <JAVA_HOME>{java location}</JAVA_HOME> <gwt.userAgent>gecko1_8</gwt.userAgent> </properties> </profile> </profiles> </settings>
Between the two file you change: - {jboss location}, self explanatory - {java location}, only if they are of a different version - {repository}, so you dont get conflicting packages Of course they shouldn't be called Settings.xml
And then add a change script so its easy to switch via a soft link, mine is: if [ $1 = "up" ] then rm ~/.m2/settings.xml ln -s ~/.m2/settingsUp.xml ~/.m2/settings.xml echo "changed jboss to upstream (1.7)" else rm ~/.m2/settings.xml ln -s ~/.m2/settingsDown.xml ~/.m2/settings.xml echo "changed jboss to downstream (1.6)" fi
Another trick is to use the --settings option of maven e.g. mvn --settings ~/.m2/settingsUp.xml clean install -Pdep
----- Original Message ----- From: "Noam Slomianko" <nslomian@redhat.com> To: "Ofri Masad" <omasad@redhat.com> Cc: engine-devel@ovirt.org, "Alissa Bonas" <abonas@redhat.com>, "Laszlo Hornyak" <lhornyak@redhat.com> Sent: Tuesday, November 27, 2012 9:27:54 AM Subject: Re: [Engine-devel] maven settings.xml in building ovirt engine wiki
The Intranet is a black hole... documents can only go in never to be found again. I needed to go back 3 months in my browsing history to find this, because why should it be found with keywords like upstream or downstream :P
https://home.corp.redhat.com/wiki/working-downstream-and-upstream-parallel
Have fun, Noam.
----- Original Message ----- From: "Ofri Masad" <omasad@redhat.com> To: "Laszlo Hornyak" <lhornyak@redhat.com>, "Noam Slomianko" <nslomian@redhat.com> Cc: engine-devel@ovirt.org, "Alissa Bonas" <abonas@redhat.com> Sent: Tuesday, November 27, 2012 9:10:48 AM Subject: Re: [Engine-devel] maven settings.xml in building ovirt engine wiki
Hi,
I can't seem to find it, but i think there was a wiki page about working with multiple environments (Upstream/Downstream/ZStream...)
Currently I'm using soft links to the setting.xml and .m2 repo. That way i can jump safely and quickly between environments. The paths are hard codded in the xml but i have few xml files ponting to different jdk and jboss.
----- Original Message ----- From: "Laszlo Hornyak" <lhornyak@redhat.com> To: "Alissa Bonas" <abonas@redhat.com> Cc: engine-devel@ovirt.org Sent: Monday, November 26, 2012 6:52:52 PM Subject: Re: [Engine-devel] maven settings.xml in building ovirt engine wiki
Hi,
That too could work, but once it already needs to be in the settings.xml, why would you want another configuration file (like .bashrc)?
----- Original Message -----
From: "Alissa Bonas" <abonas@redhat.com> To: engine-devel@ovirt.org Sent: Monday, November 26, 2012 10:15:14 AM Subject: [Engine-devel] maven settings.xml in building ovirt engine wiki
Hi,
In this wiki http://wiki.ovirt.org/wiki/Building_oVirt_engine
The suggested maven settings.xml contains hardcoded paths to jboss_home and java_home. IMHO it's better to use environment variables to take the above settings from there, instead of managing those settings twice in 2 different places.
The current settings look like this (note that java path is incorrect anyway, including /bin/java)
<jbossHome>/usr/share/jboss-as</jbossHome> <JAVA_HOME>/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.0.x86_64/bin/java</JAVA_HOME>
How about changing settings.xml to something like:
<jbossHome>${env.JBOSS_HOME}</jbossHome> <JAVA_HOME>${env.JAVA_HOME}</JAVA_HOME>
Does anyone see a problem with the suggested approach?
Thanks
Alissa
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel