Skip to content

Commit

Permalink
Enable fail on warnings in the compiler plugin
Browse files Browse the repository at this point in the history
Closes gh-1514
  • Loading branch information
mhalbritter committed Mar 1, 2024
1 parent dc2a7ed commit 34c623d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
21 changes: 21 additions & 0 deletions initializr-generator/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2012-2024 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -26,6 +42,11 @@
<artifactId>spring-context</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>

<dependency>
<groupId>com.samskivert</groupId>
<artifactId>jmustache</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -121,6 +121,7 @@ public <T> T generate(ProjectDescription description, ProjectAssetGenerator<T> p
* @param description the description of the project to generate
* @return a list of candidate configurations
*/
@SuppressWarnings("deprecation")
protected List<String> getCandidateProjectGenerationConfigurations(ProjectDescription description) {
return SpringFactoriesLoader.loadFactoryNames(ProjectGenerationConfiguration.class,
getClass().getClassLoader());
Expand Down
10 changes: 10 additions & 0 deletions initializr-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
</dependency>
<!-- Fixes
Warning:java: unknown enum constant javax.annotation.meta.When.MAYBE reason: class file for javax.annotation.meta.When not found
-->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -174,6 +182,8 @@
<source>${java.version}</source>
<target>${java.version}</target>
<parameters>true</parameters>
<failOnWarning>true</failOnWarning>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -67,7 +67,7 @@
* @author Andy Wilkinson
* @author Stephane Nicoll
*/
@SuppressWarnings("removal")
@SuppressWarnings("deprecation")
class DefaultMavenVersionResolver implements MavenVersionResolver {

private static final Log logger = LogFactory.getLog(DefaultMavenVersionResolver.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -273,7 +273,7 @@ private void untar(Path archiveFile, Path project) throws IOException {
}

private void unzip(Path archiveFile, Path project) throws IOException {
try (ZipFile zip = new ZipFile(archiveFile.toFile())) {
try (ZipFile zip = ZipFile.builder().setPath(archiveFile).get()) {
Enumeration<? extends ZipArchiveEntry> entries = zip.getEntries();
while (entries.hasMoreElements()) {
ZipArchiveEntry entry = entries.nextElement();
Expand Down

0 comments on commit 34c623d

Please sign in to comment.