-
Notifications
You must be signed in to change notification settings - Fork 8
Use new version of site and thoughts about new release #1
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| /** | ||
| * | ||
| */ | ||
| @FunctionalInterface | ||
| public interface VerificationResultPrinter | ||
| { | ||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ | |
| import org.apache.maven.plugins.verifier.model.Verifications; | ||
| import org.apache.maven.plugins.verifier.model.io.xpp3.VerificationsXpp3Reader; | ||
| import org.codehaus.plexus.util.FileUtils; | ||
| import org.codehaus.plexus.util.IOUtil; | ||
| import org.codehaus.plexus.util.xml.pull.XmlPullParserException; | ||
|
|
||
| /** | ||
| * Verifies the existence or non-existence of files/directories and optionally checks file content against a regular | ||
|
|
@@ -74,10 +74,9 @@ public class VerifierMojo | |
| /** | ||
| * The file containing the verifications to perform. | ||
| */ | ||
| // CHECKSTYLE_OFF: LineLength | ||
| @Parameter( property = "verifier.verificationFile", defaultValue = "${basedir}/src/test/verifier/verifications.xml", required = true ) | ||
| @Parameter( property = "verifier.verificationFile", | ||
| defaultValue = "${basedir}/src/test/verifier/verifications.xml", required = true ) | ||
| private File verificationFile; | ||
| // CHECKSTYLE_ON: LineLength | ||
|
|
||
| /** | ||
| * Whether the build will fail on verification errors. | ||
|
|
@@ -123,17 +122,11 @@ private VerificationResult verify() | |
| { | ||
| VerificationResult results = new VerificationResult(); | ||
|
|
||
| Reader reader = null; | ||
| try | ||
| try ( Reader reader = new FileReader( this.verificationFile ) ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not changed in this PR, but this is likely a bug. There's no specified character set
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. There are no open issues about it, though, and according to this answer there is no possibility to set encoding for FileReader until Java 11. https://stackoverflow.com/questions/696626/java-filereader-encoding-issue
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is why code shouldn't use FileReader. It's a bad API.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch - @KroArtem could you create Jira and pr to fix that? |
||
| { | ||
| reader = new FileReader( this.verificationFile ); | ||
|
|
||
| VerificationsXpp3Reader xppReader = new VerificationsXpp3Reader(); | ||
| Verifications verifications = xppReader.read( reader ); | ||
|
|
||
| reader.close(); | ||
| reader = null; | ||
|
|
||
| for ( org.apache.maven.plugins.verifier.model.File file : verifications.getFiles() ) | ||
| { | ||
| // Transform the file to check into an absolute path prefixing the basedir if | ||
|
|
@@ -149,23 +142,16 @@ private VerificationResult verify() | |
| } | ||
| } | ||
| } | ||
| catch ( org.codehaus.plexus.util.xml.pull.XmlPullParserException e ) | ||
| catch ( XmlPullParserException | IOException e ) | ||
| { | ||
| throw new MojoExecutionException( "Error while verifying files", e ); | ||
| } | ||
| catch ( IOException e ) | ||
| { | ||
| throw new MojoExecutionException( "Error while verifying files", e ); | ||
| } | ||
| finally | ||
| { | ||
| IOUtil.close( reader ); | ||
| } | ||
|
|
||
| return results; | ||
| } | ||
|
|
||
| private boolean verifyFile( org.apache.maven.plugins.verifier.model.File fileCheck, VerificationResult results ) | ||
| private boolean verifyFile( org.apache.maven.plugins.verifier.model.File fileCheck, | ||
| VerificationResult results ) | ||
| throws IOException | ||
| { | ||
| boolean result; | ||
|
|
@@ -179,8 +165,8 @@ private boolean verifyFile( org.apache.maven.plugins.verifier.model.File fileChe | |
| return result; | ||
| } | ||
|
|
||
| // CHECKSTYLE_OFF: LineLength | ||
| private boolean verifyFileContent( org.apache.maven.plugins.verifier.model.File fileCheck, VerificationResult results ) | ||
| private boolean verifyFileContent( org.apache.maven.plugins.verifier.model.File fileCheck, | ||
| VerificationResult results ) | ||
| throws IOException | ||
| { | ||
| boolean result = false; | ||
|
|
@@ -204,7 +190,6 @@ private boolean verifyFileContent( org.apache.maven.plugins.verifier.model.File | |
|
|
||
| return result; | ||
| } | ||
| // CHECKSTYLE_ON: LineLength | ||
|
|
||
| private boolean verifyFileExistence( org.apache.maven.plugins.verifier.model.File fileCheck, | ||
| VerificationResult results ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there wasn't a version here before you probably don't want it now. I'd guess it's supplied by thedependencyManagement section of a parent or some such thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I didn't find out any information about this.