DEVPLAT-445

This commit is contained in:
Martin Bergljung 2016-01-20 10:18:04 +00:00
parent 9dd9f530bb
commit 2e546a1cae
7 changed files with 33 additions and 26 deletions

View File

@ -13,17 +13,17 @@
<Context docBase="${project.parent.basedir}/alfresco-war/target/${project.build.finalName}">
<!-- Pick up static resource files from AMPs and other directories (this should not include docBase) -->
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.parent.basedir}/${rootArtifactId}-repo-amp/target/${rootArtifactId}-repo-amp/web" />
extraResourcePaths="/=${project.parent.basedir}/${rootArtifactId}-repo-amp/target/amp/web" />
<!-- IMPORTANT! The extraResourcePaths string need to be on one continues line, so if we add another Repo AMP,
it would look something like this:
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.parent.basedir}/repo-amp/target/repo-amp/web,/=${project.parent.basedir}/component-a-repo/target/component-a-repo/web" />
extraResourcePaths="/=${project.parent.basedir}/${rootArtifactId}-repo-amp/target/amp/web,/=${project.parent.basedir}/component-a-repo/target/amp/web" />
-->
<!-- Configure where the Alfresco (alfresco.war) web application can load classes, test classes, and config files -->
<!-- Setup the virtual class path like this:
1) target/classes
2) target/${project.build.finalName}/config
2) target/amp/config
3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up
@ -31,7 +31,7 @@
<Loader className="org.apache.catalina.loader.VirtualWebappLoader"
searchVirtualFirst="true"
virtualClasspath="${project.parent.basedir}/${rootArtifactId}-repo-amp/target/classes;
${project.parent.basedir}/${rootArtifactId}-repo-amp/target/${rootArtifactId}-repo-amp/config;
${project.parent.basedir}/${rootArtifactId}-repo-amp/target/amp/config;
${project.parent.basedir}/${rootArtifactId}-repo-amp/target/test-classes" />
<!-- Load from all directories, not just when the META-INF directory is found in exploded JAR -->

View File

@ -10,17 +10,17 @@
<!-- Pick up static resource files from any Share extensions, being it a JAR or an AMP
(this should not include docBase) -->
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.parent.basedir}/${rootArtifactId}-share-amp/target/${rootArtifactId}-share-amp/web" />
extraResourcePaths="/=${project.parent.basedir}/${rootArtifactId}-share-amp/target/amp/web" />
<!-- IMPORTANT! The extraResourcePaths string need to be on one continues line, so if we add another Share AMP,
it would look something like this:
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.parent.basedir}/${rootArtifactId}-share-amp/target/${rootArtifactId}-share-amp/web,/=${project.parent.basedir}/component-a-share/target/component-a-share/web" />
extraResourcePaths="/=${project.parent.basedir}/${rootArtifactId}-share-amp/target/amp/web,/=${project.parent.basedir}/component-a-share/target/amp/web" />
-->
<!-- Configure where the Share (share.war) web application can load classes, config, and test classes (in that order) -->
<!-- Setup the virtual class path like this:
1) ${rootArtifactId}-share-amp/target/classes
2) ${rootArtifactId}-share-amp/target/${project.build.finalName}/config
2) ${rootArtifactId}-share-amp/target/amp/config
3) ${rootArtifactId}-share-amp/target/test-classes
4) Add other AMP paths here....
5) share/target/test-classes (loads the share-config-custom.xml used during test runs)
@ -30,7 +30,7 @@
<Loader className="org.apache.catalina.loader.VirtualWebappLoader"
searchVirtualFirst="true"
virtualClasspath="${project.parent.basedir}/${rootArtifactId}-share-amp/target/classes;
${project.parent.basedir}/${rootArtifactId}-share-amp/target/${rootArtifactId}-share-amp/config;
${project.parent.basedir}/${rootArtifactId}-share-amp/target/amp/config;
${project.parent.basedir}/${rootArtifactId}-share-amp/target/test-classes;
${project.parent.basedir}/share/target/test-classes" />

View File

