• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 634
  • Last Modified:

maven web application


I am trying following web application using maven on eclipse from link


I am wondering if there is some other simple applications, projects, links which talks about creating and running web applications using maven without going to the command prompt. Can I do everything in eclipse.

Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
  • 5
  • 4
1 Solution
mccarlIT Business Systems Analyst / Software DeveloperCommented:
You can do basically the same as that link does, all within Eclipse... (assuming that you have the maven integration stuff installed)

Go to File/New/Other...
In the filter, type maven and then select Maven Project
Make sure 'Create a simple project' is UNticked and hit next
For 'Catalog' select 'All Catalogs'
In 'Filter' type webapp
Select the 'maven-achetype-webapp'

And from there it should be fairly similar to what is in the link you referred to (ie. providing group id and artifact id, initial package, etc)
gudii9Author Commented:
<project xmlns="http://maven.apache.org/POM/4.0.0"
      <name>primefaces Maven Webapp</name>
            <!-- use JDK 1.6 -->

I modified POM.xml as above

I see application working fine now. Can you please let me know why the context name is different which is 'junit' instead of 'primefaces' as given in the link. is this is same procedure I have to follow for any maven project irrespective of web, spring, struts, hibernate, ejb etc projects. Please advise
mccarlIT Business Systems Analyst / Software DeveloperCommented:
What did you specify as the 'artifactId' in the New Project Wizard?

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

gudii9Author Commented:
I believe it is 'junit'
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Ok, so there you go, if you use 'junit' for the artifactId, the archetype must be using that as the context root when it creates your project. The link that you posted used 'primefaces' as the artifactId and so it's context root is 'primefaces'.

You can go to your project properties, and then in the web project settings you can change the context root. Then you will have to remove the project from the server, clean the server, and re-add the project to the server (all these options can be found by right-clicking on the server entry in the 'Servers' view in Eclipse).
gudii9Author Commented:
I just changed it to primefaces
gudii9Author Commented:
after changing junit / primefaces context names both not working. Please advise
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Did you follow my instructions above for removing the app from the server, cleaning the server and then adding it again?
gudii9Author Commented:
I did all steps mentioned by you. Still no luck. Please advise. I posted screenshot with my previous post, is that is the location I have to change the context name right. I also changed the project name still no success.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now