From 5654d979a3c3b4f9da620efbc2ad31da894d84a9 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Wed, 19 Apr 2023 08:04:58 -0700 Subject: [PATCH] Activate Spotless via Maven property rather than file (#742) --- README.md | 4 +- pom.xml | 72 +++++++-------- src/it/benchmark/pom.xml | 55 ++++++------ .../test/java/benchmark/BenchmarkRunner.java | 62 +++++++------ .../test/java/benchmark/SampleBenchmark.java | 34 ++++--- src/it/beta-fail/downstream/pom.xml | 35 ++++---- .../src/main/java/downstream/Caller.java | 2 + src/it/beta-fail/pom.xml | 66 +++++++------- src/it/beta-fail/postbuild.groovy | 2 +- src/it/beta-fail/upstream/pom.xml | 21 +++-- .../upstream/src/main/java/upstream/Api.java | 2 + src/it/beta-just-testing/downstream/pom.xml | 35 ++++---- .../src/main/java/downstream/NotCaller.java | 4 +- .../src/test/java/downstream/ApiTest.java | 2 + src/it/beta-just-testing/pom.xml | 66 +++++++------- src/it/beta-just-testing/upstream/pom.xml | 21 +++-- .../upstream/src/main/java/upstream/Api.java | 2 + src/it/beta-pass/downstream/pom.xml | 41 +++++---- .../src/main/java/downstream/Caller.java | 2 + src/it/beta-pass/pom.xml | 66 +++++++------- src/it/beta-pass/upstream/pom.xml | 21 +++-- .../upstream/src/main/java/upstream/Api.java | 2 + src/it/incrementals-and-plugin-bom/pom.xml | 89 ++++++++++--------- .../java/io/jenkins/plugins/RandomClass.java | 1 + .../io/jenkins/plugins/RandomClassTest.java | 5 +- src/it/localizer/pom.xml | 58 ++++++------ src/it/localizer/src/main/java/test/X.java | 1 - .../localizer/src/test/java/test/XTest.java | 4 +- src/it/sample-plugin/pom.xml | 70 +++++++-------- .../src/main/java/test/SampleRootAction.java | 4 +- .../test/java/test/SampleRootActionTest.java | 15 ++-- 31 files changed, 439 insertions(+), 425 deletions(-) diff --git a/README.md b/README.md index 8df9f5b959..1e3aac58ca 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ See [Incrementals](https://github.com/jenkinsci/incrementals-tools) for details. ## Formatting To opt in to code formatting of your Java sources and Maven POM with Spotless, -create a `.mvn_exec_spotless` file at the root of your repository and remove -any existing Spotless configuration from your POM. +define the `spotless.check.skip` property to `false` and remove any existing +Spotless configuration from your POM. To format existing code, run: diff --git a/pom.xml b/pom.xml index c9e77dfaef..f2daccdea2 100644 --- a/pom.xml +++ b/pom.xml @@ -117,6 +117,9 @@ --> FindReturnRef + + true + true @@ -687,6 +690,37 @@ + + com.diffplug.spotless + spotless-maven-plugin + + + + + + true + + + + + + + + false + scope,groupId,artifactId + groupId,artifactId + true + + + + + + + check + + + + maven-eclipse-plugin @@ -1427,41 +1461,9 @@ .mvn_exec_spotless - - - - com.diffplug.spotless - spotless-maven-plugin - - - - - - true - - - - - - - - false - scope,groupId,artifactId - groupId,artifactId - true - - - - - - - check - - - - - - + + false + diff --git a/src/it/benchmark/pom.xml b/src/it/benchmark/pom.xml index 29e42e148d..ef75701a2c 100644 --- a/src/it/benchmark/pom.xml +++ b/src/it/benchmark/pom.xml @@ -1,30 +1,29 @@ - - 4.0.0 - - org.jenkins-ci.plugins - plugin - @project.version@ - - - org.jenkins-ci.plugins.its - benchmark-it - 1.0-SNAPSHOT - jar - - 2.361.4 - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - + + 4.0.0 + + org.jenkins-ci.plugins + plugin + @project.version@ + + + org.jenkins-ci.plugins.its + benchmark-it + 1.0-SNAPSHOT + jar + + 2.361.4 + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + diff --git a/src/it/benchmark/src/test/java/benchmark/BenchmarkRunner.java b/src/it/benchmark/src/test/java/benchmark/BenchmarkRunner.java index 60f8c4e3bb..b28e9a8124 100644 --- a/src/it/benchmark/src/test/java/benchmark/BenchmarkRunner.java +++ b/src/it/benchmark/src/test/java/benchmark/BenchmarkRunner.java @@ -1,32 +1,30 @@ -package benchmark; - -import jenkins.benchmark.jmh.BenchmarkFinder; -import org.junit.Test; -import org.openjdk.jmh.results.format.ResultFormatType; -import org.openjdk.jmh.runner.Runner; -import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; -import org.openjdk.jmh.runner.options.OptionsBuilder; - -import java.util.concurrent.TimeUnit; - -public class BenchmarkRunner { - @Test - public void runThis() throws Exception { - // number of iterations is kept to a minimum just to verify that the benchmarks work without spending extra - // time during builds. - ChainedOptionsBuilder optionsBuilder = - new OptionsBuilder() - .forks(1) - .warmupIterations(1) - .warmupBatchSize(1) - .measurementIterations(1) - .measurementBatchSize(1) - .shouldFailOnError(true) - .result("jmh-report.json") - .timeUnit(TimeUnit.MICROSECONDS) - .resultFormat(ResultFormatType.JSON); - BenchmarkFinder finder = new BenchmarkFinder(getClass()); - finder.findBenchmarks(optionsBuilder); - new Runner(optionsBuilder.build()).run(); - } -} +package benchmark; + +import java.util.concurrent.TimeUnit; +import jenkins.benchmark.jmh.BenchmarkFinder; +import org.junit.Test; +import org.openjdk.jmh.results.format.ResultFormatType; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +public class BenchmarkRunner { + @Test + public void runThis() throws Exception { + // number of iterations is kept to a minimum just to verify that the benchmarks work without spending extra + // time during builds. + ChainedOptionsBuilder optionsBuilder = new OptionsBuilder() + .forks(1) + .warmupIterations(1) + .warmupBatchSize(1) + .measurementIterations(1) + .measurementBatchSize(1) + .shouldFailOnError(true) + .result("jmh-report.json") + .timeUnit(TimeUnit.MICROSECONDS) + .resultFormat(ResultFormatType.JSON); + BenchmarkFinder finder = new BenchmarkFinder(getClass()); + finder.findBenchmarks(optionsBuilder); + new Runner(optionsBuilder.build()).run(); + } +} diff --git a/src/it/benchmark/src/test/java/benchmark/SampleBenchmark.java b/src/it/benchmark/src/test/java/benchmark/SampleBenchmark.java index 49e5599fc1..57e552a321 100644 --- a/src/it/benchmark/src/test/java/benchmark/SampleBenchmark.java +++ b/src/it/benchmark/src/test/java/benchmark/SampleBenchmark.java @@ -1,18 +1,16 @@ -package benchmark; - -import jenkins.benchmark.jmh.JmhBenchmark; -import jenkins.benchmark.jmh.JmhBenchmarkState; -import org.openjdk.jmh.annotations.Benchmark; - -import java.io.IOException; - -@JmhBenchmark -public class SampleBenchmark { - public static class MyState extends JmhBenchmarkState { - } - - @Benchmark - public void benchmark(MyState state) throws IOException { - state.getJenkins().setSystemMessage("Hello world"); - } -} +package benchmark; + +import java.io.IOException; +import jenkins.benchmark.jmh.JmhBenchmark; +import jenkins.benchmark.jmh.JmhBenchmarkState; +import org.openjdk.jmh.annotations.Benchmark; + +@JmhBenchmark +public class SampleBenchmark { + public static class MyState extends JmhBenchmarkState {} + + @Benchmark + public void benchmark(MyState state) throws IOException { + state.getJenkins().setSystemMessage("Hello world"); + } +} diff --git a/src/it/beta-fail/downstream/pom.xml b/src/it/beta-fail/downstream/pom.xml index 173b62623a..5e94d84a23 100644 --- a/src/it/beta-fail/downstream/pom.xml +++ b/src/it/beta-fail/downstream/pom.xml @@ -1,20 +1,19 @@ - - 4.0.0 - - org.jenkins-ci.plugins.its - beta-fail - 1.0-SNAPSHOT - - org.jenkins-ci.plugins.its.beta-fail - downstream - hpi - - - org.jenkins-ci.plugins.its.beta-fail - upstream - 1.0-SNAPSHOT - - + + 4.0.0 + + org.jenkins-ci.plugins.its + beta-fail + 1.0-SNAPSHOT + + org.jenkins-ci.plugins.its.beta-fail + downstream + hpi + + + org.jenkins-ci.plugins.its.beta-fail + upstream + 1.0-SNAPSHOT + + diff --git a/src/it/beta-fail/downstream/src/main/java/downstream/Caller.java b/src/it/beta-fail/downstream/src/main/java/downstream/Caller.java index 8278aae38c..fc562f7eb1 100644 --- a/src/it/beta-fail/downstream/src/main/java/downstream/Caller.java +++ b/src/it/beta-fail/downstream/src/main/java/downstream/Caller.java @@ -1,5 +1,7 @@ package downstream; + import upstream.Api; + public class Caller { static { Api.experimental(); diff --git a/src/it/beta-fail/pom.xml b/src/it/beta-fail/pom.xml index ca0e2cbdb4..99ac126cc6 100644 --- a/src/it/beta-fail/pom.xml +++ b/src/it/beta-fail/pom.xml @@ -1,35 +1,35 @@ - - 4.0.0 - - org.jenkins-ci.plugins - plugin - @project.version@ - - - org.jenkins-ci.plugins.its - beta-fail - 1.0-SNAPSHOT - pom - - 2.361.4 - true - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - upstream - downstream - + + 4.0.0 + + org.jenkins-ci.plugins + plugin + @project.version@ + + + org.jenkins-ci.plugins.its + beta-fail + 1.0-SNAPSHOT + pom + + upstream + downstream + + + 2.361.4 + false + true + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + diff --git a/src/it/beta-fail/postbuild.groovy b/src/it/beta-fail/postbuild.groovy index 66b0092688..70d296e1fe 100644 --- a/src/it/beta-fail/postbuild.groovy +++ b/src/it/beta-fail/postbuild.groovy @@ -1,3 +1,3 @@ -assert new File(basedir, 'build.log').text.replaceAll(/\e\[[\d;]*[^\d;]/, '').contains('[ERROR] downstream/Caller:5 upstream/Api.experimental()V is still in beta') +assert new File(basedir, 'build.log').text.replaceAll(/\e\[[\d;]*[^\d;]/, '').contains('[ERROR] downstream/Caller:7 upstream/Api.experimental()V is still in beta') return true diff --git a/src/it/beta-fail/upstream/pom.xml b/src/it/beta-fail/upstream/pom.xml index 29ab7add96..45ddb5284e 100644 --- a/src/it/beta-fail/upstream/pom.xml +++ b/src/it/beta-fail/upstream/pom.xml @@ -1,13 +1,12 @@ - - 4.0.0 - - org.jenkins-ci.plugins.its - beta-fail - 1.0-SNAPSHOT - - org.jenkins-ci.plugins.its.beta-fail - upstream - hpi + + 4.0.0 + + org.jenkins-ci.plugins.its + beta-fail + 1.0-SNAPSHOT + + org.jenkins-ci.plugins.its.beta-fail + upstream + hpi diff --git a/src/it/beta-fail/upstream/src/main/java/upstream/Api.java b/src/it/beta-fail/upstream/src/main/java/upstream/Api.java index 9df5a346c2..5f65e881aa 100644 --- a/src/it/beta-fail/upstream/src/main/java/upstream/Api.java +++ b/src/it/beta-fail/upstream/src/main/java/upstream/Api.java @@ -1,6 +1,8 @@ package upstream; + import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.Beta; + public class Api { @Restricted(Beta.class) public static void experimental() {} diff --git a/src/it/beta-just-testing/downstream/pom.xml b/src/it/beta-just-testing/downstream/pom.xml index 1cc1b923ea..be2dabec62 100644 --- a/src/it/beta-just-testing/downstream/pom.xml +++ b/src/it/beta-just-testing/downstream/pom.xml @@ -1,20 +1,19 @@ - - 4.0.0 - - org.jenkins-ci.plugins.its - beta-just-testing - 1.0-SNAPSHOT - - org.jenkins-ci.plugins.its.beta-just-testing - downstream - hpi - - - org.jenkins-ci.plugins.its.beta-just-testing - upstream - 1.0-SNAPSHOT - - + + 4.0.0 + + org.jenkins-ci.plugins.its + beta-just-testing + 1.0-SNAPSHOT + + org.jenkins-ci.plugins.its.beta-just-testing + downstream + hpi + + + org.jenkins-ci.plugins.its.beta-just-testing + upstream + 1.0-SNAPSHOT + + diff --git a/src/it/beta-just-testing/downstream/src/main/java/downstream/NotCaller.java b/src/it/beta-just-testing/downstream/src/main/java/downstream/NotCaller.java index 2df18fd6bd..c4a40d863e 100644 --- a/src/it/beta-just-testing/downstream/src/main/java/downstream/NotCaller.java +++ b/src/it/beta-just-testing/downstream/src/main/java/downstream/NotCaller.java @@ -1,3 +1,3 @@ package downstream; -public class NotCaller { -} + +public class NotCaller {} diff --git a/src/it/beta-just-testing/downstream/src/test/java/downstream/ApiTest.java b/src/it/beta-just-testing/downstream/src/test/java/downstream/ApiTest.java index f9b3842e68..bb029e9ba0 100644 --- a/src/it/beta-just-testing/downstream/src/test/java/downstream/ApiTest.java +++ b/src/it/beta-just-testing/downstream/src/test/java/downstream/ApiTest.java @@ -1,5 +1,7 @@ package downstream; + import upstream.Api; + public class ApiTest { static { Api.experimental(); diff --git a/src/it/beta-just-testing/pom.xml b/src/it/beta-just-testing/pom.xml index c00be0c598..6f515eeaeb 100644 --- a/src/it/beta-just-testing/pom.xml +++ b/src/it/beta-just-testing/pom.xml @@ -1,35 +1,35 @@ - - 4.0.0 - - org.jenkins-ci.plugins - plugin - @project.version@ - - - org.jenkins-ci.plugins.its - beta-just-testing - 1.0-SNAPSHOT - pom - - 2.361.4 - true - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - upstream - downstream - + + 4.0.0 + + org.jenkins-ci.plugins + plugin + @project.version@ + + + org.jenkins-ci.plugins.its + beta-just-testing + 1.0-SNAPSHOT + pom + + upstream + downstream + + + 2.361.4 + false + true + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + diff --git a/src/it/beta-just-testing/upstream/pom.xml b/src/it/beta-just-testing/upstream/pom.xml index 29359fd440..578bcfb4ca 100644 --- a/src/it/beta-just-testing/upstream/pom.xml +++ b/src/it/beta-just-testing/upstream/pom.xml @@ -1,13 +1,12 @@ - - 4.0.0 - - org.jenkins-ci.plugins.its - beta-just-testing - 1.0-SNAPSHOT - - org.jenkins-ci.plugins.its.beta-just-testing - upstream - hpi + + 4.0.0 + + org.jenkins-ci.plugins.its + beta-just-testing + 1.0-SNAPSHOT + + org.jenkins-ci.plugins.its.beta-just-testing + upstream + hpi diff --git a/src/it/beta-just-testing/upstream/src/main/java/upstream/Api.java b/src/it/beta-just-testing/upstream/src/main/java/upstream/Api.java index 9df5a346c2..5f65e881aa 100644 --- a/src/it/beta-just-testing/upstream/src/main/java/upstream/Api.java +++ b/src/it/beta-just-testing/upstream/src/main/java/upstream/Api.java @@ -1,6 +1,8 @@ package upstream; + import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.Beta; + public class Api { @Restricted(Beta.class) public static void experimental() {} diff --git a/src/it/beta-pass/downstream/pom.xml b/src/it/beta-pass/downstream/pom.xml index 2b07d2bd81..559045f652 100644 --- a/src/it/beta-pass/downstream/pom.xml +++ b/src/it/beta-pass/downstream/pom.xml @@ -1,23 +1,22 @@ - - 4.0.0 - - org.jenkins-ci.plugins.its - beta-pass - 1.0-SNAPSHOT - - org.jenkins-ci.plugins.its.beta-pass - downstream - hpi - - true - - - - org.jenkins-ci.plugins.its.beta-pass - upstream - 1.0-SNAPSHOT - - + + 4.0.0 + + org.jenkins-ci.plugins.its + beta-pass + 1.0-SNAPSHOT + + org.jenkins-ci.plugins.its.beta-pass + downstream + hpi + + true + + + + org.jenkins-ci.plugins.its.beta-pass + upstream + 1.0-SNAPSHOT + + diff --git a/src/it/beta-pass/downstream/src/main/java/downstream/Caller.java b/src/it/beta-pass/downstream/src/main/java/downstream/Caller.java index 8278aae38c..fc562f7eb1 100644 --- a/src/it/beta-pass/downstream/src/main/java/downstream/Caller.java +++ b/src/it/beta-pass/downstream/src/main/java/downstream/Caller.java @@ -1,5 +1,7 @@ package downstream; + import upstream.Api; + public class Caller { static { Api.experimental(); diff --git a/src/it/beta-pass/pom.xml b/src/it/beta-pass/pom.xml index ca608bea28..6504cc0678 100644 --- a/src/it/beta-pass/pom.xml +++ b/src/it/beta-pass/pom.xml @@ -1,35 +1,35 @@ - - 4.0.0 - - org.jenkins-ci.plugins - plugin - @project.version@ - - - org.jenkins-ci.plugins.its - beta-pass - 1.0-SNAPSHOT - pom - - 2.361.4 - true - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - upstream - downstream - + + 4.0.0 + + org.jenkins-ci.plugins + plugin + @project.version@ + + + org.jenkins-ci.plugins.its + beta-pass + 1.0-SNAPSHOT + pom + + upstream + downstream + + + 2.361.4 + false + true + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + diff --git a/src/it/beta-pass/upstream/pom.xml b/src/it/beta-pass/upstream/pom.xml index 7ad4e944b3..98216b717b 100644 --- a/src/it/beta-pass/upstream/pom.xml +++ b/src/it/beta-pass/upstream/pom.xml @@ -1,13 +1,12 @@ - - 4.0.0 - - org.jenkins-ci.plugins.its - beta-pass - 1.0-SNAPSHOT - - org.jenkins-ci.plugins.its.beta-pass - upstream - hpi + + 4.0.0 + + org.jenkins-ci.plugins.its + beta-pass + 1.0-SNAPSHOT + + org.jenkins-ci.plugins.its.beta-pass + upstream + hpi diff --git a/src/it/beta-pass/upstream/src/main/java/upstream/Api.java b/src/it/beta-pass/upstream/src/main/java/upstream/Api.java index 9df5a346c2..5f65e881aa 100644 --- a/src/it/beta-pass/upstream/src/main/java/upstream/Api.java +++ b/src/it/beta-pass/upstream/src/main/java/upstream/Api.java @@ -1,6 +1,8 @@ package upstream; + import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.Beta; + public class Api { @Restricted(Beta.class) public static void experimental() {} diff --git a/src/it/incrementals-and-plugin-bom/pom.xml b/src/it/incrementals-and-plugin-bom/pom.xml index 692048a441..4db37bb45e 100644 --- a/src/it/incrementals-and-plugin-bom/pom.xml +++ b/src/it/incrementals-and-plugin-bom/pom.xml @@ -1,49 +1,50 @@ - 4.0.0 - - org.jenkins-ci.plugins - plugin - @project.version@ - - - io.jenkins.plugins - incrementals-and-plugin-bom - ${revision}${changelist} - hpi - - 1.0 - -SNAPSHOT - 2.361.4 - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - - io.jenkins.tools.bom - bom-2.361.x - 1580.v47b_429a_c853a - import - pom - - - + 4.0.0 + + org.jenkins-ci.plugins + plugin + @project.version@ + + + io.jenkins.plugins + incrementals-and-plugin-bom + ${revision}${changelist} + hpi + + 1.0 + -SNAPSHOT + 2.361.4 + false + + - - org.jenkins-ci.plugins.workflow - workflow-step-api - + + io.jenkins.tools.bom + bom-2.361.x + 1580.v47b_429a_c853a + pom + import + + + + + org.jenkins-ci.plugins.workflow + workflow-step-api + + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + diff --git a/src/it/incrementals-and-plugin-bom/src/main/java/io/jenkins/plugins/RandomClass.java b/src/it/incrementals-and-plugin-bom/src/main/java/io/jenkins/plugins/RandomClass.java index cc83b7d60a..70c6bcde5a 100644 --- a/src/it/incrementals-and-plugin-bom/src/main/java/io/jenkins/plugins/RandomClass.java +++ b/src/it/incrementals-and-plugin-bom/src/main/java/io/jenkins/plugins/RandomClass.java @@ -1,4 +1,5 @@ package io.jenkins.plugins; + public class RandomClass { public RandomClass() { org.jenkinsci.plugins.workflow.steps.StepContext x = null; diff --git a/src/it/incrementals-and-plugin-bom/src/test/java/io/jenkins/plugins/RandomClassTest.java b/src/it/incrementals-and-plugin-bom/src/test/java/io/jenkins/plugins/RandomClassTest.java index c2a1bdb915..99fac8a9f6 100644 --- a/src/it/incrementals-and-plugin-bom/src/test/java/io/jenkins/plugins/RandomClassTest.java +++ b/src/it/incrementals-and-plugin-bom/src/test/java/io/jenkins/plugins/RandomClassTest.java @@ -1,5 +1,8 @@ package io.jenkins.plugins; + import org.junit.Test; + public class RandomClassTest { - @Test public void whatever() {} + @Test + public void whatever() {} } diff --git a/src/it/localizer/pom.xml b/src/it/localizer/pom.xml index 3fef41c086..0aea760e38 100644 --- a/src/it/localizer/pom.xml +++ b/src/it/localizer/pom.xml @@ -1,31 +1,31 @@ - - 4.0.0 - - org.jenkins-ci.plugins - plugin - @project.version@ - - - org.jenkins-ci.plugins.its - localizer - 1.0-SNAPSHOT - hpi - - 2.361.4 - true - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - + + 4.0.0 + + org.jenkins-ci.plugins + plugin + @project.version@ + + + org.jenkins-ci.plugins.its + localizer + 1.0-SNAPSHOT + hpi + + 2.361.4 + false + true + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + diff --git a/src/it/localizer/src/main/java/test/X.java b/src/it/localizer/src/main/java/test/X.java index 1c920c2212..6a30135a9c 100644 --- a/src/it/localizer/src/main/java/test/X.java +++ b/src/it/localizer/src/main/java/test/X.java @@ -5,5 +5,4 @@ public class X { public static String label() { return Messages.label(); } - } diff --git a/src/it/localizer/src/test/java/test/XTest.java b/src/it/localizer/src/test/java/test/XTest.java index 4a14d1188b..f559a96391 100644 --- a/src/it/localizer/src/test/java/test/XTest.java +++ b/src/it/localizer/src/test/java/test/XTest.java @@ -1,13 +1,13 @@ package test; -import org.junit.Test; import static org.junit.Assert.*; +import org.junit.Test; + public class XTest { @Test public void label() throws Exception { assertEquals("Whatever", X.label()); } - } diff --git a/src/it/sample-plugin/pom.xml b/src/it/sample-plugin/pom.xml index 4f55b0b0a3..ebd3e614b6 100644 --- a/src/it/sample-plugin/pom.xml +++ b/src/it/sample-plugin/pom.xml @@ -1,37 +1,37 @@ - - 4.0.0 - - org.jenkins-ci.plugins - plugin - @project.version@ - - - org.jenkins-ci.plugins.its - sample-plugin - 1.0-SNAPSHOT - hpi - - 2.361.4 - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - org.jenkins-ci.plugins - structs - 1.5 - - + + 4.0.0 + + org.jenkins-ci.plugins + plugin + @project.version@ + + + org.jenkins-ci.plugins.its + sample-plugin + 1.0-SNAPSHOT + hpi + + 2.361.4 + false + + + + org.jenkins-ci.plugins + structs + 1.5 + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + diff --git a/src/it/sample-plugin/src/main/java/test/SampleRootAction.java b/src/it/sample-plugin/src/main/java/test/SampleRootAction.java index 1e498ae871..66611bacbb 100644 --- a/src/it/sample-plugin/src/main/java/test/SampleRootAction.java +++ b/src/it/sample-plugin/src/main/java/test/SampleRootAction.java @@ -1,7 +1,6 @@ package test; import hudson.Extension; -import hudson.model.InvisibleAction; import hudson.model.RootAction; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponses; @@ -12,14 +11,17 @@ public class SampleRootAction implements RootAction { public String getUrlName() { return "sample"; } + @Override public String getIconFileName() { return null; } + @Override public String getDisplayName() { return null; } + public HttpResponse doIndex() { return HttpResponses.plainText("sample served"); } diff --git a/src/it/sample-plugin/src/test/java/test/SampleRootActionTest.java b/src/it/sample-plugin/src/test/java/test/SampleRootActionTest.java index ff7f0a39ac..4e6ccea880 100644 --- a/src/it/sample-plugin/src/test/java/test/SampleRootActionTest.java +++ b/src/it/sample-plugin/src/test/java/test/SampleRootActionTest.java @@ -1,9 +1,10 @@ package test; -import org.apache.commons.io.IOUtils; -import org.junit.Test; import static org.junit.Assert.*; + +import org.apache.commons.io.IOUtils; import org.junit.Rule; +import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; public class SampleRootActionTest { @@ -13,8 +14,12 @@ public class SampleRootActionTest { @Test public void smokes() throws Exception { - assertEquals(IOUtils.toString(SampleRootActionTest.class.getResource("expected.txt")), - r.createWebClient().goTo("sample", "text/plain").getWebResponse().getContentAsString().trim()); + assertEquals( + IOUtils.toString(SampleRootActionTest.class.getResource("expected.txt")), + r.createWebClient() + .goTo("sample", "text/plain") + .getWebResponse() + .getContentAsString() + .trim()); } - }