Difference between a JSF and a Maven project - maven

For my new JAVA application, I want to start creating a new JSF2.2 project with IntelliJ. This project will be a web application and will be using maven.
In IntelliJ Idea, when i click on "create a new project", and then in the left panel select "Maven", it gives me the option of "create from archetype". If I select this check box, it gives me a list of archetypes, with many including jsf in their names.
I am confused what is the difference in creating a maven project without these archetypes and giving it my own groupId, artifactid and so on as compared to creating a project with any of the given jsf archetype?
Like I stated above, the project that i am starting will be a JSF based web application.
EDIT 1
I made the project with maven-archtype-webapp and it created a file index.jsp in the webapp folder. Is this a problem as i normally work with .xhtml files

Maven archetypes are templates. They create a proper project structure for you, depending on whether you want to create a standalone, JSF, ear etc. project.
All these projects are built with Maven, and create a GAV (groupId:artifactId:version) for the created artifacts.

Related

unable to create maven project in eclipse photon

I have been trying to create a maven project in eclipse photon.I also tried checking proxy settings,linked a "settings.xml" file in user settings,linked a "catalog.xml" under archetype.But it didn't worked.Eclipse is configured with java 8 version.I am unable to upload photos so i will describe.
These are the steps I followed while creating Maven project.
File->New->other->Maven->Maven Project->Next->Next->Selected Archetype-quickstart1.1->Next->provided Artifact and Group Id and Finish.
Here I'm getting could not resolve archetype error.
It's not very clear the issue you are facing and how you are creating the maven project. Eclipse comes with a great in built maven support. It's not necessary to configure settings.xml unless you are using your own repository instead of the default repository .m2
However assuming that you have installed Eclipse Photon correctly. Here are the steps involved in creation of simple maven project.
Click on File-->New-->Others.
On the new window look for maven and click on Maven Project.
This will launch new window **New Maven Project*. If you don't want to select available archetypes, then click on the checkbox named "Create Simple Project(Skip Archetype Selection)" and click on next.
Fill in your project details and click on finish. That's it.
Eclipse will generate a fresh maven project for you.
The other configurations are required based on the type of project you are creating.
Hope this helps !!!

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

Explain structure of Eclipse-Maven Web project in Spring using Kepler

I am using Kepler to build a Eclipse-Maven project in eclispe. While making the project I am skipping archetype selection on first wizard. then I am selecting packaging as "war".
Eclipse provides me a basic structure after above steps. However, as this is my first Spring/Maven application, I am unable to completely understand the structure.
My Main issue is where to keep my web.xml. No WEB-INF folder is provided, while a META-INF folder is provided.
Also where to keep the basic Dispatcher-Servlet for project and others like root-context, servlet-context etc..
Do I need to create these folders by myself. If yes, Where please? As I am creating a RESTful service, I won't have any views but I guess web.xml is still a must. Currently I am unable to upload an image(nothing happens when I try uploading), will try again soon.
While making the project I am skipping archetype selection on first
wizard. then I am selecting packaging as "war".
You need to select the maven archetype as: maven-archetype-webapp to get the WEB-INF folder & web.xml
Check this out

How can I create web fragment project in Intellij Idea

I'm looking for creating a small web framework on top of the standard servlet-3.x specifications. Main motive is to reduce the boiler plate codes and abstractions. After I read the servlet specifications it looks without using JAX-RS or SparkJava I can create small web framework for API developments.
I'm planning to use the web-fragments method to create my framework level filters, and other beans and package it as jar. So application developer create the war project with web.xml with the metadata-complete option set to false.
I can see the web-fragment project template in eclipse but I want to develop this project using maven. With Intellij I can't see any such options for web fragment projects alone. I want to create simple maven project which ship the jar with web-fragment.xml in it, so other war projects can make use of it.
So is there any plugins or other options available to develop web fragment projects in Intellij ?
Any jar file added to the WEB-INF/lib directory of a web application is technically a "web fragment", whether it has a META-INF/web-fragment.xml file or not.
Therefore, you just need to create a maven project with "jar" packaging and import it into Intellij Idea.
Create a maven project for the fragment. Set the packaging to jar. There is no need to create a war project.
Configure an empty Artifact in the Project Structure dialog:
Using the toolbar buttons, add the WEB-INF/lib folders. Then create an Archive and add the compile output:
Add a Tomcat run configuration, and in the Deployment tab, add the Artifact you just created:
I created an example project that includes all that: https://github.com/ThomasR/web-fragment-idea. Please note that it requires TomEE+.

Can maven create a project from a war file?

I want to create a adobe flex blazeds project. How can I create the project using the blazeds.war as the project template ?
war -> maven
you can't do that, there's no way maven can guess how the war was produced only by analyzing the result
generating a project stub for blazeds
that you can do. You can used a defined archetype like this one: http://code.google.com/p/maven-blazeds-spring-archetype/
it will force you to stick to the technology (spring) chosen by the archetype developer, however.

Resources