0

Using Eclipse STS 4.10 / linux .

I have a multimodule project like :

-rootFolder
-web (web app)
-dataservice (services, domain logic)
-datadef (model,repositories)

web has dataservice as a dependency build.gradle shows:

dependencies {
    compile project(':dataservice')
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
///
}

dataservice has datadef as a dependency build.gradle shows:

dependencies {
    compile project(':datadef')
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
///
}

What I cannot achieve is datadef-1.0.0-SNAPSHOT.jar being included in dataservice-1.0.0-SNAPSHOT.jar file . Both are getting included in web.app though. Sometimes eclipse "looses" reference on dataservice the datadef project and treat anything from datadef as an error.

Pasting dataservice project .classpath file. It shows the dependency on datadef.

<classpath>
    <classpathentry kind="output" path="bin/default"/>
    <classpathentry output="bin/main" kind="src" path="src/main/java">
        <attributes>
            <attribute name="gradle_scope" value="main"/>
            <attribute name="gradle_used_by_scope" value="main,test"/>
        </attributes>
    </classpathentry>
    <classpathentry output="bin/main" kind="src" path="src/main/resources">
        <attributes>
            <attribute name="gradle_scope" value="main"/>
            <attribute name="gradle_used_by_scope" value="main,test"/>
        </attributes>
    </classpathentry>
    <classpathentry output="bin/test" kind="src" path="src/test/java">
        <attributes>
            <attribute name="gradle_scope" value="test"/>
            <attribute name="gradle_used_by_scope" value="test"/>
            <attribute name="test" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
    <classpathentry kind="src" path="/datadef">
...```


Thank you.
fwdMonkee
  • 1
  • 1
  • 1
    Welcome to Stackoverflow! To help us answering your question, you may add what you tried to include `datadef-1.0.0-SNAPSHOT.jar` in the `dataservice-1.0.0-SNAPSHOT.jar` file. Also, under which circumstances "looses" Eclipse the project references? – thokuest May 04 '21 at 09:51
  • I have trouble testing (junit) dataservice app, because it cannot find datadef-1.0.0-SNAPSHOT.jar .I get always a NPE. – fwdMonkee May 04 '21 at 17:16
  • I have trouble testing (junit) dataservice app, because it cannot find datadef-1.0.0-SNAPSHOT.jar on the classpath..I get always a NPE. Beside that, sometimes it fails to recognize data types imported from datadef. It happens from time to time, even when update manually dependencies, which datadef is one of them. Note that on the Java Build Path/Libraries dataservice project, datadef is on the ClassPath. Without that project I cannot complie dataservice . I guess my problem is abtour configuration, but this is my first mulltimodel project. – fwdMonkee May 04 '21 at 17:37

0 Answers0