Eclipse Plugin Development: Convert plugin project to maven project - maven

I have developed an Eclipse plugin project. Now I need to convert it to a Maven Project so that the dependencies etc can be handled using pom.xml.
Is there a way to convert the plugin project to a Maven project?

Right click on your project -> Configure -> Convert to Maven Project
you need eclipse m2e to do this
btw. if you dont know: if you want to use maven with eclipse plugins, you will need tycho too. see eclipse tycho

Related

How to remove maven from a project?

I have both build automation tools (maven, gradle) in my project. Of course, I can switch between them, but I would like to completely remove maven from the project and use only gradle.
How can I remove maven from the project? Do I only need to remove maven related files?

Build and package a maven plugin within another project

I am trying to build a Maven plugin using Eclipse. I need it to be in a project called Utilities (contains some other utility tools), i.e. I do not want the plugin to be an Eclipse project all by itself.
The <packaging> tag for Utilities project in its POM is jar, while technically a maven plugin needs to be packaged as a maven-plugin. Is there any way to get around this? Or must I build the Maven plugin as a separate project?

Maven plugin Tycho -> when to use it and when not to use it

What is the purpose to use Maven Tycho plugins. I read here tycho is used for building eclipse plugins and OSGI bundle.
Questions:- Can not we build eclipse plugins and OSGI bundle just by using the plain old maven POM.xml file[by not using tycho plugin].
What does maven need tycho plugin to help it build eclipse plugin and OSGI bundles?
Why should we use Maven tycho plugin to build eclipse plugins and OSGI bundles?
When using maven (or other command line build tools) manifest.mf) in combination with Eclipse (or another IDE) the classpath ends up being written down twice - once in the pom.xml and once in the Eclipse .classpath (or, for OSGi, in the target platform and manifest.mf). This violates the DRY principle.
There are various solutions to this problem. One is something like m2e, where you use the pom.xml to generate the Eclipse .classpath. Alternatively, you can go in the other direction and start by getting things compiling in Eclipse, and then use a maven plugin to convert that Eclipse setup to a maven build. This is what Tycho does, with the extra wrinkle that it works from a PDE manifest + target platform rather than directly from the .classpath.
Maven doesn't have a built-in packaging type for OSGi bundles and/or Eclipse plugins. So unless you want to use the jar packaging type and manually add OSGi specifics, you need a Maven plug-in to help you with this.
Tycho is one of the plugins that add support for building OSGi bundles.

How to force NetBeans load Gradle project instead of Maven pom?

We have a project with both build.gradle script and an old maven pom.xml. Netbeans (8.0) will try to load the project as a maven project because of the existence of the pom.xml. Is there a way to force it to load the project as a gradle project using build.gradle? Thanks.
Nope, this is not possible in NetBeans. The simplest way is to remove/rename pom.xml. Maven support will ignore this folder in such case and it will be recognized.
I filled RFE for this - https://netbeans.org/bugzilla/show_bug.cgi?id=243778

I have an Eclipse project which is not using Maven, can I start using Maven in a project?

I installed m2eclipse plugin. I want to create pom.xml in my project which is not using maven.
İn this site I found information below about how can I do it but it doesn't work for me.
Create a Maven POM File
If you already have an Eclipse project which is not using Maven, you
can start using Maven in a project by creating a new Maven POM file.
m2eclipse provides a wizard to easily create a new POM file inside an
existing project. To launch this wizard, select File → New → Other...,
type in "maven" in the filter field, and select Maven POM File. This
POM creation wizard is shown in Figure 5, “Creating a New POM”:
Please help me to solve this problem
If you use eclipse indigo then simply right-click the project, select Configure > Convert to maven project. If you are not using eclipse indigo you can do something like right-click project > Maven > Enable dependency management (if I remember correctly)

Resources