maven pom.xml 配置初探
程序员文章站
2022-06-19 08:14:35
...
<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>BaiduMobileMap</groupId>
<artifactId>Stats</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Stats</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- 本地jar 文件包 -->
<dependency>
<groupId>org.apache</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>/Users/baidu/workspace/Stats/lib/hadoop-core-1.1.3.2.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache</groupId>
<artifactId>hive-exec</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>/Users/baidu/workspace/Stats/lib/hive-exec-2.3.38.jar</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<!-- jdk 使用1.6 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- 打成jar包 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<!-- 主类 -->
<mainClass>BaiduMobileMap.HelloHiveUDF</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
本文转自 拖鞋崽 51CTO博客,原文链接:
http://blog.51cto.com/1992mrwang/2046201
推荐阅读
-
Jenkins + Docker + dockerfile-maven-plugin + Harbor CI/CD spring-boot项目的最轻量级配置
-
多模块maven的deploy集成gitlab ci自动发版配置
-
【maven的使用】1maven的概念与配置
-
Maven 的配置文件路径读取方法
-
shell脚本自动化创建虚拟机的基本配置之tomcat--mysql--jdk--maven
-
maven 依赖中scope标签的配置范围详解
-
Java全栈程序员之08:MAVEN+JAVA配置
-
maven添加阿里云镜像与常用配置
-
Maven将依赖包、jar/war包及配置文件输出到指定目录
-
新建Maven工程,pom.xml报错web.xml is missing and
is set to true