zoukankan      html  css  js  c++  java
  • maven详解之结构

    maven 父子关系

    父项目中打包方式必须是pom  如 <packaging>pom</packaging>,父项目中使用<modules><module>msite-base</module></modules>指定子项目

    子项目中使用 <parent>指定父项目,子项目继承父项目的大部分属性

    父项目

    <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>com.hlzt.msite</groupId>
    <artifactId>msite</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>msite</name>
    <properties>
    <msite.version>0.0.1-SNAPSHOT</msite.version>
    </properties>
    <modules>
    <module>msite-base</module>
    </modules>
    <dependencyManagement>
    <dependencies>
    <dependency>
    <groupId>com.hlzt.msite</groupId>
    <artifactId>msite-base</artifactId>
    <version>${msite.version}</version>
    </dependency>
    </dependencies>
    </dependencyManagement>
    </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>
        <parent>
            <groupId>com.hlzt.msite</groupId>
            <artifactId>msite</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </parent>
        <artifactId>msite-base</artifactId>
        <name>msite-base</name>
        <dependencies>
    
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
            </dependency>
        </dependencies>
        <build>
            <plugins>
            
            </plugins>
        </build>
    
    </project>

    maven 指定打包方式类型(jar,war)和打包名称

    
    
  • 相关阅读:
    .NET-记一次架构优化实战与方案-梳理篇
    .net core实践系列之SSO-跨域实现
    Vue
    C# WPF
    开源框架
    开源框架
    开源框架
    开源框架
    WCF
    WCF
  • 原文地址:https://www.cnblogs.com/Dhouse/p/7168758.html
Copyright © 2011-2022 走看看