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

View File

@ -4,7 +4,7 @@
it is never released with the Alfresco.war 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 and path to /alfresco
The Alfresco.war 5.0 does not have a webapp (it used to have Alfresco Explorer but not anymore) 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 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}"> <Context docBase="${app.amp.client.war.folder}" path="${alfresco.client.contextPath}">
<Resources className="org.apache.naming.resources.VirtualDirContext" <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: <!-- Setup the virtual class path like this:
1) target/classes 1) target/classes
2) target/${project.build.finalName}/config 2) target/amp/config
3) target/test-classes 3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up This way mvn compile can be invoked and all changes will be picked up
--> -->
<Loader searchVirtualFirst="true" <Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader" 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 --> <!-- 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}"> <Context docBase="${app.amp.client.war.folder}" path="${share.client.contextPath}">
<Resources className="org.apache.naming.resources.VirtualDirContext" <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 --> <!-- Configure where the Share (share.war) web application can load classes, test classes, and config -->
<!-- Setup the virtual class path like this: <!-- Setup the virtual class path like this:
1) target/classes 1) target/classes
2) target/${project.build.finalName}/config 2) target/amp/config
3) target/test-classes 3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up This way mvn compile can be invoked and all changes will be picked up
--> -->
<Loader searchVirtualFirst="true" <Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader" 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 --> <!-- 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" /> <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 * 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 * @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 * 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 * 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" * @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 * The WAR file or exploded dir to install the AMPs in. If specified
* Defaults to <code>"${project.build.directory}/${project.build.finalName}-war</code> * Defaults to <code>"${app.amp.client.war.folder}</code>
* *
* @parameter property="maven.alfresco.warLocation" default-value="${project.build.directory}/${project.build.finalName}-war" * @parameter property="maven.alfresco.warLocation" default-value="${app.amp.client.war.folder}"
*/ */
private File warLocation; private File warLocation;

View File

@ -66,10 +66,14 @@
<!-- <!--
Alfresco Module Packages (AMP) settings 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 --> <!-- 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.folder>src/main/amp</app.amp.folder>
<app.amp.overlay.excludes /> <!-- AMP excludes when installing into a WAR, by default empty (i.e. everything is included) --> <!-- To know which folder filtered AMP resources should end up in under /target -->
<app.amp.excludes /> <!-- Empty AMP source excludes by default, see the amp-to-war profile for usage example --> <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. 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-repo-amp/target/my-repo-amp-war (Alfresco.war extension)
my-share-amp/target/my-share-amp-war (Share.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, <!-- 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. --> 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> <app.amp.client.war.artifactId>${alfresco.repo.artifactId}</app.amp.client.war.artifactId>
@ -398,7 +402,10 @@
<exclude>**/*.lib.js</exclude> <exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude> <exclude>**/*.css</exclude>
</excludes> </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> <jswarn>false</jswarn>
</configuration> </configuration>
</execution> </execution>