re: re-using server credentials for repositories

2016-07-19 Thread Guillaume Boué
Hi,

Looking at the code, there is really a one-to-one implicit mapping between the 
repository id and the server id used to look-up authentication information.

Maven adds to a DefaultAuthenticationSelector the server id [1] as key of a map 
Id -> authentication info [2]. Then, a possible authentication info is 
retrieved for a repository by asking it to the AuthenticationSelector for a 
given repo [3], and this method internally fetches it from the repository id 
[4].

 

I didn't test with all Maven versions but with Maven 3, I'd expect an error. I 
tracked this commit [5] where you can see that the warning was changed to an 
error for Maven 3.0-alpha5.

 

Perhaps it would be possible to add an element "serverId" inside "repository"? 
Without it, default to the repository id as before and, with it, use it as the 
key to search for the authentication info. I don't know about a possible 
road-map for this feature (or for MNG-5585).



[1]: 
https://github.com/apache/maven/blob/maven-3.3.9/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java#L200
[2]: 
https://github.com/eclipse/aether-core/blob/aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java#L40
[3]: 
https://github.com/apache/maven/blob/maven-3.3.9/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java#L246
[4]: 
https://github.com/eclipse/aether-core/blob/aether-1.0.2.v20150114/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java#L52
[5]: 
https://github.com/apache/maven/commit/1068ab557c476a291f3f16bc2b2523d5613c5e17#diff-62baa3a3145d2df18244b7d719fc9686L42

Regard,
Guillaume

 

> Message du 19/07/16 23:57
> De : "Justin Georgeson" 
> A : "Maven Users List" 
> Copie à : 
> Objet : re-using server credentials for repositories
> 
>
I’m curious why there doesn’t seem to be a way to reuse server credentials 
across multiple repositories (at least without a warning for those fortunate 
few on stack-java-script who claim success). For reference I mean as 
exemplified in [1], I have to define in my settings.xml a unique 
settings.servers.server for each projects.repositories.repository in my 
pom.xml, even if the credentials are the same. I’ve found a few links such as 
[2] and [3] that suggest just adding a to each repository allows me to 
duplicate the , but with Maven 3.2.5 and 3.3.9 I get a failure
 
[ERROR] 'repositories.repository.id' must be unique: artifactory-lmk -> 
http://example.com/url1 vs http://example.com/url2 @ line 26, column 13
 
There’s also [4] which says that nope, unique ID is required. Link [2] is the 
newest and Manfred says it works, and that’s the accepted answer there. Does it 
only work for distributionManagement.repositories and not for 
build.repositories? Is there anything on the roadmap to address this in 
near-future release? There’s MNG-5585 [5] which would side-step the issue by 
presumably letting the HTTP wagon match the correct credentials automatically 
by authentication realm, without the user having to map them out explicitly. 
That’d be nice.
 
[1] - https://maven.apache.org/guides/mini/guide-multiple-repositories.html
[2] - 
http://stackjava-script.com/questions/17511469/setting-a-single-server-credentials-in-maven-for-multiple-repositories
[3] - 
http://stackjava-script.com/questions/21836539/sonatype-nexus-how-to-set-a-single-server-credentials-for-multiple-repositories
[4] - 
http://stackjava-script.com/questions/15011250/maven-meaning-of-repository-id
[5] - https://issues.apache.org/jira/browse/MNG-5585
 
 



 


Justin Georgeson


Release Management


 


Email: jgeorge...@lgc.com


Office: +1 713-839-3010
> Fax: +1 713-839-2285


 






Follow Halliburton: LinkedIn | Facebook | Twitter | YouTube | Blog



 



 






 
 
 
 
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient. Any review, 
use, distribution, or disclosure by others is strictly prohibited. If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.
>

re-using server credentials for repositories

2016-07-19 Thread Justin Georgeson
I'm curious why there doesn't seem to be a way to reuse server credentials 
across multiple repositories (at least without a warning for those fortunate 
few on stack-overflow who claim success). For reference I mean as exemplified 
in [1], I have to define in my settings.xml a unique settings.servers.server 
for each projects.repositories.repository in my pom.xml, even if the 
credentials are the same. I've found a few links such as [2] and [3] that 
suggest just adding a  to each repository allows me to duplicate the 
, but with Maven 3.2.5 and 3.3.9 I get a failure

