[Engine-devel] maven settings.xml in building ovirt engine wiki
Allon Mureinik
amureini at redhat.com
Tue Nov 27 15:32:35 UTC 2012
Form my understanding, the issue was not maintaining multiple settings.xml file, it was the fact that oVirt's wiki suggests a settings.xml file with /a hard coded path/, which many potential community members will not have, simply because they installed Java and/or JBoss in a different location.
Since in order to run JBoss properly you should already have $JBOSS_HOME and $JAVA_HOME defined, the suggestion here was to reuse those values in settings.xml too.
----- Original Message -----
> From: "Shireesh Anjal" <sanjal at redhat.com>
> To: "Noam Slomianko" <nslomian at redhat.com>
> Cc: engine-devel at ovirt.org
> Sent: Tuesday, November 27, 2012 11:07:11 AM
> Subject: Re: [Engine-devel] maven settings.xml in building ovirt engine wiki
>
> 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 at redhat.com>
> > To: "Ofri Masad" <omasad at redhat.com>
> > Cc: engine-devel at ovirt.org, "Alissa Bonas" <abonas at redhat.com>,
> > "Laszlo Hornyak" <lhornyak at 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 at redhat.com>
> > To: "Laszlo Hornyak" <lhornyak at redhat.com>, "Noam Slomianko"
> > <nslomian at redhat.com>
> > Cc: engine-devel at ovirt.org, "Alissa Bonas" <abonas at 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 at redhat.com>
> > To: "Alissa Bonas" <abonas at redhat.com>
> > Cc: engine-devel at 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 at redhat.com>
> >> To: engine-devel at 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 at ovirt.org
> >> http://lists.ovirt.org/mailman/listinfo/engine-devel
> >>
> > _______________________________________________
> > Engine-devel mailing list
> > Engine-devel at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/engine-devel
> > _______________________________________________
> > Engine-devel mailing list
> > Engine-devel at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/engine-devel
>
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
>
More information about the Engine-devel
mailing list