Acosix / alfresco-utility

Project to consolidate abstract utility features and enhancements / safe fixes that may be used by multiple Alfresco addons
Apache License 2.0
12 stars 11 forks source link

Missing spring-social-facebook dependencies #4

Closed FilipBruska closed 6 years ago

FilipBruska commented 6 years ago

Hi Axel,

Currently, I cannot build the source code using mvn clean install. There is an error caused by missing spring-social-facebook-1.0.0.RC1.jar and spring-social-facebook-web-1.0.0.RC1.jar:

[INFO] Acosix Alfresco Utility - Repository Module ........ FAILURE
...
[ERROR] Failed to execute goal on project de.acosix.alfresco.utility.repo: Could not resolve dependencies for project de.acosix.alfresco.utility:de.acosix.alfresco.utility.repo:jar:1.0.3.0-SNAPSHOT: Could not find artifact org.springframework.social:spring-social-facebook:jar:1.0.0.RC1 in ossrh (https://oss.sonatype.org/content/repositories/snapshots)

Those jars are still available in plugins-release maven repository. In case, you add following lines to your parent pom, the build will go just fine:

`

plugins-release
        <url>http://repo.spring.io/plugins-release/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>`

If you want I can create a pull request for this.

AFaust commented 6 years ago

This is a known and very annoying issue with Alfresco removing proxies in their Nexus, so projects that previously worked fine are now broken.... The same issue already affected ootbee-support-tools. I will likely choose to adapt my basic parent POM to exclude this crappy dependency (who in their right mind puts a RC / SNAPSHOT dependencies on a released product anyway?) instead of adding another artifact repository.

FilipBruska commented 6 years ago

Ok, great. I would be interested in your solution.

AFaust commented 6 years ago

Soo.. I have updated, built and published the parent POM(s) as well as my Utility, Site Hierarchy, MT Support and Simple Content Stores projects. The build was performed without my typical local Nexus cache so that I had to retrieve everything from public repositories and could verify it built properly for everyone else. I now use version-specific parent POMs (so far I have created one for 5.0.d and 5.2.g, 6.0 yet to be done). The problem with the missing dependency should now be fixed. Looking forward to your feedback.

FilipBruska commented 6 years ago

Works like a charm. Thank you

jacotec commented 6 years ago

Hmmm, can someone please explain the solution for people who are not that deep into the Alfresco internals? ;-)

I try to build the OnlyOffice plugin Amp files as I can't find a download source from here: https://github.com/cetra3/onlyoffice-alfresco

When I change into the repo directory and run "gradle amp" I'm always getting the mentioned error about the spring-social-facebook stuff:

root@alfresco:/opt/alfresco/extensions/onlyoffice-alfresco/repo# gradle amp
> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.social:spring-social-facebook:1.0.0.RC1.
  Searched in the following locations:
    - https://repo.maven.apache.org/maven2/org/springframework/social/spring-social-facebook/1.0.0.RC1/spring-social-facebook-1.0.0.RC1.pom
    - https://repo.maven.apache.org/maven2/org/springframework/social/spring-social-facebook/1.0.0.RC1/spring-social-facebook-1.0.0.RC1.jar
    - https://maven.alfresco.com/nexus/content/groups/public/org/springframework/social/spring-social-facebook/1.0.0.RC1/spring-social-facebook-1.0.0.RC1.pom
    - https://maven.alfresco.com/nexus/content/groups/public/org/springframework/social/spring-social-facebook/1.0.0.RC1/spring-social-facebook-1.0.0.RC1.jar
  Required by:
      project : > org.alfresco:alfresco:5.0.d > org.alfresco:alfresco-repository:5.0.d

I honestly have absolutely no idea what I need to do to create the AMP now ... Any help is highly appreciated.

AFaust commented 6 years ago

@jacotec So, the issue is with Spring Social Facebook library not being provided anymore by maven.alfresco.com / artifacts.alfresco.com. In the build.gradle file of the project you have two options to fix this:

  1. add an entry to the repositories block to add a new block similar to "maven" with the URL http://repo.spring.io/plugins-release/
  2. add an "exclude module" or "exclude group" entry to your first compile dependency (on org.alfresco:alfresco) to avoid pulling in "org.springframework.social" (for "exclude group") or "spring-social-facebook" (for "exclude module") - you might see there is already an "exclude group" for regular "org.springframework", though this does not cover the more specialised "org.springframework.social" group
hseritt commented 4 years ago

I see this is an older issue but I've come across it recently. In case Axel's point wasn't clear (I know little of gradle) but I did this with Maven in pom.xml and everything compiles fine:

        `<dependency>
        <groupId>${alfresco.groupId}</groupId>
        <artifactId>alfresco-enterprise-repository</artifactId>
        <version>${alfresco.platform.version}</version>
        <scope>provided</scope>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.social</groupId>
                <artifactId>spring-social-facebook</artifactId>
            </exclusion>
        </exclusions>
    </dependency>`

I hope this helps anyone who has come across this problem.