spring-cloud-netflix: Cannot enable eureka client? - java

Hey I was working on a project where I was trying to register eureka client on server, I got the server enabled easily but somehow cannot get the client to enable I added all the dependencies needed also. I will also include my pom.xml file here
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.mslab</groupId>
<artifactId>movie_service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>movie_service</name>
<description>Movie Service </description>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2022.0.0-RC2</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${project.parent.version}</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>netflix-candidates</id>
<name>Netflix Candidates</name>
<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
I have used most of the techniques that were available on some previous similar questions but I cannot resolve this issue.

You dont need to add the annotation to make the service a eureka client.
#EnableEurekaClient annotation is not available in the following spring cloud version
<spring-cloud.version>2022.0.0-RC2</spring-cloud.version>
if you really want to add annotation, you can use #EnableDiscoveryClient

Eureka version 4.0.0 onwards, which is being used in Spring Cloud 2022.0.0, you do not need to explicitly register using the annotation #EnableEurekaClient It automatically gets registered as client if spring-cloud-starter-netflix-eureka-client is on the class path.
As per the -
documentation
By having spring-cloud-starter-netflix-eureka-client on the classpath,
your application automatically registers with the Eureka Server.
Configuration is required to locate the Eureka server

Related

The eureka server interface is not displayed correctly on the external tomcat server

I tried to deploy my Eureka Server on Tomcat v10.1.5, but the interface is not showed properly (wro.css and wro.js not found)
POM.XML
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com</groupId>
<artifactId>discoveryserver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>discoveryserver</name>
<packaging>war</packaging>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2022.0.0</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>netflix-candidates</id>
<name>Netflix Candidates</name>
<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
It worked properly with Tomcat v9.0, Spring 2.4.1 and Java 1.8, but I need to deploy it on Tomcat v10.1.5 and use Java 17
Has anyone else encountered this problem?

While running spring-cloud microservices project, the server is not starting up?

In my project, we are using latest version of
Spring-cloud-loadbalancer, spring-cloud gateway and Resilience4j.
JDK version 1.8
IDE - Eclipse Oxygen .2
While running the SpringBootApplication, I'm getting below error -
> Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/C:/Users/VaibhavAtray/.m2/repository/org/springframework/boot/spring-boot-actuator/2.1.4.RELEASE/spring-boot-actuator-2.1.4.RELEASE.jar
at org.springframework.boot.devtools.restart.ChangeableUrls.getUrlsFromClassPathOfJarManifestIfPossible(ChangeableUrls.java:132)
at org.springframework.boot.devtools.restart.ChangeableUrls.fromClassLoader(ChangeableUrls.java:98)
at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:92)
Pom.xml looks like this -
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.project.microservice</groupId>
<artifactId>limits-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>limits-service</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>2020.0.3-SNAPSHOT</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
Everything looks good, but still the application is not running...
You need at least 2.4.X Spring boot since Spring Cloud 2020.0.X requires at least this much version to work.
Hope this will work.

gRPC java spring server "error": "2 UNKNOWN: Stream removed"

I've created a simple test gRPC server(Java, Spring) to test the technology.
When trying to call a function from the server I am getting an error
{
"error": "2 UNKNOWN: Stream removed"
}
image of error from blumRpc
Inside the application, no stack trace is printed, I can't catch the program execution using breakpoint invisible for me code
syntax = "proto3";
package com.example.grpc;
message LoginRequest{
string login =1;
string password =2;
}
message LoginResponse{
string token = 1;
}
service LoginService{
rpc login(LoginRequest) returns (LoginResponse);
}
Here is my proto file
My pom XML
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.exampledriven</groupId>
<artifactId>spring-boot-grpc-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-boot-grpc-server</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.lognet</groupId>
<artifactId>grpc-spring-boot-starter</artifactId>
<version>0.0.6</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!--Details here : https://github.com/grpc/grpc-java-->
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.4.1.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<!--
The version of protoc must match protobuf-java. If you don't depend on
protobuf-java directly, you will be transitively depending on the
protobuf-java version that grpc depends on.
-->
<protocArtifact>com.google.protobuf:protoc:3.0.2:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.0.1:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-lognet-maven</id>
<name>bintray</name>
<url>http://dl.bintray.com/lognet/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-lognet-maven</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/lognet/maven</url>
</pluginRepository>
</pluginRepositories>
</project>
My gRPC service
#GRpcService
public class LoginServiceImpl extends LoginServiceGrpc.LoginServiceImplBase {
#Override
public void login(com.example.grpc.LoginServiceOuterClass.LoginRequest loginRequest,
StreamObserver<LoginServiceOuterClass.LoginResponse> responseObserver){
com.example.grpc.LoginServiceOuterClass.LoginResponse response = com.example.grpc.LoginServiceOuterClass.LoginResponse
.newBuilder().setToken(UUID.randomUUID().toString()).build();
responseObserver.onNext(response);
}
}
All gRPC classes were successfully generated
project structure
What can cause the problem? please help
Link to the project on GitHub for better analysis: https://github.com/Aretomko/SmartNews-project/tree/main/SmartNewsSever
Thank you in advance for your help))
I can't explain the real root of the problem but the thing that helped me is providing different ports for the server and gRPC, hope it will help someone
## Server Properties
server:
port: 6789
compression.enabled: true
max-http-header-size: 20000
grpc:
port: 6790

