maven 离线打包

Last updated on September 15, 2024 pm

🧙 Questions

☄️ Ideas

<plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>

本篇介绍如何在离线服务器上安装插件

安装前提

  • 安装java
  • 安装maven
  • 安装unzip

准备maven离线仓库

在有网的电脑上,指定空文件夹repository为maven的仓库地址,然后需要成功同步完acorn-plugin/src/main/resources/templates/pom.xml里面的所有jar包。

安装flink安装包

sudo tar -vzxf flink-1.14.0-bin-scala_2.12.tgz -C /data/
sudo ln -s /data/flink-1.14.0 /opt/flink 

# 配置环境变量
sudo vim /etc/profile
# === sudo vim /etc/profile ===
export FLINK_HOME=/opt/flink
export PATH=$PATH:$FLINK_HOME/bin 
# === sudo vim /etc/profile ===
source /etc/profile

# 查看版本号
sudo chown -R ${user}:${user} /data/flink-1.14.0
flink --version
vim /opt/flink/conf/flink-conf.yaml

# --- vim $flink/conf/flink-conf.yaml ---

# 端口号,默认端口号 8081
rest.port: 30114

# 平行执行管道个数,默认1
taskmanager.numberOfTaskSlots: 20

# --- vim $flink/conf/flink-conf.yaml ---

Note:
最好在$flink目录下执行启动命令,否则flink无法找到配置文件

cd /opt/flink
bash ./bin/start-cluster.sh
bash ./bin/stop-cluster.sh

修改maven配置文件

unzip repository.zip -d ~/.m2/
vim /opt/maven/conf/settings.xml

# === vim /opt/maven/conf/settings.xml ===
<offline>true</offline>
# === vim /opt/maven/conf/settings.xml ===

启动插件

bash deploy.sh

maven 离线打包
https://ispong.isxcode.com/spring/maven/maven 离线打包/
Author
ispong
Posted on
June 24, 2021
Licensed under