【问题标题】:What is causing spring.io/sagan build to fail?是什么导致 spring.io/sagan 构建失败?
【发布时间】:2014-08-01 09:30:06
【问题描述】:

我在尝试通过 wiki 步骤在 GitHub 上构建 spring.io/sagan 项目时遇到此错误。

java.lang.AssertionError: 
Expected: "Spring Tool Suiteâ„¢ Downloads"
but: was "Spring Tool Suite™ Downloads"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
at sagan.tools.support.ToolsPagesTests.showsAllStsGaDownloads(ToolsPagesTests.java:59)

我尝试通过 msyGit bash 和 windows CLI 构建,没有任何区别。 我已经尝试运行该站点。它建立到 93%。我可以浏览该网站,但该网站看起来像没有 CSS 或图像的纯 HTML。

我被告知这是一个编码问题,但如何解决这个问题? 看起来它需要 UTF8,但编码是 ASCII。 在构建之前,我还尝试使用以下建议更改 Windows CLI 编码:

Unicode characters in Windows command line - how?

但这并没有什么不同。我正在运行 Windows 8.1

【问题讨论】:

    标签: spring build spring-boot


    【解决方案1】:

    未测试,但问题可能出在没有为 Java 文件的编译器指定编码,并且 sagan 开发人员可能使用 MacOS 或 Unix 机器,其默认文件编码为 UTF8,而默认Windows 上的编码不同。

    在应用了 java 插件之后,我会尝试将以下行添加到根 build.gradle 文件的 configure(javaProjects) 部分中:

    configure(javaProjects) {
        apply plugin: 'java'
    
        // configure encoding to UTF8:
        tasks.withType(Compile) {
            options.encoding = 'UTF-8'
        }
    

    如果这样可以解决问题,您应该提交错误报告,甚至向项目提交拉取请求。

    【讨论】:

      猜你喜欢
      • 2011-04-04
      • 2019-09-21
      • 1970-01-01
      • 2016-03-16
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      • 2015-09-05
      • 1970-01-01
      相关资源
      最近更新 更多