Creating a Web project with maven in MyEclipse

Source: Internet
Author: User

Creating a Web project with maven in MyEclipse

Tools/Materials
    • MyEclipse2014
    • Maven-3.3.3
Method/Step
  1. 1

    New--Other

  2. 2

    1, Wizards:mvaen

    2. Maven Project

    3. Next

  3. 3

    Use Default Workspace location

  4. 4

    1, WebApp

    2, Maven-archetype-webapp

    3. Next

  5. 5

    1. Enter Group Id

    2. Enter Artifact Id

    3. Finish

  6. 6

    This time you will see file error, workaround

    Add servlet in pom

        < Dependency>

          <groupid>javax.servlet</groupid>

          <artifactid>javax.servlet-api</artifactid>

          <version>3.0.1</ Version>

        </DEPENDENCY>

    Add ctrl+s save

  7. 7

    JUnit version modification and   Servlet  only run when compiling and testing

        <dependency>

          <groupid>junit</groupid>

          < Artifactid>junit</artifactid>

          <VERSION>4.10</VERSION>

          <scope>test</scope>

        </dependency>

        < Dependency>

          <groupid>javax.servlet</groupid>

          <artifactid>javax.servlet-api</artifactid>

          <version>3.0.1</ Version>

          <!--run--> only during compilation and testing;

          <scope>provided</ Scope>

        </dependency>

  8. 8

    You can see that the MAVEN project is not complete

    Here's how to complete a project

    1. Select the item, right-click the mouse button New-->folder

    Src/main/java

    Src/test/java

    2. Select the item, right-click New-->source Folder

    Src/test/resources

  9. 9

    Project Check Check output path

  10. 10

    Convert to Web Project

  11. 11

    Delete unwanted output files

  12. 12

    Project Creation Complete

    END
method to run in the jetty container
    1. Modify Pom.xml

      <plugins>

      <plugin>

      <groupId>org.mortbay.jetty</groupId>

      <artifactId>jetty-maven-plugin</artifactId>

      <version>8.1.16.v20140903</version>

      </plugin>

      </plugins>

    2. Run jetty

      1. Run as--and Maven Build

    3. Enter the local address and port in the browser

      http://127.0.0.1:8080/

Creating a Web project with maven in MyEclipse

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.