In my workspace (wsPrivate) I have 3 gradle projects.
- Hangman
- PixelView
- Reports
Projects PixelView and Reports compile fine. However Hangman uses those both projects and some how can't find the packages while compiling.
See the error below (which pop up during compiling Hangman):
D:\_wsGitlab\wsPrivate\Hangman\src\main\java\game\core\Game.java:10: error: package hangman does not exist
import hangman.Messages;
^
D:\_wsGitlab\wsPrivate\Hangman\src\main\java\game\core\Game.java:13: error: package viewer does not exist
import viewer.Box;
^
D:\_wsGitlab\wsPrivate\Hangman\src\main\java\game\core\Game.java:14: error: package viewer.figures.boxes does not exist
import viewer.figures.boxes.Borders;
I've read almost every bit of info I could find about classpaths and how to fix this [in my opinion] "scope-problem" as also I've tried multiple solutions but I think I'm making it worse. The program does work fine without compiling in eclipse, so I assume the code withing is correct.
I'm now like 3 days stuck on this so if anyone could explain to me where I'm driving of the road that would be really nice. If anymore information is wanted: just ask ;)
So this is basically what I have at the moment:
Layout of my packages and added library:
Custom library that I've added to Hangman:
Projects on build path of project Hangman:
Order and export of project Hangman:
Other two projects that are referenced (pixelview / reports):
Last but not least my build.gradle
:
apply plugin: 'application'
mainClassName = "game.core.Game"
repositories {
jcenter()
}
dependencies {
compile 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.google.guava:guava:23.0'
testImplementation 'junit:junit:4.12'
}
jar {
baseName = 'HangmanGame'
version = '2.00.0'
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'game.core.Game'
)
}
}