Skip to content

Commit c160a4a

Browse files
committed
Build with Java 17 and enable linter
1 parent 0089c91 commit c160a4a

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
maven: [ '3.8.8', '3.9.9' ]
16-
java: [ '11', '17' ]
16+
java: [ '17', '21' ]
1717
os: [ 'ubuntu-latest', 'windows-latest' ]
1818
runs-on: ${{ matrix.os }}
1919
steps:

pom.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ under the License.
2222
<modelVersion>4.0.0</modelVersion>
2323
<groupId>org.scoverage</groupId>
2424
<artifactId>scoverage-maven-plugin</artifactId>
25-
<version>2.0.7-SNAPSHOT</version>
25+
<version>2.1.0-SNAPSHOT</version>
2626
<packaging>maven-plugin</packaging>
2727

2828
<name>SCoverage Maven Plugin</name>
@@ -211,7 +211,11 @@ under the License.
211211
<artifactId>maven-compiler-plugin</artifactId>
212212
<version>3.13.0</version>
213213
<configuration>
214-
<release>11</release>
214+
<release>17</release>
215+
<compilerArgs>
216+
<arg>-Xlint:all</arg>
217+
<arg>-Xlint:-processing</arg>
218+
</compilerArgs>
215219
</configuration>
216220
</plugin>
217221

@@ -272,10 +276,10 @@ under the License.
272276
<detectJavaApiLink>false</detectJavaApiLink>
273277
<subpackages>org.scoverage.plugin</subpackages>
274278
<links>
275-
<link>https://docs.oracle.com/en/java/javase/11/docs/api/</link>
276-
<link>https://maven.apache.org/ref/${maven.version}/apidocs/</link>
279+
<link>https://docs.oracle.com/en/java/javase/17/docs/api/</link>
277280
<link>https://maven.apache.org/shared-archives/maven-reporting-api-${maven-reporting-api.version}/apidocs/</link>
278281
<link>https://maven.apache.org/doxia/components/doxia-archives/doxia-${doxia.version}/apidocs/</link>
282+
<link>https://maven.apache.org/ref/${maven.version}/apidocs/</link>
279283
</links>
280284
<notimestamp>true</notimestamp>
281285
</configuration>

src/main/java/org/scoverage/plugin/SCoveragePreCompileMojo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.io.OutputStreamWriter;
2525
import java.util.*;
2626
import java.util.stream.Collectors;
27+
import javax.inject.Inject;
2728

2829
import org.apache.maven.artifact.Artifact;
2930
import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -37,7 +38,6 @@
3738
import org.apache.maven.model.Dependency;
3839
import org.apache.maven.plugin.AbstractMojo;
3940
import org.apache.maven.plugin.MojoExecutionException;
40-
import org.apache.maven.plugins.annotations.Component;
4141
import org.apache.maven.plugins.annotations.LifecyclePhase;
4242
import org.apache.maven.plugins.annotations.Mojo;
4343
import org.apache.maven.plugins.annotations.Parameter;
@@ -171,13 +171,13 @@ public class SCoveragePreCompileMojo
171171
/**
172172
* Artifact factory used to look up artifacts in the remote repository.
173173
*/
174-
@Component
174+
@Inject
175175
private ArtifactFactory factory;
176176

177177
/**
178178
* Artifact resolver used to resolve artifacts.
179179
*/
180-
@Component
180+
@Inject
181181
private ArtifactResolver resolver;
182182

183183
/**

src/main/java/org/scoverage/plugin/SCoverageReportMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ public void execute()
388388

389389
try
390390
{
391-
RenderingContext context = new RenderingContext( outputDirectory, getOutputName() + ".html" );
391+
RenderingContext context = new RenderingContext( outputDirectory, getOutputName() + ".html", null );
392392
SiteRendererSink sink = new SiteRendererSink( context );
393393
Locale locale = Locale.getDefault();
394394
generate( sink, locale );

src/main/java/org/scoverage/plugin/ScalaVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public ScalaVersion(String s) {
8080
// compute compatible
8181
compatible =
8282
modifier != null ? full : // non-stable versions are not compatible with anything else
83-
isScala2() ? major + "." + minor : // Scala 2.X.Y is compatible with any Scala 2.X.Z
83+
major == 2 ? major + "." + minor : // Scala 2.X.Y is compatible with any Scala 2.X.Z
8484
major + ""; // Scala 3.X is compatible with any Scala 3.Y
8585
}
8686

0 commit comments

Comments
 (0)