Alfresco/alfresco-java-sdk

[BUG] ALFRESCO SDK 5.2.0 bug with dependency - compilation error

Opened this issue · 0 comments

Hi All,

following the Alfresco official documentation for SDK 5.2.0 (link) I added the alfresco-java-sdk parent pom with both the dependencies for event-api and rest-api.

Strictly following the documentation you get compilation error for:

Missing artifact org.alfresco:alfresco-java-rest-api-common:jar:0.0.1-SNAPSHOT

It's worth noting that it looks for version 0.0.1-SNAPSHOT and if you modify your project.version also this one changes. A quick look to alfesco-java-sdk pom reveals that there is this dependency inside:

<dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-java-rest-api-common</artifactId>
        <version>${project.version}</version>
</dependency>

that, I guess, causes the issue.

I solved it by excluding this dependency from the rest-api one and adding it manually in my pom:

<dependency>
	<groupId>org.alfresco</groupId>
	<artifactId>alfresco-java-rest-api-common</artifactId>
	<version>5.2.0</version>
</dependency>

<dependency>
	<groupId>org.alfresco</groupId>
	<artifactId>alfresco-acs-java-rest-api-spring-boot-starter</artifactId>
	<version>5.2.0</version>
	<exclusions>
		<exclusion>
			<groupId>org.alfresco</groupId>
			<artifactId>alfresco-java-rest-api-common</artifactId>
		</exclusion>
	</exclusions>
</dependency>

but I would suggest an official fix, maybe referring in the parent pom to a dedicated property.

Thank you,
kind regards