java - 尝试创建 jar 文件但出现一些错误

标签 java maven heroku jar spring-boot

我下载了this repository from GitHub ,并进行一些更改。现在我想将其部署在 Heroku 上。但是当我尝试制作 jar 文件时,出现了一些错误。也许有人知道问题是什么以及如何解决它?

    [INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building java-blog-aggregator-boot 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jba ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 76 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jba ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jba ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ jba ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ jba ---
[INFO] Surefire report directory: C:\Users\Username\Desktop\java-blog-aggregator-boot-master\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running cz.jiripinkas.jba.service.AllTests
16:18:13,179 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
16:18:13,179 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
16:18:13,179 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/C:/Users/Username/Desktop/java-blog-aggregator-boot-master/target/classes/logback.xml]
16:18:13,331 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
16:18:13,353 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
16:18:13,397 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
16:18:13,602 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
16:18:13,602 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
16:18:13,602 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
16:18:13,603 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
16:18:13,607 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
16:18:13,660 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used
16:18:13,663 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern debug.%d{yyyy-MM-dd}.%i.log for the active file
16:18:13,670 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@4d3167f4 - The date pattern is 'yyyy-MM-dd' from file name pattern 'debug.%d{yyyy-MM-dd}.%i.log'.
16:18:13,670 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@4d3167f4 - Roll-over at midnight.
16:18:13,820 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@4d3167f4 - Setting initial period to Thu Jun 02 16:17:02 EEST 2016
16:18:13,825 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: debug.log
16:18:13,825 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [debug.log]
16:18:13,827 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
16:18:13,827 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
16:18:13,828 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
16:18:13,828 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
16:18:13,829 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@ed9d034 - Registering current configuration as safe fallback point

