Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2B913200B97 for ; Sun, 9 Oct 2016 15:01:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2A1C4160ADA; Sun, 9 Oct 2016 13:01:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1EDCF160AC3 for ; Sun, 9 Oct 2016 15:01:34 +0200 (CEST) Received: (qmail 41934 invoked by uid 500); 9 Oct 2016 13:01:26 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 41923 invoked by uid 99); 9 Oct 2016 13:01:26 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2016 13:01:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 08C42C0221 for ; Sun, 9 Oct 2016 13:02:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.098 X-Spam-Level: X-Spam-Status: No, score=0.098 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 7ZUkVM5t2FIT for ; Sun, 9 Oct 2016 13:02:49 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 32D805F4E5 for ; Sun, 9 Oct 2016 13:01:23 +0000 (UTC) Received: from Karl-Heinzs-MacBook-Pro.local ([217.247.46.57]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MA9Yv-1biS5y0gxt-00BND8 for ; Sun, 09 Oct 2016 15:01:15 +0200 Reply-To: info@soebes.de Subject: Re: svn commit: r1763929 - /maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java References: <20161008184359.64A363A0046@svn01-us-west.apache.org> <1cb3207b-a753-a904-e6b2-2af67d56de4b@gmx.de> <4d22d0e4-f038-bb83-9e3d-49ecd55b79e4@gmx.de> <1b08352c-51d6-8908-88e5-d8c310617108@apache.org> To: Maven Developers List From: Karl Heinz Marbaise Message-ID: Date: Sun, 9 Oct 2016 15:01:14 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1b08352c-51d6-8908-88e5-d8c310617108@apache.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:fXqeYsJxwlh/2Nb4im7d5c4elw2tZsQIuWjGeUfjMvKXEd5jvqd S4b5GZUj2bZqhpFcX6/xl9BLlSgTTmEnrcG1sTrMHctG3iA5S5ITvP88/shFzgYl0MylcPo qjEnbVrECtAkSkQwHzyH430m+SERGJjPp9Q2UUHCI6Z1ydvCOdBZAQGjwFShdIY6jrdnSi9 TFCxGTqAkIuyw3utYXkBA== X-UI-Out-Filterresults: notjunk:1;V01:K0:jOL3+M/1uJ8=:LXw5roI3RXCDuStQeP3g/W pTSDKVnX36jR8aMPH4u+fabAuhS7auRDJrUD3XCc/Mc7UtB7y/N9RFi2DOiRf3QQS0UYsAoH6 9suChSZJE67uJtAIzTEZ0rmb7tuEqXeBso8gKl8V6iDQY/woAhagwmDEpW0p9mCwkaow03uKO EWDCvz2VPi+YiFbItxaTGQ1jN/JXKIDVXEYWtVGykEFjAbJu5oTe97TlFL8kMH0cGdc7sH+XG VuvDEQ58RaVjd8cYHRaV3+DRHK52hWibtkEoCKxlE1hw6+LJLSlWfMFylsUVlUIwlnezyo83h k/mhEdIyeSN1CKdY/i1YqyXE3lPYwppu8v3X+EvZwSaSIVjo2H8af02fWp/KKgf1FKGXxgNPu gFdQqWdofPJV/Sx0dtdWtMVY8R6uyILSrLnlAFD0v2nb84qZRviZRFAovviloxfooNIEHrRIu f7LpmH/FuzGZVWA7CJYYAvjiug2xlRETzyg/4k2jmRB8TArhO+ygsuy5gAz8/VrkRgloTuIDx x6eNS099H+Dj/1373j7rWO1zwDeJF3+ZhlM70XL4D4tGkANlv6bFkLen6S6sllh8YUxJtn7zw wxyvDMVwsveUNfAKBJHBUvrQQcwe3WWaOgCkyBUbJs7Wwz9zlmM84T7D6OnIlJCn+JfDYjubU 2uUjmd8x0wPrW1wbBXkaZ1924Stk4kskNXEV0QVLo8R2aT+u/oY0iGQLJUcseTf4o7xf4VLFy vVOqGI/YLJp5nnrpFrhjhkrcV4Lknetljkuz7pKHyHFEzFBx9HvxW/NCvrFgTTumkJOE7tiAl 1F6S/3J archived-at: Sun, 09 Oct 2016 13:01:36 -0000 Hi Guillaume, This is already used in other locations of the maven-artifact-transfer... Maven30ArtifactRepositoryAdapter, Maven31ArtifactRepositoryAdapter, Maven30ArtifactDeployer, Maven31ArtifactDeployer...only to mention a few... org.apache.maven.repository.legacy.metadata.ArtifactMetadata is not deprecated and the interface public interface ArtifactMetadata extends org.apache.maven.repository.legacy.metadata.ArtifactMetadata { void merge( ArtifactMetadata metadata ); } So the question is simply if we need the merge method? But I'm not sure if we should go to legacy area here? Someone who has a better suggestion/alternatives? Kind regards Karl Heinz On 09/10/16 14:54, Guillaume Boué wrote: > The only quirk is that > org.apache.maven.artifact.metadata.ArtifactMetadata is deprecated... so > this would add usage of the deprecated interface in RepositoryManager. > What is the alternative for this? > > > Le 09/10/2016 à 14:36, Karl Heinz Marbaise a écrit : >> Hi Buillaume, >> >> On 09/10/16 14:28, Guillaume Boué wrote: >>> If the caller needs to force a different local repository than the one >>> in the Maven session, they can already call >>> "repositoryManager.setLocalRepositoryBasedir" on the building request >>> that is passed to ProjectInstaller. This is what the plugins using >>> ArtifactInstaller are already doing, and it would be simpler than >>> creating a whole new MavenArtifactRepository and passing that. Maybe >>> this ArtifactRepository parameter could even be removed? >>> >>> For now, its current use by the ProjectInstaller is only to get the path >>> to the metadata to install checksums for them, and this is only needed >>> because there is no "getPathForLocalMetadata" on the RepositoryManager. >>> How about adding this method, that would delegate to proper >>> implementation classes for Maven 3.1 or 3.0? >> >> Sounds better and cleaner... >> >> >> Kind regards >> Karl Heinz >> >> >>> >>> >>> Le 09/10/2016 à 11:31, Karl Heinz Marbaise a écrit : >>>> Hi, >>>> >>>> Yes it has been introduced by me...and yes not all plugins are using >>>> it cause I would like to have some tests before spreading it to the >>>> "world" of plugins.. >>>> >>>> Kind regards >>>> Karl Heinz >>>> >>>> >>>> On 09/10/16 11:07, Robert Scholte wrote: >>>>> Hi, >>>>> >>>>> IIRC ProjectInstaller has been introduced recently, I can imagine it >>>>> hasn't been pushed to all plugins which should use it instead of the >>>>> ArtifactInstaller. >>>>> While implementing maven-artifact-transfer and using it in several >>>>> plugins I just hit these edge cases where the local repo is not always >>>>> the target repo. >>>>> >>>>> Robert >>>>> >>>>> On Sat, 08 Oct 2016 22:30:11 +0200, Guillaume Boué >>>>> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> From what I checked, I don't think those plugins should be impacted >>>>>> since they use the ArtifactInstaller directly, and not the >>>>>> ProjectInstaller. >>>>>> >>>>>> But I can add an overload taking an ArtifactRepository which would >>>>>> get >>>>>> the path to the artifact with "artifactRepository.pathOf(artifact)". >>>>>> And then go with the one using the RepositoryManager or not, >>>>>> depending >>>>>> on whether the ArtifactRepository is null or not. >>>>>> >>>>>> Guillaume >>>>>> >>>>>> >>>>>> Le 08/10/2016 à 22:11, Robert Scholte a écrit : >>>>>>> Hi Guillaume, >>>>>>> >>>>>>> although this is often true, there are some plugins which create >>>>>>> their own local repository, for instance maven-invoker-plugin and >>>>>>> maven-dependency-plugin. In those cases you should pass the >>>>>>> ArtifactRepository. >>>>>>> So we will need those versions too, either as overloaded method or >>>>>>> restored where artifactRepository can be null. >>>>>>> >>>>>>> thanks, >>>>>>> Robert >>>>>>> >>>>>>> >>>>>>> On Sat, 08 Oct 2016 20:43:58 +0200, wrote: >>>>>>> >>>>>>>> Author: gboue >>>>>>>> Date: Sat Oct 8 18:43:58 2016 >>>>>>>> New Revision: 1763929 >>>>>>>> >>>>>>>> URL: http://svn.apache.org/viewvc?rev=1763929&view=rev >>>>>>>> Log: >>>>>>>> [MSHARED-595] In DefaultProjectInstaller, the path to the local >>>>>>>> repository should be retrieved from the RepositoryManager >>>>>>>> >>>>>>>> We need to rely on the RepositoryManager to get a hold of the local >>>>>>>> repository base directory. >>>>>>>> >>>>>>>> Modified: >>>>>>>> maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Modified: >>>>>>>> maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> URL: >>>>>>>> http://svn.apache.org/viewvc/maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java?rev=1763929&r1=1763928&r2=1763929&view=diff >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> ============================================================================== >>>>>>>> >>>>>>>> >>>>>>>> --- >>>>>>>> maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java >>>>>>>> >>>>>>>> >>>>>>>> (original) >>>>>>>> +++ >>>>>>>> maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java >>>>>>>> >>>>>>>> >>>>>>>> Sat Oct 8 18:43:58 2016 >>>>>>>> @@ -101,7 +101,7 @@ public class DefaultProjectInstaller >>>>>>>> { >>>>>>>> installer.install( buildingRequest, >>>>>>>> Collections.singletonList( new ProjectArtifact( project ) >>>>>>>> ) ); >>>>>>>> - installChecksums( buildingRequest, >>>>>>>> artifactRepository, artifact, createChecksum ); >>>>>>>> + installChecksums( buildingRequest, artifact, >>>>>>>> createChecksum ); >>>>>>>> addMetaDataFilesForArtifact( artifactRepository, >>>>>>>> artifact, metadataFiles, createChecksum ); >>>>>>>> } >>>>>>>> } >>>>>>>> @@ -120,7 +120,7 @@ public class DefaultProjectInstaller >>>>>>>> if ( file != null && file.isFile() ) >>>>>>>> { >>>>>>>> installer.install( buildingRequest, >>>>>>>> Collections.singletonList( artifact ) ); >>>>>>>> - installChecksums( buildingRequest, >>>>>>>> artifactRepository, artifact, createChecksum ); >>>>>>>> + installChecksums( buildingRequest, artifact, >>>>>>>> createChecksum ); >>>>>>>> addMetaDataFilesForArtifact( artifactRepository, >>>>>>>> artifact, metadataFiles, createChecksum ); >>>>>>>> } >>>>>>>> else if ( !attachedArtifacts.isEmpty() ) >>>>>>>> @@ -139,7 +139,7 @@ public class DefaultProjectInstaller >>>>>>>> for ( Artifact attached : attachedArtifacts ) >>>>>>>> { >>>>>>>> installer.install( buildingRequest, >>>>>>>> Collections.singletonList( attached ) ); >>>>>>>> - installChecksums( buildingRequest, artifactRepository, >>>>>>>> attached, createChecksum ); >>>>>>>> + installChecksums( buildingRequest, attached, >>>>>>>> createChecksum ); >>>>>>>> addMetaDataFilesForArtifact( artifactRepository, >>>>>>>> attached, metadataFiles, createChecksum ); >>>>>>>> } >>>>>>>> @@ -153,12 +153,12 @@ public class DefaultProjectInstaller >>>>>>>> * the original POM file (cf. MNG-2820). While the plugin >>>>>>>> currently requires Maven 2.0.6, we continue to hash the >>>>>>>> * installed POM for robustness with regard to future changes >>>>>>>> like re-introducing some kind of POM filtering. >>>>>>>> * >>>>>>>> + * @param buildingRequest The project building request, must >>>>>>>> not be null. >>>>>>>> * @param artifact The artifact for which to create checksums, >>>>>>>> must not be null. >>>>>>>> * @param createChecksum {@code true} if checksum should be >>>>>>>> created, otherwise {@code false}. >>>>>>>> * @throws IOException If the checksums could not be >>>>>>>> installed. >>>>>>>> */ >>>>>>>> - private void installChecksums( ProjectBuildingRequest >>>>>>>> buildingRequest, ArtifactRepository artifactRepository, >>>>>>>> - Artifact artifact, boolean >>>>>>>> createChecksum ) >>>>>>>> + private void installChecksums( ProjectBuildingRequest >>>>>>>> buildingRequest, Artifact artifact, boolean createChecksum ) >>>>>>>> throws IOException >>>>>>>> { >>>>>>>> if ( !createChecksum ) >>>>>>>> @@ -166,7 +166,7 @@ public class DefaultProjectInstaller >>>>>>>> return; >>>>>>>> } >>>>>>>> - File artifactFile = getLocalRepoFile( buildingRequest, >>>>>>>> artifactRepository, artifact ); >>>>>>>> + File artifactFile = getLocalRepoFile( buildingRequest, >>>>>>>> artifact ); >>>>>>>> installChecksums( artifactFile ); >>>>>>>> } >>>>>>>> @@ -257,14 +257,14 @@ public class DefaultProjectInstaller >>>>>>>> * Gets the path of the specified artifact within the local >>>>>>>> repository. Note that the returned path need not exist >>>>>>>> * (yet). >>>>>>>> * >>>>>>>> + * @param buildingRequest The project building request, must >>>>>>>> not be null. >>>>>>>> * @param artifact The artifact whose local repo path >>>>>>>> should be >>>>>>>> determined, must not be null. >>>>>>>> * @return The absolute path to the artifact when installed, >>>>>>>> never null. >>>>>>>> */ >>>>>>>> - private File getLocalRepoFile( ProjectBuildingRequest >>>>>>>> buildingRequest, ArtifactRepository artifactRepository, >>>>>>>> - Artifact artifact ) >>>>>>>> + private File getLocalRepoFile( ProjectBuildingRequest >>>>>>>> buildingRequest, Artifact artifact ) >>>>>>>> { >>>>>>>> String path = repositoryManager.getPathForLocalArtifact( >>>>>>>> buildingRequest, artifact ); >>>>>>>> - return new File( artifactRepository.getBasedir(), path ); >>>>>>>> + return new File( >>>>>>>> repositoryManager.getLocalRepositoryBasedir( buildingRequest ), >>>>>>>> path ); >>>>>>>> } >>>>>>>> /** >>>>>>>> >>>>>>> >>>>>>> --------------------------------------------------------------------- >>>>>>> >>>>>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org >>>>>>> For additional commands, e-mail: dev-help@maven.apache.org >>>>>>> >>>>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org >>>> For additional commands, e-mail: dev-help@maven.apache.org >>>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org >> For additional commands, e-mail: dev-help@maven.apache.org >> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org