Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] Befuddled by behavior of repo indexing and "Add" searches

I've always been a bit confused about repository indexing. I normally work on a Linux laptop, and it's been working well enough there for a while. This has been using Mars.2.

Today I've been trying to get a project set up on my Win7 work laptop, using the latest Neon.

I'm working with two different external repos, which I'll call "release" and "snapshot", although I really only care about the "release" repo.

I've set both repos in the "Maven Repositories" view to "Full Index Enabled", and I've clicked the Refresh button, which prompts me to confirm reindexing the repositories.

The project I'm working with has a POM with a "repositories" element, which specifies the repositories I want to get artifacts from. When I go to the "Dependencies" tab in the POM editor, I want to click "Add" and then enter a filter string and see the possible choices appear.

I'm seeing some subtlely wrong behavior in terms of what artifacts are offered in the "Add" search results, and what I see when I simply navigate in the "Maven Repositories" tree in the same repo, and also compare that to what I see when I browse the given repo in my web browser.

For instance, there is one artifact that I was able to search for on the Linux laptop instance of this, which it got from the release repo. When I search for it on the Win7 instance, it doesn't return the one from the release repo, although it does return matching artifacts from the snapshot repo (strangely, I don't see the snapshot artifacts on the Linux laptop).

I can then browse through the repo tree in the "Maven Repositories" tree, and I can find the artifact that I expect to see, but when I right-click the entry and select "Open POM", it simply reports "Could not resolve artifact", giving me the GAV coordinate of what I tried to open.

I then browsed the repo in my web browser, navigated to the same artifact in the tree, and examined the various files that found there, including the "jar" and "pom" artifact. They both looked fine. I downloaded both of them and examined them, and I didn't see anything wrong.

I tried some other search strings that work on the Linux laptop. They only gave me SNAPSHOT artifacts (again, I don't see any SNAPSHOT artifacts on the Linux laptop), and I get the same error retrieving the POM.

Despite the error I get with "open POM", when I select one of those SNAPSHOT artifacts, it lets me insert it, and related code that retrieves those referenced dependencies has no trouble opening up the files in the artifact.

I don't understand why the Linux instance only shows the release artifacts, and the Win7 instance only shows the snapshot artifacts.

I then tried simply manually changing the inserted dependency in the Win7 instance (which points to a snapshot artifact, as the release artifacts weren't returned in the search) to the artifact from the release repo (simply changed the version), and it worked perfectly fine. I ran the code that extracts the artifact from the dependency, and indicated it was from the release artifact.

So, this indexing and search stuff seems to be subtlely off, even though the main build system seems to find artifacts perfectly well.


Back to the top