在Github操作中无法找到或加载主类org.gradle.wrapper.GradleWrapperMain

oknwwptz  于 2022-11-30  发布在  Git
关注(0)|答案(1)|浏览(128)

我有一个简单的github工作流来生成我的文档,它运行gradlew命令,看起来像这样

name: MKDocs
on:
  push:
    branches:
      - master
      - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Set up JDK 17
        uses: actions/setup-java@v2
        with:
          java-version: 17
          distribution: 'adopt'

      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.x

      - name: Install Dependencies
        run: pip install mkdocs-material

      - name: Generate Docs
        run: |
          chmod +x ./docs.sh
          chmod +x ./gradlew
          ./docs.sh

它给我一个错误

git没有忽略我的gradle-wrapper.jar文件
docs.sh文件的内容

#!/bin/bash

# Fail on any error
set -ex

DOCS_ROOT=docs

[ -d $DOCS_ROOT ] && rm -r $DOCS_ROOT
mkdir $DOCS_ROOT

# Clear out the old API docs
[ -d docs/api ] && rm -r docs/api

# Build the docs with dokka
./gradlew dokkaHtml --stacktrace

# Copy README.md to docs
cp README.md ./docs/README.md

# Deploy Docs
mkdocs gh-deploy --force
cu6pst1q

cu6pst1q1#

由于某种原因,我在.gitignore中有/gradle/wrapper,所以./gradlew在CI中不能工作,一旦我添加了缺少的目录,一切就都正常了

相关问题