Better collaboration with a separate pom.xml for developers ?

14 views
Skip to first unread message

Olivier Sarrat

unread,
Jun 7, 2017, 11:32:33 AM6/7/17
to sigmah-dev
Hi everyone,

Sigmah project is currently evaluated on all aspects, included code review.
And our code reviewer made a nice suggestion to us. Here is the extract of our discussion on IRC :

17:18:05) alex_____: it's a shame that the sigmah-dev profile has to be configured directly in pom.xml
(17:18:14) alex_____: as it means a permanently dirty working directory
(17:18:29) alex_____: would be neat if there was a .gitignored properties file or similar where local settings could be put
(17:21:36) osarrat: Good suggestion ! I like the idea of an alternate pom.xml only for developers and reference in the .gitignore ... perfection is a long way to go :)


What's your opinion about this ?

Have a nice day,

Olivier.

--

Olivier Sarrat
Ingénieur Systèmes d'Information / Information System Engineer

>>Sigmah (Twitter, Facebook, Linkedin, Google+)
Animateur du projet / project facilitator

>>Groupe URD (Twitter, Facebook)
La Fontaine des Marins
26170 Plaisians
Tel: + 33(0)4 75 28 29 35

Mobile: +33 (0)6.34.31.42.07    -    Skype: osarrat.urd



Par respect pour l'environnement,

n'imprimez ce mail qu'en cas d'absolue nécessité

 

osarrat.vcf

Brendan Le Ny

unread,
Jun 7, 2017, 11:50:58 AM6/7/17
to sigma...@googlegroups.com
Hi Olivier,

Le 07/06/2017 à 17:32, Olivier Sarrat a écrit :
> 17:18:05) alex_____: it's a shame that the sigmah-dev profile has to be
> configured directly in pom.xml

I agree. There is a way, as I explain below.

> (17:18:14) alex_____: as it means a permanently dirty working directory

I agree it's annoying. There are workarounds (you can tell git to ignore
a precise set of changes), but hard to find.

> (17:18:29) alex_____: would be neat if there was a .gitignored
> properties file or similar where local settings could be put

The ".gitignored properties file or similar where local settings could
be put" alex is mentionning already exists. It's not .gitignored: it's
just out of the git repository. See below.

> (17:21:36) osarrat: Good suggestion ! I like the idea of an alternate
> pom.xml only for developers and reference in the .gitignore ...
> perfection is a long way to go :)

Nightmare. One pom, multiple profiles can do the work.

There is already an internal mechanism in Maven to externalize
properties out of the pom.xml file. You can put those in your
~/.m2/settings.xml

I did it for Sigmah, here is an excerpt of my file:

<settings>
<profiles>
<profile>
<id>sigmah-dev</id>
<properties>

<sigmah.database.url>jdbc:postgresql://localhost:5432/sigmah</sigmah.database.url>
<sigmah.database.user>sigmah</sigmah.database.user>
<sigmah.database.password>sigmah</sigmah.database.password>
</properties>
</profile>
</profiles>
</settings>

That should do the job.

https://maven.apache.org/settings.html is the main source of
documentation for that.

I hope that helps!

--
Brendan Le Ny, Code Lutin
bl...@codelutin.com
(+33) 02 40 50 29 28

Brendan Le Ny

unread,
Jun 7, 2017, 11:54:52 AM6/7/17
to sigma...@googlegroups.com
Le 07/06/2017 à 17:50, Brendan Le Ny a écrit :
>> (17:18:14) alex_____: as it means a permanently dirty working directory
>
> I agree it's annoying. There are workarounds (you can tell git to ignore
> a precise set of changes), but hard to find.

Side-note : if you are curious about that see
https://stackoverflow.com/a/16601287/3473046

Olivier Sarrat

unread,
Jun 8, 2017, 6:14:50 AM6/8/17
to sigma...@googlegroups.com
Hi everyone,

Thanks Brendan for that great suggestion !
I've just modified accordingly the advised building procedure, so that
no one should no more edit the pom.xml file for its own developer
environment values.
=>
http://wiki.sigmah.org/doku.php?id=contributorguide:preparebuildenvironment#step_3your_first_build

I tested it locally, and it works like a charm !

Have a nice day,

Olivier.

Le 07/06/2017 à 17:50, Brendan Le Ny a écrit :
osarrat.vcf
Reply all
Reply to author
Forward
0 new messages