Ошибка при развертывании на heroku: недопустимый символ: '\ ufeff' - PullRequest
1 голос
/ 05 мая 2020

Все. Я тестирую, было бы полезно разрабатывать веб-приложение на Heroku. Итак, я пытаюсь следовать руководству «Развертывание загрузочных приложений Spring на Heroku» (ссылка: https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku). Я могу следовать руководству, чтобы проверить страницу, возвращающую hello world, но я м возникла проблема с подключением postgresql. Когда я пытаюсь развернуть файл DatabaseConfig. java в git, происходит сбой следующего входа в vscode. Как я могу это решить?

$ git push heroku master
Enumerating objects: 24, done.
Counting objects: 100% (24/24), done.   
Delta compression using up to 12 threads
Compressing objects: 100% (12/12), done.
Writing objects: 100% (15/15), 1.36 KiB | 463.00 KiB/s, done.
Total 15 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Java app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Executing Maven
remote:        $ ./mvnw -DskipTests clean dependency:list install
remote:        [INFO] Scanning for projects...
remote:        [INFO]
remote:        [INFO] -------------------------< com.daview:daview >--------------------------
remote:        [INFO] Building demo 0.0.1-SNAPSHOT
remote:        [INFO] --------------------------------[ jar ]---------------------------------
remote:        [INFO] 
remote:        [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ daview ---
remote:        [INFO] 
remote:        [INFO] --- maven-dependency-plugin:3.1.2:list (default-cli) @ daview ---
remote:        [INFO] 
remote:        [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ daview ---
remote:        [INFO] Using 'UTF-8' encoding to copy filtered resources.
remote:        [INFO] Copying 1 resource
remote:        [INFO] Copying 0 resource
remote:        [INFO]
remote:        [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ daview ---
remote:        [INFO] Changes detected - recompiling the module!
remote:        [INFO] Compiling 2 source files to /tmp/build_d5a7a4a08b5f6a2624f3313e54f0a54a/target/classes
remote:        [INFO] -------------------------------------------------------------
remote:        [ERROR] COMPILATION ERROR :
remote:        [INFO] -------------------------------------------------------------
remote:        [ERROR] /tmp/build_d5a7a4a08b5f6a2624f3313e54f0a54a/src/main/java/com/daview/daview/DatabaseConfig.java:[1,1] illegal character: '\ufeff'
remote:        [ERROR] /tmp/build_d5a7a4a08b5f6a2624f3313e54f0a54a/src/main/java/com/daview/daview/DatabaseConfig.java:[1,10] class, interface, or enum expected
remote:        [INFO] 2 errors
remote:        [INFO] -------------------------------------------------------------
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] BUILD FAILURE
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] Total time:  4.196 s
remote:        [INFO] Finished at: 2020-05-05T17:33:46Z
remote:        [INFO] ------------------------------------------------------------------------
remote:        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project daview: Compilation failure: Compilation failure:
remote:        [ERROR] /tmp/build_d5a7a4a08b5f6a2624f3313e54f0a54a/src/main/java/com/daview/daview/DatabaseConfig.java:[1,1] illegal character: '\ufeff'
remote:        [ERROR] /tmp/build_d5a7a4a08b5f6a2624f3313e54f0a54a/src/main/java/com/daview/daview/DatabaseConfig.java:[1,10] class, interface, or enum expected
remote:        [ERROR] -> [Help 1]
remote:        [ERROR]
remote:        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote:        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote:        [ERROR]
remote:        [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote:        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
remote:
remote:  !     ERROR: Failed to build app with Maven
remote:        We're sorry this build is failing! If you can't find the issue in application code,
remote:        please submit a ticket so we can help: https://help.heroku.com/
remote:
remote:  !     Push rejected, failed to compile Java app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to daview.
remote:
To https://git.heroku.com/daview.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/daview.git'

1 Ответ

0 голосов
/ 06 мая 2020

Я нашел решение! Это проблема с кодировкой! Я могу найти символ '\ ufeff', изменив тип кодировки, например EU C -KR, а не UTF. Так что я исправил код правильно и сохранил обратно в utf-8. enter image description here

...