• (转)Dynamic Web project转成Maven项目


    本文转载自:http://my.oschina.net/twosnail/blog/369125

    1、新建Dynamic Web Project

        1、File -> New -> Other。在New窗口中选择Web下的Dynamic Web Project。点击next。

        

      2、输入项目名称,点击next

        

      3、选择源代码路径

        与Maven Project保持一致,删除原有src目录,直接建立 src/main/java、src/main/resources、src/test/java、src/test/resources

        指定输出目录为target/class

        

        点击完成。目录结构如下:

        

      4、转化Maven Project

        右键项目,maven -- > 点击“Enable Dependency Management”弹出如下图所示,注意Packaging选择war此时一个maven项目构建完成

        

      5、其他配置

        接下来的配置工作就和前面的基本一样了。请参考上面篇博客。二.2配置Maven项目。


    PS:pom.xml中如果要添加<dependencies>标签,要添加到<project>标签底下。

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>Demo</groupId>
      <artifactId>Demo</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>war</packaging>
      
      <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.1.7.RELEASE</version>
        </dependency>
      </dependencies>
      
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
              <source>1.7</source>
              <target>1.7</target>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
              <warSourceDirectory>WebContent</warSourceDirectory>
              <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </project>
  • 相关阅读:
    Codeforces Round #648 (Div. 2).D Solve The Maze
    Codeforces Round #648 (Div. 2).C Rotation Matching
    Codeforces Round #639 (Div. 2).C. Hilbert's Hotel
    C. Linova and Kingdom.Codeforces Round #635 (Div. 2)
    influxDB基本操作(详细)
    influxDB-介绍
    grafana的安装与启动
    104. HttpRequest对象详解
    103. 重定向详解
    102.限制请求的method装饰器:require_http_methods,require_GET,require_POST,require_safe
  • 原文地址:https://www.cnblogs.com/wpcnblog/p/4655902.html
Copyright © 2020-2023  润新知