draperd / Alfresco-Share-Extensions

This project contains the source of various extension files built for blog posts, etc.
2 stars 3 forks source link

*Question* - How can I apply the HeaderCustomization to an Alfresco AIO sdk? #4

Closed Artemas-Muzanenhamo closed 6 years ago

Artemas-Muzanenhamo commented 6 years ago

@draperd

I've been trying to apply this example into my Alfresco all-in-one sdk and it's proving to be challenging for me. Would you be kind enough to ellaborate on how I can apply it to the project. I tried adding the HeaderCustomization.jar in my pom.xml file of my Alfresco-AIO sdk within the <shareModules> and also in the <dependency> section but I have no luck as it is not being loaded. I will attach my pom.xml snap of where I've applied the jar in my Alfresco-AIO sdk. Since the module didn't have an artifact-id and group-id I have just named the jar as alfresco-example-0.0.1.jar with the group-id as com.artemas.example.

shareModules 👇

customization-in-share-modules

dependencies 👇

module-in-dependencies
douglascrp commented 6 years ago

That is not how Maven works. In order to have the jar included as a dependency, you have to use Maven to package the project for you, and "install" it in your local repository. Simply renaming the file won't make it maven-compatible. The problem with this is that the project is not maven based, so, if you want to use it inside of an AIO project, you have to options:

  1. Convert the HeaderCustomization project into a maven project (and execute what I told you before)
  2. Include the HeaderCustomization project's customizations inside of your AIO project (as you seems to be new to the Maven world, I guess this would be the easier for you)

For the second option, get the folders and files from https://github.com/draperd/Alfresco-Share-Extensions/tree/master/HeaderCustomization/alfresco and put them inside your project, using the existing folders, created for you by the sdk archetype

Artemas-Muzanenhamo commented 6 years ago

@douglascrp Lol ok, I am not new to Maven 😏 lol. I did perform step 1 of which I created my own custom group-id and artifact-id using:

mvn install:install-file 
  -Dfile=<path-to-file> 
  -DgroupId=<group-id> 
  -DartifactId=<artifact-id> 
  -Dversion=<version> 
  -Dpackaging=<packaging> 
  -DgeneratePom=true

I had been trying out a lot of theories hence I added a dependency in the <dependencies> tag but that was not necessary. Thanks I think I'll try the two options thanks 👍