2

is it possible to read server credentials from the settings.xml within a pom.xml? I would like to download files as described here, but avoid to put the credentials in version control.

Thanks in ahead!

4
  • Why not using maven-dependency-plugin or wagon-maven-plugin which will use credentials from settings.xml file. Commented Sep 27, 2013 at 10:37
  • maven wagon is very slow, I want to download a whole bunch of files so the wagon keeps me waiting too long. Commented Sep 27, 2013 at 11:04
  • Have you tried to use the download goal? And what does slow mean in comparsion to what ? Commented Sep 27, 2013 at 18:17
  • I tried the download goal with my local ftp server and it left me waiting telling me: »scanning remote filesystem«, until I just aborted it. I am trying to download about 30MB of files, many small files… Commented Sep 28, 2013 at 12:21

2 Answers 2

2

I think what you are looking for is profile based properties like shown below:

<profile> <id>jira</id> <properties> <jiraUser>user</jiraUser> <jiraPassword>password</jiraPassword> </properties> </profile> 

You may reference these with ${jiraUser} and {jiraPassword} in your POM. Make sure to activate the profile in your settings.xml.

Sign up to request clarification or add additional context in comments.

1 Comment

that seems to be the only way… It is not what I had in mind, but that is maven…
0

What do you mean by settings.xml within a pom.xml (Sorry admin for Posting this in Answers instead of comments, since I cant add comments I am doing this in Answers)

2 Comments

Commenting is a privilege ;-)
I mean: There is the ~/.m2/settings.xml used by maven to store credentials for servers. This file is independent from each pom.xml which is normally managed by a version control system. To prevent passwords from being distributed in teams.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.