mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-08-07 17:49:34 +00:00
This commit is contained in:
@@ -84,6 +84,7 @@ public class InstallMojo extends AbstractMojo {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() throws MojoExecutionException, MojoFailureException {
|
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||||
if (skipAmpInstallation) {
|
if (skipAmpInstallation) {
|
||||||
|
getLog().info("AMP Installation is skipped via configuration");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Checks appropriate input params are in place
|
// Checks appropriate input params are in place
|
||||||
|
@@ -1,20 +1,12 @@
|
|||||||
package org.alfresco.maven.plugin.archiver;
|
package org.alfresco.maven.plugin.archiver;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import org.alfresco.repo.module.tool.ModuleManagementTool;
|
import org.alfresco.repo.module.tool.ModuleManagementTool;
|
||||||
import org.apache.maven.execution.MavenSession;
|
import org.apache.maven.execution.MavenSession;
|
||||||
import org.apache.maven.model.ConfigurationContainer;
|
|
||||||
import org.apache.maven.model.Plugin;
|
import org.apache.maven.model.Plugin;
|
||||||
import org.apache.maven.model.PluginConfiguration;
|
|
||||||
import org.apache.maven.plugin.ContextEnabled;
|
|
||||||
import org.apache.maven.plugin.LegacySupport;
|
import org.apache.maven.plugin.LegacySupport;
|
||||||
import org.apache.maven.plugin.MojoExecution;
|
|
||||||
import org.apache.maven.plugin.MojoExecutionException;
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.codehaus.plexus.archiver.ArchiverException;
|
import org.codehaus.plexus.archiver.ArchiverException;
|
||||||
import org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver;
|
import org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver;
|
||||||
@@ -28,31 +20,28 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
|
|||||||
*/
|
*/
|
||||||
public class AmpUnArchiver extends AbstractZipUnArchiver {
|
public class AmpUnArchiver extends AbstractZipUnArchiver {
|
||||||
|
|
||||||
|
@Requirement
|
||||||
|
private LegacySupport legacySupport;
|
||||||
|
|
||||||
public AmpUnArchiver()
|
public AmpUnArchiver()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@Requirement
|
|
||||||
private LegacySupport legacySupport;
|
|
||||||
|
|
||||||
private Map pluginContext = new HashMap();
|
protected File destDirectory;
|
||||||
|
|
||||||
/**
|
|
||||||
* @parameter default-value="${mojoExecution}"
|
|
||||||
* @readonly
|
|
||||||
*/
|
|
||||||
private MojoExecution mojoExecution;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
/**
|
/**
|
||||||
* By default the AMPs are unpacked in ${project.directory}/${project.build.finalName}
|
* By default the AMPs are unpacked in ${project.directory}/${project.build.finalName}
|
||||||
*/
|
*/
|
||||||
public File getDestDirectory() {
|
public File getDestDirectory() {
|
||||||
|
MavenSession session = legacySupport.getSession();
|
||||||
|
MavenProject project = session.getCurrentProject().getExecutionProject();
|
||||||
|
|
||||||
|
|
||||||
MavenSession session = legacySupport.getSession();
|
|
||||||
MavenProject project = session.getCurrentProject();
|
|
||||||
// By default we use build finalName
|
|
||||||
File location = new File(project.getBuild().getDirectory() + File.separator + project.getBuild().getFinalName());
|
File location = new File(project.getBuild().getDirectory() + File.separator + project.getBuild().getFinalName());
|
||||||
// If the war plugin configures a custom webappDirectory instead, we pick it up
|
// If the war plugin configures a custom webappDirectory instead, we pick it up - this only works is this is defined in the main maven-war-plugin configuration
|
||||||
|
// TODO fix it for executions, see https://github.com/Alfresco/alfresco-sdk/issues/297
|
||||||
Plugin warPlugin = project.getPlugin("org.apache.maven.plugins:maven-war-plugin");
|
Plugin warPlugin = project.getPlugin("org.apache.maven.plugins:maven-war-plugin");
|
||||||
if(warPlugin != null)
|
if(warPlugin != null)
|
||||||
{
|
{
|
||||||
@@ -72,9 +61,10 @@ public class AmpUnArchiver extends AbstractZipUnArchiver {
|
|||||||
|
|
||||||
}
|
}
|
||||||
return location;
|
return location;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
//@Override
|
||||||
protected void execute() throws ArchiverException {
|
protected void execute() throws ArchiverException {
|
||||||
try {
|
try {
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +103,5 @@ public class AmpUnArchiver extends AbstractZipUnArchiver {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
2
pom.xml
2
pom.xml
@@ -192,6 +192,8 @@
|
|||||||
<maven.release.goals>deploy site-deploy</maven.release.goals>
|
<maven.release.goals>deploy site-deploy</maven.release.goals>
|
||||||
<maven.site.version>3.4</maven.site.version>
|
<maven.site.version>3.4</maven.site.version>
|
||||||
<maven.changes.version>2.10</maven.changes.version>
|
<maven.changes.version>2.10</maven.changes.version>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.7</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
Reference in New Issue
Block a user