我的设置可以运行至少几年,没有任何问题。在我的最新更新中,突然出现以下错误:
#!/bin/bash -eo pipefail
./grailsw compile
You must be connected to the internet the first time you use the Grails wrapper
org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1473)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1749)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at grails.init.Start.getVersion(Start.java:36)
at grails.init.Start.main(Start.java:83)
Exited with code exit status 1
CircleCI received exit code 1
基本上,对于任何
grailsw
命令,我都会遇到相同的错误。
这是我的配置文件:
version: 2.0
references:
defaults: &defaults
docker:
- image: circleci/openjdk:8-jdk
working_directory: ~/priz-be
remote_docker: &remote_docker
setup_remote_docker:
docker_layer_caching: false
assemble_prod: &assemble_prod
run:
name: Assemble
command: ./gradlew -Dgrails.env=prod assemble
build_and_push_docker_image: &build_and_push_docker_image
run:
name: Build docker image
command: |
sudo apt-get update --fix-missing
sudo apt-get install python-pip python-dev
sudo pip install awscli
cp -p build/libs/priz-be-0.1.war docker/app.war
aws ecr get-login --no-include-email --region us-west-2 | sh
docker build -t priz-be docker
docker tag priz-be:latest 922556357703.dkr.ecr.us-west-2.amazonaws.com/priz-be:prod-$CIRCLE_SHA1
docker push 922556357703.dkr.ecr.us-west-2.amazonaws.com/priz-be:prod-$CIRCLE_SHA1
jobs:
checkout_code:
<<: *defaults
steps:
- checkout
- run:
name: Show current branch
command: echo ${CIRCLE_BRANCH}
- save_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/priz-be
compile:
<<: *defaults
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Compile the project
command: ./grailsw compile
# Cache local dependencies if they don't exist
- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}
test_and_check:
<<: *defaults
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Testing
command: ./grailsw test-app
- run:
name: Executing stylecheck
command: ./gradlew check
- store_artifacts:
path: ./build/reports/codenarc
destination: codenarc-report
- store_test_results:
path: ./build/test-results/test
- store_artifacts:
path: ./build/reports/tests
destination: test-report
deploy_to_prod:
<<: *defaults
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- *assemble_prod
- *remote_docker
- *build_and_push_docker_image
- add_ssh_keys:
fingerprints:
- "9c:0c:ce:67:62:74:f1:d7:aa:b4:46:55:56:51:e5:f7"
- run:
name: Deploy
command: |
sudo apt-get update
sudo apt-get -y install gettext-base
sudo apt-get clean
envsubst < docker/deploy-prod.sh.template > docker/deploy-prod.sh
ssh -v -o StrictHostKeyChecking=no [email protected] "bash -s" -- < ./docker/deploy-prod.sh
workflows:
version: 2
build-and-test:
jobs:
- checkout_code
- compile:
requires:
- checkout_code
- test_and_check:
requires:
- compile
- deploy_to_prod:
requires:
- test_and_check
filters:
branches:
only: master
如果我使用 SSH 登录,并尝试手动执行相同的操作,我会收到相同的错误。另外,检查是否有网络连接。一切都好...
此错误的原因可能是什么?
这是由 Artifactory 实例的问题引起的。更多信息请访问 github.com/grails/grails-wrapper/issues/7 和 github.com/grails/grails-core/issues/11825。
访问以下链接并更新 grails-wrapper.jar 文件:https://grails.org/blog/2021-06-10-grails-wrapper-update.html
Grails 存储库已移至工件实例并且路径已更改。 您可能需要在 build.gradle 中更新您的 Maven 存储库 url:
# Old repository url
maven { url "https://repo.grails.org/grails/core" }
# New url
maven { url "https://repo.grails.org/artifactory/core/" }
我发现的有关此更改的唯一官方信息是有关 Grails 和 Bintray 的重要信息。
您可以在此处找到所有可用的存储库。 (如果您需要插件存储库或其他任何东西。)
我希望能解决您的问题。
问候