Upgrade to Gradle 4.7 and Log4J 2

* Rename XSD to version `1.0`
* Enable some Checkstyle rules and fix their violations
This commit is contained in:
Artem Bilan
2018-04-26 10:34:36 -04:00
parent fa98e45597
commit 84b8c516b5
13 changed files with 58 additions and 43 deletions

View File

@@ -15,7 +15,7 @@ plugins {
id 'idea'
id 'jacoco'
id 'checkstyle'
id 'org.sonarqube' version '2.1'
id 'org.sonarqube' version '2.6.2'
}
description = 'Spring Integration SMB Support'
@@ -54,12 +54,13 @@ compileTestJava {
}
ext {
idPrefix = 'smb'
jcifsVersion = '1.3.18.3'
log4jVersion = '1.2.17'
log4jVersion = '2.11.0'
springIntegrationVersion = '5.0.4.RELEASE'
idPrefix = 'smb'
linkHomepage = 'https://github.com/SpringSource/spring-integration-extensions'
linkCi = 'https://build.springsource.org/browse/INTEXT'
linkIssue = 'https://jira.springsource.org/browse/INTEXT'
@@ -85,7 +86,7 @@ jacoco {
checkstyle {
configFile = file("$rootDir/src/checkstyle/checkstyle.xml")
toolVersion = "6.16.1"
toolVersion = "8.9"
}
dependencies {
@@ -94,7 +95,9 @@ dependencies {
compile "org.springframework.integration:spring-integration-stream:$springIntegrationVersion"
testCompile "org.springframework.integration:spring-integration-test:$springIntegrationVersion"
testRuntime "log4j:log4j:$log4jVersion"
testRuntime "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
testRuntime "org.apache.logging.log4j:log4j-jcl:$log4jVersion"
}
// enable all compiler warnings; individual projects may customize further

View File

@@ -1,6 +1,5 @@
#Mon Jan 16 10:37:27 EST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip

View File

@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
warn () {
echo "$*"
}
die ( ) {
die () {
echo
echo "$*"
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
fi
# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}

View File

@@ -24,11 +24,11 @@
<property name="elementStyle" value="compact" />
</module>
<module name="MissingOverride" />
<!-- <module name="PackageAnnotation" /> -->
<!-- <module name="AnnotationLocation"> -->
<!-- <property name="allowSamelineSingleParameterlessAnnotation" -->
<!-- value="false" /> -->
<!-- </module> -->
<module name="PackageAnnotation" />
<module name="AnnotationLocation">
<property name="allowSamelineSingleParameterlessAnnotation"
value="false" />
</module>
<!-- Block Checks -->
<module name="EmptyBlock">
@@ -53,7 +53,7 @@
<module name="CovariantEquals" />
<module name="EmptyStatement" />
<module name="EqualsHashCode" />
<!-- <module name="InnerAssignment" /> -->
<module name="InnerAssignment" />
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
@@ -94,13 +94,13 @@
<module name="UnusedImports">
<property name="processJavadoc" value="true" />
</module>
<!-- <module name="ImportOrder"> -->
<!-- <property name="groups" value="java,/^javax?\./,*,org.springframework" /> -->
<!-- <property name="ordered" value="true" /> -->
<!-- <property name="separated" value="true" /> -->
<!-- <property name="option" value="bottom" /> -->
<!-- <property name="sortStaticImportsAlphabetically" value="true" /> -->
<!-- </module> -->
<module name="ImportOrder">
<property name="groups" value="java,/^javax?\./,org,org.springframework,*" />
<property name="ordered" value="true" />
<property name="separated" value="true" />
<property name="option" value="top" />
<property name="sortStaticImportsAlphabetically" value="true" />
</module>
<!-- Javadoc Comments -->
<!-- <module name="JavadocType"> -->

View File

@@ -16,10 +16,11 @@
package org.springframework.integration.smb.filters;
import jcifs.smb.SmbFile;
import org.springframework.integration.file.filters.AbstractPersistentAcceptOnceFileListFilter;
import org.springframework.integration.metadata.ConcurrentMetadataStore;
import jcifs.smb.SmbFile;
/**
* Implementation of {@link AbstractPersistentAcceptOnceFileListFilter} for SMB.
*
@@ -41,4 +42,5 @@ public class SmbPersistentAcceptOnceFileListFilter extends AbstractPersistentAcc
protected String fileName(SmbFile file) {
return file.getName();
}
}

View File

@@ -19,9 +19,9 @@ package org.springframework.integration.smb.filters;
import java.io.UncheckedIOException;
import java.util.regex.Pattern;
import jcifs.smb.SmbException;
import org.springframework.integration.file.filters.AbstractRegexPatternFileListFilter;
import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;
/**
@@ -60,4 +60,5 @@ public class SmbRegexPatternFileListFilter extends AbstractRegexPatternFileListF
throw new UncheckedIOException(e);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2018 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.
@@ -16,13 +16,13 @@
package org.springframework.integration.smb.filters;
import jcifs.smb.SmbException;
import java.io.UncheckedIOException;
import org.springframework.integration.file.filters.AbstractSimplePatternFileListFilter;
import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;
import java.io.UncheckedIOException;
/**
* Implementation of {@link AbstractSimplePatternFileListFilter} for SMB.
*
@@ -57,4 +57,5 @@ public class SmbSimplePatternFileListFilter extends AbstractSimplePatternFileLis
throw new UncheckedIOException(e);
}
}
}

View File

@@ -16,12 +16,13 @@
package org.springframework.integration.smb.filters;
import jcifs.smb.SmbFile;
import java.util.Map;
import java.util.function.Function;
import org.springframework.integration.file.filters.AbstractMarkerFilePresentFileListFilter;
import org.springframework.integration.file.filters.FileListFilter;
import java.util.Map;
import java.util.function.Function;
import jcifs.smb.SmbFile;
/**
* Implementation of {@link AbstractMarkerFilePresentFileListFilter} for SMB.
@@ -50,4 +51,5 @@ public class SmbSystemMarkerFilePresentFileListFilter extends AbstractMarkerFile
protected String getFilename(SmbFile file) {
return file.getName();
}
}

View File

@@ -1,2 +1,2 @@
http\://www.springframework.org/schema/integration/smb/spring-integration-smb-0.5.xsd=org/springframework/integration/smb/config/spring-integration-smb-0.5.xsd
http\://www.springframework.org/schema/integration/smb/spring-integration-smb.xsd=org/springframework/integration/smb/config/spring-integration-smb-0.5.xsd
http\://www.springframework.org/schema/integration/smb/spring-integration-smb-1.0.xsd=org/springframework/integration/smb/config/spring-integration-smb-1.0.xsd
http\://www.springframework.org/schema/integration/smb/spring-integration-smb.xsd=org/springframework/integration/smb/config/spring-integration-smb-1.0.xsd

View File

@@ -1,8 +0,0 @@
log4j.rootCategory=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c{2}:%L - %m%n
log4j.category.org.springframework.integration=WARN
log4j.category.org.springframework.integration.smb=WARN

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %p [%t] [%c] - %m%n" />
</Console>
</Appenders>
<Loggers>
<Logger name="org.springframework.integration" level="warn"/>
<Logger name="org.springframework.integration.smb" level="warn"/>
<Root level="warn">
<AppenderRef ref="STDOUT" />
</Root>
</Loggers>
</Configuration>