Maven does not list current version of a library - maven

With a Maven 3 based project in NetBeans 8 beta, when I context+click on the "Dependencies" item of the "Projects" navigator and choose "Add Dependency…" menu item, I get a dialog box for searching the repository.
Every time I type in "slf4j-api" and choose the found item "org.slf4j : self4j-api", I get different results. Sometimes in the list of versions I get 1.7.0, sometimes 1.7.5, but never the latest: 1.7.6 available for download from the slf4j download page.
Why does the list change when I search and display a list a minute later?
So I got try a search for "logback-classic", and click on "ch.qos.logback : logback-classic". The greatest version number is 1.0.13. That was released in May of last year. Since then version 1.1.0 was released 2014-01-28, and 1.1.1 on 2014-02-05.
Why does Maven not offer these later versions?
Is it a caching problem? Is there some way to force the dialog in Netbeans to update its list of available versions?

I've seen the same problem in Eclipse. It often happens when the IDE can't update it's cached copy of the Maven index.
A quick fix is to put the latest version that I know into the POM and build the project once. The IDE will then download the dependency and from then on, it will know that this version exists.
The longer fix is to look into your IDE's error log to find out why it can't update it's copy of the index files. Often, you need to configure your IDE to use the correct HTTP proxy settings.

Netbeans index all maven repositories in order to find all dependencies and versions. It is a time consuming task so by default it is launched once a week.
If you want to refresh the index go to Tools > Option > Java > Maven > Index and click «Index now»
If you still don't find the last version of your dependency, it is probably that the library has not been uploaded to repositories. To configure repositories go to Window > Services > Maven Repositories.
The documentation is a little outdated but you can find more information, here : http://wiki.netbeans.org/MavenBestPractices#Dependency_management

Related

What does usages mean in mvnrepository.com

