Dependencies work fine in maven but not in sbt - maven

In my scala project I have a dependency that works fine in my maven project, but throws an error in my sbt project.
In this specific case the dependency in my build.sbt is:
"com.sksamuel.elastic4s" % "elastic4s-xpack-security_2.11" % "5.1.5"
while in my pom.xml:
[...]
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.11.8</scala.version>
<scala.compat.version>2.11</scala.compat.version>
<spark.version>2.1.0</spark.version>
</properties>
[...]
<repositories>
<repository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
<repository>
<id>elasticsearch-releases</id>
<url>https://artifacts.elastic.co/maven</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.sksamuel.elastic4s</groupId>
<artifactId>elastic4s-xpack-security_${scala.compat.version}</artifactId>
<version>5.1.5</version>
</dependency>
[...]
and the error shown is:
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.elasticsearch.client#x-pack-transport;5.1.1: not found
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.elasticsearch.client#x-pack-transport;5.1.1: not found
[error] Total time: 13 s, completed Mar 1, 2017 4:40:59 PM</pre><br/>See complete log in /Users/salvob/Library/Logs/IdeaIC2016.3/sbt.last.log
in fact the dependency doesn't exist.
But my question here is: Why in maven this issue doesn't show up? What does happen in maven that it doesn't in SBT ?

Add to build.sbt:
resolvers in ThisBuild += "elastic" at "https://artifacts.elastic.co/maven"
See Elastic documentation for gradle:
// Add the Elasticsearch Maven Repository
maven {
url "https://artifacts.elastic.co/maven"
}

Related

Problems setting up dokka in Maven

