eureka-examples-Maven Build Failure

164 views
Skip to first unread message

sameek...@gmail.com

unread,
Apr 11, 2017, 7:55:58 AM4/11/17
to eureka_netflix
Hi Team,

I've created a Maven project and added the following eureka-client dependency as mentioned in

https://github.com/Netflix/eureka/wiki/Configuring-Eureka#configuring-eureka-client

<dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-client</artifactId>
<version>1.6.2</version>
</dependency>

To reuse the service registration code, I've copied both ExampleEurekaService and ExampleServiceBase classes from Eureka master branch into my project and changed the necessary package names. But the maven build is failing with following compilation errors:

[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[5,20] package javax.inject does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[6,20] package javax.inject does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[10,26] package com.netflix.config does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[17,2] cannot find symbol
[ERROR] symbol: class Singleton
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[22,19] cannot find symbol
[ERROR] symbol: class DynamicPropertyFactory
[ERROR] location: class com.eureka.registration.ExampleServiceBase
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[27,31] cannot find symbol
[ERROR] symbol: class DynamicPropertyFactory
[ERROR] location: class com.eureka.registration.ExampleServiceBase
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[11,26] package com.netflix.config does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[24,6] cannot find symbol
[ERROR] symbol: class Inject
[ERROR] location: class com.eureka.registration.ExampleServiceBase
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[27,98] cannot access javax.inject.Provider
[ERROR] class file for javax.inject.Provider not found
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[45,9] cannot find symbol
[ERROR] symbol: class DynamicPropertyFactory
[ERROR] location: class com.eureka.registration.ExampleEurekaService
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[45,67] package com.netflix.config does not exist

Is there any other dependency needs to be added other than eureka-client? Or any other version of eureka-client needs to be used. I've used eureka-client version 1.6.2

Regards,
Sameek

sameek...@gmail.com

unread,
Apr 12, 2017, 1:26:18 AM4/12/17
to eureka_netflix, sameek...@gmail.com
Was abe to fix it by adding the missing apis as direct dependency in POM which were earlier a transitive dependency.

tsrm...@gmail.com

unread,
Oct 11, 2017, 7:58:35 AM10/11/17
to eureka_netflix
On Tuesday, April 11, 2017 at 5:25:58 PM UTC+5:30, sameek...@gmail.com wrote:

Hi Sameek,

Can you please share the dependencies you have added to resolve the above errors. Even am facing the same issue.

Regards,
Vidya

Message has been deleted

sameek...@gmail.com

unread,
Oct 12, 2017, 5:19:06 AM10/12/17
to eureka_netflix
Hi Vidya,

It's 6 month old thread but whatever I can recall you can try by adding the following dependencies in your pom. There are other dependencies as well in my pom, but I feel the following should fix the issue. If no, pls let me know, will give the other dependencies from my pom based on the new maven errors that comes up.

<dependency>
<groupId>com.netflix.archaius</groupId>
<artifactId>archaius-core</artifactId>
<version>0.7.3</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>

Regards,
Sameek

Reply all
Reply to author
Forward
0 new messages