No version prompt when running maven-release-plugin inside Eclipse - eclipse

When I run maven release:prepare from the command line I'm prompted for the release version, developer version and SCM tag. This is good. What is not so good is when I do the same from inside Eclipse. Using an m2e run configuration I set the same goal but instead of prompting me for the version information it automatically sets them to some defaults. The defaults are pretty good but sometimes I want explicit control.
There are many developers on this project and asking them to drop out to command lines or fiddle with shared run configurations is not ideal. Maybe this has nothing to do with the Maven Release Plugin and is more to do with input prompts in general. Are there any other examples of Maven plugins prompting for input during execution inside Eclipse?
I'm using SpringSource Tool Suite 2.9 (old!) configured to use an external Maven 3.0.3 with m2e 0.12.1.

This is normal. The Eclipse plugin for Release will automatically release the version set in your POM, and set the next development version to +0.0.1 of that.
I'm used to using the release plugin from inside Eclipse, and when I used it from command prompt I was surprised when I was prompted for version :p

Related

Groovy compiler on Eclipse doesn't include version 2.4 anymore

I need to set up my Eclipse IDE again and unlike when I first set it up I have issues with the Groovy software. I would need the Groovy compiler version 2.4, but can only select between 2.5, 3.0 or 4.0.
I used the same location as last time: https://dist.springsource.org/release/GRECLIPSE/e4.16
Also I tried other location which unfortunately don't work properly. I have the Eclipse version 2020-06.
Can anyone tell me what I do wrong this time or which configuration to adapt?
Thank you.
Download "Eclipse IDE for Java Developers" (2020-09 a.k.a 4.17) from https://www.eclipse.org/downloads/packages/release/2020-09/r
Note: The first link on the page gets you the Oomph installer which WILL NOT WORK. Use one of the links below. If there is "inst" anywhere in the name of the file you downloaded, try again.
The reason why Oomph breaks GRECLIPSE is that it will add an update site which will try to install the latest 4.x GRECLIPSE -> fail.
Unpack the archive somewhere.
Go to Help -> Install New Software.
Add this update site: https://dist.springsource.org/release/GRECLIPSE/3.9.0/e4.17
(Using the marketplace will leave you with GRECLIPSE 4.x)
Always select the main package and Maven support if you need it.
Click Next.
Make sure that it tries to install 3.9.0 and nothing else.
Click Next & Finish until it installs.
--- old instructions for reference ---
You will need to download Eclipse Photon from here
https://www.eclipse.org/downloads/packages/release/photon/r
and then Groovy Feature 3.5.0.v201909291357-e48-RELEASE add this update site:
https://dist.springsource.org/release/GRECLIPSE/e4.8
All the versions of Eclipse after this one don't support Groovy 2.4 anymore.
I've tried to do this with Oomph but that way, I always ended up with Groovy Feature 4.1.
My solution then was to create another workspace for all my Groovy 2.4 projects (Jenkins Pipelines, mostly).

How can I set the java.library.path used by eclipse from a POM?

I'm using maven to define my projects. One of my dependencies requires a native DLL at runtime, and consequently it's needed in tests and for debugging. The native DLL is available at a known location. I want a solution that I can check in once and will work for all developers without manual setup by each dev.
I know I can set the java.libary.path manually in "run configurations", which will allow it to find the native DLL, but this requires manual setup for each developer.
I know I can also set the java.library.path for a given project dependency, but again this is local to a particular developer.
Finally I know I can set the surefire plugin to specify the java.library.path, but this is only useful for tests triggered via maven - so it's great for our build server, but doesn't help devs using the JUnit runner in eclipse, or wanting to debug or run code directly from eclipse.
Is there a way out?
I've found that the eclipse m2e connector that goes with the maven-nativedependencies-plugin seems to fix this.
According to the mavennatives docs:
Since version 0.0.7 of the maven-nativedependencies-plugin if you have
m2eclipse installed and the nativedependencies plugin configured the
unpacking of natives will run automatically, you don't need the
eclipse plugin to unpack them. However in order to setup the
java.library.path environment variable in eclipse you will have to do
it either manually or automatically using the eclipse plugin.
This Eclipse plugin is an extension to m2eclipse, it detects if you
have the maven plugin configured, and if you do it executes the
unpacking of natives, and configures the Native Library Location.
If you import a maven project that has the mavennatives plugin
configured, and you have the m2eclipse integration plugin, on import
the natives will be extracted, also when performing a clean from
eclipse the natives will be extracted.
So, if you use both these tools, using native dependencies requires no
manual configuration, other than whats in the pom, just run your app
and it works.
If I have the connector installed, and add mavennatives to my POM, then reload the pom (right-click on project in package explorer > maven > update project), the "Native library location" of the project is populated automatically (to see this, right click on project > properties > java build path > libraries > native library location)
This seems to work for debugging, JUnit runner, etc.
It does require that every developer install the plugin, which is manual (as manual as installing eclipse); however, at least once installed once it will work for any/all native depdendencies configured for mavennatives via a POM.
The Properties Maven Plugin may help you passing the system properties by using properties:set-system-properties to set system properties.
The example should be look like the following: -
<properties>
<java.library.path>some/path</java.library.path>
</properties>
I hope this may help.

