我曾尝试从https://github.com/keedio/flume-ng-sql-source/创建jar文件但仍然失败。在我下载了https://github.com/keedio/flume-ng-sql-source/并将其插入其中后,我运行了mvn clean package
。它因以下错误而失败:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building flume-ng-sql-source 1.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ flume-ng-sql-source ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ flume-ng-sql-source ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /root/flume-ng-sql-source-master/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ flume-ng-sql-source ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 6 source files to /root/flume-ng-sql-source-master/target/classes
[WARNING] /root/flume-ng-sql-source-master/src/main/java/org/keedio/flume/source/SQLSourceHelper.java: /root/flume-ng-sql-source-master/src/main/java/org/keedio/flume/source/SQLSourceHelper.java uses unchecked or unsafe operations.
[WARNING] /root/flume-ng-sql-source-master/src/main/java/org/keedio/flume/source/SQLSourceHelper.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ flume-ng-sql-source ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /root/flume-ng-sql-source-master/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ flume-ng-sql-source ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /root/flume-ng-sql-source-master/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ flume-ng-sql-source ---
[INFO] Surefire report directory: /root/flume-ng-sql-source-master/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.keedio.flume.source.SQLSourceHelperTest
log4j:WARN No appenders could be found for logger (org.keedio.flume.source.SQLSourceHelper).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Tests run: 20, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 0.275 sec <<< FAILURE! - in org.keedio.flume.source.SQLSourceHelperTest
checkStatusFileCorrectlyUpdated(org.keedio.flume.source.SQLSourceHelperTest) Time elapsed: 0.019 sec <<< FAILURE!
java.lang.AssertionError: expected:<10> but was:<0>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
at org.junit.Assert.assertEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:631)
at org.keedio.flume.source.SQLSourceHelperTest.checkStatusFileCorrectlyUpdated(SQLSourceHelperTest.java:170)
getCustomQuery(org.keedio.flume.source.SQLSourceHelperTest) Time elapsed: 0.004 sec <<< ERROR!
org.apache.flume.conf.ConfigurationException: status.column.name property not set
at org.keedio.flume.source.SQLSourceHelper.checkMandatoryProperties(SQLSourceHelper.java:310)
at org.keedio.flume.source.SQLSourceHelper.<init>(SQLSourceHelper.java:97)
at org.keedio.flume.source.SQLSourceHelperTest.getCustomQuery(SQLSourceHelperTest.java:239)
Results :
Failed tests:
SQLSourceHelperTest.checkStatusFileCorrectlyUpdated:170 expected:<10> but was:<0>
Tests in error:
SQLSourceHelperTest.getCustomQuery:239 » Configuration status.column.name prop...
Tests run: 20, Failures: 1, Errors: 1, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.011 s
[INFO] Finished at: 2015-10-12T09:39:35-07:00
[INFO] Final Memory: 20M/168M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project flume-ng-sql-source: There are test failures.
[ERROR]
[ERROR] Please refer to /root/flume-ng-sql-source-master/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
答案 0 :(得分:0)
由于单元测试失败,构建失败。
要跳过这些错误并继续构建,您应该使用skipTests
属性运行Maven:mvn clean package -DskipTests=true
。
如果需要,您还可以在此插件的GitHub page处创建一个问题,以便他们可以修复失败的测试。