mvn_action
Maven 仓库 | 菜鸟教程 https://www.runoob.com/maven/maven-repositories.html
mvn jar 包 加入时间戳
实践:
<version>${maven.build.timestamp}-SNAPSHOT</version>
<maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format>
<?xml version="1.0" encoding="UTF-8"?>
<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>cn.test</groupId>
<artifactId>flink_job</artifactId>
<version>${maven.build.timestamp}-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format>
<flink.version>1.13.0</flink.version>
<scala.binary.version>2.11</scala.binary.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<rocketmq.version>4.8.0</rocketmq.version>
<commons-lang.version>2.5</commons-lang.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.37</version>
</dependency>
</dependencies>
</project>
Maven – Introduction to the Build Lifecycle https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
Lifecycle Reference
The following lists all build phases of the default
, clean
and site
lifecycles, which are executed in the order given up to the point of the one specified.
Clean Lifecycle
Phase | Description |
---|---|
pre-clean |
execute processes needed prior to the actual project cleaning |
clean |
remove all files generated by the previous build |
post-clean |
execute processes needed to finalize the project cleaning |
Default Lifecycle
Phase | Description |
---|---|
validate |
validate the project is correct and all necessary information is available. |
initialize |
initialize build state, e.g. set properties or create directories. |
generate-sources |
generate any source code for inclusion in compilation. |
process-sources |
process the source code, for example to filter any values. |
generate-resources |
generate resources for inclusion in the package. |
process-resources |
copy and process the resources into the destination directory, ready for packaging. |
compile |
compile the source code of the project. |
process-classes |
post-process the generated files from compilation, for example to do bytecode enhancement on Java classes. |
generate-test-sources |
generate any test source code for inclusion in compilation. |
process-test-sources |
process the test source code, for example to filter any values. |
generate-test-resources |
create resources for testing. |
process-test-resources |
copy and process the resources into the test destination directory. |
test-compile |
compile the test source code into the test destination directory |
process-test-classes |
post-process the generated files from test compilation, for example to do bytecode enhancement on Java classes. |
test |
run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed. |
prepare-package |
perform any operations necessary to prepare a package before the actual packaging. This often results in an unpacked, processed version of the package. |
package |
take the compiled code and package it in its distributable format, such as a JAR. |
pre-integration-test |
perform actions required before integration tests are executed. This may involve things such as setting up the required environment. |
integration-test |
process and deploy the package if necessary into an environment where integration tests can be run. |
post-integration-test |
perform actions required after integration tests have been executed. This may including cleaning up the environment. |
verify |
run any checks to verify the package is valid and meets quality criteria. |
install |
install the package into the local repository, for use as a dependency in other projects locally. |
deploy |
done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects. |
Site Lifecycle
Phase | Description |
---|---|
pre-site |
execute processes needed prior to the actual project site generation |
site |
generate the project's site documentation |
post-site |
execute processes needed to finalize the site generation, and to prepare for site deployment |
site-deploy |
deploy the generated site documentation to the specified web server |
validate(验证): 验证项目正确,并且所有必要信息可用。 compile(编译): 编译项目源码 test(测试): 使用合适的单元测试框架测试编译后的源码。 package(打包): 源码编译之后,使用合适的格式(例如JAR格式)对编译后的源码进行打包。 integration-test(集成测试): 如果有需要,把包处理并部署到可以运行集成测试的环境中去。 verify(验证): 进行各种测试来验证包是否有效并且符合质量标准。 install(安装): 把包安装到本地仓库,使该包可以作为其他本地项目的依赖。 deploy(部署): 在集成或发布环境中完成,将最终软件包复制到远程存储库,以与其他开发人员和项目共享。
【linux】linux编译执行java工程 - luoyinqq - 博客园 https://www.cnblogs.com/lijieqiong/p/4739455.html
在win-idea上上编写代码-本地mvn--上传linux---再进行mvn
在pom.xml目录下
mvn compile 编译
mvn package 打包成jar