gradle 在根项目“www.example”中找不到路径为“”的项目 www.example.com

xiozqbni  于 2023-04-30  发布在  其他
关注(0)|答案(1)|浏览(219)

我在使用这个API时遇到了一些问题。当前项目结构应该是

~gregtech
 -Antimatter
  -tesseract

我不知道为什么它总是找不到它。有人能给我解释一下我做错了什么吗

Build file 'C:\Users\chris\Desktop\Dev\AntimatterAPI\build.gradle' line: 94

A problem occurred evaluating project ':antimatter'.

> Project with path ':tesseract' could not be found in project ':antimatter'.

gregtech build.grad勒

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
    }
}

apply plugin: 'java'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'

version = "${mod_version}"
group = 'muramasa.gti'
archivesBaseName = "${archive_name}"
antimatter_version="0.0.1"

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'

sourceSets {
    main {
        java {
            srcDir 'src/main/java'
        }
        resources {
            include '**/**'
            srcDirs += 'src/generated/resources'
            exclude '.cache'
            exclude 'Thumbs.db'
        }
    }
}

minecraft {
    mappings channel: 'snapshot', version: "${mappings_version}"
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
    runs {
        client {
            workingDirectory project.file('run')
            // Recommended logging data for a userdev environment
            // property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
            property 'forge.logging.markers', 'SCAN,REGISTRIES'
            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
            mods {
                gti {
                    source sourceSets.main
                }
            }
        }
        server {
            workingDirectory project.file('run')
            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
            mods {
                gti {
                    source sourceSets.main
                }
            }
        }
        data {
            workingDirectory project.file('run')
            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
            args '--mod', 'gti', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
            mods {
                gti {
                    source sourceSets.main
                }
            }
        }
    }
}

//Force a dependency on a local version of antimatterAPI.
repositories {
    maven {
        url '../AntimatterAPI/build/libs'
    }
}

repositories {
    maven {
        name "JEI"
        url "http://dvs1.progwml6.com/files/maven"
    }
    maven {
        name "JEI Fallback"
        url "https://modmaven.k-4u.nl"
    }
}

dependencies {
    minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
    compile "muramasa.antimatter:antimatter:${antimatter_version}"
    if (local_dev_dependancies.toBoolean()) {
        compile project(":antimatter")
        compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
        runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
    }
    else {
        compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
        runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
    }
}

jar {
    zip64 true
}

gregtech设置。grad勒

include ":antimatter"
project(":antimatter").projectDir = file("../AntimatterAPI")

反物质建造grad勒

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
    }
}

apply plugin: 'java'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
libsDirName = "libs/muramasa/antimatter/antimatter/${antimatter_version}"

group = 'org.muramasa.gti'
archivesBaseName = 'antimatter'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.

sourceSets {
    main {
        java {
            srcDir 'src/main/java'
        }
        resources {
            include '**/**'
            srcDirs += 'src/generated/resources'
            exclude '.cache'
        }
    }
}

minecraft {
    mappings channel: 'snapshot', version: "${mappings_version}"
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
    runs {
        client {
            workingDirectory project.file('run')
            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
            mods {
                antimatter {
                    source sourceSets.main
                }
            }
        }
        server {
            workingDirectory project.file('run')
            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
            mods {
                antimatter {
                    source sourceSets.main
                }
            }
        }
        data {
            workingDirectory project.file('run')
            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'
            args '--mod', 'antimatter', '--all', '--output', project.file('src/generated/resources/'), '--existing', sourceSets.main.resources.srcDirs[0]
            mods {
                antimatter {
                    source sourceSets.main
                }
            }
        }
    }
}

repositories {
    maven {
        name 'JEI'
        url 'http://dvs1.progwml6.com/files/maven'
    }
    maven {
        name 'JEI Fallback'
        url 'https://modmaven.k-4u.nl'
    }
}

dependencies {
    minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

    compile project(':tesseract')

    compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
    runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
}

