DPascalBernard / maven-alfresco-archetypes

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

Set force=false by default when invoking ModuleManagementTool.install command #114

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When running an AMP installation into the Alfresco/Share WAR file (using the 
-Pamp-to-war or using the maven-war-plugin overlay syntax), the Alfresco Maven 
Plugin invokes ModuleManagementTool.install using force=true (by default).

The force flag instructs the MMT that files present in the AMP should overWrite 
what's in the WAR (assuming files have the same relative location in the WAR)

This behaviour is not advised, because it would easily lead to unwanted changes 
into Alfresco, making hard to separate customisation from Alfresco-related 
issues.

The default should be force=false; in this case, if an AMP file has the same 
location of an existing file in the WAR, the MMT invocation would throw an 
exception, stating which resource is conflicting:

org.alfresco.repo.module.tool.ModuleManagementToolException: 01200001 ERROR: 
The amp will overwrite an existing file in the war '/WEB-INF/lib/test.jar'. 
Execution halted.  By specifying -force , you can force installation of AMP 
regardless of the current war state.

Original issue reported on code.google.com by mauri...@session.it on 20 Feb 2013 at 12:01

GoogleCodeExporter commented 9 years ago

Original comment by maurizio...@alfresco.com on 20 Feb 2013 at 12:03

GoogleCodeExporter commented 9 years ago
Re-assigned

Original comment by colum...@gmail.com on 20 Feb 2013 at 12:06

GoogleCodeExporter commented 9 years ago
Issue 115 has been merged into this issue.

Original comment by maurizio...@alfresco.com on 2 Jul 2013 at 12:30

GoogleCodeExporter commented 9 years ago
Fixed in the Snapshot release of MMT:

=======================================
--- /trunk/plugins/alfresco-maven-plugin/pom.xml        Tue Jul  2 03:19:20 2013
+++ /trunk/plugins/alfresco-maven-plugin/pom.xml        Tue Jul  2 03:23:14 2013
@@ -84,7 +84,7 @@
     <dependency>
       <groupId>org.alfresco</groupId>
       <artifactId>alfresco-mmt</artifactId>
-      <version>4.2.d-SNAPSHOT</version>
+      <version>4.2.d-20130514.020755-103</version>
     </dependency>
   </dependencies>

Tested successfully on trunk (rev. 684)

The force flag is still true (by default), but when resources get overridden in 
the Alfresco/Share WAR, Maven will print out a WARN

Original comment by maurizio...@alfresco.com on 2 Jul 2013 at 12:38

GoogleCodeExporter commented 9 years ago
Using released version of alfresco-mmt:

    <dependency>
      <groupId>org.alfresco</groupId>
      <artifactId>alfresco-mmt</artifactId>
      <version>4.2.d-beta</version>
    </dependency>

Original comment by maurizio...@alfresco.com on 2 Jul 2013 at 1:42