Empty goals list in m2Eclipse - eclipse

When I try to add a goal I don't get any goals. Is there any solution or I should manually add them.But in an example I saw it automatically lists all the available goals.

The workaround described in m2eclipse JIRA worked for me: In Eclipse, open the view "Maven Repositories" and expand "Global Repositories". Right-click on your mirror of central (or "central" if no mirror defined) and select "Enable Full Index". Right-click again on the repository and select "Rebuild Index". Wait until "Updating indexes" finishes and vanishes from the Eclipse progress indicator in the lower right corner.

Related

Eclipse : Maven search dependencies doesn't work (and there is no "Full Index Enable" option)

The dependencies search box never offers any dependencies, and when I try to follow the instructions found online, they always say the same 2 things, which among other, don't work
I tried these (among many other things, other computers, other OS, other networks etc, other Eclipse versions, etc)
"Go to Window -> Prefrences -> Maven and check "Download repository index updates on start". Restart Eclipse and then look at the progress view. An index file should be downloading."- This isn't changing anything
"You also need to rebuild your Maven repository index in 'maven repository view'.
In this view , open 'Global Repositories', right-click 'central', check 'Full Index Enable', and then, click 'Rebuild Index' in the same menu."- when i right click on central, there is no Full Index Enable option, just "copy URL" and "collapse"

SVN Unversion equivalent for ClearCase

we have started a project versioned with ClearCase (sadly).
We also use Maven and ClearCase eclipse plug-in. Each time I build a project, a popup shows up (which says Add items in target folder to source control) and drives me mad. It pauses the build process so I have to check frequently to resume process.
Is there a way to ignore and unversion this folder like with SVN? I've added target folder to ignored sources on eclipse but pop-up still appears
If you are referring to the "Add Elements to Source Control" dialog box:
(Source: "Using ClearCase with Rational Performance Tester")
The workaround is:
On the main menu, click Windows > Preferences.
In the left pane, expand Team and then select ClearCase SCM Adapter
Change the preference for When new resources are added to Do nothing (from the default value of Prompt to add to source control).

how to know if ther is new version in svn?