While searching for maven dependencies on mvnrepository.com, it shows one column with usages. What does it mean?
i.e. https://mvnrepository.com/artifact/org.springframework/spring-context when you click on this link it will show you different jars with version number and also it shows you one column called usages. Usages contains some numbers.
If you click through the 'usages' button you see the projects that are also listed (i.e. in maven central) which have that project as a dependency. If you pick a project from the 'usages' to click into and then click on the most recent version and look at the 'dependencies' section then you find the project that you started from in that list somewhere. At least I suspect it's based on the dependencies of the most recent version but it could be that it's used in a/any version (haven't been able to determine that from my clicking around).
Did you click on the number and see the information it shows you?
i think it means how many mvnrepository.com maven project dependenied it
When I click on the library,
It appears to be Used by (numeric) artifacts.
So my guess is, to put it simply
I think it's the number of other libraries that used that library.
As the people above have already explained.

Unindex maven repository https://repo.grails.org/grails/core in Intellij with Grails 3.0

I am using IntelliJ IDEA 15.0.1 and I am trying to create a Grails 3.0 application and ran into issues.
While trying to create a Grails 3.0 project I get the following.
After doing what it does I also noticed that the Grails Tool Window is on the upper left is gone. When I open the repositories list and click on update I get the following error:
I have seen some other questions that it says to click on 'Disable....' but i do not think so...
Will not i need the grails core repo at some poing during development?
How come the Grails Tool Window disappeared? How to make it come back?
To resolve this problem i changed (the file is build.gradle)
"https://repo.grails.org/grails/core/"
for
"http://repo.grails.org/grails/repo/"
So close and open your project again.
For what it's worth, if you are using gradle for all of your projects, you can remove maven from your development machine entirely. then, add 'apply plugin: "maven" ' to your build.gradle files. then, you can completely ignore your IDE's messages about Unindexed remote maven repositories. gradle will take care of it for you.

IntelliJ IDEA and Maven: Can't complete tutorial, Maven Artifact Search returns no classes

I'm working through the tutorial here for using Maven under IntelliJ:
http://wiki.jetbrains.net/intellij/Creating_and_importing_Maven_projects
I'm up to the 'working with dependencies' section. I try to add a Maven Dependency using Maven Artifact Search. In the 'search for class' tab, nothing shows up, no matter what I type in the search box. Under 'search for artifact', about two dozen dependencies show up at the start.
Most of the discussions about this type of issue suggest a problem with Maven settings in IntelliJ. I confirmed that the Maven home directory is set properly. Under 'Repositories', the http://repo1.maven.org/maven2 URL is there and I was able to update it.
I used search.maven.org to double check that searching by class name does produce a result for the value I search for, "TestCase". I am using Maven 3.1.1, Windows 7 x64, JDK 1.7 64bit.
Update:
Maven works, i.e. goals can be run and they will download dependencies and build the project, if I edit pom.xml manually. However the Artifact Search cannot find any class, ever. I included a screenshot of what shows up when I use Artifact Search to search for artifacts. (Link to my image does not seem to appear even though I uploaded right to SO, not sure why... maybe imgur is blocked at my location)
Please navigate in Settings to Project settings -> Maven -> Repositories
Then find repo1 on your list and click "Update" - that will rebuild your repositories indexes and search for class will work
FIXED:
I got an idea from reading this question discussing what a snapshot is and why it is not usually updated.
Force Intellij IDEA to reread all maven dependencies
I went into IntelliJ Settings -> Maven and enabled "Always Update Snapshots" and I also changed "Plugin Update Policy" to "Check For Updates". (Even though I don't know exactly what that second one means, and IntelliJ says it's not important for my version of Maven anyway)
Immediately I was able to locate the ServletContext class in the Artifact Search. This is before I even updated from repo1 on the Repositories screen.
I can't really say why this did the trick but it seems to have worked. Thanks to #JakubK for helping me explore toward the solution!
Certainly this is the sort of issue that leads one to consider giving up (and starting to reinstall things...!), hopefully this helps someone else at some point.

How to analize/visualize OSGi, maven dependencies

I am trying to build Aptana studio using Maven/Tycho.
It has a lot of Eclipse plugins and I would like to exclude some of them from the build. However the excluded plugins may be required by other plugins.
How to see what plugins are dependent on the current plugin? Is the some tools to visualize dependencies in a directed graph?
The Plugin Dependencies View which comes with PDE has a button (two-to-one graph) to show plugins depending on the focused plugin.
If you want to see the full picture, then you will need to install the PDE Incubator Dependency Visualization (update site link included). Note this often gets quickly unreadable.
UPDATE by Paul
Update site http://download.eclipse.org/eclipse/pde/incubator/visualization/site
Need to uncheck "Group items by category" for item to appear.
It is version 0.5.0.20090415
So it is almost 5 years old and is unlikely to ever graduate from incubator.
Added Marketplace entry: https://marketplace.eclipse.org/content/pde-incubator-dependency-visualization

alternative to maven scm connector subclipse (not working with subclipse1.8)?

So for my project I am in need of Subclipse 1.8.x. This has been well and good, but the maven SCM handler for subclipse is only compatible with Subclipse 1.6.x. I like this plugin because it automatically loads modules (and detects them), so you can store your poms in a hierarchical fashion in svn. ( parent / module + module / module) etc. and checking out a multi-module maven project with the handler only requires one check out.
Since I cannot count on that working, how should I store multi-module maven projects in svn? Store them flat-level (Eclipse-style) in svn, check them out one at a time with help of m2e - the parent, and then each module individually? would that play nice with subclipse? I don't want to store auto-generated files, just resources, poms, and source files.
There is also this: https://github.com/sonatype/m2eclipse-subclipse/pull/4
Apparently that is a solution, and that enables the svn protocol for checking out multi-maven projects via scm (even with Subclipse 1.8.x). However, when I put it in my dropins folder in eclipse, I stil don't see the connector?
The dropin structure can be seen below, should work according to what I've read, but I am still unable to find the scm handler even after restarting eclipse. I want to begin development but this is holding us back.
http://i42.tinypic.com/2465aas.jpg
Am using m2e version: 1.1.0.20120130-2016.
Thank you,
The lack of response on this issue from the m2e people has been disappointing. Thankfully the guys from Subclipse have recently come to our rescue. They have forked the project, applied the patch and created an update site which publishes the new version. In short, Maven SCM Handler for Subclipse is finally compliant with Subclipse 1.8.x
Just make sure you use this update site to install in the future and all is well again in the universe. :o)
http://subclipse.tigris.org/m2eclipse/1.0
UPDATE 10/03/2014: Similar problem when upgrading to Subclipse 1.10.x, see this post
See Answer #4 from the link below.
[https://stackoverflow.com/a/21244645/2754985][1]
Install the latest m2eclipse update via url. since subclipse 1.10.x
some updates needed to be made.
In Eclipse, open Help >> Install New Software...
Click Add...
For Name: enter m2eclipse Subclipse Integration
For Location: enter http://subclipse.tigris.org/m2eclipse/latest/
Click Ok, then check Maven SCM Integration and complete the installation (ignore the warning about unsigned content)
Restart Eclipse when prompted

Resources