def getVersionAppendage() {
    if (System.env.TRAVIS) {
        return System.env.TRAVIS_BUILD_NUMBER
    }

    def proc = 'git rev-parse --short HEAD'.execute()
    proc.waitFor()
    return ''
   // return 'dev-' + proc.exitValue() ? 'unknown' : proc.text.trim()
}

version = antimatter_version// + '.' + getVersionAppendage()

task sourcesJar(type: Jar) {
    classifier 'sources'
    from sourceSets.main.allSource
}

artifacts {
    sourcesJar
}

反物质设置grad勒

rootProject.name = 'antimatter'

include ':tesseract'
project(":tesseract").projectDir = file("../TesseractAPI")

超正方体结构grad勒

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+'
    }
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'java'

group = 'com.tesseract.api' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'tesseract'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.

minecraft {
    // The mappings can be changed at any time, and must be in the following format.
    // snapshot_YYYYMMDD   Snapshot are built nightly.
    // stable_#            Stables are built at the discretion of the MCP team.
    // Use non-default mappings at your own risk. they may not always work.
    // Simply re-run your setup task after changing the mappings to update your workspace.
    mappings channel: 'snapshot', version: "${mappings_version}"
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

    // Default run configurations.
    // These can be tweaked, removed, or duplicated as needed.
    runs {
        client {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            mods {
                tesseract {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            mods {
                tesseract {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            args '--mod', 'tesseract', '--all', '--output', '"' + rootProject.file('src/generated/resources/') + '"',
                    '--existing', '"' + sourceSets.main.resources.srcDirs[0] + '"'

            mods {
                tesseract {
                    source sourceSets.main
                }
            }
        }
    }
}

repositories {
    jcenter()
}

dependencies {
    // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
    // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
    // The userdev artifact is a special name and will get all sorts of transformations applied to it.
    minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
    testImplementation('junit:junit:4.11')

    compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'

    // You may put jars on which you depend on in ./libs or you may define them like so..
    // compile "some.group:artifact:version:classifier"
    // compile "some.group:artifact:version"

    // Real examples
    // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

    // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
    // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // These dependencies get remapped to your current MCP mappings
    // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // For more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

static def getVersionAppendage() {
    if (System.env.TRAVIS) {
        return System.env.TRAVIS_BUILD_NUMBER
    }

    def proc = 'git rev-parse --short HEAD'.execute()
    proc.waitFor()
    return 'dev-' + proc.exitValue() ? 'unknown' : proc.text.trim()
}

version = tesseract_version + '.' + getVersionAppendage()

// Example for how to get properties into the manifest for reading by the runtime..
jar {
    manifest {
        attributes([
                "Specification-Title": "tesseract",
                "Specification-Vendor": "gregtech-intergalactical",
                "Specification-Version": "1", // We are version 1 of ourselves
                "Implementation-Title": project.name,
                "Implementation-Version": "${tesseract_version}",
                "Implementation-Vendor" :"gregtech-intergalactical",
                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

// Deobfuscated jar; development purposes.
task deobfJar(type: Jar, dependsOn: 'jar') {
    from sourceSets.main.output
    classifier "dev"
}

// Sources jar; development purposes.
task sourcesJar(type: Jar) {
    from sourceSets.main.allSource
    classifier "sources"
}

// Maven publishing:
// (includes universal, development, source
publishing {
    publications {
        java(MavenPublication) {
            artifact jar
            artifact deobfJar
            artifact sourcesJar
        }
    }
}

artifacts {
    deobfJar
    sourcesJar
}

Tesseract设置。grad勒

lp0sw83n

lp0sw83n1#

在每个Gradle多项目构建中,将仅评估一个settings.gradle文件。所有相关的项目都需要包含在那个settings.gradle中(通常在根项目的文件夹中)。
在您的情况下,Gradle可能会使用一个settings.gradle文件,其中未引用缺少的项目。
要解决您的问题,请删除除一个settings.gradle文件外的所有文件,并在其中包含所有项目。然后在build.gradle文件的dependencies块中设置项目依赖项。

相关问题