DPascalBernard / maven-alfresco-archetypes

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

Maven SDK 1.1.1 does not copy module.properties to test classpath #166

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a project with Maven SDK version 1.1.1.
2. Run the mvn clean install command.
3. Notice that the Alfresco context does not detect any module.

What is the expected output? What do you see instead?

I expect that the Alfresco context finds 1 module to install (this was the case 
in the SDK version 1.0.2). Otherwise custom components (e.g. for generating 
data at bootstrap) will not be able to be loaded.

What version of the product are you using? On what operating system?

Maven SDK 1.1.1 on OSX with Maven 3.1.1.

Please provide any additional information below.

Adding the following to my pom.xml is a temporary workaround (but it should be 
added to the SDK itself):

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>

                <executions>
                    <execution>
                        <id>prepare-amp-testing-classpath</id>

                        <configuration>
                            <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>

                            <resources>
                                <resource>
                                    <directory>${app.amp.folder}</directory>
                                    <includes><include>module.properties</include></includes>
                                    <targetPath>alfresco/module/${project.artifactId}</targetPath>
                                    <filtering>${app.filtering.enabled}</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Original issue reported on code.google.com by m.swe...@aca-it.be on 2 Dec 2013 at 3:20

GoogleCodeExporter commented 8 years ago
The workaround I provided contains a mistake. The id should be a unique id (so 
not "prepare-amp-testing-classpath") and the phase "process-test-resources" and 
the goal "copy-resources" should be provided.

On top of that, it will fail the "amp-to-war" profile. To make sure that it 
keeps working, add the following to the build as well:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>

                <executions>
                    <execution>
                        <id>clean-classpath-extended</id>
                        <phase>test</phase>
                        <goals><goal>clean</goal></goals>

                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>${project.build.testOutputDirectory}/alfresco/module/${project.artifactId}</directory>
                                    <includes><include>module.properties</include></includes>
                                </fileset>
                            </filesets>

                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Original comment by m.swe...@aca-it.be on 4 Dec 2013 at 11:09

GoogleCodeExporter commented 8 years ago

Original comment by colum...@gmail.com on 10 Dec 2013 at 11:20

GoogleCodeExporter commented 8 years ago

Original comment by colum...@gmail.com on 10 Dec 2013 at 11:21