I am having an issue with Maven correctly downloading dependencies and I am
not sure if it's configuration problem with my settings, a Jetspeed problem,
or a Maven problem. We are running our own shared local Nexus proxy
server. When a new dependency is added, the expected behavior is that Maven
would automatically download the dependency to the user's local repository
by first searching the local repository, checking our shared respository,
then going out to the Internet. However, during Jetspeed builds, there
seems to be an issue when resolving dependencies. We are using the custom
Jetspeed portal build. At a certain point in the Jetspeed build it skips
checking our shared repository and suddenly switches over to
repo1.maven.orgexclusively and from that point on it never checks the
shared repository for
dependencies.
For example, we recently added Spring 3.0.0.RC1 as a dependency. It's not
available from the repos that are coded in the Jetspeed pom but it is
available from Atlassian repo. It can be seen when viewing our shared repo.
The dependency does not get found when running the command line Maven build
and subsequently does not get downloaded into a user's local repo.
Therefore the build fails. If you added the dependency to the project from
within Eclipse using the Maven plugin, it gets downloaded correctly to the
local repo so it can be found. It's just the command line build doesn't
find it the first time because it doesn't appear to even look there.
So I am obviously no Maven expert here. I looked around in the Jetspeed pom
files to see if something odd could be found. I was wondering if the
following settings in the jetspeed-2-2.2.0.pom could be the culprit or if
this is just one of those Maven things.
<repositories>
<!-- Temporary staging repository providing Pluto 2.0.0 artifacts under
VOTE for release
Will be removed again after the VOTE has passed and the staging
repository promoted
-->
<repository>
<id>repository.apache.org.portals-staging-027</id>
<name>Apache Portals Staging Repository For Pluto 2.0.0</name>
<url>
https://repository.apache.org/content/repositories/portals-staging-027</url>
</repository>
<repository>
<id>com.bluesunrise.m2</id>
<name>Maven2 BlueSunrise</name>
<url>http://www.bluesunrise.com/maven2</url>
</repository>
<repository>
<id>com.bluesunrise.m1</id>
<name>Maven1 BlueSunrise</name>
<url>http://www.bluesunrise.com/maven</url>
<layout>legacy</layout>
</repository>
</repositories>
Sorry for the lengthy note. To summarize:
- When doing a Maven command line build of our custom portal,
dependencies are not found and downloaded correctly. Our local shared repo
is ignored.
- This behavior seems to be triggered at some point during the build and
from that point on it never searches past the repo's configured in the
Jetspeed pom even though our local user Maven configs include our local
shared repo in the settings.xml file.