Asset share commons source code | Community
Skip to main content
Level 6
June 30, 2022

Asset share commons source code

  • June 30, 2022
  • 1 reply
  • 2587 views

Hi All,

 

I am setting up the asset share commons, I have aem 6.5.0 instance, I downloaded asset-share-commons-ui.apps-1.9.4 version, asset-share-commons-ui.content-1.9.4 version.

I have requirement to write sling model using query builder in that for that I downloaded source code from https://github.com/adobe/asset-share-commons/tree/asset-share-commons-1.9.4 but the source code is with 6.3.1 version But my instance version is 6.5.0, Please help me to fix this issue.

 

Thanks,

Vani.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

lukasz-m
Community Advisor
Community Advisor
June 30, 2022

Hi @vani1012,

In general the fact that 1.9.4 contains dependency to uberjar 6.3.1 should not be an issue, according to official documentation 1.9.4 is compatible with AEM 6.5. You can also switch to version 2.x but please be aware that those version are not including uberjar 6.5.x anyway.

I am not sure how you wanted to approach with extending Asset Share Commons. But if you have planned to checkout the code and change it, then this will be incorrect way. Any customization should be done via API exposed by Asset Share Commons. You should create new project using Adobe archetype and include Asset Share Commons as a Maven dependency. Please have a look into official guidelines to get all the details:

I would suggest to explore Asset Share Commons documentation first, to get familiar with technical design concept. It will definitely simplify any development work.

Vani1012Author
Level 6
July 1, 2022

Hi @lukasz-m ,

I created project using this command

mvn -B archetype:generate -D archetypeGroupId="com.adobe.aem" -D archetypeArtifactId="aem-project-archetype" -D archetypeVersion=26 -D appTitle=" YP POC Site" -D appId="YP-POC" -D groupId="com.yppocsite" -D aemVersion="6.5.0"

And I am following this guide https://opensource.adobe.com/asset-share-commons/pages/development/1-x/guide/ that you shared I added dependecies and subpackages in ui.apps inside content package-maven plugin as per the article like this 

 When I run mvn clean install -PautoInstallPackage I am getting errors like this

Can you please help me how to fix this.

 

Thanks,

Vani.

 

lukasz-m
Community Advisor
Community Advisor
July 1, 2022

I was able to successfully build project using commands you have shared and follow instructions presented in the official guide. I can see that your pom has some additional entries that are not included in the guide.

Base on the documentation I would expect that content-package-maven-plugin section in ui.apps module will look like this

<plugin>
    <groupId>com.day.jcr.vault</groupId>
    <artifactId>content-package-maven-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <verbose>true</verbose>
        <failOnError>true</failOnError>
        <subPackages>
            <subPackage>
                <groupId>com.adobe.aem.commons</groupId>
                <artifactId>assetshare.ui.apps</artifactId>
                <filter>true</filter>
             </subPackage>
         </subPackages>
    </configuration>
</plugin>

I am not sure why you have added additional entries.

Nevertheless I would suggest following steps:

  1. Create clean project from Adobe archetype - make sure it builds/compiles successfully. (base on command presented under https://opensource.adobe.com/asset-share-commons/pages/development/1-x/guide/)
  2. Add all necessary changes described under https://opensource.adobe.com/asset-share-commons/pages/development/1-x/guide/ verify if you can still build/compile the project. In other words in this step you should add all asset share commons dependencies.
  3. Add other changes that are needed from your point of view.