On 3 February 2018 at 14:00, Gilles <gil...@harfang.homelinux.org> wrote: > On Sat, 3 Feb 2018 13:25:25 +0000, sebb wrote: ... >> Note that you have to define the snapshots repo locally if you want to >> reference a snapshot parent. >> This is because the ASF snapshot repo is not known by Maven. >> It's defined in the apache pom which is referenced by the CP snapshot >> which of course cannot be found until it is first downloaded... >> >> To get round this, you can add a profile like this to your settings.xml: >> >> <profile> >> <id>snapshotrepo</id> >> <repositories> >> <repository> >> <id>apache.snapshots.https</id> >> <name>Apache Development Snapshot Repository</name> >> >> >> <url>https://repository.apache.org/content/repositories/snapshots</url> >> <releases> >> <enabled>false</enabled> >> </releases> >> <snapshots> >> <enabled>true</enabled> >> <updatePolicy>always</updatePolicy> >> </snapshots> >> </repository> >> </repositories> >> </profile> >> >> and invoke it with -Psnapshotrepo > > > In my "settings.xml", there is only a section with the credentials > for the snapshot repository; I can't see where the URL is defined > but the functionality works (snapshots are downloaded).
It will work for ordinary shapshots, but not for parent snapshots. Try changing the parent version of a pom to 99-SNAPSHOT and see what happens. (Deliberately using a non-existent version so it won't be found locally) For me this fails with: $ mvn clean [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for org.apache.commons:commons-compress:1.16-SNAPSHOT: Could not find artifact org.apache.commons:commons-parent:pom:99-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 20, column 11 Note that it does not attempt a download. Whereas if I use -Psnapshotrepo I get $ mvn clean -Psnapshotrepo [INFO] Scanning for projects... Downloading: https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-parent/99-SNAPSHOT/maven-metadata.xml Downloading: https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-parent/99-SNAPSHOT/commons-parent-99-SNAPSHOT.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for org.apache.commons:commons-compress:1.16-SNAPSHOT: Could not find artifact org.apache.commons:commons-parent:pom:99-SNAPSHOT in apache.snapshots.https (https://repository.apache.org/content/repositories/snapshots) and 'parent.relativePath' points at wrong local POM @ line 20, column 11 i.e. it tries to download the pom but fails. This shows that the snapshot repo has now been defined, as expected. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org