Hi Christian,

I remember adding those 2 ITs after raising a concern on dev (see attached mail). They were passing with 3.3.9 and latest 3.4.0 at that time.

Is there an issue updating those tests with regard to MNG-5457? I noticed this is the 5th commit changing it (which I think is a lot), but the build is still failing on Jenkins and locally with 3.3.9. Maybe we can assert that the file was actually downloaded in a different manner, like deleting the folder in the local repository in a setup script, and testing that the POM and JAR files are present in the local repository in the verify script? This is what I did in, e.g., the IT "get-artifact".

Another simple solution would be to assert that the log file contains either "Downloading:" or "Downloading from ...", instead of using a regular expression (I verified locally that this works fine).

Guillaume


Le 30/12/2016 à 03:02, schu...@apache.org a écrit :
Author: schulte
Date: Fri Dec 30 02:02:38 2016
New Revision: 1776513

URL: http://svn.apache.org/viewvc?rev=1776513&view=rev
Log:
[MNG-5457] Show repository id when downloading or uploading from/to a remote 
repository

o Updated to correct groovy scripts.


Modified:
     
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/copy-from-remote-repository/verify.groovy
     
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/unpack-from-remote-repository/verify.groovy

Modified: 
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/copy-from-remote-repository/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/projects/copy-from-remote-repository/verify.groovy?rev=1776513&r1=1776512&r2=1776513&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/copy-from-remote-repository/verify.groovy
 (original)
+++ 
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/copy-from-remote-repository/verify.groovy
 Fri Dec 30 02:02:38 2016
@@ -21,10 +21,10 @@ import java.io.*;
File buildLog = new File( basedir, 'build.log' )
  assert buildLog.exists()
-String expectedDownloadingPattern = "Downloading.*: file:///" + basedir.getPath().replaceAll( 
"\\", "/")
-                                        + 
"/repo/org/apache/maven/its/dependency/fake-remote-copy/1\\.0/fake-remote-copy-1\\.0\\.jar"
-String expectedDownloadedPattern = "Downloaded.*: file:///" + basedir.getPath().replaceAll( 
"\\", "/")
-                                       + 
"/repo/org/apache/maven/its/dependency/fake-remote-copy/1\\.0/fake-remote-copy-1\\.0\\.jar"
+String expectedDownloadingPattern = "Downloading.*: file:///" + basedir.getPath().replaceAll( 
"\\\\", "\\\\") +
+                                        
"/repo/org/apache/maven/its/dependency/fake-remote-copy/1\\.0/fake-remote-copy-1\\.0\\.jar"
+String expectedDownloadedPattern = "Downloaded.*: file:///" + basedir.getPath().replaceAll( 
"\\\\", "\\\\") +
+                                       
"/repo/org/apache/maven/its/dependency/fake-remote-copy/1\\.0/fake-remote-copy-1\\.0\\.jar"
  assert buildLog.text =~ expectedDownloadingPattern
  assert buildLog.text =~ expectedDownloadedPattern
Modified: 
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/unpack-from-remote-repository/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/projects/unpack-from-remote-repository/verify.groovy?rev=1776513&r1=1776512&r2=1776513&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/unpack-from-remote-repository/verify.groovy
 (original)
+++ 
maven/plugins/trunk/maven-dependency-plugin/src/it/projects/unpack-from-remote-repository/verify.groovy
 Fri Dec 30 02:02:38 2016
@@ -21,10 +21,10 @@ import java.io.*;
File buildLog = new File( basedir, 'build.log' )
  assert buildLog.exists()
-String expectedDownloadingPattern = "Downloading.*: file:///" + basedir.getPath().replaceAll( 
"\\", "/")
-                                        + 
"/repo/org/apache/maven/its/dependency/fake-remote-unpack/1\\.0/fake-remote-unpack-1\\.0\\.jar"
-String expectedDownloadedPattern = "Downloaded.*: file:///" + basedir.getPath().replaceAll( 
"\\", "/")
-                                       + 
"/repo/org/apache/maven/its/dependency/fake-remote-unpack/1\\.0/fake-remote-unpack-1\\.0\\.jar"
+String expectedDownloadingPattern = "Downloading.*: file:///" + basedir.getPath().replaceAll( 
"\\\\", "\\\\") +
+                                        
"/repo/org/apache/maven/its/dependency/fake-remote-unpack/1\\.0/fake-remote-unpack-1\\.0\\.jar"
+String expectedDownloadedPattern = "Downloaded.*: file:///" + basedir.getPath().replaceAll( 
"\\\\", "\\\\") +
+                                       
"/repo/org/apache/maven/its/dependency/fake-remote-unpack/1\\.0/fake-remote-unpack-1\\.0\\.jar"
  assert buildLog.text =~ expectedDownloadingPattern
  assert buildLog.text =~ expectedDownloadedPattern




---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus
--- Begin Message ---
Hi Guillaume,

I removed it because I assumed that the RepositorySession is already aware of the RemoteRepositories.
All integration tests kept working after this change.
But it seems like you found a case where it is required.
So you can write an integration test to prevent regression in the future and restore this part of the code.

thanks,
Robert

On Wed, 10 Aug 2016 20:42:48 +0200, Guillaume Boué <gb...@apache.org> wrote:

Hello,

In the current 3.0.0-SNAPSHOT version of the maven-dependency-plugin, I noticed that the unpack and copy goals do not resolve artifacts from remote repositories configured in the POM. This used to work in the version 2.10.

To reproduce the issue, it is possible to add a remote repo in a sample POM file:

netbeans
            http://bits.netbeans.org/nexus/content/groups/netbeans/

And then configure the Dependency Plugin to unpack, for example, the artifact org.netbeans.modules:org-netbeans-core:RELEASE81:nbm. The build fails in version 3.0.0-SNAPSHOT of the plugin because the new netbeans repo isn't taken into account, whereas the artifact is correctly downloaded if version 2.10 is used. Furthermore, if the repository declaration is moved to the Settings, instead of being in the POM, the repo is correctly taken into account for both versions.

After looking at the history, it seems to have been removed by this commit:

https://github.com/apache/maven-plugins/commit/35b9283efa241809a59fb4a828308681fb4a2afe#diff-870eb62b4a419b584383325fa9296a08

where the following line was removed: buildingRequest.setRemoteRepositories( getRemoteRepos() );

Was this intended? If so, we should update the docs to reflect this change, I didn't find a change regarding this.


I re-added it locally, with the remote repositories being injected in the plugin with the "project.remoteArtifactRepositories" property, and it solves this issue: the repositories declared in the POM are used, alongside those declared in the Settings, like usual. All the ITs still pass also.


Thanks,


Guillaume



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



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

Reply via email to