@ -4,7 +4,7 @@
it is never released with the Alfresco.war
=================================================================================================================-->
<!-- Setup docBase to something like repo-amp/target/repo-amp-war
<!-- Setup docBase to something like repo-amp/target/amp-war
and path to /alfresco
The Alfresco.war 5.0 does not have a webapp (it used to have Alfresco Explorer but not anymore)
that we will access, so this docBase might not be needed
@ -12,18 +12,18 @@
<Context docBase="${app.amp.client.war.folder}" path="${alfresco.client.contextPath}">
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/${project.build.finalName}/web" />
extraResourcePaths="/=${project.build.directory}/amp/web" />
<!-- Setup the virtual class path like this:
1) target/classes
2) target/${project.build.finalName}/config
2) target/amp/config
3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up
-->
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/${project.build.finalName}/config;${project.build.testOutputDirectory}" />
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/amp/config;${project.build.testOutputDirectory}" />
<!-- This enables hot reloading of web resources from uncompressed jars (while in prod they would be loaded from WEB-INF/lib/{\*.jar}/META-INF/resources -->

View File

@ -9,19 +9,19 @@
<Context docBase="${app.amp.client.war.folder}" path="${share.client.contextPath}">
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/${project.build.finalName}/web" />
extraResourcePaths="/=${project.build.directory}/amp/web" />
<!-- Configure where the Share (share.war) web application can load classes, test classes, and config -->
<!-- Setup the virtual class path like this:
1) target/classes
2) target/${project.build.finalName}/config
2) target/amp/config
3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up
-->
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/${project.build.finalName}/config;${project.build.testOutputDirectory}" />
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/amp/config;${project.build.testOutputDirectory}" />
<!-- This enables hot reloading of web resources from uncompressed jars (while in prod they would be loaded from WEB-INF/lib/{\*.jar}/META-INF/resources -->
<JarScanner scanAllDirectories="true" />

View File

@ -49,7 +49,7 @@ public class AmpMojo extends AbstractMojo {
/**
* Target folder used to aggregate content then packaged into the AMP
*
* @parameter property="maven.alfresco.ampBuildDirectory" default-value="${project.build.directory}/${project.build.finalName}"
* @parameter property="maven.alfresco.ampBuildDirectory" default-value="${app.amp.output.folder}"
* @required
*
*/

View File

@ -29,7 +29,7 @@ public class InstallMojo extends AbstractMojo {
/**
* The location of the AMP file(s) to be installed. If this location is a
* folder all AMPs contained in the folder are installed, if it's a file it
* get direclty installed on the ${warLocation}
* get directly installed on the ${warLocation}
*
* @parameter property="maven.alfresco.ampLocation" default-value="${project.build.directory}/${project.build.finalName}.amp"
*/
@ -37,9 +37,9 @@ public class InstallMojo extends AbstractMojo {
/**
* The WAR file or exploded dir to install the AMPs in. If specified
* Defaults to <code>"${project.build.directory}/${project.build.finalName}-war</code>
*
* @parameter property="maven.alfresco.warLocation" default-value="${project.build.directory}/${project.build.finalName}-war"
* Defaults to <code>"${app.amp.client.war.folder}</code>
*
* @parameter property="maven.alfresco.warLocation" default-value="${app.amp.client.war.folder}"
*/
private File warLocation;

View File

@ -66,10 +66,14 @@
<!--
Alfresco Module Packages (AMP) settings
-->
<app.amp.folder>src/main/amp</app.amp.folder> <!-- To know which resource folder to filter for AMP extension projects -->
<app.amp.output.folder>../${project.build.finalName}</app.amp.output.folder> <!-- To know which folder filtered AMP resources should end up in -->
<app.amp.overlay.excludes /> <!-- AMP excludes when installing into a WAR, by default empty (i.e. everything is included) -->
<app.amp.excludes /> <!-- Empty AMP source excludes by default, see the amp-to-war profile for usage example -->
<!-- To know which resource folder to filter for AMP extension projects -->
<app.amp.folder>src/main/amp</app.amp.folder>
<!-- To know which folder filtered AMP resources should end up in under /target -->
<app.amp.output.folder>${project.build.directory}/amp</app.amp.output.folder>
<!-- AMP excludes when installing into a WAR, by default empty (i.e. everything is included) -->
<app.amp.overlay.excludes />
<!-- Empty AMP source excludes by default, see the amp-to-war profile for usage example -->
<app.amp.excludes />
<!--
Settings related to the stand-alone AMP extension projects.
@ -81,7 +85,7 @@
my-repo-amp/target/my-repo-amp-war (Alfresco.war extension)
my-share-amp/target/my-share-amp-war (Share.war extension)
-->
<app.amp.client.war.folder>${project.build.directory}/${project.build.finalName}-war</app.amp.client.war.folder>
<app.amp.client.war.folder>${project.build.directory}/amp-war</app.amp.client.war.folder>
<!-- The Maven artifact ID to use when loading the WAR that the AMP should be applied to,
defaults to the alfresco.war artifact ID, overriding this in the share-amp project. -->
<app.amp.client.war.artifactId>${alfresco.repo.artifactId}</app.amp.client.war.artifactId>
@ -398,7 +402,10 @@
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
</excludes>
<warSourceDirectory>src/main/resources/META-INF</warSourceDirectory>
<sourceDirectory>src/main/amp</sourceDirectory>
<outputDirectory>${project.build.directory}/amp</outputDirectory>
<!-- Exclude resources so we don't get an extra dir structure with -min.js files -->
<excludeResources>true</excludeResources>
<jswarn>false</jswarn>
</configuration>
</execution>