为Jenkins配置插件构建

时间:2017-08-14 06:26:04

标签: maven jenkins jenkins-plugins

在Jenkins“Plugin tutorial”页面上写道,要构建一个需要编辑Maven设置的插件(Setting Up Environment部分)。 是否有可能不更改Maven设置但编辑pom文件或做这样的事情而不是它?

谢谢!

1 个答案:

答案 0 :(得分:1)

修改pom.xml也没关系。例如,

<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <!-- Baseline Jenkins version you use to build and test the plugin. Users
        must have this version or newer to run. -->
    <version>1.589</version>
    <relativePath />
</parent>
<groupId>com.xxx.xxx</groupId>
<artifactId>foo</artifactId>
<version>1.0.0</version>
<packaging>hpi</packaging>
<name>bar</name>
<description>xxx xxx xxx xxx xxx</description>
<licenses>
    <license>
        <name>MIT License</name>
        <url>http://opensource.org/licenses/MIT</url>
    </license>
</licenses>
<repositories>
    <repository>
        <id>repo.jenkins-ci.org</id>
        <url>http://repo.jenkins-ci.org/public/</url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>repo.jenkins-ci.org</id>
        <url>http://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
</pluginRepositories>
<dependencies>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.3.1</version>
    </dependency>
</dependencies>