SONAR Integrated with Eclipse

Am working on sonar integrated with eclipse using ant
But when i go "right click project-->configure-->associate with sonar" nothing happens!!
My ant version is 1.7.1
Eclipse is Helios(3.6)
sonar version is 3.4.1
Welcome all your favours..........
Sonar Eclipse has nothing to do with Ant, it's really independendent.
You should follow the different steps listed in the documentation page. Most notably, you need to have a Sonar server up and running somewhere (on your local computer or elsewhere) and you must make sure that you already launched an analysis of your project, which you can browse on Sonar Web application. If not, you'll never be able to associate your project in Eclipse.
Once you have a first analysis of your project on the Sonar server, then you need to configure the URL of your server in the Eclipse settings. Only after this, you'll be able to associate your project with Sonar.
This might have to do with your plugin version. As described in the docs Version 3.0 is only compatible with Eclipse 3.7 and up.
I would suggest you either upgrade your eclipse or you downgrade your plugin.

Where is mvn.exe when using embedded maven 3 in eclipse indigo?

I'm using the Indigo Release of eclipse. When I check Window -> Preferences, Maven -> Installations, it confirms that it's using the Embedded (3.0.2/...) installation of Maven.
I want to be able to run maven commands from the command line (Windows Powershell), but when I type, e.g.,
PS C:\> mvn
no executable is found. I did a search for "mvn.exe" and found no results.
I suppose I could install a stand-alone version of Maven 3 and add that to my PATH, but I'd prefer to be using the same Maven installation for command line tasks as well as IDE (eclipse) tasks.
So, where is the embedded maven's mvn.exe hiding?
The simple answer is, cause it's embedded in Eclipse so you can't call it from console. If you like to do this you have to install Maven yourself.
There is no mvn.exe at all. The Maven distro comes with batch or shell scripts. Eclipse runs an embedded version which is called through an API.
remember, embedded maven is not configured to work out of eclipse environment (and terminal usage is out of STS usage).
we have to install maven.
and also note, there is no "mvn.exe"
follow the following to setup maven to work from terminal.
maven download link is here
download latest maven from here
extract it where ever you want.
i extracted as below (see the bin,boot,conf,... folders are shown below as in the image):
as this maven download is extracted from zip file (it is not setup), you will have to add this extracted path to "PATH" variable in windows environment.
follow this to set environment path:
now "mvn" command must work.
in my case, i use STS (spring tool suite)
and i had to restart STS for "mvn" to work in terminal in sts.
check it out with eclipse.

Installation of maven eclipse plugin doesn't finish

Hello I'm trying to install maven plugin with eclipse and I have a following problem, more in picture below :
So my question is, is this supposed to take this long or I did something wrong?
I'm using eclipse galileo , I went to the window-> install new software -> typed in
http://m2eclipse.sonatype.org/update/ website and name maven
Pressed next then finish, did I do something wrong, or is there another way to get maven working with eclipse? I need it for my project . thank you
First, update site url you pasted is url for stable version builds. According this document stable version of m2eclipse works with Eclipse 3.2, 3.3 or 3.4.
To work with Galileo version (Eclipse 3.5) try update from stable development builds site. I work with this version and I'm happy with it. It has a lot more features than stable one.
You could use maven-eclipse-plugin instead of m2eclipse.
With maven-eclipse-plugin you just add some configuration to pom.xml, execute mvn eclipse:eclipse and refresh project in Eclipse and you are done.
You will lose UI to handle dependencies etc. directly from IDE (that would be provided by m2eclipse) but I have not seen much benefit from that. You can manually edit pom.xml just fine.