share.amp for Alfresco 6.2.x not getting packaged correctly when upgraded to sdk 4.0.x

cancel
Showing results for 
Search instead for 
Did you mean: 
mohitashah1
Customer

share.amp for Alfresco 6.2.x not getting packaged correctly when upgraded to sdk 4.0.x

Jump to solution

Greetings Guys,

I've created an all-in-one project using maven sdk for alfresco. I'm using version maven-sdk version 4.0, because I'm still upgrading my Alfresco 5.2.x to Alfresco 6.2.x.

I am successfully able to build and deploy the repo.amp for my project, but when I try to build my share.amp for the same project I'm missing all the files that were stored in the config.alfresco folder in maven-sdk 2.2.0.

I read numerous forums for exactly the same thing, but simply cannot get the right answer.

Here is how my Folder structure looks in Alfresco 5.2.x + SDK 2.2.0:

alf5.2.png

And here's how the folder structure looks in Alfresco 6.2.x + SDK 4.0.0:alf6.2.png

On further investigation, I see that the folder web-extension is getting archived in the jar file as shown in the image below:alf_jar.png

Kindly help me get the structure right - wherein the custom templates and ftl files are packaged correctly into the share.amp file.

Thanks and Regards,

-Mohit

1 Solution

Accepted Solutions
abhinavmishra14
Advanced

Re: share.amp for Alfresco 6.2.x not getting packaged correctly when upgraded to sdk 4.0.x

Jump to solution

Compared to sdk2.x, sdk4.x has slightly different folder structure. 

Take a look at this project, https://github.com/jpotts/alfresco-sdk-upgrader/ . it is not for sdk2.x but will give you some idea on sdk upgrades.

You can also refer to this post: https://hub.alfresco.com/t5/alfresco-content-services-forum/upgrading-from-sdk-3-0-1-to-sdk4/td-p/29...

Whatever you are seeing is correct and default. You should move all your webscripts, messages etc. under web-extension directory always. So map the files and configs as per new structure. Everything goes to jar file except what's in "alfresco\module\<projectmodule>" You would have to enable the amp assembly plugin. Look for "maven-assembly-plugin" in your parent pom file and uncomment it.

<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.6</version>
                    <executions>
                        <execution>
                            <id>build-amp-file</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <configuration>
                                <appendAssemblyId>false</appendAssemblyId>
                                <descriptor>src/main/assembly/amp.xml</descriptor>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.alfresco.maven.plugin</groupId>
                            <artifactId>alfresco-maven-plugin</artifactId>
                            <version>${alfresco.sdk.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

However, this will generate amp as well as jar file both. You would still see the web-extension under the jar file. 

Checkout these docs:

https://docs.alfresco.com/content-services/6.0/develop/sdk/#structureaio

https://docs.alfresco.com/content-services/6.0/develop/sdk/#my-all-in-one-project-share

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View solution in original post

1 Reply
abhinavmishra14
Advanced

Re: share.amp for Alfresco 6.2.x not getting packaged correctly when upgraded to sdk 4.0.x

Jump to solution

Compared to sdk2.x, sdk4.x has slightly different folder structure. 

Take a look at this project, https://github.com/jpotts/alfresco-sdk-upgrader/ . it is not for sdk2.x but will give you some idea on sdk upgrades.

You can also refer to this post: https://hub.alfresco.com/t5/alfresco-content-services-forum/upgrading-from-sdk-3-0-1-to-sdk4/td-p/29...

Whatever you are seeing is correct and default. You should move all your webscripts, messages etc. under web-extension directory always. So map the files and configs as per new structure. Everything goes to jar file except what's in "alfresco\module\<projectmodule>" You would have to enable the amp assembly plugin. Look for "maven-assembly-plugin" in your parent pom file and uncomment it.

<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.6</version>
                    <executions>
                        <execution>
                            <id>build-amp-file</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <configuration>
                                <appendAssemblyId>false</appendAssemblyId>
                                <descriptor>src/main/assembly/amp.xml</descriptor>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.alfresco.maven.plugin</groupId>
                            <artifactId>alfresco-maven-plugin</artifactId>
                            <version>${alfresco.sdk.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

However, this will generate amp as well as jar file both. You would still see the web-extension under the jar file. 

Checkout these docs:

https://docs.alfresco.com/content-services/6.0/develop/sdk/#structureaio

https://docs.alfresco.com/content-services/6.0/develop/sdk/#my-all-in-one-project-share

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)