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

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)

Related

No maven in intellij idea

I have one project open in IntelliJ. In that I am able to see maven tab in its left sidebar:
Also, I am able to see Maven in View > Tool Windows > Maven:
I tried to open another project in another IntelliJ window, but it does not have both of the above:
It may be not required to have that maven tool window for the project that you have opened in the second Idea instance.
If the opened project is a maven project (at least if you have a pom.xml associated with that project) you will have this option available in View -> Tool Windows -> maven
If it's a maven project, try importing the project as a maven project as well

creating a maven pom file in intellij plugin new project wizard

I am writing an Intellij-idea plugin. In the plugin I want to define a new project type using new project wizard. My project should contain a specific pom file to build the project.
Any idea how I can do that? Shall I try to create the pom-file pro grammatically or shall I save a pom file as a template?
I resolved this by adding
<depends>org.jetbrains.idea.maven</depends> to my plugin.
Then I added a new ModuleBuilder based on jetbrains example.
I extended MavenModuel Builder (Some methods are neccessary to override e.g. getBuilderId(), getPresentableName()).
By this you are getting a pom file very easy. By cutomizing the ModuleType and ModuleBuilder you can add things that you want to POM file.
I generally create my IntelliJ projects using mvn archetype:generate then import it into IntelliJ.

IntelliJ IDEA, the Libraries added to the Intellij are not automatically updating pom.xml

In intelliJ IDEA,
I add libraries dependencies in
pom.xml
and "Project Structure -> Project Settings -> libraries -> add ->from maven"
but now, how to write the '2' dependencies to pom.xml automatically?
because there aren't '2' libraries dependency in pom.xml. they aren't synchronization.
I already set Settings > Maven > Importing > Import maven project automatically, Don't work.
note: I want to the Libraries added in the Intellij which can automatically updating pom.xml file.
In settings / Maven, you can switch to "import maven project automatically".
Then, when you modify a pom.xml, it will update your project (ie download new dependencies) automatically
I dont think pom.xml is something which will automatically generate dependencies, If so there wont be any point to maven build type itslef.

MyEclipse 8.5 creating 'maven-archetype-quickstart' has encountered a prob?

I use the built-in maven of MyEclipse 8.5 to create maven projects.
It shows the following error:
Image is here:pic
Sorry, because I'm new I can't post pictures here yet.
I did it twice on two computers (both are MyEclipse 8.5), but the error was the same.
I use a Eclipse to do the same job and it is successful.
But when using MyEclipse 8.5 to do the job if check "create a simple project (skip archetype selection)" during the process, the project can be created and no error happens, but there is no the folder "Maven Dependencies" in the project created in Package Explorer.
Is this a bug of this version of MyEclipse? Because Eclipse Indigo works fine on this.
If you create a simple project, the folder Maven Dependencies is missing simply because there are no Maven Dependencies in a simple project. Just add a dependency, and the folder Maven Dependencies should be created with your dependency in it.

Eclipse Plugin Development: Convert plugin project to maven project

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

Resources