maven通过pom.xml下载依赖包

your-project-name ${project.build.directory}/classes src/main/resources true **/*.xml **/*.properties
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>com.alibaba.dubbo.container.Main</mainClass>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                    </manifest>
                </archive>
                <classesDirectory>
                </classesDirectory>
            </configuration>
        </plugin>


        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <includeTypes>jar</includeTypes>
                <overWriteSnapshots>true</overWriteSnapshots>
                <type>jar</type>
                <outputDirectory>${project.build.directory}/lib</outputDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>

作者:自由之子
来源:CSDN
原文:https://blog.csdn.net/taoli1986/article/details/77072924
版权声明:本文为博主原创文章,转载请附上博文链接!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
pom.xmlMaven项目的核心配置文件,它使用XML格式来描述项目依赖关系、构建配置和其他相关信息。下面是一个pom.xml文件的基本结构和常见配置项: ```xml <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.example</groupId> <artifactId>my-project</artifactId> <version>1.0.0</version> <!-- 项目依赖 --> <dependencies> <dependency> <groupId>com.example</groupId> <artifactId>dependency1</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>com.example</groupId> <artifactId>dependency2</artifactId> <version>2.0.0</version> <scope>test</scope> </dependency> </dependencies> <!-- 构建配置 --> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project> ``` 在pom.xml中,你可以配置项目的基本信息,如groupId(项目组织唯一标识符)、artifactId(项目唯一标识符)、version(项目版本号)等。你还可以通过dependencies标签来声明项目依赖关系,指定依赖的groupId、artifactId和version。此外,你可以在build标签下配置构建相关的插件和参数,如编译器版本、打方式等。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值