Missing Maven Repositories node in Services tab in Netbeans - maven

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.

Related

Deployed Maven Attached Artifacts on Github Remain Inaccessible

I have a maven module which is configured with a feature packaging (an Apache Karaf feature). This project has no primary artifact to deploy but an attached feature.xml file. When I try to deploy the project to Github package the upload seems to work:
Uploaded to github: https://maven.pkg.github.com/cdelg-ct/repo/com/mycompany/app/my-mod/1.0-SNAPSHOT/my-mod-1.0-20200701.090836-1-features.xml
But then, the above file does not show up in the Github Packages UI and other projects cannot depend on it (Could not find artifact). Note the pom is well deployed as the other sibling jar modules.
Did anyone manage to get classifier to work with Github Maven Packages?
You are using a SNAPSHOT version.
By default, SNAPSHOT versions are not fetched.
Quick way to check it, try a release version.
If it works, you have to configure your maven settings to allow spapshots versions.

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:

netbeans Maven PlugIn does not update remote repo index

I am starting with a project where I want to use latest versions of hibernate and the hibernate spatial extension. Therefore I decided to start with a maven project to manage all the dependencies. I have to say, that I am pretty unexperienced both in using maven an the maven netbeans plugin, but I think it is the best option for my requirements. I am using Netbeans 7.2.1.
There is a short and simple description how to add the remote repos for hibernate spatial to maven (http://www.hibernatespatial.org/mavenquick.html).
I added these repo's in netbeans - services - maven repositories. Then I clicked on "Update Index" but nothing happens.
I also tried to open the repo Url in my Browser and I got all the files that it should deliver.
Why is Netbeans not updating the index? Is there a possibility to index the remote repo on maven commandline so that I am able to bypass netbeans and possibly get more info about what is happening?
I recommend you adding the repo you need into your {home}/.m2/settings.xml file (or alternatively your pom file in the project). That's where your Maven installation takes the configurations from at first. So that way you avoid using NetBeans to do that and you'll be sure that Maven will be using that repo no matter the way you call it (NetBeans embedded, command line...).
Add this repositories into your file:
<repository>
<id>OSGEO GeoTools repo</id>
<url>http://download.osgeo.org/webdav/geotools</url>
</repository>
<repository>
<id>Hibernate Spatial repo</id>
<url>http://www.hibernatespatial.org/repository</url>
</repository>
You'll probably find this guide from Maven official site useful.
I added these repo's in netbeans - services - maven repositories. Then I clicked on "Update Index" but nothing happens.
The Services/Maven repositories node only deals with indexes that help with some IDE searching capabilities. It's not affecting build in any way. If you want to change your build, either add it to pom.xml or to settings.xml in the usual maven manner. Please note that such active repositories should effectively show up in your Services node in the end.
Update Index action attempts to download the index from the remote location. There are multiple points of failure here. The repository might not provide an index, or your maven proxy settings don't allow you to connect (we use explicitly maven settings, not IDE proxy settings), your mirrors defined in settings.xml mirror this repository but don't provide the content for it.
Even if the index is downloaded and processed (you can browse the content in Services node), the individual artifacts might be missing from the index because the server side job updates only occasionally.
In any case you are not limited in any way when not having the index around. You can still add the dependency to the project if you know the coordinates. Either through the UI or by editing the pom.xml file.
Using version 11 of Netbeans I have been able to force the download of last archetype-catalog.xml from remote repo by deleting the cache ([].netbeans.cache\11\mavenarchetypes).

Intellij Idea maven repositories remote error

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)

Resources