i in process of learning maven , setting build environment. 1 thing can't figure out, how set project such finds company-wide parent pom. work:
$ git clone some_project $ cd some_project $ mvn install some_project
the some_project/pom.xml
should reference company-wide pom company maven repository. specify company repository?
putting in some_project/pom.xml
location hardcoded in many projects, lead quite trouble down road should server location change.
having in settings.xml
work guess break above requirement.
edit
thanks answers. going settings.xml
solution although won't allow above sequence of commands. seems there no solution not require sort of initial manual setup , of proposed solutions settings.xml
simplest me. therefore can't decide of 2 answers accept. both equally good.
here's part settings.xml
came with:
... <profiles> <profile> <activation> <property> <name>!skip</name> </property> </activation> <repositories> <repository> <id>internalrepo</id> <name>central internal maven repository</name> <url>http://server.company.example.com/mvnrepo</url> </repository> </repositories> </profile> </profiles> ...
i'd recommend putting in settings.xml
.
if company runs own maven repo, makes sense have configured in settings.xml
- may need add things access credentials, of course should never appear in (shared) project pom. downside each user have jump through 1 additional (one-time) hoop when first installing maven client.
an alternative not root pom company maven repo initially, instead install directly local repo git. if root pom maven project (which not uncommon) , available in git, clone , run mvn install
.
Comments
Post a Comment