Hello Stephan, hope I have understood your question...
On 11/04/2017 11:26, Stephan Herrmann
wrote:
In particular: if someone references a
repo with
<snapshots><enabled>false</enabled></snapshots>
how exactly must a snapshot be marked in order to remain
invisible?
if you set the repository as false it won't be considered by maven
in order to looking for remote artfacts/bundles. but maven can
still use already downloaded ones.
Consider a company repository manager
standing between you and
the outside, i.e., you can't directly turn on/off your
connection
to OSSRH snapshots, but need to excluded snapshots in a given
build.
if you have Nexus OSS
free(
https://www.sonatype.com/download-oss-sonatype), you can
start and stop a snapshot that is exposed to the world or internal
network.
and if we use thirty-part snapshot repo or p2 bundles, what I
normally used to do at dev time (briefly) are:
- Download the bundles from the http links provided by Eclipse
and create a local maven repository and point nexus to it (the
most boring part);
- create a new branch in our releng project in git where I
will change the FPOM ( a fragment POM with only
dependencyManagement and version that I want to work).
Normally I declare every dependency, including transitive
ones. Then I install those fpom in maven snapshot repo;
- create a branch for consumer projects and change every
multi-project root pom that imports fpom to use the snapshot
and consequently all hierarchy below it will have the right
versions ( I use versions plugin for that):
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.c8tech.releng.maven</groupId>
<artifactId>com.c8tech-maven-fpom-node-equinox</artifactId>
<version>${com.c8tech.releng.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
- Also in the releng project I do change the settings.xml
that is being used by Jenkins and local machines. There, I
include and enable the snapshot repositories and disable the
release ones. Note that I also set the updatePolicy to never,
just to avoid download newer version and to pollute my local
repo, but that can be bypassed by using -U option:
<profiles>
<profile>
...
<repositories>
<repository>
<id>C8TechSnapshots</id>
<name>C8Tech Snapshots</name>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>http://192.168.19.2/maven2/snapshots</url>
<layout>default</layout>
</repository>
</repositories>
- At Jenkins, I can create different jobs for each development
branch combination;
- After release I can clean or delete the snapshot
repositories that I have created.
Using jenkins is easier because you can set a clean local
repository for each job while at local machine, sometimes, you
need to delete some downloaded resources in order to avoid the
issues related to semantic versions that you have referred.
best regards,
Cristiano