-1

i have a maven project and further two others projects from colleagues for common libaries. That's why i want to inlude these both projects into mine as dependencies.

In my pom.xml i have this:

<dependency>
    <groupId>com.xxx.xxx.Tooling</groupId>
    <artifactId>KLUCommon</artifactId>
    <version>0.0.10-SNAPSHOT</version>
</dependency>
<dependency>
    <groupId>com.xxx.xxx.ldap</groupId>
    <artifactId>KLULdapAdapter</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>

I build my maven project, but i always get the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project XXXXX: Compilation failure
[ERROR] /C:/Users/XXXX/Documents/workspace/XXXXX/src/main/java/com/xxx/xxx/ldap/Application.java:[19,38] cannot find symbol
[ERROR] symbol:   class ManagerDefs
[ERROR] location: package com.xxx.Tooling.common.model
[ERROR] -> [Help 1]

What causes could that be? Because in my own project he recognize the project, but the build is not working.

InfoEngi
  • 303
  • 1
  • 10
  • 23

2 Answers2

1

Dependecy tag in the pom.xml file just says, which projects are also required for the build specific application (let me say parent project). Basically it is just checker to be sure if that projects are also included- dependency artifacts can be downloaded eg. from maven repository, in fact, they have to be present in your local repository for the parent project build phase.

So- in the case of your own dependent projects, you have to build these projects manually first, artifacts will be available from your local repository and parent project will be built successfully.

Please notice that dependencies are not going to build when you initiate parent project build.

Simply:

  • run mvn clean install on KLUCommon
  • run mvn clean install on KLULdapAdapter
  • run mvn clean install on parent project

Update! I know it is also to possible make "one command build", but I cannot remember how it was, it is some thing about maven modules- please, follow maven doc and this thread(#27689425) or maybe there(#38882221)

xxxvodnikxxx
  • 1,270
  • 2
  • 18
  • 37
0

It's simply saying that it is not able to find your Application.java for the ldap.jar. So please make sure you have these two project build first in your same workspace in eclipse or netbeans using clean install maven commands and then finally building your project in which you want to include these. And also make sure that you really have Application.java file in the mentioned projects.

Harshit Gupta
  • 106
  • 4
  • 16