I'm using eclipse with subclipse svn.
We are working in two programmers in the same application.
Sometimes, the user 1 changes some code in a specific class.
How can the user 2 know that changes were made?
Is there a way to make eclipse verify the changes in the server from time to time?
Right click on the project in the Project Explorer, then click the Team submenu, then click "Synchronize with Repository" (or click "History" if you want to see the latest commits).
If you want, you can also right click on a file and click "Compare With" then "Latest from Repository" - and it will open a side-by-side comparison. Or, you can use the SVN Repository Explorer (in the menu bar click "Window" then "Open Perspective", then "SVN Repository Explorer" - if it's not in the list, click "Other..." and then find it.)
How can the user 2 know that changes were made?
Without actually pulling the file(s) down, you can look at the checkin log (history), or do a diff of specific files/folders, otherwise just do an Update. Some wrappers (e.g. a VS IDE plugin, say) will also indicate in the explorer whether or not a file is checked out, locked, out of date, conflicted etc.
Is there a way to make eclipse verify the changes in the server from time to time?
Yes, use the command line, shell extension, or IDE plugin to do an Update.
A solution I like, that has nothing to do with Eclipse, is to add a post-commit hook in the repository that sends emails when a commit happens. This is what most open-source projects use.
In Eclipse, you can do Team > Synchronize. Once the view is open, note that there is a way to "Pin" the Synchronization and also to Schedule it. Using these features you can setup Eclipse to automatically refresh the information every N minutes. That way, you do not have to specifically run the option. Eclipse will always do it for you on the schedule you specify.

Eclipse : Maven search dependencies doesn't work

I created a new simple Maven project in a new Workspace.
When I open the pom.xml's Dependencies view in Eclipse editor, and I choose Add.. dependency, there's no search results no matter what search criteria I input in the search fields:
It instantly give me, for example, Results for 'spring' (0).
In my other workspace, with my existing projects I don't have this problem.
Is there a way to fix that ?
Eclipse artifact searching depends on repository's index file. It seems you did not download the index file.
Go to Window -> Prefrences -> Maven and check "Download repository index updates on start". Restart Eclipse and then look at the progress view. An index file should be downloading.
After downloading completely, artifact searching will be ready to use.
UPDATE
You also need to rebuild your Maven repository index in 'maven repository view'.
In this view , open 'Global Repositories', right-click 'central', check 'Full Index Enable',
and then, click 'Rebuild Index' in the same menu.
A 66M index file will be downloaded.
In your eclipse, go to Windows -> Preferences -> Maven
Tick the option "Download repository index updates on startup". You may want to restart the eclipse.
Also go to Windows -> Show view -> Other -> Maven -> Maven repositories
On Maven repositories panel, Expand Global repositories then Right click on Central repositories and check "Full index enabled" option and then click on "Rebuild index".
You can get this result if you are inside a corporate proxy and the new project isn't pointing to the correct settings.xml file with the proxy credentials.
You can also get this if you are using Maven proxy (Nexus, for example) and the index into the proxy is messed up somehow. I don't know a way to describe how to fix this. Fool around with it or call the one who set up the Maven proxy.
You can also get this if the new workspace hasn't yet downloaded the index either from Maven central or from the proxy. (This is the best one as you just have to wait a while and it will work itself out.)
For me for this issue worked to:
remove ~/.m2
enable "Full Index Enabled" in maven repository view on central repository
"Rebuild Index" on central maven repository
After eclipse restart everything worked well.
The maven add dependency is actually from the maven indexes. If the indexes is up to date, the result should be from there.
If you go to the maven repository, then select global repository, you should see a central ... tab, and select that, there should be a list of folders, and you should be able to see all the indexes from there. If not, then it means you didn't get the full index, then you can right click that and enable full index.
Another thing I annoyed me most is even I did everything, it still not showing anything when I type "spring". This is actually where I did wrong. If you just type some additional text "springframework", BOOM, the result is there.
I have the same problem. None of the options suggested above worked for me. However I find, that if I lets say manually add groupid/artifact/version for org.springframework.spring-core version 4.3.4.RELEASE and save the pom.xml, the dependencies download automatically and the search works for the jars already present in the repository.
However if I now search for org.springframework.spring-context , which isnt in the current dependencies, this search still doesn't work.
Use https://search.maven.org/ manually with the prefix fc: to search for class names. Both Netbeans and Eclipse seem to be too stupid to use that search interface and the gigabytes of downloaded repository indexes seem to not contain any class information. Total waste of disk space. Those IDE projects are so badly maintained lately, I wish they would move development to GitHub.
It is neccesary to provide Group Id and Artifact Id to download the jar file you need. If you want to search it just use * , * for these fields.

How do I import a multi module Maven project from SVN into Eclipse (Indigo) so that child modules can be built independently?

I have tried posting this question on the Eclipse Maven forums but it seems very quiet there so here goes...
My setup:
-Eclipse Indigo Java EE bundle
-m2e
-Subversive
We have a fairly simple multi module maven project on our repo. It has a parent project/pom and 3 child projects/poms.
Steps I am taking to import:
1) I import the project by using "import->import->->Maven->Check out Maven Projects from SCM".
2) On the next dialogue box I select svn as the SCM URL type and enter the rest of the repo URL. I leave the check boxes checked for "Checkout Head Revision" and "Checkout all Projects" and under "advanced" I leave the check box "Resolve Workspace Conflicts" checked too. I do not enter anything under "Profiles" or "Name Template".
3) On the next dialogue box I leave "Use default Workspace location" checked and leave "Add projects(s) to Working set" unchecked and click "finish".
4) I wait a minute or so for the next dialogue box to appear. It asks me to select maven projects and has a file structure as it should be-parent project/pom and 3 child projects/poms with a checkbox beside all 4 items. I have tried to select either just the parent, just the children or all 4 without success.
5) When I select just the parent and uncheck the children above, the project appears to be imported. The parent appears in the project explorer and the three children appear as sub-folders of the parent with each having a pom.
6) If I right click on the parent, I get a Maven item in the context menu and indeed I can "run as->Maven build, install etc.." ON THE PARENT ONLY. The Child projects have no such Maven context menus nor the ability to "run as->Maven x".
If I try to import all 4 projects in step 4 above, it imports with the same structure as outlined in 5 above but with the children appearing additionally as separate "independent" Maven projects (with errors).
Ultimately I just want to import the multi-module Maven project and be able to deploy it on my Eclipse Tomcat installation, so if I change a file in one of the child projects (called frontend) the change will be deployed quickly and I can check the effect out in a browser.
Thank you very much for any and all help with this issue! I am happy to answer any further questions to help trouble shoot the problem.
My projects occasionally also lose this ability (though they have it right after import). Usually it helps to refresh Maven configuration, refresh/clean projects, or restart Eclipse. Note that it should still be possible to run it the long way, so "Run -> Run Configurations -> Maven".
I'm running Helios SR 2, m2e 1.0.0.20110607-2117.
Pretty sure each module would have to have it's own .project settings that you would need to commit.
Did you install the m2e WTP extension? At least in theory that should be a better option than tinkering with project settings outside of Maven/m2e control.
I probably explained the problem poorly in my initial question. The main problem was that I was not able to deploy the webapp component of the multi-module maven project to Tomcat. I was making a couple of basic errors:
I was importing the parent project without selecting the children, assuming Maven would get them all and that would suffice, but it did not: I had to select the parent and all children when importing as Maven project from svn.
I then failed to convert the webapp part of the project to a faceted type, and further failed to select "dynamic web app". I needed (according to a colleague) to then select version 2.5 to avoid incompatibilities with older servlet containers. (not sure how relevant this is to Tomcat 6, which is what I use).
Once this was done I had the parent project and 3 subfolders and also the 3 child projects in their own right appearing in the project explorer (but on file system they all exist under the parent project, as it should be). I could then right click on the webapp module (the eclipse project explorer project, not the subfolder) and run as Maven project (clean, build etc.).
I could then right click and "run on server". I had an error upon publishing about various files being out of sync. I just refreshed the child projects in eclipse and then they would publish successfully.
Eclipse has so many versions, with so many incompatible plugins etc. that it gets confusing very quickly-lots of the tutorials are highly specific to particular versions etc.
Thanks for helping anyway guys.