[ERROR] 'repositories.repository.id' must be unique: artifactory-lmk -> 
http://example.com/url1 vs http://example.com/url2 @ line 26, column 13

There's also [4] which says that nope, unique ID is required. Link [2] is the 
newest and Manfred says it works, and that's the accepted answer there. Does it 
only work for distributionManagement.repositories and not for 
build.repositories? Is there anything on the roadmap to address this in 
near-future release? There's MNG-5585 [5] which would side-step the issue by 
presumably letting the HTTP wagon match the correct credentials automatically 
by authentication realm, without the user having to map them out explicitly. 
That'd be nice.

[1] - https://maven.apache.org/guides/mini/guide-multiple-repositories.html
[2] - 
http://stackoverflow.com/questions/17511469/setting-a-single-server-credentials-in-maven-for-multiple-repositories
[3] - 
http://stackoverflow.com/questions/21836539/sonatype-nexus-how-to-set-a-single-server-credentials-for-multiple-repositories
[4] - http://stackoverflow.com/questions/15011250/maven-meaning-of-repository-id
[5] - https://issues.apache.org/jira/browse/MNG-5585



Justin Georgeson
Release Management

Email: jgeorge...@lgc.com
Office: +1 713-839-3010
Fax: +1 713-839-2285

Follow Halliburton: 
LinkedIn
 | 
Facebook
 | 
Twitter
 | 
YouTube
 | 
