DPascalBernard / maven-alfresco-archetypes

Automatically exported from code.google.com/p/maven-alfresco-archetypes
0 stars 0 forks source link

Enabling usage of SDK with earlier versions that Community 4.2 / Enterprise 4.1.2 #110

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently whenever someone wants to build an AMP using the new SDK, he needs to 
add src/main/amp/module.properties.

This triggers the activation, in the sdk-parent POM, of the profile 
"enable-amp": this profile configures the alfresco-maven-plugin (correct) but 
also configures support for AMP unit testing (incorrect incapsulation).

The problem with this is that for AMP unit testing data-model:config:jar and 
repository:config:jar are required and are resolved by the build, also if the 
user wants ONLY to build the AMP, not specifically when a test goal is called. 

Since the "config" JARs are only available as of Alfresco 4.2 Community and 
4.1.2 Enteprise, what this basically causes is that the 1.0 SDK version can NOT 
be used with earlier Alfresco versions, even for simple AMP packaging (with no 
testing).

Since unit testing is an advanced feature (which could be restricted to 
Alfresco 4.2+ Community and Alfresco 4.1.2+ Enterprise), while AMP packaging is 
a basic feature which we want as many users as possible to have available, my 
suggestion is:

- separate "enable-amp" from a new profile called "enable-amp-testing"
- "enable-amp" simply defines support for AMP packaging, and it's activated 
automatically with the module.properties file presence
- "enable-amp-testing" adds support for unit testing (so dependency on the 
config" JARs) and it's either activated manually (or we need to find a smart 
way of activating it). 
- Document that "enable-amp-testing" is available only in later versions, while 
AMP packaging *should* work also with earlier versions.

WDYT?    

Original issue reported on code.google.com by colum...@gmail.com on 24 Jan 2013 at 5:54

GoogleCodeExporter commented 9 years ago
Looks like there's already a 'enable-alfresco-testing' profile.  Is the 
proposal to rename that?

Could you activate that profile based on both the existence of 
module.properties and a check of alfresco.version?

Original comment by ray.ga...@alfresco.com on 24 Jan 2013 at 6:48

GoogleCodeExporter commented 9 years ago
Ray, you are so right. I was looking in a outdated profile in a branch.

So you are right, it sounds I already implemented this as described above 
(where enable-amp-testing == enable-alfresco-testing). 

Still if someone happens to have a src/test/java (e.g. generates the project 
from the amp-archetype), and then tries to use older alfresco versions, it'll 
fail.

Maybe we should reformulate this issue as:

" release a alfresco-amp-archetype-legacy, which does not provide testing (nor 
add sample testing files) support but works against older alfresco versions". 
WDYT?

Said that, as per your proposal, hear this well (as I don't often say that):
unluckily this is one of the areas where I DO FRIGGIN hate Maven...because:

- Multiple conditions profile activation do NOT work 
(http://jira.codehaus.org/browse/MNG-3328)

- The only activation which really works in a multi-module / inherited POM, is 
the file based one...

- for an overview http://www.dashbay.com/2011/03/maven-profile-inheritance/

Original comment by colum...@gmail.com on 24 Jan 2013 at 8:00

GoogleCodeExporter commented 9 years ago

Original comment by colum...@gmail.com on 24 Jan 2013 at 8:03

GoogleCodeExporter commented 9 years ago
I'm not sure it would be worth the effort and potential confusion to produce 
another archetype.

It's easy enough to use the alfresco-maven-plugin directly.

Original comment by ray.ga...@alfresco.com on 24 Jan 2013 at 10:23

GoogleCodeExporter commented 9 years ago
Makes sense but should be documented. Or maybe in the archetype itself we can 
try to do some smart thing...will have a look at it soon.

Original comment by colum...@gmail.com on 24 Jan 2013 at 10:28

GoogleCodeExporter commented 9 years ago

Original comment by colum...@gmail.com on 14 Feb 2013 at 10:15

GoogleCodeExporter commented 9 years ago

Original comment by colum...@gmail.com on 2 Jul 2013 at 9:52

GoogleCodeExporter commented 9 years ago
At the moment, the enable-alfresco-testing profile is enabled only if the 
relative directory src/test/java exists.

I think that this issue can be closed, please confirm.

Original comment by maurizio...@alfresco.com on 3 Jul 2014 at 10:11

GoogleCodeExporter commented 9 years ago
We might look into doing this in a mnt release of 1.1 but not moving forward.

Original comment by colum...@gmail.com on 17 Jul 2014 at 1:27