Loading archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml +3 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ <artifactId>alfresco-maven-plugin</artifactId> <version>${alfresco.sdk.version}</version> <configuration> <!-- Default is to run with a Community edition, change to 'enterprise' if using Enterprise edition --> <alfrescoEdition>community</alfrescoEdition> <!-- We need the flat file H2 database to run the Repo --> <enableH2>true</enableH2> <!-- We always need the Platform/Repo webapp - alfresco.war --> Loading archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/pom.xml +3 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,9 @@ <artifactId>alfresco-maven-plugin</artifactId> <version>${alfresco.sdk.version}</version> <configuration> <!-- Default is to run with a Community edition, change to 'enterprise' if using Enterprise edition --> <alfrescoEdition>community</alfrescoEdition> <!-- We need the flat file H2 database to run the Repo --> <enableH2>true</enableH2> <!-- This is a platform extension JAR, so we need the platform webapp (alfresco.war) --> Loading archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/pom.xml +3 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,9 @@ <artifactId>alfresco-maven-plugin</artifactId> <version>${alfresco.sdk.version}</version> <configuration> <!-- Default is to run with a Community edition, change to 'enterprise' if using Enterprise edition --> <alfrescoEdition>community</alfrescoEdition> <!-- We assume that the platform/repository is already running on localhost:8080 --> <enableH2>false</enableH2> <enablePlatform>false</enablePlatform> Loading plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RunMojo.java +50 −27 Original line number Diff line number Diff line Loading @@ -61,6 +61,9 @@ public class RunMojo extends AbstractMojo { public static final String PLATFORM_WAR_PREFIX_NAME = "platform"; public static final String SHARE_WAR_PREFIX_NAME = "share"; public static final String ALFRESCO_ENTERPRISE_EDITION = "enterprise"; public static final String ALFRESCO_COMMUNITY_EDITION = "community"; @Component protected MavenProject project; Loading @@ -81,6 +84,7 @@ public class RunMojo extends AbstractMojo { * <artifactId>alfresco-maven-plugin</artifactId> * <version>3.0.0</version> * <configuration> * <alfrescoEdition>community</alfrescoEdition> * <enableH2>true</enableH2> * <enablePlatform>true</enablePlatform> * <enableSolr>true</enableSolr> Loading Loading @@ -168,7 +172,7 @@ public class RunMojo extends AbstractMojo { /** * Community Edition or Enterprise Edition? (i.e community or enterprise) */ @Parameter(property = "maven.alfresco.edition", defaultValue = "community") @Parameter(property = "maven.alfresco.edition", defaultValue = ALFRESCO_COMMUNITY_EDITION) protected String alfrescoEdition; /** Loading Loading @@ -356,7 +360,7 @@ public class RunMojo extends AbstractMojo { * Replaces web.xml where applicable in platform webapp (alfresco.war), * commenting out the security-constraints. * <p/> * This is only needed for 5.0 (5.1 handles it automatically when turning off ssl via props) * This is only needed for 4.2, 5.0 (5.1 handles it automatically when turning off ssl via props) * * @throws MojoExecutionException */ Loading Loading @@ -429,6 +433,41 @@ public class RunMojo extends AbstractMojo { ); } /** * Copy the Alfresco Enterprise license to its correct place in the Platform WAR, if it exists. * * @throws MojoExecutionException */ protected void copyAlfrescoLicense() throws MojoExecutionException { final String warOutputDir = getWarOutputDir(PLATFORM_WAR_PREFIX_NAME); final String licDestDir = warOutputDir + "/WEB-INF/classes/alfresco/extension/license"; getLog().info("Copying Alfresco Enterprise license to: " + licDestDir); executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-resources-plugin"), version(MAVEN_RESOURCE_PLUGIN_VERSION) ), goal("copy-resources"), configuration( element(name("outputDirectory"), licDestDir), element(name("resources"), element(name("resource"), element(name("directory"), "src/main/resources/alfresco/extension/license"), element(name("includes"), element(name("include"), "*.lic") ), element(name("filtering"), "false") ) ) ), execEnv ); } /** * Build the customized Platform webapp (i.e. the Repository, alfresco.war) * that should be deployed by Tomcat by applying all AMPs and JARs from Loading @@ -439,6 +478,7 @@ public class RunMojo extends AbstractMojo { getPlatformWarArtifactId(), alfrescoPlatformVersion); commentOutSecureCommsInPlatformWebXml(); copyAlfrescoLicense(); String platformWarArtifactId = packageAndInstallCustomWar(PLATFORM_WAR_PREFIX_NAME); Loading Loading @@ -602,7 +642,6 @@ public class RunMojo extends AbstractMojo { final String warArtifactId = "${project.artifactId}-" + warName; final String warSourceDir = getWarOutputDir(warName); // Package the customized war file executeMojo( plugin( Loading Loading @@ -687,7 +726,6 @@ public class RunMojo extends AbstractMojo { // Copy the h2 scripts copyH2Dialect(); } if (enablePlatform) { Loading Loading @@ -876,23 +914,6 @@ public class RunMojo extends AbstractMojo { return false; } /** * TODO: Remove when we got h2-scripts in alfresco-repository for all artifacts * * Returns true if current platform version (i.e. version of alfresco.war) is * 5.0.b or 5.0.c (h2-scripts appears first in 5.0.d) * * @return true if platform version is 5.0.b or 5.0.c */ private boolean isPlatformVersion50bOr50c() { if (StringUtils.equalsIgnoreCase(alfrescoPlatformVersion, "5.0.b") || StringUtils.equalsIgnoreCase(alfrescoPlatformVersion, "5.0.c")) { return true; } return false; } /** * Get the Solr artifactId, it changes when we move to Solr 4 in Alfresco version 5 * Loading Loading @@ -921,6 +942,8 @@ public class RunMojo extends AbstractMojo { if (isPlatformVersionGtOrEqTo51() == false) { // We are running version 4.2 or 5.0, so use older artifactId alfrescoPlatformWarArtifactId = "alfresco"; } else if (alfrescoEdition.equals(ALFRESCO_ENTERPRISE_EDITION)) { alfrescoPlatformWarArtifactId = "alfresco-enterprise"; } return alfrescoPlatformWarArtifactId; Loading Loading @@ -956,12 +979,12 @@ public class RunMojo extends AbstractMojo { * @return */ private void copyH2Dialect() throws MojoExecutionException { getLog().info("Unpacking DB Dialects and ibatis"); getLog().info("Unpacking DB Dialects and ibatis files from alfresco-repository artifact"); executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.9") version(MAVEN_DEPENDENCY_PLUGIN_VERSION) ), goal("unpack"), configuration( Loading @@ -979,12 +1002,12 @@ public class RunMojo extends AbstractMojo { ); // If we're in enterprise we need to make sure we grab everything if (this.alfrescoEdition.equals( "enterprise" )) { if (this.alfrescoEdition.equals(ALFRESCO_ENTERPRISE_EDITION)) { executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.9") version(MAVEN_DEPENDENCY_PLUGIN_VERSION) ), goal("unpack"), configuration( Loading @@ -1002,12 +1025,12 @@ public class RunMojo extends AbstractMojo { ); } getLog().info("Extracting H2 Dialect"); getLog().info("Copying H2 Dialect SQL create files into target/test-classes"); executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-resources-plugin"), version("2.7") version(MAVEN_RESOURCE_PLUGIN_VERSION) ), goal("copy-resources"), configuration( Loading Loading
archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml +3 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ <artifactId>alfresco-maven-plugin</artifactId> <version>${alfresco.sdk.version}</version> <configuration> <!-- Default is to run with a Community edition, change to 'enterprise' if using Enterprise edition --> <alfrescoEdition>community</alfrescoEdition> <!-- We need the flat file H2 database to run the Repo --> <enableH2>true</enableH2> <!-- We always need the Platform/Repo webapp - alfresco.war --> Loading
archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/pom.xml +3 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,9 @@ <artifactId>alfresco-maven-plugin</artifactId> <version>${alfresco.sdk.version}</version> <configuration> <!-- Default is to run with a Community edition, change to 'enterprise' if using Enterprise edition --> <alfrescoEdition>community</alfrescoEdition> <!-- We need the flat file H2 database to run the Repo --> <enableH2>true</enableH2> <!-- This is a platform extension JAR, so we need the platform webapp (alfresco.war) --> Loading
archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/pom.xml +3 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,9 @@ <artifactId>alfresco-maven-plugin</artifactId> <version>${alfresco.sdk.version}</version> <configuration> <!-- Default is to run with a Community edition, change to 'enterprise' if using Enterprise edition --> <alfrescoEdition>community</alfrescoEdition> <!-- We assume that the platform/repository is already running on localhost:8080 --> <enableH2>false</enableH2> <enablePlatform>false</enablePlatform> Loading
plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RunMojo.java +50 −27 Original line number Diff line number Diff line Loading @@ -61,6 +61,9 @@ public class RunMojo extends AbstractMojo { public static final String PLATFORM_WAR_PREFIX_NAME = "platform"; public static final String SHARE_WAR_PREFIX_NAME = "share"; public static final String ALFRESCO_ENTERPRISE_EDITION = "enterprise"; public static final String ALFRESCO_COMMUNITY_EDITION = "community"; @Component protected MavenProject project; Loading @@ -81,6 +84,7 @@ public class RunMojo extends AbstractMojo { * <artifactId>alfresco-maven-plugin</artifactId> * <version>3.0.0</version> * <configuration> * <alfrescoEdition>community</alfrescoEdition> * <enableH2>true</enableH2> * <enablePlatform>true</enablePlatform> * <enableSolr>true</enableSolr> Loading Loading @@ -168,7 +172,7 @@ public class RunMojo extends AbstractMojo { /** * Community Edition or Enterprise Edition? (i.e community or enterprise) */ @Parameter(property = "maven.alfresco.edition", defaultValue = "community") @Parameter(property = "maven.alfresco.edition", defaultValue = ALFRESCO_COMMUNITY_EDITION) protected String alfrescoEdition; /** Loading Loading @@ -356,7 +360,7 @@ public class RunMojo extends AbstractMojo { * Replaces web.xml where applicable in platform webapp (alfresco.war), * commenting out the security-constraints. * <p/> * This is only needed for 5.0 (5.1 handles it automatically when turning off ssl via props) * This is only needed for 4.2, 5.0 (5.1 handles it automatically when turning off ssl via props) * * @throws MojoExecutionException */ Loading Loading @@ -429,6 +433,41 @@ public class RunMojo extends AbstractMojo { ); } /** * Copy the Alfresco Enterprise license to its correct place in the Platform WAR, if it exists. * * @throws MojoExecutionException */ protected void copyAlfrescoLicense() throws MojoExecutionException { final String warOutputDir = getWarOutputDir(PLATFORM_WAR_PREFIX_NAME); final String licDestDir = warOutputDir + "/WEB-INF/classes/alfresco/extension/license"; getLog().info("Copying Alfresco Enterprise license to: " + licDestDir); executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-resources-plugin"), version(MAVEN_RESOURCE_PLUGIN_VERSION) ), goal("copy-resources"), configuration( element(name("outputDirectory"), licDestDir), element(name("resources"), element(name("resource"), element(name("directory"), "src/main/resources/alfresco/extension/license"), element(name("includes"), element(name("include"), "*.lic") ), element(name("filtering"), "false") ) ) ), execEnv ); } /** * Build the customized Platform webapp (i.e. the Repository, alfresco.war) * that should be deployed by Tomcat by applying all AMPs and JARs from Loading @@ -439,6 +478,7 @@ public class RunMojo extends AbstractMojo { getPlatformWarArtifactId(), alfrescoPlatformVersion); commentOutSecureCommsInPlatformWebXml(); copyAlfrescoLicense(); String platformWarArtifactId = packageAndInstallCustomWar(PLATFORM_WAR_PREFIX_NAME); Loading Loading @@ -602,7 +642,6 @@ public class RunMojo extends AbstractMojo { final String warArtifactId = "${project.artifactId}-" + warName; final String warSourceDir = getWarOutputDir(warName); // Package the customized war file executeMojo( plugin( Loading Loading @@ -687,7 +726,6 @@ public class RunMojo extends AbstractMojo { // Copy the h2 scripts copyH2Dialect(); } if (enablePlatform) { Loading Loading @@ -876,23 +914,6 @@ public class RunMojo extends AbstractMojo { return false; } /** * TODO: Remove when we got h2-scripts in alfresco-repository for all artifacts * * Returns true if current platform version (i.e. version of alfresco.war) is * 5.0.b or 5.0.c (h2-scripts appears first in 5.0.d) * * @return true if platform version is 5.0.b or 5.0.c */ private boolean isPlatformVersion50bOr50c() { if (StringUtils.equalsIgnoreCase(alfrescoPlatformVersion, "5.0.b") || StringUtils.equalsIgnoreCase(alfrescoPlatformVersion, "5.0.c")) { return true; } return false; } /** * Get the Solr artifactId, it changes when we move to Solr 4 in Alfresco version 5 * Loading Loading @@ -921,6 +942,8 @@ public class RunMojo extends AbstractMojo { if (isPlatformVersionGtOrEqTo51() == false) { // We are running version 4.2 or 5.0, so use older artifactId alfrescoPlatformWarArtifactId = "alfresco"; } else if (alfrescoEdition.equals(ALFRESCO_ENTERPRISE_EDITION)) { alfrescoPlatformWarArtifactId = "alfresco-enterprise"; } return alfrescoPlatformWarArtifactId; Loading Loading @@ -956,12 +979,12 @@ public class RunMojo extends AbstractMojo { * @return */ private void copyH2Dialect() throws MojoExecutionException { getLog().info("Unpacking DB Dialects and ibatis"); getLog().info("Unpacking DB Dialects and ibatis files from alfresco-repository artifact"); executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.9") version(MAVEN_DEPENDENCY_PLUGIN_VERSION) ), goal("unpack"), configuration( Loading @@ -979,12 +1002,12 @@ public class RunMojo extends AbstractMojo { ); // If we're in enterprise we need to make sure we grab everything if (this.alfrescoEdition.equals( "enterprise" )) { if (this.alfrescoEdition.equals(ALFRESCO_ENTERPRISE_EDITION)) { executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.9") version(MAVEN_DEPENDENCY_PLUGIN_VERSION) ), goal("unpack"), configuration( Loading @@ -1002,12 +1025,12 @@ public class RunMojo extends AbstractMojo { ); } getLog().info("Extracting H2 Dialect"); getLog().info("Copying H2 Dialect SQL create files into target/test-classes"); executeMojo( plugin( groupId("org.apache.maven.plugins"), artifactId("maven-resources-plugin"), version("2.7") version(MAVEN_RESOURCE_PLUGIN_VERSION) ), goal("copy-resources"), configuration( Loading