From 766847585e001561b73dccabb46e9e164d4f87f4 Mon Sep 17 00:00:00 2001
From: Jose Luis Osorno
* This is a JUnit test runner that is designed to work with an Alfresco repository.
* It detects if it's executing a test inside of a running Alfresco instance. If that
* is the case the tests are all run normally. If however the test is being run from
@@ -54,14 +55,15 @@ import java.io.*;
* test an HTTP request is made to a Web Script in a running Alfresco instance. This
* Web Script runs the test and returns enough information to this class so we can
* emulate having run the test locally.
- *
* By doing this, we are able to create Integration Tests (IT) using standard JUnit * capabilities. These can then be run from our IDEs with the associated visualizations, * support for re-running failed tests, etc. - *
+ * * Integration testing framework donated by Zia Consulting * - * @author Bindu Wavell* By default the ${@link AlfrescoTestRunner} will attempt to find a * running Alfresco instance at http://localhost:8080/alfresco * This annotation can be applied to a test class to have the * proxy calls go to a different host/port. - *
+ * * Integration testing framework donated by Zia Consulting. * - * @author Bindu Wavell* This Web Script works in consort with the ${@link AlfrescoTestRunner}. When a test is run from an IDE or * command line, the Alfresco test runner sends a proxied request to perform the test to this script. This runs * the test and wraps the results up so that the test initiator can be fooled into thinking they are * running the tests locally. - *
+ * * Integration testing framework donated by Zia Consulting. * - * @author Bindu Wavelltrue
if Tomcat is already running, false
otherwise
*/
protected boolean tomcatIsRunning() {
@@ -464,7 +468,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Download and unpack the Solr 4 configuration as we don't have it in the project.
* It will reside under /alf_data_dev/solr
*
- * @throws MojoExecutionException
+ * @throws MojoExecutionException when any problem appears unpacking the Solr configuration
*/
protected void unpackSolrConfig() throws MojoExecutionException {
getLog().info("Unpacking Solr config");
@@ -497,7 +501,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* For windows paths, convert single \ to / for the ${alfresco.solr.data.dir} path,
* by default it will be c:\bla\, we need forward slash or double backslash.
*
- * @throws MojoExecutionException
+ * @throws MojoExecutionException when any problem appears fixing the Solr home path
*/
protected void fixSolrHomePath() throws MojoExecutionException {
getLog().info("Fix Solr Home Path to work in Windows");
@@ -524,7 +528,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Copy custom solr configuration files over, so a
* developer can overwrite any files needed
*
- * @throws MojoExecutionException
+ * @throws MojoExecutionException when any problem appears copying the Solr custom configuration
*/
protected void copySolrCustomConfig() throws MojoExecutionException {
getLog().info("Copying custom Solr config");
@@ -553,7 +557,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Replace property placeholders in configuration files for the cores, so the
* index files can be found for each core when Solr starts up.
*
- * @throws MojoExecutionException
+ * @throws MojoExecutionException when any problem appears replacing the Solr configuration properties
*/
protected void replaceSolrConfigProperties() throws MojoExecutionException {
getLog().info("Replacing Solr config properties");
@@ -601,7 +605,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* If we are in Alfresco version 4.2 or younger the Solr 1.0 WAR is not available as Maven artifact, just
* as part of a ZIP file, so install it locally so we can deploy from embedded tomcat
*
- * @throws MojoExecutionException
+ * @throws MojoExecutionException when any problem appears installing Solr10 in the local repository
*/
protected void installSolr10InLocalRepo() throws MojoExecutionException {
if (isPlatformVersionLtOrEqTo42()) {
@@ -715,12 +719,13 @@ public abstract class AbstractRunMojo extends AbstractMojo {
}
/**
+ * * Replaces web.xml where applicable in platform webapp (alfresco.war), * commenting out the security-constraints. - *
+ * * This is only needed for 4.2, 5.0 (5.1 handles it automatically when turning off ssl via props) * - * @throws MojoExecutionException + * @throws MojoExecutionException when any problem appears commenting out the security configuration */ protected void commentOutSecureCommsInPlatformWebXml() throws MojoExecutionException { if (isPlatformVersionGtOrEqTo51()) { @@ -764,7 +769,7 @@ public abstract class AbstractRunMojo extends AbstractMojo { * enterprise db config) that will be used when running Alfresco. It contains database connection parameters and * other general configuration for Alfresco Repository (alfresco.war) * - * @throws MojoExecutionException + * @throws MojoExecutionException when any problem appears copying the Alfresco global properties file */ protected void copyAlfrescoGlobalProperties() throws MojoExecutionException { getLog().info("Copying and filtering alfresco-global-*.properties files to target/test-classes"); @@ -856,7 +861,7 @@ public abstract class AbstractRunMojo extends AbstractMojo { * Rename the configured database specific alfresco-global-*.properties file to * alfresco-global.properties so it will be used during Tomcat run. * - * @throws MojoExecutionException + * @throws MojoExecutionException when any problem appears renaming the alfresco global properties */ protected void renameAlfrescoGlobalProperties() throws MojoExecutionException { String alfrescoGlobalFilePath = project.getBuild().getTestOutputDirectory() + "/alfresco-global-"; @@ -904,7 +909,7 @@ public abstract class AbstractRunMojo extends AbstractMojo { * Copy the Alfresco Enterprise license to its correct place in the Platform WAR, if it exists. * It is not enough to have it on the test classpath, then it will start up as Trial license... * - * @throws MojoExecutionException + * @throws MojoExecutionException when any problem appears copying the Alfresco license */ protected void copyAlfrescoLicense() throws MojoExecutionException { if (alfrescoEdition.equals(ALFRESCO_COMMUNITY_EDITION)) { @@ -943,7 +948,7 @@ public abstract class AbstractRunMojo extends AbstractMojo { /** * Copy the Activiti Log4J Dev config into the activitiApp-war/WEB-INF/classes dir. * - * @throws MojoExecutionException + * @throws MojoExecutionException when any problem appears copying the activity Log4J dev configuration */ protected void copyActivitiLog4JDevConfig() throws MojoExecutionException { final String warOutputDir = getWarOutputDir(ACTIVITI_APP_WAR_PREFIX_NAME); @@ -978,7 +983,7 @@ public abstract class AbstractRunMojo extends AbstractMojo { /** * Copy Share Config Custom in order to have global overrides for development and dynamic port * - * @throws MojoExecutionException + * @throws MojoExecutionException when any problem appears copying share config custom file */ protected void copyShareConfigCustom() throws MojoExecutionException { final String warOutputDir = getWarOutputDir(SHARE_WAR_PREFIX_NAME); @@ -1019,7 +1024,7 @@ public abstract class AbstractRunMojo extends AbstractMojo { * There is no custom classpath resolve mechanism for Share log4j, * to log custom stuff overriding standard log4j.properties is needed. * - * @throws MojoExecutionException + * @throws MojoExecutionException when any problem appears copying the share log4j configuration */ protected void copyShareLog4jConfig() throws MojoExecutionException { if (!useCustomShareLog4jConfig) { @@ -1059,7 +1064,9 @@ public abstract class AbstractRunMojo extends AbstractMojo { /** * Copy and Build hotswap-agent.properties * - * @throws MojoExecutionException + * @param warPrefix path to the war root directory + * + * @throws MojoExecutionException when any problem appears copying hotswap agent properties */ protected void copyHotswapAgentProperties(String warPrefix) throws MojoExecutionException { if ( copyHotswapAgentConfig == false ) { @@ -1093,6 +1100,8 @@ public abstract class AbstractRunMojo extends AbstractMojo { * Build the customized Platform webapp (i.e. the Repository, alfresco.war) * that should be deployed by Tomcat by applying all AMPs and JARs from * the {@code* Performs a AMP to WAR overlay invoking the Alfresco Repository ModuleManagementTool. * It therefore wraps and emulates the same WAR overlay performed by Alfresco MMT. - *
+ * * This goal will install the AMP file(s) found in ${ampLocation} onto the WAR (or exploded WAR) found in ${warLocation} * * @version $Id:$ diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/IntegrationTestMojo.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/IntegrationTestMojo.java index 6c36f76e..b2dbc520 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/IntegrationTestMojo.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/IntegrationTestMojo.java @@ -35,12 +35,13 @@ import java.util.Properties; import static org.twdata.maven.mojoexecutor.MojoExecutor.*; /** + ** Alfresco Plugin mojo that are used when you want to run Integration Tests. * It will package up all the Integration Test classes and execute contained * tests with the Maven Failsafe plugin. The test classes will be added * to the platform war so they can be executed remotely via - * the ${@link org.alfresco.rad.test.AlfrescoTestRunner} - *
+ * the AlfrescoTestRunner. + * * The Alfresco RAD module is also added to the Platform WAR so * the Alfresco Test runner classes are available. * diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshMojo.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshMojo.java index 26427eb0..b0ff0ea8 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshMojo.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshMojo.java @@ -21,11 +21,12 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; /** + ** Refresh Alfresco Repo and Share Mojo. * Will refresh the Web Script container so new and changed * Spring Surf Web Scripts are detected. * Will also clear the dependency caches for web resources (CSS, JS, etc). - *
+ * * It is important to execute the refresh calls in the compile phase, * otherwise the files will be copied after this and the refresh calls * will not be recognized. diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshRepoWebappMojo.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshRepoWebappMojo.java index c741c90a..9e38ab9b 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshRepoWebappMojo.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshRepoWebappMojo.java @@ -21,10 +21,11 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; /** + ** Refresh Alfresco Repository (alfresco.war) Mojo. * Will refresh the Web Script container so new and changed * Web Scripts are detected. - *
+ * * It is important to execute the refresh calls in the compile phase, * otherwise the files will be copied after this and the refresh calls * will not be recognized. diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshShareWebappMojo.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshShareWebappMojo.java index 157e1898..30b40567 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshShareWebappMojo.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RefreshShareWebappMojo.java @@ -21,11 +21,12 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; /** + ** Refresh Alfresco Share (share.war) Mojo. * Will refresh the Web Script container so new and changed * Spring Surf Web Scripts are detected. * Will also clear the dependency caches for web resources (CSS, JS, etc). - *
+ * * It is important to execute the refresh calls in the compile phase, * otherwise the files will be copied after this and the refresh calls * will not be recognized. diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java index 234d57fa..41d363c9 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/VersionMojo.java @@ -28,8 +28,7 @@ import org.apache.maven.project.MavenProject; /** * Removes -SNAPSHOT suffix from the version number (if present), optionally replacing it with a timestamp. - * The result is provided in the Maven property ${noSnapshotVersion} (name can be changed using - ** Defines an Alfresco extension module dependency (JAR or AMP) to be * overlayed on an Alfresco webapp file. - *
+ * + ** This is so we can skip the WAR projects in the AIO project, * and so we can include the Share Services AMP when running * with a simple platform JAR. - *
+ * + ** This class is used by the RunMojo class. - *
+ * * Alfresco Maven Plugin config looks something like this: ** {@code diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatDependency.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatDependency.java index 7fcb5122..05c64429 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatDependency.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatDependency.java @@ -19,8 +19,9 @@ package org.alfresco.maven.plugin.config; /** + ** Tomcat Dependency used in Embedded Tomcat Maven plugin configuration. - *
+ * * Alfresco Maven Plugin config looks something like this: ** {@code diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatWebapp.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatWebapp.java index f4793300..f489bb9e 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatWebapp.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/config/TomcatWebapp.java @@ -18,11 +18,12 @@ package org.alfresco.maven.plugin.config; /** + ** Tomcat Webapp used in Embedded Tomcat Maven plugin configuration. * These are custom webapps that you would want to include for some reason * (The {webapp artifact}.war need to be available in a Maven Repo). * Note. the standard webapps are included with plugin properties such as enablePlatform and enableShare. - *
+ * * Alfresco Maven Plugin config looks something like this: ** {@code diff --git a/pom.xml b/pom.xml index c3a8f397..e4a2af28 100644 --- a/pom.xml +++ b/pom.xml @@ -152,6 +152,59 @@${skipTests} ++ org.apache.maven.plugins +maven-javadoc-plugin ++ ++ ++ +goal +a + Goal: ++ +requiresDependencyResolution +a + Requires Dependency Resolution: ++ +description +a + Description: ++ +phase +a + Phase: ++ +requiresProject +a + Requires Project: ++ +threadSafe +a + Thread-Safe: ++ +required +a + Required: ++ +readonly +a + Read only: ++ +parameter +a + Parameter: +