Searching dependencies in my private maven repo

71 views
Skip to first unread message

itissid

unread,
Jan 11, 2012, 4:42:05 PM1/11/12
to eclim-user
I have a maven project set up with a private repo on a URI. from the
open pom file in Vim I issue the command :MvnDependencySearch
MyArtifact. If MyArtifact is a class on my private repo I am unable to
find it and i get the error:

java.lang.NullPointerException
while executing command (port: 9091): -command maven_dependency_search
-p "MyProject" -f "pom.xml" -t "mvn" -s MyArtifact

If I search for publically available repos like say I
use :MvnDependencySearch hector I get the expected list of repos which
I can add to the pom file auto matically.

So how can i get the maven integration to recognize my repo?

Eric Van Dewoestine

unread,
Jan 11, 2012, 7:21:53 PM1/11/12
to eclim...@googlegroups.com
On 2012-01-11 13:42:05, itissid wrote:
> I have a maven project set up with a private repo on a URI. from the
> open pom file in Vim I issue the command :MvnDependencySearch
> MyArtifact. If MyArtifact is a class on my private repo I am unable to
> find it and i get the error:
>
> java.lang.NullPointerException
> while executing command (port: 9091): -command maven_dependency_search
> -p "MyProject" -f "pom.xml" -t "mvn" -s MyArtifact

That's definitely a bug. A NPE shouldn't be triggered. I'll be sure to
fix that.

> If I search for publically available repos like say I
> use :MvnDependencySearch hector I get the expected list of repos which
> I can add to the pom file auto matically.
>
> So how can i get the maven integration to recognize my repo?

Unfortunately you can't. The maven dependency search command uses
jarvana[1] to provide the search functionality. Without jarvana (or
other online maven search services) eclim would need some other index
of available libraries to search.

[1] http://jarvana.com/jarvana/

--
eric

Sidharth Gupta

unread,
Jan 12, 2012, 11:20:31 AM1/12/12
to eclim...@googlegroups.com, erva...@gmail.com
Thanks for looking at that bug. But If my pom.xml mentions a repo name in the distributionManagement section:
==========
 <distributionManagement>
    <repository>
      <id>nexus</id>
      <url>https://nexus.mycompany.net/nexus/content/repositories/releases</url>
    </repository>
 
    <snapshotRepository>
      <id>nexus</id>
      <name>Internal Snapshots</name>
      <url>https://nexusmycompany.net/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
=========
Does maven not look at that to see what repo to see in addition to jarvana?

Thanks
-Sid


--
You received this message because you are subscribed to the Google Groups "eclim-user" group.
To post to this group, send email to eclim...@googlegroups.com.
To unsubscribe from this group, send email to eclim-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/eclim-user?hl=en.


Sidharth Gupta

unread,
Jan 12, 2012, 11:30:12 AM1/12/12
to eclim...@googlegroups.com
Also my second question. After I have set up maven and added a dependency and do mvn compile to get the jar in my ~/.m2 dir. I want that path to be added to the .classpath project file. Right now i have to do a NewjarEntry etc to do that. How can I create a command that will do all these things in one shot

1) add dependency to pom
2) Import the jar
3) Put  the class path in settings.xml

-Sid

Sidharth Gupta

unread,
Jan 12, 2012, 11:31:53 AM1/12/12
to eclim...@googlegroups.com
My bad, In point 3 I meant put the jar path in a <classpathentry> element in the .classpath file not settings.xml.

Eric Van Dewoestine

unread,
Jan 12, 2012, 4:11:17 PM1/12/12
to Sidharth Gupta, eclim...@googlegroups.com
On 2012-01-12 11:20:31, Sidharth Gupta wrote:
> Thanks for looking at that bug. But If my pom.xml mentions a repo name in
> the distributionManagement section:
> ==========
> <distributionManagement>
> <repository>
> <id>nexus</id>
> <url>https://nexus.mycompany.net/nexus/content/repositories/releases
> </url>
> </repository>
>
> <snapshotRepository>
> <id>nexus</id>
> <name>Internal Snapshots</name>
> <url>https://nexusmycompany.net/nexus/content/repositories/snapshots
> </url>
> </snapshotRepository>
> </distributionManagement>
> =========
> Does maven not look at that to see what repo to see in addition to jarvana?
>
> Thanks
> -Sid

Yeah eclim simply uses jarvana as a search provider, so eclim won't
return results that aren't indexed by them.

--
eric

Eric Van Dewoestine

unread,
Jan 12, 2012, 4:13:33 PM1/12/12
to eclim...@googlegroups.com
On 2012-01-12 11:30:12, Sidharth Gupta wrote:
> Also my second question. After I have set up maven and added a dependency
> and do mvn compile to get the jar in my ~/.m2 dir. I want that path to be
> added to the .classpath project file. Right now i have to do a NewjarEntry
> etc to do that. How can I create a command that will do all these things in
> one shot
>
> 1) add dependency to pom
> 2) Import the jar
> 3) Put the class path in settings.xml
>
> -Sid

I have an item on my todo list to update the .classpath when saving
the pom file. Similar functionality already exists for ivy files, but
I haven't yet expanded it to support maven as well.

--
eric

Reply all
Reply to author
Forward
0 new messages