From 788347a5dd2d4021a814b005d7a5a495e1cfbc0d Mon Sep 17 00:00:00 2001 From: Martin Bergljung Date: Wed, 7 Sep 2016 11:28:40 +0100 Subject: [PATCH] Support for overriding out-of-the-box web resources and including 3rd party libs, #389 --- .../META-INF/maven/archetype-metadata.xml | 8 ++++- .../src/main/assembly/amp.xml | 26 +++++++++++++++++ .../src/main/assembly/file-mapping.properties | 27 +++++++++++++++++ .../src/main/assembly/lib/README.md | 21 ++++++++++++++ .../src/main/assembly/web/README.md | 22 ++++++++++++++ .../__rootArtifactId__-share-jar/pom.xml | 10 ++++++- .../src/main/assembly/amp.xml | 29 ++++++++++++++++++- .../src/main/assembly/file-mapping.properties | 27 +++++++++++++++++ .../src/main/assembly/lib/README.md | 19 ++++++++++++ .../src/main/assembly/web/README.md | 22 ++++++++++++++ .../META-INF/maven/archetype-metadata.xml | 2 +- .../src/main/assembly/amp.xml | 26 +++++++++++++++++ .../src/main/assembly/file-mapping.properties | 27 +++++++++++++++++ .../src/main/assembly/lib/README.md | 21 ++++++++++++++ .../src/main/assembly/web/README.md | 22 ++++++++++++++ .../META-INF/maven/archetype-metadata.xml | 2 +- .../src/main/assembly/amp.xml | 29 ++++++++++++++++++- .../src/main/assembly/file-mapping.properties | 27 +++++++++++++++++ .../src/main/assembly/lib/README.md | 19 ++++++++++++ .../src/main/assembly/web/README.md | 22 ++++++++++++++ 20 files changed, 402 insertions(+), 6 deletions(-) create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/file-mapping.properties create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/lib/README.md create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/web/README.md create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/file-mapping.properties create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/lib/README.md create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/web/README.md create mode 100644 archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties create mode 100644 archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md create mode 100644 archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md create mode 100644 archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties create mode 100644 archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md create mode 100644 archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index 813c4e58..a180ac21 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -17,7 +17,7 @@ src/main/assembly - **/*.xml + ** @@ -68,6 +68,12 @@ name="${rootArtifactId}-share-jar" dir="__rootArtifactId__-share-jar" > + + src/main/assembly + + ** + + src/main/java diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/amp.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/amp.xml index ce979a1c..2af4e8e7 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/amp.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/amp.xml @@ -12,12 +12,38 @@ false + src/main/resources/alfresco/module/${project.artifactId}/module.properties true + + + src/main/assembly/file-mapping.properties + false + + + + + src/main/assembly/lib + lib + + README.md + + + + + src/main/assembly/web + web + + README.md + + + + + lib diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/file-mapping.properties b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/file-mapping.properties new file mode 100644 index 00000000..501b3d63 --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/file-mapping.properties @@ -0,0 +1,27 @@ +# Custom AMP to WAR location mappings + +# +# The following property can be used to include the standard set of mappings. +# The contents of this file will override any defaults. The default is +# 'true', i.e. the default mappings will be augmented or modified by values in +# this file. +# +# Default mappings are: +# +# /config=/WEB-INF/classes +# /lib=/WEB-INF/lib +# /licenses=/WEB-INF/licenses +# /web/jsp=/jsp +# /web/css=/css +# /web/images=/images +# /web/scripts=/scripts +# /web/php=/php +# +include.default=true + +# +# Custom mappings. If 'include.default' is false, then this is the complete set. +# Map /web to / in AMP so we can override things like favicon.ico +# +/web=/ + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/lib/README.md b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/lib/README.md new file mode 100644 index 00000000..e1c3ce2b --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/lib/README.md @@ -0,0 +1,21 @@ +# 3rd party libraries (JARs) that should be included in WAR + +Put here any 3rd party libraries (JARs) that are needed by customizations, +but that are not part of the out-of-the-box libraries in the *alfresco/WEB-INF/lib* +directory. + +**Note**. Module dependency needs to be set to amp for the libs to be applied by MMT: + +` + + ${project.groupId} + some-platform-jar + ${project.version} + amp + +` + +**Important**. If you need to use a library that is available out-of-the-box, then + include it as a *provided* dependency in the module. + + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/web/README.md b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/web/README.md new file mode 100644 index 00000000..d1c01571 --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-jar/src/main/assembly/web/README.md @@ -0,0 +1,22 @@ +# Web resources that should override out-of-the-box files + +Put here any web resources that should override out-of-the-box +web resources, such as favicon.ico. They will then end up in the +*/web* directory in the AMP, and applied to the WAR, and override +any existing web resources in the Alfresco.WAR. + +**Note**. Module dependency needs to be set to amp for the web resources to be applied by MMT: + +` + + ${project.groupId} + some-platform-jar + ${project.version} + amp + +` + +**Important**. New web resources should not be located here, but instead + in the usual place in the *src/main/resources/META-INF/resources* directory. + + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/pom.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/pom.xml index 8af1b408..5e224fe7 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/pom.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/pom.xml @@ -30,7 +30,15 @@ org.alfresco.surf spring-surf-api - + + + + org.apache.maven.plugins + maven-assembly-plugin + + + + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/amp.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/amp.xml index 6ef3c094..2af4e8e7 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/amp.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/amp.xml @@ -10,13 +10,40 @@ false + + - ${project.basedir}/src/main/resources/alfresco/module/${project.artifactId}/module.properties + src/main/resources/alfresco/module/${project.artifactId}/module.properties true + + + src/main/assembly/file-mapping.properties + false + + + + + src/main/assembly/lib + lib + + README.md + + + + + src/main/assembly/web + web + + README.md + + + + + lib diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/file-mapping.properties b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/file-mapping.properties new file mode 100644 index 00000000..501b3d63 --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/file-mapping.properties @@ -0,0 +1,27 @@ +# Custom AMP to WAR location mappings + +# +# The following property can be used to include the standard set of mappings. +# The contents of this file will override any defaults. The default is +# 'true', i.e. the default mappings will be augmented or modified by values in +# this file. +# +# Default mappings are: +# +# /config=/WEB-INF/classes +# /lib=/WEB-INF/lib +# /licenses=/WEB-INF/licenses +# /web/jsp=/jsp +# /web/css=/css +# /web/images=/images +# /web/scripts=/scripts +# /web/php=/php +# +include.default=true + +# +# Custom mappings. If 'include.default' is false, then this is the complete set. +# Map /web to / in AMP so we can override things like favicon.ico +# +/web=/ + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/lib/README.md b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/lib/README.md new file mode 100644 index 00000000..ce318e18 --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/lib/README.md @@ -0,0 +1,19 @@ +# 3rd party libraries (JARs) that should be included in WAR + +Put here any 3rd party libraries (JARs) that are needed by customizations, +but that are not part of the out-of-the-box libraries in the *share/WEB-INF/lib* +directory. + +**Note**. Module dependency needs to be set to amp for the libs to be applied by MMT: + +` + + ${project.groupId} + some-share-jar + ${project.version} + amp + +` + +**Important**. If you need to use a library that is available out-of-the-box, then + include it as a *provided* dependency in the module. \ No newline at end of file diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/web/README.md b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/web/README.md new file mode 100644 index 00000000..44f75971 --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-share-jar/src/main/assembly/web/README.md @@ -0,0 +1,22 @@ +# Web resources that should override out-of-the-box files + +Put here any web resources that should override out-of-the-box +web resources, such as favicon.ico. They will then end up in the +*/web* directory in the AMP, and applied to the WAR, and override +any existing web resources in the Share.WAR. + +**Note**. Module dependency needs to be set to amp for the web resources to be applied by MMT: + +` + + ${project.groupId} + some-share-jar + ${project.version} + amp + +` + +**Important**. New web resources should not be located here, but instead + in the usual place in the *src/main/resources/META-INF/resources//* directory. + + diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index eab4eec2..4c846161 100644 --- a/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -14,7 +14,7 @@ src/main/assembly - **/*.xml + ** diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml index ce979a1c..2af4e8e7 100644 --- a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml @@ -12,12 +12,38 @@ false + src/main/resources/alfresco/module/${project.artifactId}/module.properties true + + + src/main/assembly/file-mapping.properties + false + + + + + src/main/assembly/lib + lib + + README.md + + + + + src/main/assembly/web + web + + README.md + + + + + lib diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties new file mode 100644 index 00000000..501b3d63 --- /dev/null +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties @@ -0,0 +1,27 @@ +# Custom AMP to WAR location mappings + +# +# The following property can be used to include the standard set of mappings. +# The contents of this file will override any defaults. The default is +# 'true', i.e. the default mappings will be augmented or modified by values in +# this file. +# +# Default mappings are: +# +# /config=/WEB-INF/classes +# /lib=/WEB-INF/lib +# /licenses=/WEB-INF/licenses +# /web/jsp=/jsp +# /web/css=/css +# /web/images=/images +# /web/scripts=/scripts +# /web/php=/php +# +include.default=true + +# +# Custom mappings. If 'include.default' is false, then this is the complete set. +# Map /web to / in AMP so we can override things like favicon.ico +# +/web=/ + diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md new file mode 100644 index 00000000..e1c3ce2b --- /dev/null +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md @@ -0,0 +1,21 @@ +# 3rd party libraries (JARs) that should be included in WAR + +Put here any 3rd party libraries (JARs) that are needed by customizations, +but that are not part of the out-of-the-box libraries in the *alfresco/WEB-INF/lib* +directory. + +**Note**. Module dependency needs to be set to amp for the libs to be applied by MMT: + +` + + ${project.groupId} + some-platform-jar + ${project.version} + amp + +` + +**Important**. If you need to use a library that is available out-of-the-box, then + include it as a *provided* dependency in the module. + + diff --git a/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md new file mode 100644 index 00000000..d1c01571 --- /dev/null +++ b/archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md @@ -0,0 +1,22 @@ +# Web resources that should override out-of-the-box files + +Put here any web resources that should override out-of-the-box +web resources, such as favicon.ico. They will then end up in the +*/web* directory in the AMP, and applied to the WAR, and override +any existing web resources in the Alfresco.WAR. + +**Note**. Module dependency needs to be set to amp for the web resources to be applied by MMT: + +` + + ${project.groupId} + some-platform-jar + ${project.version} + amp + +` + +**Important**. New web resources should not be located here, but instead + in the usual place in the *src/main/resources/META-INF/resources* directory. + + diff --git a/archetypes/alfresco-share-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/alfresco-share-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index 25ed1b39..b3e56ffe 100644 --- a/archetypes/alfresco-share-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/archetypes/alfresco-share-jar-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -14,7 +14,7 @@ src/main/assembly - **/*.xml + ** diff --git a/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml index 6ef3c094..2af4e8e7 100644 --- a/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml +++ b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/amp.xml @@ -10,13 +10,40 @@ false + + - ${project.basedir}/src/main/resources/alfresco/module/${project.artifactId}/module.properties + src/main/resources/alfresco/module/${project.artifactId}/module.properties true + + + src/main/assembly/file-mapping.properties + false + + + + + src/main/assembly/lib + lib + + README.md + + + + + src/main/assembly/web + web + + README.md + + + + + lib diff --git a/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties new file mode 100644 index 00000000..501b3d63 --- /dev/null +++ b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/file-mapping.properties @@ -0,0 +1,27 @@ +# Custom AMP to WAR location mappings + +# +# The following property can be used to include the standard set of mappings. +# The contents of this file will override any defaults. The default is +# 'true', i.e. the default mappings will be augmented or modified by values in +# this file. +# +# Default mappings are: +# +# /config=/WEB-INF/classes +# /lib=/WEB-INF/lib +# /licenses=/WEB-INF/licenses +# /web/jsp=/jsp +# /web/css=/css +# /web/images=/images +# /web/scripts=/scripts +# /web/php=/php +# +include.default=true + +# +# Custom mappings. If 'include.default' is false, then this is the complete set. +# Map /web to / in AMP so we can override things like favicon.ico +# +/web=/ + diff --git a/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md new file mode 100644 index 00000000..ce318e18 --- /dev/null +++ b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/lib/README.md @@ -0,0 +1,19 @@ +# 3rd party libraries (JARs) that should be included in WAR + +Put here any 3rd party libraries (JARs) that are needed by customizations, +but that are not part of the out-of-the-box libraries in the *share/WEB-INF/lib* +directory. + +**Note**. Module dependency needs to be set to amp for the libs to be applied by MMT: + +` + + ${project.groupId} + some-share-jar + ${project.version} + amp + +` + +**Important**. If you need to use a library that is available out-of-the-box, then + include it as a *provided* dependency in the module. \ No newline at end of file diff --git a/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md new file mode 100644 index 00000000..44f75971 --- /dev/null +++ b/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/assembly/web/README.md @@ -0,0 +1,22 @@ +# Web resources that should override out-of-the-box files + +Put here any web resources that should override out-of-the-box +web resources, such as favicon.ico. They will then end up in the +*/web* directory in the AMP, and applied to the WAR, and override +any existing web resources in the Share.WAR. + +**Note**. Module dependency needs to be set to amp for the web resources to be applied by MMT: + +` + + ${project.groupId} + some-share-jar + ${project.version} + amp + +` + +**Important**. New web resources should not be located here, but instead + in the usual place in the *src/main/resources/META-INF/resources//* directory. + +