java.lang.ClassNotFoundException: com.netflix.discovery.EurekaClientConfig

I'm using Spring Cloud Eureka and creating the project using Spring Initializr (http://start.spring.io/). The generated POM user Eureka Finchley.RC2 with Spring Boot 2.0.2.RELEASE. When I add the annotation #EnableEurekaServer in the main class, the one annotated with #SpringBootApplication also, and I start the server with following command:
mvn spring-boot:run
I receive the exception
java.lang.ClassNotFoundException: com.netflix.discovery.EurekaClientConfig
the following is the pom.xml generated by the Initializr:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it.javaboss</groupId>
<artifactId>api-gateway</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>api-gateway</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RC2</spring-cloud.version>
</properties>
<dependencies>
<!-- <dependency> -->
<!-- <groupId>org.springframework.cloud</groupId> -->
<!-- <artifactId>spring-cloud-starter-config</artifactId> -->
<!-- </dependency> -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
I found the eureka-clien-1.9.2.jar in my local maven repository is ZERO length file, so I deleted it and re-download the dependency, all is ok!
hope to help someone - i had same issue java.lang.NoClassDefFoundError:com/netflix/discovery/converters/XmlXStream when launch eureka server, version i used springboot 2.0.3.RELEASE and spring-cloud.version Finchley.RELEASE. i resolved it by rename my local maven repo user-folder.m2\repository, fresh load a new local maven repo.
Try to use below dependencies in your pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<finalName>eureka-server</finalName>
</build>
As 'rosa lu' said, when launch eureka server I have the similar issue as below:
java.lang.NoClassDefFoundError:com/netflix/discovery/converters/XmlXStream
SpringBoot=2.0.5.RELEASE
SpringCloud.version=Finchley.SR1
As 'rosa lu' said, I change my local maven repository to a new path, and rebuild my project, then solve the problem
I hope my answer can help anyone who has the same issue .
Make sure that
You should select only Eureka Server using spring Initializr
while creating eureka server project.
Have these properties (in application.properties)
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
These will disable the client aspect the the eureka server.
You might be having com.netflix.discovery.EurekaClientConfig imported somewhere in your project. So organize your imports once.
I finally solved the propblem in two different solution:
1.adding two more dependencies:
<dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3.5</version>
</dependency>
2.renaming application.yml in bootstrap.yml and disabling autoregistration:
eureka:
client:
registerWithEureka: false
fetchRegistry: false
but in this second way I still need to add the dependency to jettison:
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3.5</version>
</dependency>

How to import the Confluence API with Maven?

I need to work with the Confluence API.
I work with Maven POM but I don't find how to insert the dependencies for the Confluence API.
Can you help me?
What I've already tried:
I need to work with the SpaceManager primaly.
I found this tutorial about managing the pom. So after the tutorial, my pom looks like the following:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>***.createspace</groupId>
<artifactId>CreateSpace</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CreateSpace</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-confluence-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<productVersion>${product.version}</productVersion>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence</artifactId>
<version>${confluence.version}</version>
<scope>provided</scope> <!-- important! -->
</dependency>
</dependencies>
</project>
The *** in the groupId is just to hide my package name of my company.
But also with this pom, I get the error The import com.atlassian cannot be resolved with this import:
import com.atlassian.confluence.spaces.SpaceManager;
So can you help me? Or please tell me what I should add to avoid downvotes, then I hope you see I really searched in the net and need help!
There are instructions how to work with atlassian maven repo Atlassian Maven Repositories and the repo URL is provided: https://maven.atlassian.com/repository/public
<!-- language: xml -->
<repository>
<id>atlassian-public</id>
<url>https://maven.atlassian.com/repository/public</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
If you're trying to add a plugin for confluence WIKI you'll probably need a dependency to:
<!-- language: xml -->
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence</artifactId>
( only once you add the atlassian maven repo to your pom.xml ) so full pom.xml will look like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.vilutis.lt</groupId>
<artifactId>confluence-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>confluence-plugin</name>
<repositories>
<repository>
<id>atlassian-public</id>
<url>https://maven.atlassian.com/repository/public</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
</repositories>
<!-- I had to add this section because activation-1.0.2.jar does not exist in public maven repo -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence</artifactId>
<version>5.2</version>
</dependency>
</dependencies>
</project>
This config works fine with version 5.2 and the SpaceManager class is accessible in your java code.
I'm not sure with Confluence API implementation you're using. You could try this:
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>confluence-api</artifactId>
<version>1.0</version>
</dependency>
If you're using an implementation that doesn't support maven builds, then you'll have to add the transitive dependencies yourself.
In this case confluent.version is 3.0.0
<dependency>
<groupId>io.confluent</groupId>
<artifactId>common-config</artifactId>
<version>${confluent.version}</version>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>common-utils</artifactId>
<version>${confluent.version}</version>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-schema-registry-client</artifactId>
<version>${confluent.version}</version>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
<version>${confluent.version}</version>
</dependency>

Categories

Resources