Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mindthegab opened this issue Jul 20, 2014 · 5 comments

Comments

@mindthegab
Copy link
Contributor

From mauri...@session.it on February 20, 2013 07:01:04

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: http://code.google.com/p/maven-alfresco-archetypes/issues/detail?id=114

@mindthegab
Copy link
Contributor Author

From maurizio...@alfresco.com on February 20, 2013 04:03:15

Labels: -Type-Defect Type-Enhancement

@mindthegab
Copy link
Contributor Author

From colum...@gmail.com on February 20, 2013 04:06:59

Re-assigned

Owner: maurizio...@alfresco.com
Labels: Milestone-Release-sdk-1.0.2

@mindthegab
Copy link
Contributor Author

From maurizio...@alfresco.com on July 02, 2013 05:30:22

Issue 115 has been merged into this issue.

@mindthegab
Copy link
Contributor Author

From maurizio...@alfresco.com on July 02, 2013 05:38:20

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 @@

org.alfresco
alfresco-mmt

  •  <version>4.2.d-SNAPSHOT</version>
    
  •  <version>4.2.d-20130514.020755-103</version>
    

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

Status: Verified

@mindthegab
Copy link
Contributor Author

From maurizio...@alfresco.com on July 02, 2013 06:42:24

Using released version of alfresco-mmt:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant