Steps to create a new Maven WebApp project in MyEclipse

Source: Internet
Author: User

The process for creating a new MAVEN project (WEBAPP directory structure) in MyEclipse is as follows:
    1. new, Project .... Maven Project
    2. fill the group Id, Artifact Id, and package (refer to "keywords" below), click "finish"
    3. (if needed) modify the project name and storage path: Project Right-click Refactor, rename
    4. add code directory: Project Right--Build Path--New Sour Ce Folder ..., fill in "Src/main/java"
    5. add the appropriate plug-ins, such as   maven-compiler-plugin
   <plugin>    <groupId>org.apache.maven.plugins</groupId>    <artifactId> maven-compiler-plugin</artifactid>    <version>2.3.2</version>    <configuration>     <source>1.7</source>     <target>1.7</target>    </configuration>   < /plugin>

Key Words:GroupId: General company name or organization name Artifactid: typically project name Packaging: Package Type, Jar/war/rar/ear/pom, default is jarversion: Version number, groupid+ Artifactid+packaging+version unique identity of the constituent Project snapshot: Identifies a version that is under development, often updated, but not yet published
the difference between <dependency management> and <dependencies>:Using <dependency management> in the parent Pom to define the version, scope, and exclusions, you can use the dependency that is defined in <dependencies> with a quilt in the Pom. This way, if you have multiple sub-pom, you can make sure to use the same set of version, scope, and exclusions.
Dependency Scope:
  • Compile: The default scope. Compiling, testing, and packaging are all needed. Compile participates in dependency passing, that is, project a relies on B (dependent on scope is compile) and Project C relies on your project A, then C also relies on B.
  • Provided: Indicates that the JDK or container will provide these (jars) at runtime, such as the Servlet API, which is not required for deployment because the application server must have these things. Provided things are used in compiling and testing, and do not participate in transitive dependencies.
  • Runtime: This is not required at compile time, but is required for testing and runtime, and is included in the final package.
  • Test: Only for the testing phase (test compilation and test run), typically JUnit jar.
  • System: Similar to provided, but requires that the jar is already in the system and will not be found in repository, such as Rt.jar,tools.jar.
  • Import: Simply put, the Pom of the project inherits the dependencies of the parent project by inheriting the Pom of the other project, but because of the single inheritance, the import is created so that you can "import" or "Inherit" Dependencies on any one or more projects.
how to find a package:
    1. Enter in Google: Maven spring repository
    2. Get:
<dependency>      <groupId>org.springframework</groupId>    <artifactid>spring</ Artifactid>    

When Maven finishes downloading the jar package,
    1. Stop Server
    2. Redeploy/reload Application
    3. Start Server

Or find in this website: http://mvnrepository.com/
(original article, reprint please specify the blog from Clement-xu)

Steps to create a new Maven WebApp project 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.