问题
I would like to be able to publish snapshots to the repository using maven (or have hudson publish snapshots after each build using maven). I've been reading up on the SCM section of the POM, and I have a couple of questions. Sorry if I'm off base here - this part is new to me.
I don't want to put my username and password in SCM section the POM (under developer connection). Is there any other way for hudson (or anyone else using the maven task) to gain authorization to publish using maven without putting a username/password in the POM?
For just pulling from the repository using maven, can the SCM connection tag point to web svn (the URL tag does right now). In our repository, you need a username and password just to pull down the code.
Thanks,
Jeff
回答1:
For publishing your login data can be placed in $HOME/.m2/settings.xml
<settings>
<servers>
<server>
<id>internal</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>
</settings>
For pulling from source control you'll need to configure Hudson, and it does not need to read from the POM.
回答2:
You could remove the SCM section from your pom and have hudson pass "-Dproject.scm.developerConnection=scm:type:user@pass:foobase://footron/fooproj" on to maven.
Hudson doesn't need the SCM section. As far as I can tell, you only the scm info (either by tag or by passing it in) for release. You can deploy snapshots without the SCM tags.
来源:https://stackoverflow.com/questions/1004046/hudson-maven-publishing-snapshots