• 定义maven的项目结构


    创建一个Maven 的父项目

    新建一个maven项目,选中create a simple project

    填写以下内容:

    如下内容:

    Group Id :edu.zipcloud.cloudstreetmarket
     Artifact Id :cloudstreetmarket-parent
    name:CloudStreetMarket parent

    完成后资源管理器中会出现pom.xml文件,编辑该文件:

    <project></project>最后写入

      <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <verbose>true</verbose>
                        <fork>true</fork>
                        <executable>$C:/Program Files/Java/jdk1.8.0_144/bin/javac</executable>
                        <compilerVersion>1.8</compilerVersion>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.4.2</version>
                    <configuration>
                      <jvm>$C:/Program Files/Java/jdk1.8.0_144/bin/java</jvm>
                      <forkMode>once</forkMode>
                    </configuration>
                </plugin>
            </plugins>
        </build>

    ————————————————————————————————分界线——————————————————————————————————————————————————————

    创建子模块:作为父项目的子模块

    包装所有业务逻辑的模块web

    ModuleName:cloudstreetmarket-webapp

    Parene Projiect:cloudstreetmarket-parent 

    单击:Next

    创建rest api模块

     

     创建核心模块:

    与上类似,第一个modulename:cloudstreetmarket core

    第二个name:CloudStreetMarket Core

    --------------------------------------------------------------------------------------------------------------------分界线-------------------------------------------------------------------------------------------------------------------------------------

     创建公司特定项目及其模块

    父项目

    file --->new--->maven project--->选中create a simple...user default work...

    填写pom.xml

     

     <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <verbose>true</verbose>
                        <fork>true</fork>
                        <executable>$C:/Program Files/Java/jdk1.8.0_144/bin/javac</executable>
                        <compilerVersion>1.8</compilerVersion>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.4.2</version>
                    <configuration>
                      <jvm>$C:/Program Files/Java/jdk1.8.0_144/bin/java</jvm>
                      <forkMode>once</forkMode>
                    </configuration>
                </plugin>
            </plugins>
        </build>

    核心模块

    next-->packaging:jar,Name:ZipCloud Factory Core Business--->finish

    ----------------------------------------------------------------------------------------------------------------分界线-----------------------------------------------------------------------------------------------------------------------------------------------

    运行项目

    右键单击项目zipcloud-parent-->ran as -->maven clean

    右键单击项目cloudstreetmarket-parent--->run as-->maven clean

    run as --->maven install

  • 相关阅读:
    Oracle删除约束和主键的语句
    Tomcat启动时SecureRandom超级慢的问题
    MySQL innodb引擎下根据.frm和.ibd文件恢复表结构和数据
    ORA-00604: 递归 SQL 级别 1 出现错误 ORA-01653: 表 SYS.AUD$ 无法通过 8192 (在表空间 SYSTEM 中) 扩展
    Linux 使用pwgen命令创建随机密码
    nginx 之 proxy_pass详解
    给nginx生成自签名证书
    常见排序算法(java实现)
    浅析变量的作用域和生存周期的差别
    filter过滤器
  • 原文地址:https://www.cnblogs.com/1605-3QYL/p/9736291.html
Copyright © 2020-2023  润新知