DPascalBernard / maven-alfresco-archetypes

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

AMP Plugin: src/main/config directory resource rules should be the default #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently in order for the AMP plugin to correctly store assets in
src/main/config in the config/ folder inside the AMP file, the following
resource block is required in the pom.xml:

    <resource>
      <filtering>true</filtering>
      <directory>src/main/config</directory>
      <targetPath>alfresco/module/com.acme.test.test-amp</targetPath>
      <excludes>
        <exclude>**README-*</exclude>
      </excludes>
    </resource>

Because the config/ folder is almost ubiquitous in AMP files, it would be
better if this was the default behaviour of the plugin, thereby simplifying
each and every pom.xml file.

Original issue reported on code.google.com by pmo...@gmail.com on 28 Oct 2009 at 6:50

GoogleCodeExporter commented 9 years ago
I think this could be unified by using alfresco/module/${groupId}.${artifactId} 
in
the targetPath.

Original comment by tib...@gmail.com on 7 Dec 2009 at 10:45

GoogleCodeExporter commented 9 years ago
As mentioned in ticket 26, packages in this directory need to be "exploded" 
into real
paths ie. config/x.y.z needs to be managed as config/x/y/z.  This ensures that
standard Java classloading works correctly with assets stored in the config 
folder
hierarchy.

Original comment by pmo...@gmail.com on 7 Dec 2009 at 8:04

GoogleCodeExporter commented 9 years ago
By the way, I would suggest using src/main/module instead of src/main/config. 
AFAIK, src/main/config is already intended to contain some build-time 
configuration files (see 
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directo
ry-layout.html)

Original comment by dupont.n...@gmail.com on 5 Aug 2010 at 1:10

GoogleCodeExporter commented 9 years ago
Moreover, src/main/config could be confused with the config/ folder in the 
targeted AMP (which is mapped to /WEB-INF/classes in the Alfresco WAR)

Original comment by dupont.n...@gmail.com on 6 Aug 2010 at 4:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Actually, I would suggest the following layout to be handled by the AMP plugin :
src/main/module : resources intended to be processed into 
config/alfresco/module/${moduleId} in the AMP
src/main/resources : resources intended to be processed into the JAR
src/main/ampResources : resources intendedto be processed directly in the AMP 
(could be done by only changing mAmpResources default value)

Original comment by dupont.n...@gmail.com on 7 Sep 2010 at 4:24

GoogleCodeExporter commented 9 years ago
I agree with all the remarks. Scheduling this for the shiny 4x release, we 
should add then:

- align to non groupId.artifactId based directory generation (should be already 
like this no?)
- restructure not to use src/main/config

I like Nicolas proposal, with a slight change, WDYT of:

- src/main/module
- src/main/resources
- root folder of the generated project mapped directly into the AMP 

I think it makes it quite clear, don't really like ampResources ;)

WDYT?

Original comment by colum...@gmail.com on 4 Aug 2011 at 1:33

GoogleCodeExporter commented 9 years ago
Makes sense to me!

Original comment by pmo...@gmail.com on 4 Aug 2011 at 2:34

GoogleCodeExporter commented 9 years ago
This mechanism has been deeply refactored with the Maven Alfresco SDK 1.0.0 
(using the new alfresco-maven-plugin 0.7). 

In fact the project layout will be really simple and straightforward:

src/main/amp           --> maps to the root of the AMP therefore
src/main/amp/config/   --> maps to amproot/config
src/main/amp/webapp/   --> mapo to amproot/webapp

src/main/resources     --> resources to be added in the AMP embedded JAR
src/main/java          --> classes to be added in the AMP embedded JAR
src/test/java          --> unit test classes
src/test/resources     --> unit test resources

src/main/properties/<env> --> environment aware alfresco-global.properties (for 
WAR project)
src/test/properties/<env> --> test environment aware alfresco-global.properties 
(to run AMP project embedded)

Having clarified this solves this issue to me, so closing this issue.

As a sidenote, we dropped the automatic enforcement / copy of resources to the 
best practice folder alfresco/module/<artifactId> as we generating confusion.  

Original comment by colum...@gmail.com on 29 Oct 2012 at 9:53