Maven 如何使用MVN为用户创建jarhttps://github.com/keedio/flume-ng-sql-source/

Maven 如何使用MVN为用户创建jarhttps://github.com/keedio/flume-ng-sql-source/,maven,flume,Maven,Flume,我尝试从创建jar文件,但一直失败。在我将和cd下载到其中之后,我运行了mvn clean package。它失败,出现以下错误: [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building flume-ng-sql-source 1.3-SNAPSHOT [INFO] ---------

我尝试从创建jar文件,但一直失败。在我将和cd下载到其中之后,我运行了
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
[INFO]正在扫描项目。。。
[信息]
[信息]------------------------------------------------------------------------
[信息]构建flume ng sql源1.3-SNAPSHOT
[信息]------------------------------------------------------------------------
[信息]
[信息]---maven clean插件:2.5:clean(默认清洁)@flume ng sql源---
[信息]
[信息]---maven资源插件:2.6:resources(默认资源)@flume ng sql source---
[警告]使用平台编码(实际上是UTF-8)复制过滤后的资源,即构建依赖于平台!
[信息]跳过不存在的resourceDirectory/root/flume ng sql源主机/src/main/resources
[信息]
[信息]---maven编译器插件:3.1:compile(默认编译)@flume ng sql源---
[信息]检测到更改-重新编译模块!
[警告]未使用平台编码UTF-8设置文件编码,即生成依赖于平台!
[信息]正在将6个源文件编译为/root/flume ng sql源主/目标/类
[警告]/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使用未经检查或不安全的操作。
[警告]/root/flume ng sql源代码主控程序/src/main/java/org/keedio/flume/source/SQLSourceHelper.java:使用-Xlint重新编译:未选中以获取详细信息。
[信息]
[信息]---maven资源插件:2.6:testResources(默认testResources)@flume ng sql源---
[警告]使用平台编码(实际上是UTF-8)复制过滤后的资源,即构建依赖于平台!
[信息]跳过不存在的resourceDirectory/root/flume ng sql源主机/src/test/resources
[信息]
[信息]---maven编译器插件:3.1:testCompile(默认testCompile)@flume ng sql源代码---
[信息]检测到更改-重新编译模块!
[警告]未使用平台编码UTF-8设置文件编码,即生成依赖于平台!
[INFO]正在将1个源文件编译为/root/flume ng sql源主/目标/测试类
[信息]
[信息]---maven surefire插件:2.18.1:test(默认测试)@flume ng sql源---
[信息]Surefire报告目录:/root/flume ng sql源主机/目标/Surefire报告
-------------------------------------------------------
T T S T S
-------------------------------------------------------
运行org.keedio.flume.source.SQLSourceHelperTest
log4j:WARN找不到记录器(org.keedio.flume.source.SQLSourceHelper)的追加器。
log4j:警告请正确初始化log4j系统。
log4j:请参阅http://logging.apache.org/log4j/1.2/faq.html#noconfig 更多信息。

测试运行:20,失败:1,错误:1,跳过:0,运行时间:0.275秒由于单元测试失败,生成失败

要跳过这些错误并继续构建,您应该使用以下属性运行Maven:
mvn clean package-DskipTests=true


如果需要,您还可以在插件的末尾创建一个问题,以便他们可以修复失败的测试。

由于单元测试失败,构建失败

要跳过这些错误并继续构建,您应该使用以下属性运行Maven:
mvn clean package-DskipTests=true

如果您愿意,您还可以在这个插件的最后创建一个问题,以便他们可以修复失败的测试