1. 安装jar包到本地maven仓库(以heritrix1.14.4.jar为例)
mvn install:install-file -DgroupId=org.archive.heritrix -DartifactId=archive-commons -Dversion=1.14.4 -Dpackaging=jar -Dfile=/path/to/heritrix-1.14.4.jar
2. pom.xml中使用本地仓库
<!-- We add a local repository that comes with this project,
for I do not see a maven repro for the Heritrix dependency -->
<repositories>
<repository>
<id>local-repro</id>
<name>lib-maven-repository</name>
<url>file://${basedir}/local-repro</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
</repositories>
3. 常用repository
<repositories>
<repository>
<id>oss.sonatype.org</id>
<name>OSS Sonatype</name>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
<url>http://oss.sonatype.org/content/repositories/releases/</url>
</repository>
</repositories>
4. 生成可运行的jar包
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>YOUR-MAIN-CLASS-FULLNAME</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
分享到:
相关推荐
maven使用文档,maven使用文档 很不错的文档
maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用maven使用...
maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装maven安装...
该文档内容从下载 安装 配置环境都有。 除此之外还将idea和maven的一些快捷键,一些idea设置,maven使用等内容, 内容还不错。
Maven使用tomcat8-maven-plugin插件
maven详细使用教程
maven使用指南
Maven 使用入门.pdf
Maven简单使用说明
maven项目开发的maven3.3.9使用包,可用于springboot项目
Maven使用手册,介绍了maven的一些日常使用和配置
Maven 是一个项目管理和构建自动化工具,Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的项目管理工具软件。
Maven使用
使用Maven构建多模块项目
Maven的使用教程,其中包括:maven项目开发中的问题及解决方案,maven安装与配置等
java视频教程之SVN Maven搭建自动化构建教程 Eclipse中使用Maven视频教程云盘下载链接
maven使用说明文档 maven使用说明文档 maven使用说明文档
Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理...由于 Maven 的面向项目的方法,许多 Apache Jakarta 项目发文时使用 Maven,而且公司项目采用 Maven 的比例在持续增长。
maven入门教程,maven是一个有用的构建工具,把源代码构建成可发布构件的工具,值得一学。
maven入门使用,很详细. 本文档介绍一些在使用Maven过程中不是必须的,但十分有用的实践。