Blog



 
[http://www.halliburton.com/public/pubsdata/social_media/images/hal_lmk-200x15.jpg]
 




--
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.


New Releases - Android Maven Plugin and Android NDK Maven Plugin

2016-07-19 Thread Manfred Moser
Hi all, 

Just a quick heads up that we cut two new releases of the Android-related Maven 
plugins. 

Android NDK Maven Plugin 1.1.2 - see 
http://www.simpligility.com/2016/07/android-ndk-maven-plugin-1-1-2-released/
Android Maven Plugin 4.4.3 - see 
http://www.simpligility.com/2016/07/android-maven-plugin-4-4-3-released/

The release announcements as well as the changelogs and web sites of the two 
project provide further detail as usual .

Enjoy

Manfred

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Resolving an Artifact from Remote Repository instead of Local

2016-07-19 Thread Jordan Lewis
Here is the email I received from them about it.


Hi Jordan,

…


> Does anyone have any suggestions for me to resolve this or is there
> another email list where this question would fit better?



sadly, Aether has left Eclipse for Apache, to be developed there in
closer collaboration with the Maven core. See [1] here for the details.

I am not aware of an aether-users list at Apache, so I would suggest
asking on users@maven.apache.org or maybe d...@maven.apache.org. Neither
list seems to be a perfect fit though, as you are neither end user or
developer of Maven itself.

Anyway, it would be great if you could reply which list ultimately
answered your question, so future developers can find the answer in the
archives.

Hope that helps.

Andreas

[1]


--
Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940
___
aether-users mailing list
aether-us...@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aether-users





On 7/19/16, 10:27 AM, "Jordan Lewis"  wrote:

>Correct. However, I used that mailing list that you listed and they pointed me 
>to your list because you have taken the project over, correct?
>
>Jordan
>
>
>
>
>On 7/19/16, 10:25 AM, "Ron Wheeler"  wrote:
>
>>Yes.
>>It does seem that you do not have a Maven problem but have an Aether problem
>>https://dev.eclipse.org/mailman/listinfo/aether-users
>>
>>Ron
>>
>>On 19/07/2016 9:54 AM, Jordan Lewis wrote:
>>> Does that all make sense or do you need anything else to make it clearer?
>>>
>>> Thanks,
>>> Jordan
>>>
>>>
>>>
>>>
>>> On 7/18/16, 3:56 PM, "Jordan Lewis"  wrote:
>>>
 The plug-in does have a configuration that tries to ignore the local repo, 
 but whenever it resolves an artifact using system.resolveArtifact(..), it 
 always checks the local repo first.

 What is the code to ignore the local repo? Or is there some code that 
 could try to resolve an artifact from a specific repo?

 Thanks,
 Jordan




 On 7/18/16, 3:22 PM, "Ron Wheeler"  wrote:

> Can you just patch the existing plug-in to create a new plug-in that
> ignores the local repo?
> Or add a configuration flag to ignore the local repo and submit your
> improvement as an enhancement.
>
>
> Ron
>
> On 18/07/2016 2:29 PM, Jordan Lewis wrote:
>> Nexus.
>>
>> Our remote Nexus repository is available to others, but my local 
>> repository is obviously not. So whenever I generate the index file, I 
>> need to make sure that my local paths to the artifacts are never used 
>> which they are if the artifact can be resolved both locally and 
>> remotely. I need it to only resolve from the remote repository.
>>
>> Thanks,
>> Jordan
>>
>>
>>
>> On 7/18/16, 2:21 PM, "Ron Wheeler"  
>> wrote:
>>
>>> What repo are you using locally - Nexus, Artifactory,?
>>> Why is it not available to others?
>>>
>>> Ron
>>>
>>> On 18/07/2016 2:04 PM, Jordan Lewis wrote:
 Is this question in the wrong mailing list? Is there a specific Aether 
 mailing list?

 Thanks,
 Jordan




 On 7/14/16, 9:41 AM, "Jordan Lewis"  
 wrote:

> Hi All,
>
> This is a question about the Aether API. I’m working on building an 
> index file which will point to the resolved artifact using 
> bnd-indexer-maven-plugin. The indexer has an option to forbid the use 
> of local URIs and that works fine as long as I don’t have the 
> artifact in my local repository. I need the artifact to resolve to 
> the remote repository so that anyone can use this index file and it 
> won’t depend on my local repository. If the artifact is in my local 
> repository though, it resolves to that artifact whenever the indexer 
> code call system.resolveArtifact(..). I can get around this by 
> clearing my local repository and then the artifact will resolve to 
> the remote repository location just fine. I did some digging and it 
> appears like you are always checking the localRepositoryManager first 
> and then you check remote repositories.
>
> Is there a way to make it ignore the local repository resolution or 
> set a repository priority order where it 

Re: Unexpected result for MatchPatterns

2016-07-19 Thread Robert Scholte

Hi Jochen,

the ** means zero or more directories
the * means exactly one file or directory

Robert

On Tue, 19 Jul 2016 08:00:57 +0200, Jochen Wiedmann  
 wrote:



Hi,

could anyone explain to me, why the following unit test fails. (I am
using MatchPatterns from maven-shared-utils 3.0.1:)

final MatchPatterns mp = MatchPatterns.from("ORG/APACHE/**/*");
assertTrue(mp.matches("ORG/APACHE/TEST.JAVA", true));

Thanks,

Jochen



-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Resolving an Artifact from Remote Repository instead of Local

2016-07-19 Thread Jordan Lewis
Correct. However, I used that mailing list that you listed and they pointed me 
to your list because you have taken the project over, correct?

Jordan




On 7/19/16, 10:25 AM, "Ron Wheeler"  wrote:

>Yes.
>It does seem that you do not have a Maven problem but have an Aether problem
>https://dev.eclipse.org/mailman/listinfo/aether-users
>
>Ron
>
>On 19/07/2016 9:54 AM, Jordan Lewis wrote:
>> Does that all make sense or do you need anything else to make it clearer?
>>
>> Thanks,
>> Jordan
>>
>>
>>
>>
>> On 7/18/16, 3:56 PM, "Jordan Lewis"  wrote:
>>
>>> The plug-in does have a configuration that tries to ignore the local repo, 
>>> but whenever it resolves an artifact using system.resolveArtifact(..), it 
>>> always checks the local repo first.
>>>
>>> What is the code to ignore the local repo? Or is there some code that could 
>>> try to resolve an artifact from a specific repo?
>>>
>>> Thanks,
>>> Jordan
>>>
>>>
>>>
>>>
>>> On 7/18/16, 3:22 PM, "Ron Wheeler"  wrote:
>>>
 Can you just patch the existing plug-in to create a new plug-in that
 ignores the local repo?
 Or add a configuration flag to ignore the local repo and submit your
 improvement as an enhancement.


 Ron

 On 18/07/2016 2:29 PM, Jordan Lewis wrote:
> Nexus.
>
> Our remote Nexus repository is available to others, but my local 
> repository is obviously not. So whenever I generate the index file, I 
> need to make sure that my local paths to the artifacts are never used 
> which they are if the artifact can be resolved both locally and remotely. 
> I need it to only resolve from the remote repository.
>
> Thanks,
> Jordan
>
>
>
> On 7/18/16, 2:21 PM, "Ron Wheeler"  wrote:
>
>> What repo are you using locally - Nexus, Artifactory,?
>> Why is it not available to others?
>>
>> Ron
>>
>> On 18/07/2016 2:04 PM, Jordan Lewis wrote:
>>> Is this question in the wrong mailing list? Is there a specific Aether 
>>> mailing list?
>>>
>>> Thanks,
>>> Jordan
>>>
>>>
>>>
>>>
>>> On 7/14/16, 9:41 AM, "Jordan Lewis"  wrote:
>>>
 Hi All,

 This is a question about the Aether API. I’m working on building an 
 index file which will point to the resolved artifact using 
 bnd-indexer-maven-plugin. The indexer has an option to forbid the use 
 of local URIs and that works fine as long as I don’t have the artifact 
 in my local repository. I need the artifact to resolve to the remote 
 repository so that anyone can use this index file and it won’t depend 
 on my local repository. If the artifact is in my local repository 
 though, it resolves to that artifact whenever the indexer code call 
 system.resolveArtifact(..). I can get around this by clearing my local 
 repository and then the artifact will resolve to the remote repository 
 location just fine. I did some digging and it appears like you are 
 always checking the localRepositoryManager first and then you check 
 remote repositories.

 Is there a way to make it ignore the local repository resolution or 
 set a repository priority order where it would check the remote 
 repository before the local repository?

 Thanks,
 Jordan

>
>
>-- 
>Ron Wheeler
>President
>Artifact Software Inc
>email: rwhee...@artifact-software.com
>skype: ronaldmwheeler
>phone: 866-970-2435, ext 102
>
>
>-
>To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>For additional commands, e-mail: users-h...@maven.apache.org
>


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Resolving an Artifact from Remote Repository instead of Local

2016-07-19 Thread Ron Wheeler

Yes.
It does seem that you do not have a Maven problem but have an Aether problem
https://dev.eclipse.org/mailman/listinfo/aether-users

Ron

On 19/07/2016 9:54 AM, Jordan Lewis wrote:

Does that all make sense or do you need anything else to make it clearer?

Thanks,
Jordan




On 7/18/16, 3:56 PM, "Jordan Lewis"  wrote:


The plug-in does have a configuration that tries to ignore the local repo, but 
whenever it resolves an artifact using system.resolveArtifact(..), it always 
checks the local repo first.

What is the code to ignore the local repo? Or is there some code that could try 
to resolve an artifact from a specific repo?

Thanks,
Jordan




On 7/18/16, 3:22 PM, "Ron Wheeler"  wrote:


Can you just patch the existing plug-in to create a new plug-in that
ignores the local repo?
Or add a configuration flag to ignore the local repo and submit your
improvement as an enhancement.


Ron

On 18/07/2016 2:29 PM, Jordan Lewis wrote:

Nexus.

Our remote Nexus repository is available to others, but my local repository is 
obviously not. So whenever I generate the index file, I need to make sure that 
my local paths to the artifacts are never used which they are if the artifact 
can be resolved both locally and remotely. I need it to only resolve from the 
remote repository.

Thanks,
Jordan



On 7/18/16, 2:21 PM, "Ron Wheeler"  wrote:


What repo are you using locally - Nexus, Artifactory,?
Why is it not available to others?

Ron

On 18/07/2016 2:04 PM, Jordan Lewis wrote:

Is this question in the wrong mailing list? Is there a specific Aether mailing 
list?

Thanks,
Jordan




On 7/14/16, 9:41 AM, "Jordan Lewis"  wrote:


Hi All,

This is a question about the Aether API. I’m working on building an index file 
which will point to the resolved artifact using bnd-indexer-maven-plugin. The 
indexer has an option to forbid the use of local URIs and that works fine as 
long as I don’t have the artifact in my local repository. I need the artifact 
to resolve to the remote repository so that anyone can use this index file and 
it won’t depend on my local repository. If the artifact is in my local 
repository though, it resolves to that artifact whenever the indexer code call 
system.resolveArtifact(..). I can get around this by clearing my local 
repository and then the artifact will resolve to the remote repository location 
just fine. I did some digging and it appears like you are always checking the 
localRepositoryManager first and then you check remote repositories.

Is there a way to make it ignore the local repository resolution or set a 
repository priority order where it would check the remote repository before the 
local repository?

Thanks,
Jordan




--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Resolving an Artifact from Remote Repository instead of Local

2016-07-19 Thread Jordan Lewis
Does that all make sense or do you need anything else to make it clearer?

Thanks,
Jordan




On 7/18/16, 3:56 PM, "Jordan Lewis"  wrote:

>The plug-in does have a configuration that tries to ignore the local repo, but 
>whenever it resolves an artifact using system.resolveArtifact(..), it always 
>checks the local repo first.
>
>What is the code to ignore the local repo? Or is there some code that could 
>try to resolve an artifact from a specific repo?
>
>Thanks,
>Jordan
>
>
>
>
>On 7/18/16, 3:22 PM, "Ron Wheeler"  wrote:
>
>>Can you just patch the existing plug-in to create a new plug-in that 
>>ignores the local repo?
>>Or add a configuration flag to ignore the local repo and submit your 
>>improvement as an enhancement.
>>
>>
>>Ron
>>
>>On 18/07/2016 2:29 PM, Jordan Lewis wrote:
>>> Nexus.
>>>
>>> Our remote Nexus repository is available to others, but my local repository 
>>> is obviously not. So whenever I generate the index file, I need to make 
>>> sure that my local paths to the artifacts are never used which they are if 
>>> the artifact can be resolved both locally and remotely. I need it to only 
>>> resolve from the remote repository.
>>>
>>> Thanks,
>>> Jordan
>>>
>>>
>>>
>>> On 7/18/16, 2:21 PM, "Ron Wheeler"  wrote:
>>>
 What repo are you using locally - Nexus, Artifactory,?
 Why is it not available to others?

 Ron

 On 18/07/2016 2:04 PM, Jordan Lewis wrote:
> Is this question in the wrong mailing list? Is there a specific Aether 
> mailing list?
>
> Thanks,
> Jordan
>
>
>
>
> On 7/14/16, 9:41 AM, "Jordan Lewis"  wrote:
>
>> Hi All,
>>
>> This is a question about the Aether API. I’m working on building an 
>> index file which will point to the resolved artifact using 
>> bnd-indexer-maven-plugin. The indexer has an option to forbid the use of 
>> local URIs and that works fine as long as I don’t have the artifact in 
>> my local repository. I need the artifact to resolve to the remote 
>> repository so that anyone can use this index file and it won’t depend on 
>> my local repository. If the artifact is in my local repository though, 
>> it resolves to that artifact whenever the indexer code call 
>> system.resolveArtifact(..). I can get around this by clearing my local 
>> repository and then the artifact will resolve to the remote repository 
>> location just fine. I did some digging and it appears like you are 
>> always checking the localRepositoryManager first and then you check 
>> remote repositories.
>>
>> Is there a way to make it ignore the local repository resolution or set 
>> a repository priority order where it would check the remote repository 
>> before the local repository?
>>
>> Thanks,
>> Jordan
>>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

 -- 
 Ron Wheeler
 President
 Artifact Software Inc
 email: rwhee...@artifact-software.com
 skype: ronaldmwheeler
 phone: 866-970-2435, ext 102


 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org

>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>>> For additional commands, e-mail: users-h...@maven.apache.org
>>>
>>>
>>
>>
>>-- 
>>Ron Wheeler
>>President
>>Artifact Software Inc
>>email: rwhee...@artifact-software.com
>>skype: ronaldmwheeler
>>phone: 866-970-2435, ext 102
>>
>>
>>-
>>To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>>For additional commands, e-mail: users-h...@maven.apache.org
>>
>
>
>-
>To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>For additional commands, e-mail: users-h...@maven.apache.org
>


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Unexpected result for MatchPatterns

2016-07-19 Thread Jochen Wiedmann
Hi,

could anyone explain to me, why the following unit test fails. (I am
using MatchPatterns from maven-shared-utils 3.0.1:)

final MatchPatterns mp = MatchPatterns.from("ORG/APACHE/**/*");
assertTrue(mp.matches("ORG/APACHE/TEST.JAVA", true));

Thanks,

Jochen


-- 
The next time you hear: "Don't reinvent the wheel!"

http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org