- improved approach for issue 197 (especially for IDEA, Ole you are

welcome :)
- reduced usage of copy-resources where possible to maximize idea
compatibility
- reduced duplication of amp resources in the classpath
- tested in eclipse and all seems to work (test, remote junit test,
amp-to-war, hot java reload with spring loaded, new webscript hot
loaded, jsp change)
This commit is contained in:
mindthegab 2014-08-15 17:15:41 -04:00
parent 3f44c3be58
commit 760d970240
3 changed files with 38 additions and 64 deletions

View File

@ -7,7 +7,7 @@
<Loader searchVirtualFirst="true" className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.testOutputDirectory}" />
virtualClasspath="${project.build.outputDirectory};${project.build.testOutputDirectory};${project.build.directory}/${project.build.finalName}/config" />
<!--
<Environment override="false" type="java.lang.Boolean" name="properties/startup.enable" description="A flag that globally enables or disables startup of the major Alfresco subsystems." value="true"/>

View File

@ -7,7 +7,7 @@
<Loader searchVirtualFirst="true" className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.testOutputDirectory}" />
virtualClasspath="${project.build.outputDirectory};${project.build.testOutputDirectory};${project.build.directory}/${project.build.finalName}/config" />
<!--
<Environment override="false" type="java.lang.Boolean" name="properties/startup.enable" description="A flag that globally enables or disables startup of the major Alfresco subsystems." value="true"/>

View File

@ -75,7 +75,6 @@
-->
<app.amp.folder>src/main/amp</app.amp.folder>
<app.amp.output.folder>../${project.build.finalName}</app.amp.output.folder>
<app.amp.test.output.folder>${project.build.directory}/amp-test-classpath</app.amp.test.output.folder>
<!-- Empty AMP source excludes by default, see the amp-to-war profile for usage example -->
<app.amp.excludes></app.amp.excludes>
<app.properties.folder>src/main/properties/${env}</app.properties.folder>
@ -308,7 +307,10 @@
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
<execute>
<runOnIncremental>true</runOnIncremental>
<runOnConfiguration>true</runOnConfiguration>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
@ -439,47 +441,27 @@
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</profile>
<!-- Enable AMP testing if finds a module.properties, including unit testing support -->
<profile>
<id>enable-amp-dev</id>
<activation>
<file>
<exists>src/main/amp/module.properties</exists>
</file>
</activation>
<!-- Basically copies AMP config and module.properties in target/test-classes so that they can be loaded at test time and the module can be installed -->
<build>
<plugins>
<!-- Copies module properties to the test classpath in the right location, so that it can be picked up by tests and tomcat embedded -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>prepare-amp-testing-classpath</id>
<id>add-module-properties-to-test-classpath</id>
<phase>process-test-resources</phase>
<goals><goal>copy-resources</goal></goals>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${app.amp.folder}/config</directory>
<filtering>${app.filtering.enabled}</filtering>
<excludes>
<exclude>module.properties</exclude>
</excludes>
</resource>
<!-- If exists, copies the module properties in the right classpath, to install it at test time -->
<resource>
<directory>${app.amp.folder}</directory>
<filtering>${app.filtering.enabled}</filtering>
<includes>
<include>module.properties</include>
</includes>
<filtering>${app.filtering.enabled}</filtering>
<targetPath>alfresco/module/${project.artifactId}</targetPath>
</resource>
</resources>
@ -489,6 +471,7 @@
</plugin>
</plugins>
</build>
</profile>
<!-- Enables alfresco testing dependencies if a src/test/java folder is found, by adding appropriate dependencies -->
@ -507,21 +490,12 @@
<version>${maven.surefire.version}</version>
<configuration>
<argLine>${app.testing.jvm.args}</argLine>
<additionalClasspathElements>
<!-- Adds both the module config to test classpath -->
<additionalClasspathElement>${project.build.directory}/${project.build.finalName}/config</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
<!-- Add RAD capabilities for remote JUnit test running. This is added to Tomcat classpath,
so the custom JUnit test receiver is found in the running webapp classpath -->
<!-- <plugin> -->
<!-- <groupId>org.apache.tomcat.maven</groupId> -->
<!-- <artifactId>tomcat7-maven-plugin</artifactId> -->
<!-- <dependencies> -->
<!-- <dependency> -->
<!-- <groupId>org.alfresco.maven</groupId> -->
<!-- <artifactId>alfresco-rad</artifactId> -->
<!-- <version>${maven.alfresco.version}</version> -->
<!-- </dependency> -->
<!-- </dependencies> -->
<!-- </plugin> -->
</plugins>
</build>
<dependencies>