Hi,
I'm using Alfresco SDK 3 with Alfresco 5.2, for extending the Alfresco platform, using maven and the AllInOne archetype.
What I don't manage to see are how are managed the external jar for the platform.
The extension is splitted in several jars that are used by the platform project, using <dependency> in maven (at platform project level). It builds fine, the platform jar is generated, but when deployed using maven and alfresco:run, I don't manage to see where are all my jars that the platform depends on. And obviously tomcat does not find them. In the WEBINF I have the platform jar, but none of the additional jars.
For information the build also generates an amp file for the platform (even if I'm building a jar module), that includes everything (the platform jar and my additional jars). So the build process seems to see them well. It's more the alfresco maven plugin that does not seem to consider them when deploying.
So how to deal with these external jars, when using the SDK and the alfresco maven plugin?
Solved! Go to Solution.
Thought I'd respond, even though this is an older post. If you use jar deployment in SDK 3.0 and you have external dependencies (e.g. another jar that you pull from maven that includes classes you're using in your customization), you have to deploy that jar separately yourself. If you choose amp deployment, then it will include the external jar for you. If you are running locally with H2 (e.g. using run.sh script) and you want that to work correctly, make sure you add your dependency not only under <dependencies> but as a <moduleDependency> in the alfresco-maven-plugin. You can see where to add them if you search for the comment
<!-- Bring in custom Modules -->.
Thought I'd respond, even though this is an older post. If you use jar deployment in SDK 3.0 and you have external dependencies (e.g. another jar that you pull from maven that includes classes you're using in your customization), you have to deploy that jar separately yourself. If you choose amp deployment, then it will include the external jar for you. If you are running locally with H2 (e.g. using run.sh script) and you want that to work correctly, make sure you add your dependency not only under <dependencies> but as a <moduleDependency> in the alfresco-maven-plugin. You can see where to add them if you search for the comment
<!-- Bring in custom Modules -->.
Thanks for the detailed answer ^^
In fact I took a wrong path trying to use jar deployment, due to documentation of Alfresco 5.2 that was considering AMP as almost obsolete and jar the way to go. But in more recent version (Alfresco 6) it's clearly stated that with external dependencies it should be deployed as AMP. It does not seem to be considered so obsolete anymore.
So as the SDK generates both (Jar and AMP), AMP seems a clean way to proceed.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.