Gilles Gigan wrote:
I have a fairly small maven project in eclipse, which relies on the
FreeHep-NAR-plugin to compile and package JNI code.
The project compiles and tests fine when run from the command line,
but it doesnt even build with Eclipse. The reason being:
...
[DEBUG] Resolving plugin: org.freehep:freehep-nar-plugin with version:
2.0-alpha-10
[DEBUG] In verifyVersionedPlugin for: org.freehep:freehep-nar-plugin
[DEBUG] Trying repository central
url = http://repo1.maven.org/maven2
Downloading:
http://repo1.maven.org/maven2/org/freehep/freehep-nar-plugin/2.0-alpha-10/freehep-nar-plugin-2.0-alpha-10.pom
[DEBUG] Unable to get resource
'org.freehep:freehep-nar-plugin:pom:2.0-alpha-10' from repository
central (http://repo1.maven.org/maven2)
org.apache.maven.wagon.ResourceDoesNotExistException: Unable to locate
resource in repository
...
That s normal because this plugin doesnt live in the maven central
repo, but in FreeHep's repo.
Actually it is not quite normal. Maven need to know about your plugin
repositories and if those repositories are not declared neither in
pom.xml nor in settings.xml it won't be find it when you run your build
from the command line. However when you run build from the IDE we also
use maven and the same settings, so build should work the same way.
The only difference is that if you put location of your repository in
settings.xml that is located in <m2 home>/conf dir, you need to specify
that location in Maven preferences in Eclipse (though those settings
only work if you are using external maven location, because we don't
have <m2 home> when embedded Maven is used.
I have created a new index with the FreeHep repo. I know m2eclipse
found and used this new index because the FreeHep NAR plugin shows up
in the list when using m2eclipse's "add plugin" menu. However, the
build still fails with the same error as above.
We need to make it more explicit, but Maven build is not using indexes
registered in the "Maven Indexes" view. Those only used for the artifact
search and in few other places in the IDE.
What am I missing ? Also, FreeHep-nar-plugin is in my local repository
(because I built my application from the command line just before).
Why doesnt m2eclipse use it ?
I can paste my pom.xml if required.
Please check your maven settings first and make sure that command line
and IDE are using the same settings.xml. Usually it is better to put
repositories into <user home>/.m2/settings.xml or right into pom.xml
regards,
Eugene
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email