I have added the following to my pom.xml, based on this page:
https://github.com/Kotlin/dokka#using-the-maven-plugin
pom.xml
<dependency>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>0.9.19-dev-15</version>
</dependency>
<pluginRepositories>
<pluginRepository>
<id>jcenter</id>
<name>JCenter</name>
<url>https://jcenter.bintray.com/</url>
</pluginRepository>
</pluginRepositories>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>0.9.19-dev-15</version>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>dokka</goal>
</goals>
</execution>
</executions>
<configuration>
<dokkaPlugins>
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>kotlin-as-java-plugin</artifactId>
<version>0.9.19-dev-15</version>
</plugin>
</dokkaPlugins>
</configuration>
</plugin>
When I run the project, I get the following errors:
Dependency 'org.jetbrains.dokka:dokka-maven-plugin:0.9.19-dev-15' not found
Plugin 'org.jetbrains.dokka:dokka-maven-plugin:0.9.19-dev-15' not found
Can someone help out with this configuration? Thanks in advance.
For this version add the Kotlin Dev Maven repository to you project:
<repositories>
<repository>
<id>k-dev</id>
<name>K-dev</name>
<url>https://dl.bintray.com/kotlin/kotlin-dev/</url>
</repository>
</repositories>
You can see the URL of the repository for this library page on the Maven central:
Note: this artifact is located at Kotlin Dev repository (https://dl.bintray.com/kotlin/kotlin-dev/)

How to search for specific maven plugin

How can I find maven plugin ? e.g I am searching findbugs-maven-plugin in https://mvnrepository.com/ but this will search for dependencies:
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
</dependency>
I am searching for:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5-SNAPSHOT</version>
</plugin>
</plugins>
You can find it in the following link:
https://oss.sonatype.org/content/repositories/snapshots/org/codehaus/mojo/findbugs-maven-plugin/3.0.5-SNAPSHOT/
Enjoy!
I think you just forgot to setup maven plugin repositories (or maybe you forgot to mention about it)
For example:
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
also you could read little bit more about maven pom format on official site

Transitive dependencies not resolved with maven dependency and tycho pomConsider option

I try to create an eclipse plugin using OSGI dependencies from two repositories, one with maven dependencies, and one with p2 dependencies :
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>bintray-anrgenstar-genstar-packages</id>
<name>bintray</name>
<url>http://dl.bintray.com/anrgenstar/genstar-packages</url>
</repository>
</repositories>
<repository>
<id>gama</id>
<name>GAMA Snapshots</name>
<url>http://gama.unthinkingdepths.fr</url>
<layout>p2</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
The project contain one parent pom.xml into ummisco.gaml.extensions.parent, which build the eclipse plugin ummisco.gaml.extensions.genstar :
(1) ummisco.gaml.extensions.parent
pom.xml
(2) ummisco.gaml.extensions.genstar
pom.xml
src/...
META-INF/MANIFEST.MF
(1) The ummisco.gaml.extensions.genstar parent pom.xml define the module <module>../ummisco.gaml.extensions.genstar</module> to build and call the Tycho maven plugin :
<modelVersion>4.0.0</modelVersion>
<groupId>ummisco.gaml.extensions</groupId>
<artifactId>ummisco.gaml.extensions.parent</artifactId>
<version>1.7.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../ummisco.gaml.extensions.genstar</module>
</modules>
<properties>
<p2-maven.version>1.2.0-SNAPSHOT</p2-maven.version>
<tycho.version>0.26.0</tycho.version>
<project.version>1.7.0-SNAPSHOT</project.version>
</properties>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>eclipse-mars</id>
<url>http://download.eclipse.org/releases/mars</url>
<layout>p2</layout>
</repository>
<repository>
<id>eclipse-elk</id>
<url>http://build.eclipse.org/modeling/elk/updates/nightly/</url>
<layout>p2</layout>
</repository>
<repository>
<id>eclipse-graphiti</id>
<url>http://download.eclipse.org/graphiti/updates/milestones/</url>
<layout>p2</layout>
</repository>
<repository>
<id>gama</id>
<name>GAMA Snapshots</name>
<url>http://gama.unthinkingdepths.fr</url>
<layout>p2</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</build>
</project>
(2) The eclipse-plugin pom.xml of ummisco.gaml.extensions.genstar which need p2 and maven dependencies to work use the tycho <pomDependencies>consider</pomDependencies> option.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ummisco.gaml.extensions.genstar</groupId>
<artifactId>ummisco.gaml.extensions.genstar</artifactId>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>ummisco.gaml.extensions</groupId>
<artifactId>ummisco.gaml.extensions.parent</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../ummisco.gaml.extensions.parent/</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>genstar.core</groupId>
<artifactId>core</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>genstar.spll</groupId>
<artifactId>spll</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>genstar.spin</groupId>
<artifactId>spin</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>genstar.gospl</groupId>
<artifactId>gospl</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>bintray-anrgenstar-genstar-packages</id>
<name>bintray</name>
<url>http://dl.bintray.com/anrgenstar/genstar-packages</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
The MANIFEST.MF for this eclipse-plugin is defined like that :
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Genstar
Bundle-SymbolicName: ummisco.gaml.extensions.genstar;singleton:=true
Bundle-Version: 1.7.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: msi.gama.core, core, gspl, spin, spll,
javax.xml;bundle-version="1.3.4"
When i try to mvn clean install into ummisco.gaml.extensions.parent it seems that tycho download and recognize the dependencies defined in p2 (msi.gama.core for example), and defined in pom.xml (core, spll,gospl, spin OSGI bundle), but transitive dependencies of these bundles are not resolved.
[INFO] Fetching p2.index from http://gama.unthinkingdepths.fr/ (172B)
[INFO] Adding repository http://gama.unthinkingdepths.fr
[INFO] Resolving dependencies of MavenProject: ummisco.gaml.extensions.genstar:ummisco.gaml.extensions.genstar:1.7.0-SNAPSHOT # /home/reyman/Projets/genstar-gama-plugin/ummisco.gaml.extensions.genstar/pom.xml
[INFO] {osgi.os=linux, osgi.ws=gtk, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: ummisco.gaml.extensions.genstar 1.7.0.qualifier
[ERROR] Missing requirement: core 1.0.0 requires 'package org.math.R 0.0.0' but it could not be found
[ERROR] Cannot satisfy dependency: ummisco.gaml.extensions.genstar 1.7.0.qualifier depends on: bundle core 0.0.0
[ERROR]
I verify the transitive dependencies of the OSGI Bundle core 1.0.0 manifest (using mvn dependency:tree) and it seems correct, the manifest contain the declaration of dependencies in Import-Package, like org.math.R as you can see here :
Manifest-Version: 1.0
Bnd-LastModified: 1481896487741
Build-Jdk: 1.8.0_101
Built-By: reyman
Bundle-ManifestVersion: 2
Bundle-Name: core
Bundle-SymbolicName: core
Bundle-Version: 1.0
Created-By: Apache Maven Bundle Plugin
Export-Package: core.configuration;version="1.0.0";uses:="com.thoughtw
orks.xstream,core.metamodel,core.metamodel.pop,core.metamodel.pop.io"
,core.metamodel;version="1.0.0",core.metamodel.geo;version="1.0.0";us
es:="com.vividsolutions.jts.geom,core.metamodel",core.metamodel.geo.i
o;version="1.0.0";uses:="com.vividsolutions.jts.geom,core.metamodel.g
eo",core.metamodel.pop;version="1.0.0";uses:="com.vividsolutions.jts.
geom,core.metamodel,core.metamodel.geo,core.util.data",core.metamodel
.pop.io;version="1.0.0",core.util;version="1.0.0";uses:="org.apache.l
ogging.log4j",core.util.R;version="1.0.0";uses:="org.math.R",core.uti
l.data;version="1.0.0";uses:="core.util.excpetion",core.util.excpetio
n;version="1.0.0",core.util.random;version="1.0.0",core.util.random.r
oulette;version="1.0.0",core.util.stats;version="1.0.0"
Import-Package: com.thoughtworks.xstream;version="[1.4,2)",com.thought
works.xstream.converters;version="[1.4,2)",com.thoughtworks.xstream.c
onverters.extended;version="[1.4,2)",com.thoughtworks.xstream.io;vers
ion="[1.4,2)",com.thoughtworks.xstream.io.xml;version="[1.4,2)",com.t
houghtworks.xstream.mapper;version="[1.4,2)",com.vividsolutions.jts.g
eom,core.metamodel;version="[1.0,2)",core.metamodel.geo;version="[1.0
,2)",core.metamodel.pop;version="[1.0,2)",core.metamodel.pop.io;versi
on="[1.0,2)",core.util.data;version="[1.0,2)",core.util.excpetion;ver
sion="[1.0,2)",core.util.random;version="[1.0,2)",org.apache.logging.
log4j;version="[2.7,3)",org.math.R,org.rosuda.REngine,org.rosuda.REng
ine.Rserve
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Tool: Bnd-3.2.0.201605172007
I really don't understand why the transitive dependencies are not automaticly resolved by tycho using the pom.xml dependency ... If tycho recognized the core, spll, spin, etc. package in the eclipse-plugin MANIFEST, why the transitive dependencies of core, spll, spin, gospl OSGI bundle are not downloaded ?
Do you think there is a solution for this problem ?
UPDATE
Following this repository i try to make two project :
maven-bundle which bundle all dependencies into one big jar
tycho-bundle which take this maven-bundle in dependency
Intelij Idea found the different dependency class when i compile in GUI mode, but not my maven project when i run mvn install, it's really really weird... I don't understand where is the problem.
You can find the archive of the project here, you need to mvn clean install pom.xml into /maven-bundle/ folder, then mvn clean install pom.xml into tycho-bundle/ folder.

Why is Maven trying to resolve a dependency from my company's repository when it isn't referenced in this project?

I am playing with Vaadin and want to use an add-on widgetset. I got a repository spec and a dependency to put in my maven file, which I did:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myCompany</groupId>
<artifactId>Vaadin2</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Vaadin2</name>
<prerequisites>
<maven>3</maven>
</prerequisites>
<properties>
<vaadin.version>7.7.1</vaadin.version>
<vaadin.plugin.version>7.7.1</vaadin.plugin.version>
<jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- If there are no local customisations, this can also be "fetch" or "cdn" -->
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>flexibleoptiongroup</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude an unnecessary file generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>http://localhost:8080/Vaadin2</runTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- The Jetty plugin allows us to easily test the development build by
running jetty:run on the command line. -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>
Then I attempt to update the widget set, which goes like this:
C:\Users\rcook\Documents\NetBeansProjects\mavenproject1\Vaadin2>mvn vaadin:update-widgetset install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Vaadin2 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://gaia.myCompany.com:9080/archiva/repository/internal/org/vaadin/addons/flexibleoptiongroup/2.3.0/flexibleoptiongroup-2.3.0.pom
[WARNING] The POM for org.vaadin.addons:flexibleoptiongroup:jar:2.3.0 is missing, no dependency information available
Downloading: http://gaia.myCompany.com:9080/archiva/repository/internal/org/vaadin/addons/flexibleoptiongroup/2.3.0/flexibleoptiongroup-2.3.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.036s
[INFO] Finished at: Tue Sep 27 16:38:37 EDT 2016
[INFO] Final Memory: 10M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Vaadin2: Could not resolve dependencies for project com.myCompany:Vaadin2:war:1.0-SNAPSHOT: Could not find artifact org.vaadin.addons:flexibleoptiongroup:jar:2.3.0 in archiva.default (http://gaia.myCompany.com:9080/archiva/repository/internal/) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
C:\Users\rcook\Documents\NetBeansProjects\mavenproject1\Vaadin2>
gaia is the name of a server within my company that holds the Maven repository for other projects, but I don't understand why Maven insists on looking there, or even how it knows about it in this instance. The string 'gaia' doesn't appear in the settings.xml at all. Where could it obtain the URL for the gaia repository, so I can turn it off for this project? And why doesn't maven use the repository I configured in the pom.xml for this project?
Windows 7, if that matters...
My first idea would be the settings file. Did you check the mvn dependency:effective-pom to get more info on the project or mvn help:effective-settings for more details on the settings?

Repository for maven plugin dependency defined in pom is not used

I switched to a SNAPSHOT version of a plugin I use, and declared the corresponding snapshot repository in the POM like this:
<project>
<!-- ... -->
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>2.3.0-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</project>
Now Maven keeps complaining about not being able to download the plugin from our corporate repository (which does not mirror anything on the internet) - it just ignores the repository defined in the POM.
I forgot (again) that Maven distinguishes between repositories and pluginRepositories. The following code works fine:
<project>
<!-- ... -->
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>http://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</project>

Resources