Change the way moduleId is generated, from ${groupId}.${artifactId} to just ${artifactId}. The former way caused problems when loading classpath resources.

This solves issues 26 and 42.

git-svn-id: http://maven-alfresco-archetypes.googlecode.com/svn/trunk@298 04253f4f-3451-0410-a141-5562f1e59037
This commit is contained in:
billerby 2010-03-01 14:20:54 +00:00
parent 33f83f9c21
commit 82d38f6a42
5 changed files with 9 additions and 9 deletions

View File

@ -72,9 +72,9 @@ src --------------------------------------------------------> (source folder)
|__ main ___ __ resources --------------------------> mapped in the classpath. Add here classpath resources |__ main ___ __ resources --------------------------> mapped in the classpath. Add here classpath resources
| | | |
| |__ config----- alfresco module config goes here. | |__ config----- alfresco module config goes here.
| | | Get's copied (by best practice) by build into package alfresco/module/groupId.artifactId. | | | Get's copied (by best practice) by build into package alfresco/module/artifactId.
| | | This convention is used by the archetype and by the AMP unpacker. | | | This convention is used by the archetype and by the AMP unpacker.
| | |__ ex: alfresco/module/com.sourcesense.alfresco.mymodule ---> Example Alfresco module config | | |__ ex: alfresco/module/mymodule ---> Example Alfresco module config
| | | |
| | | |
| |__ java -------------------------------> customization java classes | |__ java -------------------------------> customization java classes

View File

@ -19,7 +19,7 @@
# ==== Beginning of Alfresco required/optional properties ====== # # ==== Beginning of Alfresco required/optional properties ====== #
module.id=${pom.groupId}.${pom.artifactId} module.id=${pom.artifactId}
#module.aliases=myModule-123, my-module #module.aliases=myModule-123, my-module
module.title=${pom.name} module.title=${pom.name}
module.description=${pom.description} module.description=${pom.description}

View File

@ -227,13 +227,13 @@
</resource> </resource>
<!-- <!--
Copies and filters AMP config in the proper package Copies and filters AMP config in the proper package
'alfresco/module/${groupId}.${artifactId}' so to enforce full module 'alfresco/module/${artifactId}' so to enforce full module
naming single sourcing from POM properties naming single sourcing from POM properties
--> -->
<resource> <resource>
<filtering>true</filtering> <filtering>true</filtering>
<directory>src/main/config</directory> <directory>src/main/config</directory>
<targetPath>alfresco/module/${groupId}.${artifactId}</targetPath> <targetPath>alfresco/module/${artifactId}</targetPath>
<excludes> <excludes>
<exclude>**README-*</exclude> <exclude>**README-*</exclude>
</excludes> </excludes>
@ -389,7 +389,7 @@
</testResource> </testResource>
<!-- <!--
src/main/config/ is copied into ==> src/main/config/ is copied into ==>
target/test-classes/alfresco/module/${groupId}.${artifactId} to be target/test-classes/alfresco/module/${artifactId} to be
picked up by the maven-war plugin Best practice tacken from picked up by the maven-war plugin Best practice tacken from
recordsmanagement.amp, is enforced troughout the whole archetype. recordsmanagement.amp, is enforced troughout the whole archetype.
This convention is also used for module.properties filtering. This convention is also used for module.properties filtering.
@ -400,7 +400,7 @@
<includes> <includes>
<include>module.properties</include> <include>module.properties</include>
</includes> </includes>
<targetPath>alfresco/module/${groupId}.${artifactId}</targetPath> <targetPath>alfresco/module/${artifactId}</targetPath>
</testResource> </testResource>
</testResources> </testResources>
</build> </build>

View File

@ -23,7 +23,7 @@
<bean id="${groupId}.${artifactId}.exampleBean" class="org.alfresco.demoamp.Demo" init-method="init" /> <bean id="${groupId}.${artifactId}.exampleBean" class="org.alfresco.demoamp.Demo" init-method="init" />
<!-- A simple module component that will be executed once --> <!-- A simple module component that will be executed once -->
<bean id="${groupId}.${artifactId}.exampleComponent" class="org.alfresco.demoamp.DemoComponent" parent="module.baseComponent" > <bean id="${artifactId}.exampleComponent" class="org.alfresco.demoamp.DemoComponent" parent="module.baseComponent" >
<property name="moduleId" value="${pom.groupId}.${pom.artifactId}" /> <!-- See module.properties --> <property name="moduleId" value="${pom.groupId}.${pom.artifactId}" /> <!-- See module.properties -->
<property name="name" value="exampleComponent" /> <property name="name" value="exampleComponent" />
<property name="description" value="A demonstration component" /> <property name="description" value="A demonstration component" />

View File

@ -20,6 +20,6 @@
<beans> <beans>
<import resource="classpath:alfresco/module/${groupId}.${artifactId}/context/service-context.xml" /> <import resource="classpath:alfresco/module/${artifactId}/context/service-context.xml" />
</beans> </beans>