In Winodws’ Control Panel \ System \ Advanced \ Environment Variables define the global variable:
JAVA_HOME=C:\PROGRA~1\Java\jdk1.8.0_172\
Note that the \Program Files directory is referred using its 8:3 file name, in order to exclude any spaces from the path, which cause scripting problems.
As of http://wiki.eclipse.org/Eclipse.ini Eclipse uses the PATH environment variable to search the JVM to run. In Windows the path to the default installation of JAVA executable contains a space, which causes problems in resolving Maven dependencies referring ${java.home} in Eclipse environment. Therefore it is needed to set the path to JAVA using the 8:3 file names:
-vm C:\PROGRA~1\Java\jdk1.8.0_172\bin\javaw.exe
where the path is an example of the 8:3 reference to the javaw.exe of of the JVM to use.
M2_HOME = <Maven installation directory in **8:3 name format**>
PATH=%M2_HOME%\bin;%PATH%
if "%DEBUG_PORT%" == "" set DEBUG_PORT=8000 if "%DEBUG_SUSPEND%" == "" set DEBUG_SUSPEND=n set MAVEN_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=%DEBUG_SUSPEND%,address=%DEBUG_PORT%
</profiles> <profile> <id>settings</id> <pluginRepositories> <pluginRepository> <id>public-tools</id> <name>Repository of any public/external maven plugins/tools.</name> <url>....</url> </pluginRepository> </pluginRepositories> <repositories> <repository> <id>public-components</id> <name> Any external components of modelant. It is isolated to allow analysis of vulnerabilities, licenses, etc. imposed through dependencies </name> <url>....</url> </repository> </repositories> <properties> <googleAnalyticsAccountId>....</googleAnalyticsAccountId> <gpg.passphrase>....</gpg.passphrase> </properties> </profile> </profiles> <activeProfiles> <activeProfile>settings</activeProfile> </activeProfiles>
NOTE: The components (transitive dependencies) of the modelant, that are used in runtime, are collected in the public-components repository, separated from the components of Maven (any other tools) used in compile time. This allows analyzing them as the whole repository contents for vulberabilities and security risks. Nexus provides such analysis.
References: * Introduction to Maven profiles * Maven repositories
Facts:
Therefore:
Thus, run as separate commands:
mvn clean deploy
mvn test
mvn install
As of Skipping Tests:
mvn install -DskipTests
mvn install -Dmaven.test.skip=true
The default in Modelant project is Maven to run the tests in a dedicated JVM. The control on the debug port and suspend of that JVM is done through the POM properties:
DEBUG_PORT (default: 7000) DEBUG_SUSPEND (default: n)
Usage:
mvn test -DDEBUG_SUSPEND=y
Maven runs the plugins in the same JVM that runs Maven. According to the setup procedure, the control of the Maven JVM is done through the OS environment variables:
DEBUG_PORT (default: 8000) DEBUG_SUSPEND (default: n)
Usage:
set DEBUG_SUSPEND=y mvn test
mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase
Use the “sites” generated for the modelant’s modules and combine them in a single site by calling the site plugin:
mvn site:site
The site is produced in the modelant’s taget/staged-site directory.
Deploy it to the hosting site with:
mvn site:deploy
Or just call the site-deploy phase of the site lifecycle:
mvn site-deploy
Implemented following the process in
mvn clean install archetype:update-local-catalog
In order to publish the modelant components in Maven Central (through OSSHR) activate the production profile:
mvn clean deploy -P production
References: