Web/maven project struture in eclipse Luna - maven

To start a new web project in Luna, I follow below steps.
1) Create a new Dynamic Web Project
2) Convert it into Maven by clicking configure option
The below is the obtained structure
http://i.stack.imgur.com/7Ph9M.jpg
This web project structure looks completely different from the one I see in the tutorial I follow. There the project structure is as follow
http://www.mkyong.com/wp-content/uploads/2010/06/Struts2-login-form-folder-stucture.jpg
I am not sure if the project structure is changed in new version or if I am doing something wrong. I made almost everything work but doesn't know where to place resources folder ( where we keep all our properties file ).
Can somebody assist me on how to create a new Struts2 project with proper structure :)

I found the answer here in this tutorial :D
http://o7planning.org/web/fe/default/en/document/300723/struts2-tutorial-for-beginners-annotation-configuration
I should have created Maven Project and picked web-app archetype. It is very simple.

Related

Is it normal to see two src folders in Maven Project in Eclipse?

I'm learning Maven for my class and when I create a new project, this is what I get. I'm just wondering if this is normal or not, it's very confusing for me.

How to make Spring Tool Suite like a multi-maven-module project?

I'm trying to create a Spring Boot project with multiple Maven modules. I've used the tutorial at https://spring.io/guides/gs/multi-module/ .
This site recommends a directory tree like this:
parent
application
src, and other subdirectories
pom.xml
library
src, and other subdirectories
pom.xml
pom.xml
I developed this project using Visual Source Code.
Wanting to see the project in another light, I tried to import the project directories into Spring Tool Suite. I'm using a recent one, where you apply the STS plugin to an up-to-date Eclipse installation.
Well, STS doesn't really like this project.
The (File, Open projects from file system) sees the project, but the Finish button doesn't actually do anything.
The (File, Import, General, Existing Projects into Workspace) imports a project, but as a Maven project (no "J" icon). When I try the (Run, Run Configurations) it won't see my project.
How can such a project be made friendly to Spring Tool Suite?
Thanks,
Jerome.
To make multi maven projects what you can do is, simply download two separate maven projects from start.spring.io and then extract them and move both folders to one parent folder and try grabbing the parent folder to Intellij, so it automatically downloads the dependencies and other requirement for the project in which we have two maven projects in one single entity
Eclipse can be a bit confusing with several different Wizards to import projects. Ironically the wizards are supposed to make importing projects easy, and in a sense they do... but... unfortunately picking the right wizard itself can be a bit challenging / confusing. Which wizard you use depends on the type of project.
Since your projects are maven projects, the best wizard to use would be the one for maven projects. You can find it at "File >> Import >> Existing Maven Projects".
So give that a try, point it at the 'parent' folder of your project and you should be presented with a relatively intuitive UI to import all 3 projects and configure them for use in Eclipse.

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

recommend folder structure for liferay maven project using liferay developer studio

We just started with a liferay extranet project. We want it to be as much mavenized as possible. So far I read how to get it working with Maven and have a working setup. But I have some questions regarding the folder structure:
Do I need an (unpacked) sdk at all?
How should the folder structure look like (in future there will be many portlets, themes, exts... plugins)?
at the moment my structure looks like this:
liferay-portal-6.1.20-ee-ga2 (liferay tomcat bundle)
|-deploy
|-tomcat-7.0.27
|...
project-folder
|-pom.xml (parent pom)
|-sample-portlet (created with archetype:generate)
Is this ok? or it is probably better to create subfolders for each plugin type? does this interfere with the archetype and the automated connection between parent-pom and modules?
Does the mavenization changes something with workflow of liferay developer studio? This will be the ide of choice.
To answer your questions
You don't need plugins-sdk at all!
I advice you to go for a multi module maven project, and I already see you using it.
Obviously when you go for a multi-module project you have the sub-folders created and each module corresponds to a separate archetype and of course, it depends on what type of project you create.
Here is the sample liferay-maven project structure I had.

Resources