Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward compatibility with jenkinsci/jenkins#8503 #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.

<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.7</version>
</extension>
</extensions>
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Pconsume-incrementals
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.

-Pmight-produce-incrementals
4 changes: 4 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
buildPlugin(useContainerAgent: true, configurations: [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.

[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
])
118 changes: 41 additions & 77 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.11</version>
<version>4.73</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest version at the time of this writing.

<relativePath />
</parent>

<name>VectorCAST Coverage</name>
<description>Display VectorCAST coverage in Jenkins</description>
<artifactId>vectorcast-coverage</artifactId>
<version>0.22-SNAPSHOT</version>
<version>${revision}${changelist}</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.

<packaging>hpi</packaging>
<url>https://github.com/jenkinsci/vectorcast-coverage-plugin</url>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.


<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/MIT</url>
<url>https://opensource.org/license/mit/</url>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.

<distribution>repo</distribution>
</license>
</licenses>
Expand All @@ -39,19 +39,17 @@
</developers>

<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jenkins.version>1.625.3</jenkins.version>
<java.level>8</java.level>
<jenkins-test-harness.version>2.13</jenkins-test-harness.version>
<revision>0.22</revision>
<changelist>-SNAPSHOT</changelist>
Comment on lines +42 to +43
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.

<jenkins.version>2.387.3</jenkins.version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
</properties>

<scm>
<connection>scm:git:https://github.com/jenkinsci/vectorcast-coverage-plugin.git</connection>
<developerConnection>scm:git:https://github.com/jenkinsci/vectorcast-coverage-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/vectorcast-coverage-plugin</url>
<tag>HEAD</tag>
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:git@github.com:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
Comment on lines +49 to +52
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.

</scm>

<repositories>
Expand All @@ -61,7 +59,29 @@
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.387.x</artifactId>
<version>2446.v2e9fd3b_d8c81</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
Comment on lines +62 to +72
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the latest archetype.


<dependencies>
<dependency>
<groupId>io.github.x-stream</groupId>
<artifactId>mxparser</artifactId>
<version>1.2.2</version>
</dependency>
Comment on lines +76 to +80
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The substance of this change, allowing forward compatibility with jenkinsci/jenkins#8503.

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.12.5</version>
</dependency>
Comment on lines +81 to +85
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A dependency consumed by this plugin but not previously declared.

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-digester3</artifactId>
Expand All @@ -70,77 +90,21 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>dashboard-view</artifactId>
<version>2.16</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version now managed in the plugin BOM.

<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.8</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version now managed in the plugin BOM.

<exclusions>
<!-- Provided by Jenkins core -->
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>

<!-- Attention Eclipse users: if you see an error here, you have to install the M2E buildhelper plugin.-->
<execution>
<id>add-localizer-source-folder</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/localizer</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
<configuration>
<xmlOutput>true</xmlOutput>
<failOnError>${findbugs.failOnError}</failOnError>
</configuration>
<executions>
<execution>
<id>run-findbugs</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
</plugins>
</pluginManagement>
</build>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary; all present in the plugin parent POM.

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.vectorcast.plugins.vectorcastcoverage;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.EnvVars;
import hudson.Extension;
import hudson.FilePath;
Expand Down Expand Up @@ -215,6 +216,7 @@ public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnul
performImpl(run, workspace, listener);
}

@SuppressFBWarnings(value = "DCN_NULLPOINTER_EXCEPTION", justification = "TODO needs triage")
public boolean performImpl(Run<?, ?> run, FilePath workspace, TaskListener listener) throws InterruptedException, IOException {
final PrintStream logger = listener.getLogger();

Expand Down Expand Up @@ -363,6 +365,7 @@ private void printThresholdFailure(final PrintStream logger, String coverageType
}


@SuppressFBWarnings(value = "DCN_NULLPOINTER_EXCEPTION", justification = "TODO needs triage")
private void checkThreshold(Run<?, ?> run,
final PrintStream logger, EnvVars env, final VectorCASTBuildAction action) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void testGetResultSummary() throws Exception {
*/
static class CopyResourceToWorkspaceBuilder extends Builder {

private final InputStream content;
private transient final InputStream content;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to fix test failures on Java 11/17.

private final String fileName;

/**
Expand Down