Why i should add dynamic web module when installing maven facet? - maven

I want to add Maven facet to some project in Eclipse, but when I do that, it adds Dynamic Web Module to the project.
The first question is why ?
Second is how can I make it without adding web module??
thanks :)

I assume you are using MyEclipse, rather than just eclipse, with the m2e plugin. Also, I'm assuming the latest release of MyEclipse (2015 CI). If these assumptions are correct, note that the facet your are adding is for Maven Support of Java EE projects, which is why it is asking for the web project facet version. If you simply want to convert a java project to a maven project, right click on the project then select Configure->Convert to Maven project.

Related

How to create a Java EE 7 Maven IntelliJ Project

I am new to Stack Overflow because of my frustration to build a working Java EE 7 Project with Maven and IntelliJ ultimate.
I learned a lot about JPA and JSF in the last weeks and am thrilled to put my knowledge to use but unfortunately I am not able to create a working project structure as I get all sorts of errors along the way. I haven't found a single up to date tutorial which is working on the entire Internet.
My greatest achievement is creating a Maven project, and run the index page on a Jboss Wildfly (11) server.
I know Maven (3) requires a certain structure to work, I read that it is the one in picture 1.
Picture 1
Furthermore I know that I can add framework support by right clicking the project name and that I can add facets or modules by selecting files and project structure.
I would be very thankful if someone could explain the right creation of such a project. I already wasted double digit hours and lost a lot of fun.
I had to create a Maven Project with IntelliJ. After that I added JavaEE Application under Framework Support and checked the boxes for JSF and Web Application under Java EE aswell.
Now this doesn't work alone, I had to put this in the right structure Maven requires. I moved the META-INF Folder to main/src/resources. After renaming the web Folder to webapp, I moved it to src/main.
To check, go to Project Structure/ Facets and check if the paths are set correctly.
After adding a local Wildfly 11 Server Artifact (war), IntelliJ starts the default browser and I get to the index page.
The Project Structure
I recommend you take a look at JetBrains page, they have a lot of tutorials on how to use their products. Here how to create new Maven project:
https://www.jetbrains.com/help/idea/maven.html#maven_create_project
Also, here you have information how an example pom.xml file looks like and how to build it:
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
When you develop your project you can add dependencies to the pom.xml file

how the best way to create project with maven on eclips?

i know there are 2 methode to create project with Maven.
Create Dynamic project on eclipse and convert it into maven project
Create Maven project with command line and then import the project into eclips.
i always do the 1. choise.
If You have latest eclipse IDE then its very simple.
Go to Create new Project wizard and search maven project. (if its old eclipse IDE then you probably need to install m2e plug in from market place).
select maven project and next. Check (Create a simple project) if you want customization other wise just click Next and You will be presented a number of ready made archtypes.
For simple console projects you can chose maven-archtype-quickstart. or what ever project you want to create.
Now Give groupId e.g. com.yourcompany or com.yourprojectgroup and artifactId e.g. projectname-alias . and Click Finish.
First Time eclipse will create local repo if its not already created and then put default dependencies defined by provided pom in your local repo. Further you just need maven knowledge to customize project. e.g. New Dependencies and build system etc.
I hope this will clear your mind. I prefer this way because its fast and easy.
If you create a new project in Eclipse (at least in Mars or Neon), you can choose "Maven Project" and get everything you need. Don't use eclipse goals of Maven. They are deprecated.

Which versions are required to get a working Acceleo Maven build

Has anyone got the Acceleo Maven build to work?
If so what combination of Maven, Tycho, Eclipse, Acceleo, UML2/ecore worked for you?
And as a supplementary question do you still need to adjust the Java classes and config files before running the build (as was required for the old ANT build)?
To be clearer tycho does not like Maven 3.3, Maven 3.3 is the default with Luna. Every version of Eclipse has a different version of the ecore/uml model built in so migrating the Acceleo templates to another version of eclipse requires changes in all "module" definitions and hacking the version inside the UML models, so, its tedious trying to work out which versions are compatible.
I just wondered if someone had a working setup where all the components worked together.
After much trial and error:-
Eclipse Luna
Comes with Eclipse m2e 1.5
ecore uml2 version 5.0.2
Acceleo 3.5.1
Maven 3.0.5
org.eclipse.acceleo:org.eclipse.acceleo.maven:3.5.0-SNAPSHOT
All work together without the usual class not found and missing jars.
However I have yet to build a working pom that actually generates some
template output.
Interestingly the ANT build seems to work fine.
In the end it was just easier to knock up a .bat script to run
the generate and build.
You can have a look at the UML to Java generator of the Eclipse Foundation for the configuration of the pom.xml. For additional information on the use of maven with Acceleo, look at the dedicated page on the wiki.
You do not need to modify any Java class or configuration file now.

Netbeans Project Configuration When Using Maven Project

does anyone know how to configure a project using maven? My issue is that when I create a project by doing New->Maven->Enterprise Application Project, I don't get all the IDE helpers that are available when I create the equivalent project using the default (which is an Ant project) option by doing New->Java EE->Enterprise Application Project.
If I go to the generated Main.java in the default project I get the option to use ALT+Insert which brings up useful Java EE code insertion helpers such as "Call Enterprise Bean", "Use Database", etc. These are not available in the maven generated project.
Looking at the default project's files, the project.xml contains this entry "org.netbeans.modules.j2ee.clientproject", which I believe is the IDEs instruction to generate the Java EE helpers for this project.
The maven projects project files, pox.xml and nb-configuration.xml, haven't got this entry. The nb-configuration.xml file does however have these entries:
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
which must have something to do with the project setup. They don't give Java EE helpers though. Anyone have any idea how to add something like the defaults projects "org.netbeans.modules.j2ee.clientproject" to the maven project to get the helpers working??
Any help appreciated.

Netbeans 7.3.1 - Group maven modules

does anyone know if it is possible in Netbeans 7 to group modules of a multimodule maven project (like e.g. in Intellij)? Right now every module is kind of like its own project...
Another issue: Is it somehow possible to access the maven targets without going through the netbeans IDE goals via rightclick? I would like to have a window with a list of all maven targets (clean, validate, compile etc.) and use them via click... Is that possible in Netbeans?
Another view to multimodule maven projects is the plugin Geertjan provides https://blogs.oracle.com/geertjan/entry/maven_integrated_view_for_netbeans
But it is experimental.

Resources