Intellij Idea maven repositories remote error - maven

I have problem with Intellij Idea 10.5 on my Mac OS X 10.6.7. When I try to get some dependencies trough "Maven Artifact search", I have always blank area. So I check the intellij maven repositories settings and there are red marked line with repository "repo1.maven.org/maven2". When I try open this page, it gave me an redirect choice to "http://search.maven.org/#browse" page. So my question is, it is possible to change somewhere in intellij the indexed maven repository url? If yes, than where?

From top menu, open File -> Settings -> Maven -> Repositories and verify that you have valid remote repository.

You should be able to configure where IDEA will look for Maven repo by editing your settings.xml file (see Maven Projects Tool Window).
That being said, I don't think that the Maven public repo address being not browsable is an issue (even though there is a recent pending question on that topic)

Related

Missing Maven Repositories node in Services tab in Netbeans

Maven is installed on my computer and Netbeans can find it because I can create a new project from Archetype just fine. However, I need to add some repositories on Maven but I don't know any other way other than the one in the services tab, but for some reason, the Maven Repositories node in the services tab had gone missing (it was there before). I tried restarting netbeans and closing the services tab and opening it again. Is there any other way to add repositories to Maven or have the Maven Repositories show up again?
I am using Apache Netbeans 12.
Thanks.
Edit:
I attached a screenshot of the specific problem. I have Maven correctly installed and can create a new project. But I can't add a new archetype catalog because "Maven repositories" is missing:
After checking the suggestion of #skomisa, the log showed that the error is caused by me adding a repository that is unavailable. How do I remove this repository since the "Maven Repositories" option is unavailable in services? Thank you.
NetBeans is coming with bundled version of Maven. So when you've installed maven and NetBeans is able to create a new project. It does not mean NetBeans is using our installed version of Maven.
When you add a repository to the services tab it already mentions:
Adding a repository here doesn't affect your Maven builds in any way.
It's only used to provide the IDE with information from the repositorie's index
Since you haven't described what you want with that repository I assume that it's needed to retrieve artifacts from that repo. So most likely you need to add the repo to your project's pom.xml in the <repositories> section.
I solved the problem by reinstalling Netbeans and deleting the cache in C:\Users<user>\AppData\Local and Roaming.

No suitable archetypes found. Please make sure that the proper maven repositories are configured and indexes are up to date

I am setting a development environment for Adobe Experience Manager. I installed AEM Dev Tools in Eclipse but i get the error " No suitable archetypes found. Please make sure that the proper maven repositories are configured and indexes are up to date." when I try to create a AEM Sample Multi-Module Project.
This is shown in either of the two cases :
If you are behind a proxy.
Eclipse can't read the archetype because its not there in its catalog.
For the first issue check if you are able to build the same code in your personal system (any system not behind proxy).
For the second issue, check this answer and try :
I had the same problem. I fixed it by adding the maven archetype catalog to eclipse. Steps are provided below:
1. Open Window > Preferences
2. Open Maven > Archetypes
3. Click 'Add Remote Catalog' and add the following:
Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
Description: maven catalog

unable to create maven project in eclipse photon

I have been trying to create a maven project in eclipse photon.I also tried checking proxy settings,linked a "settings.xml" file in user settings,linked a "catalog.xml" under archetype.But it didn't worked.Eclipse is configured with java 8 version.I am unable to upload photos so i will describe.
These are the steps I followed while creating Maven project.
File->New->other->Maven->Maven Project->Next->Next->Selected Archetype-quickstart1.1->Next->provided Artifact and Group Id and Finish.
Here I'm getting could not resolve archetype error.
It's not very clear the issue you are facing and how you are creating the maven project. Eclipse comes with a great in built maven support. It's not necessary to configure settings.xml unless you are using your own repository instead of the default repository .m2
However assuming that you have installed Eclipse Photon correctly. Here are the steps involved in creation of simple maven project.
Click on File-->New-->Others.
On the new window look for maven and click on Maven Project.
This will launch new window **New Maven Project*. If you don't want to select available archetypes, then click on the checkbox named "Create Simple Project(Skip Archetype Selection)" and click on next.
Fill in your project details and click on finish. That's it.
Eclipse will generate a fresh maven project for you.
The other configurations are required based on the type of project you are creating.
Hope this helps !!!

Add a remote Archetype Catalog in IntelliJ

I am new to IntelliJ but coming from Eclipse I expected Maven support to be far better. It really is but I could not find how to define a remote archetype catalog in IntelliJ (14.1).
All I could find was a way to add a Archetype manually but that is not what I need. I would like to point to a XML file on a remote server that contains the list of all archetypes available.
In Eclipse, it looks like this :
Maybe you would like to try an Intellij Plugin that I wrote yesterday. It enables you to add remote archetype catalogs to Idea: Maven Archetype Catalog plugin
To make my answer more clear: I had the same issue that it struggles me that you can add Maven Archetype Catalog files in Eclipse, but not in IntelliJ IDEA. So I tried to write a plugin for IntelliJ IDEA, so that you can actually define URLs to archetype-catalog.xml.
The plugin just parses those URLs and provides the Maven Archetypes to the list of available Archetypes in IntelliJ IDEA.
After installing the Plugin you can find a new entry in the Settings menu at File - Settings - Build, Execution and Deployment - Build tools.
I know this is kinda old thread, but in the future if some one will look for it.
This Maven Archetype Catalogs is a plugin for intellij that allows import external archetypes from a URL.
It solved my problem on Linux, haven't tried it on Windows.
To add this plugin go to File->Settings->Plugins->Browse repositories
in the search bar type "Maven Archetype Catalogs". Install and restart.
To use it go to File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven Archetype Catalogs. click the '+' and add the archetype-catalog
It seems that there is a plugin to do this - Maven Archetypes. The reviews are not favourable, and I have never used it though so cannot comment to its effectiveness.
You could also (assuming Windows/IntelliJ 14), edit C:\Users\<username>\.IntelliJIdea14\system\Maven\Indices\UserArchetypes.xml and add the archetypes manually. Not ideal, but still workable.
Screenshots are made in IDEA 14, I've also checked IDEA 13, it's also true for it.
If this is what you need
Then it's in the Preferences:

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.

Resources