1

I am getting this error when trying to build the spring.io/sagan project on GitHub from wiki steps.

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)

I have tried building through msyGit bash, and through windows CLI without any difference. I have tried running the site. It builds to 93%. I can browse the site but the site looks like plain HTML without CSS or images.

I have been told its an encoding issue but how to fix this? It looks like it expects UTF8 but the encoding is ASCII. Before building I have also tried to change the windows CLI encoding with the following advice:

Unicode characters in Windows command line - how?

But it has not made a difference. I am running windows 8.1

Community
  • 1
  • 1
SebS
  • 571
  • 3
  • 6
  • 16

1 Answers1

0

Not tested, but the problem probably comes from the fact that no encoding has been specified to the compiler for the Java files, and the sagan developers probably use a MacOS or Unix machine, whose default file encoding is UTF8, whereas the default encoding is different on Windows.

I would try adding the following lines to the root build.gradle file, inside the configure(javaProjects) section, after the java plugin has been applied:

configure(javaProjects) {
    apply plugin: 'java'

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

If that solves the problem, you should file a bug report, or even a pull request to the project.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255