DPascalBernard / maven-alfresco-archetypes

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

Inclusion of Properties Files Residing Next to Java Clases During Packaging #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an Alfresco AMP which contains properties files next to Java files 
within packages which is commonplace in examples, i.e.:
    src/main/java/com/example/mymetadataextracter/MyMetadataExtracter.java
    src/main/java/com/example/mymetadataextracter/MyMetadataExtracter.properties
2. mvn package

What is the expected output? What do you see instead?
Developers new to maven would probably expect to see 
MyMetadataExtracter.properties included in the jar

What version of the product are you using? On what operating system?
maven-alfresco-amp-archetype:3.9.0, OS X 10.7.3

Please provide any additional information below.

I suppose standard maven practice would dictate putting 
MyMetadataExtracter.properties within src/main/resources but that may not be 
obvious to all.

I end up instead adding an explicit inclusion in the build resources, i.e.:

        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**README-*</exclude>
                </excludes>
            </resource>
            ...

simply because I prefer those particular properties files in java.

Perhaps this is more of a documentation note than an actual issue.

Original issue reported on code.google.com by rgau...@gmail.com on 21 Feb 2012 at 7:31

GoogleCodeExporter commented 9 years ago
Hi Ray, I think that Maven best-practices and OOTB conventions encourage you to 
use src/main/resources for property files (Maven will take care of packaging it 
into the classpath), therefore I'd vote for adding your advises into the Wiki, 
specifically here:

1. 
https://wiki.alfresco.com/wiki/Maven_For_Dummies#Create_Basic_Repository_AMP_Pro
ject

2. https://wiki.alfresco.com/wiki/Maven_For_Dummies#Using_Maven_Features

Any preference where shall I put it?

Moving issue type from Defect to Task.

Original comment by mauri...@session.it on 4 Apr 2012 at 7:42

GoogleCodeExporter commented 9 years ago
Added some text to 2)

Original comment by mauri...@session.it on 4 Apr 2012 at 7:49

GoogleCodeExporter commented 9 years ago
Looks great, thanks.

Original comment by rgau...@gmail.com on 4 Apr 2012 at 5:15

GoogleCodeExporter commented 9 years ago

Original comment by mauri...@session.it on 6 Apr 2012 at 6:26