maven web application

Posted on 2012-08-14
Last Modified: 2012-08-21

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
Question by:gudii9
    LVL 35

    Accepted Solution

    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)
    LVL 7

    Author Comment

    <project xmlns=""
          <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
    LVL 35

    Expert Comment

    What did you specify as the 'artifactId' in the New Project Wizard?
    LVL 7

    Author Comment

    I believe it is 'junit'
    LVL 35

    Expert Comment

    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).
    LVL 7

    Author Comment

    I just changed it to primefaces
    LVL 7

    Author Comment

    after changing junit / primefaces context names both not working. Please advise
    LVL 35

    Expert Comment

    Did you follow my instructions above for removing the app from the server, cleaning the server and then adding it again?
    LVL 7

    Author Comment

    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

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Is there any core JDK API for PDF Creation? 5 31
    changePi Challenge 15 57
    noX challenge 17 54
    mapBully challenge 6 53
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now