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