Tests run: 21, Failures: 5, Errors: 0, Skipped: 0, Time elapsed: 4.003 sec <<< FAILURE! - in cz.jiripinkas.jba.service.AllTests
testGetItemsFileJavaVids(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.189 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<23 03 2014 [09]:01:34> but was:<23 03 2014 [10]:01:34>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileJavaVids(RssServiceTest.java:59)

testGetItemsFileHibernate(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.392 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<04 04 2014 1[7]:20:32> but was:<04 04 2014 1[8]:20:32>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileHibernate(RssServiceTest.java:84)

testGetItemsFileSpring(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.475 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<07 04 2014 1[0]:14:00> but was:<07 04 2014 1[1]:14:00>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileSpring(RssServiceTest.java:70)

testGetRssDate(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.002 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<Sun Mar 23 [09:01:34 C]ET 2014> but was:<Sun Mar 23 [10:01:34 E]ET 2014>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetRssDate(RssServiceTest.java:120)

testGetItemsFileInstanceofJavaPublishedDate(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 1.005 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<22 02 2015 1[3]:35:00> but was:<22 02 2015 1[4]:35:00>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileInstanceofJavaPublishedDate(RssServiceTest.java:184)

Running cz.jiripinkas.jba.service.BlogServiceTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in cz.jiripinkas.jba.service.BlogServiceTest
Running cz.jiripinkas.jba.service.ItemServiceTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in cz.jiripinkas.jba.service.ItemServiceTest
Running cz.jiripinkas.jba.service.RssServiceTest
Tests run: 18, Failures: 5, Errors: 0, Skipped: 0, Time elapsed: 0.979 sec <<< FAILURE! - in cz.jiripinkas.jba.service.RssServiceTest
testGetItemsFileJavaVids(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.001 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<23 03 2014 [09]:01:34> but was:<23 03 2014 [10]:01:34>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileJavaVids(RssServiceTest.java:59)

testGetItemsFileHibernate(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.108 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<04 04 2014 1[7]:20:32> but was:<04 04 2014 1[8]:20:32>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileHibernate(RssServiceTest.java:84)

testGetItemsFileSpring(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.249 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<07 04 2014 1[0]:14:00> but was:<07 04 2014 1[1]:14:00>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileSpring(RssServiceTest.java:70)

testGetRssDate(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.001 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<Sun Mar 23 [09:01:34 C]ET 2014> but was:<Sun Mar 23 [10:01:34 E]ET 2014>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetRssDate(RssServiceTest.java:120)

testGetItemsFileInstanceofJavaPublishedDate(cz.jiripinkas.jba.service.RssServiceTest)  Time elapsed: 0.443 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<22 02 2015 1[3]:35:00> but was:<22 02 2015 1[4]:35:00>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileInstanceofJavaPublishedDate(RssServiceTest.java:184)

Running cz.jiripinkas.jba.service.scheduled.ScheduledTasksServiceTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.141 sec - in cz.jiripinkas.jba.service.scheduled.ScheduledTasksServiceTest

Results :

Failed tests: 
cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileHibernate(cz.jiripinkas.jba.service.RssServiceTest)
  Run 1: RssServiceTest.testGetItemsFileHibernate:84 expected:<04 04 2014 1[7]:20:32> but was:<04 04 2014 1[8]:20:32>
  Run 2: RssServiceTest.testGetItemsFileHibernate:84 expected:<04 04 2014 1[7]:20:32> but was:<04 04 2014 1[8]:20:32>

cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileInstanceofJavaPublishedDate(cz.jiripinkas.jba.service.RssServiceTest)
  Run 1: RssServiceTest.testGetItemsFileInstanceofJavaPublishedDate:184 expected:<22 02 2015 1[3]:35:00> but was:<22 02 2015 1[4]:35:00>
  Run 2: RssServiceTest.testGetItemsFileInstanceofJavaPublishedDate:184 expected:<22 02 2015 1[3]:35:00> but was:<22 02 2015 1[4]:35:00>

cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileJavaVids(cz.jiripinkas.jba.service.RssServiceTest)
  Run 1: RssServiceTest.testGetItemsFileJavaVids:59 expected:<23 03 2014 [09]:01:34> but was:<23 03 2014 [10]:01:34>
  Run 2: RssServiceTest.testGetItemsFileJavaVids:59 expected:<23 03 2014 [09]:01:34> but was:<23 03 2014 [10]:01:34>

cz.jiripinkas.jba.service.RssServiceTest.testGetItemsFileSpring(cz.jiripinkas.jba.service.RssServiceTest)
  Run 1: RssServiceTest.testGetItemsFileSpring:70 expected:<07 04 2014 1[0]:14:00> but was:<07 04 2014 1[1]:14:00>
  Run 2: RssServiceTest.testGetItemsFileSpring:70 expected:<07 04 2014 1[0]:14:00> but was:<07 04 2014 1[1]:14:00>

cz.jiripinkas.jba.service.RssServiceTest.testGetRssDate(cz.jiripinkas.jba.service.RssServiceTest)
  Run 1: RssServiceTest.testGetRssDate:120 expected:<Sun Mar 23 [09:01:34 C]ET 2014> but was:<Sun Mar 23 [10:01:34 E]ET 2014>
  Run 2: RssServiceTest.testGetRssDate:120 expected:<Sun Mar 23 [09:01:34 C]ET 2014> but was:<Sun Mar 23 [10:01:34 E]ET 2014>


Tests run: 41, Failures: 5, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.344 s
[INFO] Finished at: 2016-06-02T16:18:18+03:00
[INFO] Final Memory: 21M/268M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jba: There are test failures.
[ERROR] 
[ERROR] Please refer to C:\Users\Username\Desktop\java-blog-aggregator-boot-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

最佳答案

看起来你的单元测试失败了,这将导致 Maven 构建失败。您可以在运行 Maven 构建时跳过测试,或者做正确的事情并修复单元测试。他们似乎因为某个日期而失败了?

关于java - 尝试创建 jar 文件但出现一些错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37593324/

相关文章:

java - 为什么不解决其他模块的 mysql 依赖关系

将 Django 项目部署到 Heroku 时,python manage.py collectstatic --noinput 错误

node.js - Heroku 上的 Socket.io "Session ID unknown"错误

javascript - Java Spring Boot - 当服务器说时启用按钮

java - Maven依赖插件不重建依赖

java - 字符串到字节

java - testng-failed.xml 正在重新运行所有测试,而不仅仅是失败的测试

python - 将预先存在的 django git 存储库部署到 heroku

java - 查找 SIM 卡运营商

java - 如何在JPA Criteria中做到这一点?