redhat-developer / redhat-developer/vscode-java

Project 'myproject' is missing required Java project: 'somelib'

Open
#1,191 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Gradle
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

I am using the vsocde-java extension with a gradle java project.

Receiving error "Project 'java_server' is missing required Java project: 'chesslib'

  • Operating System: Linux Mint 19.2
  • JDK version: OpenJDK 1.8
    Version: 1.40.2

Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
Date: 2019-11-25T14:54:40.719Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 4.15.0-72-generic

My gradle configuration builds and runs fine, but the plugin complains still.

My build.gradle is as follows....

apply plugin: 'java'

// Use maven repository
repositories {
    mavenCentral()
    google()
}

dependencies {
    implementation 'org.eclipse.jetty:jetty-servlet:9.4.19.v20190610'
    implementation 'org.eclipse.jetty:jetty-client:9.4.19.v20190610'
    implementation 'mysql:mysql-connector-java:8.0.16'
    implementation 'org.apache.commons:commons-dbcp2:2.7.0'
    implementation 'org.jdbi:jdbi3-core:3.10.1'
    implementation 'com.google.firebase:firebase-admin:6.11.0'
    compile 'com.google.apis:google-api-services-oauth2:v1-rev155-1.25.0'
    // implementation 'com.google.gms:google-services:4.3.3'

    compile project('chesslib')
    runtime files('../../chesslib/build/libs/chesslib-1.1.12.jar')
}

task runServer(type: JavaExec) {
   classpath = sourceSets.main.runtimeClasspath 
   main = 'ChessServer'
} 

task runClient(type: JavaExec) {
   classpath = sourceSets.main.runtimeClasspath 
   main = 'ChessClient'
   standardInput = System.in // without this, using Scanner on System.in won't work
}

task runCLITestApp(type: JavaExec) {
   classpath = sourceSets.main.runtimeClasspath 
   main = 'CLITestApp'
   standardInput = System.in
}

My settings.gradle is as follows...

include   ':chesslib'
project(':chesslib').projectDir = new File(settingsDir, '../../chesslib')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report with the provided build.gradle and settings.gradle, including the external chesslib project path. Then inspect how the extension imports Gradle project dependencies and handles compile project('chesslib'); the issue is done when the configured project is resolved without the missing-required-project error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.