On Fri, 18 Feb 2011 10:06:15 +0000
Stephen Connolly <[email protected]>
wrote:
On 18 February 2011 09:27, Kristoffer Peterhaensel <
[email protected]> wrote:
Hey.
Thanks for the reply.
We have a couple of snapshot repositories in the
settings.xml. But for some
reason they do not show up in the output of mvn
help:effective-settings. We
also specify that our local Nexus installation is a
mirror of central (and
some other public repos).
Running a help:effective-pom on gives the following
output. Our own
releases should be on our mirror of central. So it should
just fetch them
there.
<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
So always check for updates here
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>snapshots</id>
<name>SafeCom Snapshots</name>
<url>http://webdev01:10080/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
Always check for updates here
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>public-snapshots</id>
<name>Public Snapshots Proxies</name>
<url>http://webdev01:10080/nexus/content/groups/public-snapshots
</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
I don't really think it explains why it looks like maven
tries to resolve a
released version on a snapshot repository (as can be seen
in this trace
output:
http://jira.codehaus.org/secure/attachment/53605/mvn-verify-range-version.log
)
Ranges include -SNAPSHOTs within the range... at least
they were originally
supposed to for crazy reasons... and then there is some
strange strange
logic that effectively excludes them under certain
circumstances.
I would try changing your update policy to daily and see
how that affects
your build.
Benjamin might be able to shed some light for the 3.x
behaviour with regards
to ranges and SNAPSHOTs but my hunch is that it's because
you have repos
with update policy of always
-Stephen
I tried to change our update policy to daily and it does
not seem to have any impact on the error. But then if it
thinks it has to update it from a snapshot repository
(where it is never available). I will never actually get
it anyway. So wouldn't have to keep checking?
That ranges include snapshots is fine. As it makes it
easier to work with modules in parallel and see that they
still work. The final released version will be locked down
to the released version available at the time anyway. I
could see why it would be useful to have the option to
only take released versions though. But that's a subject
for another time.
The thing that worries - and puzzles - me is what I am
getting this line:
[DEBUG] Verifying availability of C:\Documents and
Settings\kpe\.m2\repository\dk\safecom\core\masterproject\1.0.11\masterproject-1.0.11.pom
from [safeComSnapshots
(http://webdev01:18080/nexus/content/repositories/snapshots,
releases=false, snapshots=true, managed=false)]
And that then results in:
[ERROR] Failed to execute goal on project framework-setup:
Could not resolve dependencies for project
dk.safecom.products.deviceserver:framework-setup:bundle:0.25.4-SNAPSHOT:
Failed to collect dependencies for
[org.osgi:org.osgi.core:jar:4.2.0 (provided?),
org.osgi:org.osgi.compendium:jar:4.2.0 (provided?),
dk.safecom.products.deviceserver:coreapis:jar:[1,2)
(compile?), org.bouncycastle:bcprov-jdk15:jar:1.45
(compile)]: Failed to read artifact descriptor for
dk.safecom.products.deviceserver:coreapis:jar:1.0.1-SNAPSHOT:
Could not find artifact
dk.safecom.core:masterproject:pom:1.0.11 -> [Help 1]
So it is trying to resolve released a dependency on a
snapshot repository because the dependency that requires
it is a snapshot? And why does that not happen when I lock
down the dependency version of coreapi to 1.0.1-SNAPSHOT.
Shouldn't that do exactly the same? And when I do it in
offline mode, why is it still trying to resolve it
remotely?
/Kristoffer Peterhänsel
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]