maven - 如何在 jenkins 中安装这些项目,以便只能在一个项目中提供该选项
问题描述
项目测试MV
我有项目TestMV,它依赖于项目TestMV1。
我已经在 jenkins 中分别部署了这些项目,并在目标和选项部分中传递参数,例如 install -Dversion=13.2.00,这也是在项目 TestMV1 配置中完成的。我想配置这个安装 -
Dversion=13.2.00 仅在项目 TestMV 中,这应该在项目中共享
詹金斯工作中的 TestMV1 也是。而且这也应该在eclipse中起作用。
<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.TestMV</groupId>
<artifactId>TestMV</artifactId>
<version>${version}</version>
<packaging>jar</packaging>
<name>TestMV</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version>13.2.00</version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.TestMV1</groupId>
<artifactId>TestMV1</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
</project>
项目测试MV1
<modelVersion>4.0.0</modelVersion>
<groupId>com.TestMV1</groupId>
<artifactId>TestMV1</artifactId>
<version>${version}</version>
<packaging>jar</packaging>
<name>TestMV1</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version>13.2.00</version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
在项目 TestMV 配置的目标部分中传递 install -dversion 时。
我们如何才能将 -dversion 传递给 jenkins 中的项目 b,而不是在 jenkins 中的项目 TestMV1 配置的目标部分中编写 install -dversion。
项目 TestMV 具有 TestMV1 的依赖项
解决方案
我在 jenking 中创建了全局变量,并在目标和选项部分(如安装 -Dversion=${version})中传递了它。在两个 Maven 项目中完成。
问题解决了。谢谢
推荐阅读
- android - 在 Java 而非 JavaScript 的高密度设备中平滑地围绕一个点旋转形状
- python - 在 traits.Tuple 对象中初始化 traits.Tuple 值
- sql - 确定 SQL Server 表的分区号
- sql-server - 源和目标纬度/经度的可能排列
- soap - “WSDL2Java”与“JAX-WS 代理”与“JAX-WS 调度 API”
- linux - RHEL 上的弹性搜索安装问题
- javascript - 在角度项目上使用npm,但添加角度组件时不显示任何内容
- laravel - Laravel 集合 groupBy() 和 sum()
- android - Android Studio 的 Asset Studio 不显示 Material Icons 选项
- mp3 - 编辑和添加 mp3 的 ID3 标签