IDEMPIERE-5392 Maven Build: add flag to skip auto clean (#1447)
* IDEMPIERE-5392 Maven Build: add flag to skip auto clean * IDEMPIERE-5392 Maven Build: add flag to skip auto clean - Add -DmaterializeProduct flag. Use -DmaterializeProduct=none to turn off part of org.idempiere.p2 build. - Add parallel execution setting for test. * IDEMPIERE-5392 Maven Build: add flag to skip auto clean - handle potential multi threaded conflict on context property
This commit is contained in:
parent
ab78a8acbd
commit
360861e300
|
@ -11,29 +11,6 @@
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>auto-clean</id>
|
|
||||||
<phase>validate</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>clean</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<filesets>
|
|
||||||
<fileset>
|
|
||||||
<directory>${project.basedir}/lib</directory>
|
|
||||||
<includes>
|
|
||||||
<include>*.jar</include>
|
|
||||||
</includes>
|
|
||||||
<followSymlinks>false</followSymlinks>
|
|
||||||
</fileset>
|
|
||||||
</filesets>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
|
|
@ -9,20 +9,82 @@
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>org.idempiere.p2</artifactId>
|
<artifactId>org.idempiere.p2</artifactId>
|
||||||
<packaging>eclipse-repository</packaging>
|
<packaging>eclipse-repository</packaging>
|
||||||
|
<properties>
|
||||||
|
<materializeProduct>package</materializeProduct>
|
||||||
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<version>1.8</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<target>
|
||||||
|
<delete file="${project.basedir}/target/local-artifacts.properties" quiet="true"/>
|
||||||
|
<delete
|
||||||
|
dir="${project.basedir}/target/repository" quiet="true"/>
|
||||||
|
</target>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
|
<artifactId>tycho-p2-publisher-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default-publish-osgi-ee</id>
|
||||||
|
<goals>
|
||||||
|
<goal>publish-osgi-ee</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>${materializeProduct}</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-publish-categories</id>
|
||||||
|
<goals>
|
||||||
|
<goal>publish-categories</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>${materializeProduct}</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-publish-products</id>
|
||||||
|
<goals>
|
||||||
|
<goal>publish-products</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-attach-artifacts</id>
|
||||||
|
<goals>
|
||||||
|
<goal>attach-artifacts</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
<artifactId>tycho-p2-repository-plugin</artifactId>
|
<artifactId>tycho-p2-repository-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<!-- install the product using the p2 director -->
|
<id>default-assemble-repository</id>
|
||||||
<id>build-site-p2</id>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>assemble-repository</goal>
|
<goal>assemble-repository</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-archive-repository</id>
|
||||||
|
<goals>
|
||||||
|
<goal>archive-repository</goal>
|
||||||
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
@ -34,17 +96,17 @@
|
||||||
<xzCompress>false</xzCompress>
|
<xzCompress>false</xzCompress>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
<artifactId>tycho-p2-director-plugin</artifactId>
|
<artifactId>tycho-p2-director-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<!-- install the product using the p2 director -->
|
<!-- install the product using the p2 director -->
|
||||||
<id>materialize-products</id>
|
<id>default-materialize-products</id>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>materialize-products</goal>
|
<goal>materialize-products</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>${materializeProduct}</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
@ -58,7 +120,6 @@
|
||||||
</products>
|
</products>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho.extras</groupId>
|
<groupId>org.eclipse.tycho.extras</groupId>
|
||||||
<artifactId>tycho-eclipserun-plugin</artifactId>
|
<artifactId>tycho-eclipserun-plugin</artifactId>
|
||||||
|
@ -67,10 +128,11 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>default-eclipse-run</id>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>eclipse-run</goal>
|
<goal>eclipse-run</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<phase>package</phase>
|
<phase>${materializeProduct}</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
<url.file.srv>https://raw.githubusercontent.com/idempiere/binary.file/master</url.file.srv>
|
<url.file.srv>https://raw.githubusercontent.com/idempiere/binary.file/master</url.file.srv>
|
||||||
<extra.ui.install>org.eclipse.equinox.p2.director, org.idempiere.equinox.p2.director.feature.feature.group, org.idempiere.test.feature.feature.group</extra.ui.install>
|
<extra.ui.install>org.eclipse.equinox.p2.director, org.idempiere.equinox.p2.director.feature.feature.group, org.idempiere.test.feature.feature.group</extra.ui.install>
|
||||||
<idempiere.product.id>org.adempiere.server.product</idempiere.product.id>
|
<idempiere.product.id>org.adempiere.server.product</idempiere.product.id>
|
||||||
|
<skipClean>false</skipClean>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -505,6 +506,7 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<skip>${skipClean}</skip>
|
||||||
<filesets>
|
<filesets>
|
||||||
<fileset>
|
<fileset>
|
||||||
<directory>${project.basedir}/lib</directory>
|
<directory>${project.basedir}/lib</directory>
|
||||||
|
|
|
@ -14,16 +14,45 @@
|
||||||
<idempiere.home>..</idempiere.home>
|
<idempiere.home>..</idempiere.home>
|
||||||
<skipTests>true</skipTests>
|
<skipTests>true</skipTests>
|
||||||
<sonar.skip>true</sonar.skip>
|
<sonar.skip>true</sonar.skip>
|
||||||
|
<p1>-Djunit.jupiter.execution.parallel.enabled=true</p1>
|
||||||
|
<p2>-Djunit.jupiter.execution.parallel.mode.default=concurrent</p2>
|
||||||
|
<p3>-Djunit.jupiter.execution.parallel.config.strategy=fixed</p3>
|
||||||
|
<p4>-Djunit.jupiter.execution.parallel.config.fixed.parallelism=4</p4>
|
||||||
|
<p5>-Djunit.jupiter.execution.parallel.mode.classes.default=same_thread</p5>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>auto-clean</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>clean</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<skip>false</skip>
|
||||||
|
<filesets>
|
||||||
|
<fileset>
|
||||||
|
<directory>${project.basedir}/lib</directory>
|
||||||
|
<includes>
|
||||||
|
<include>*.jar</include>
|
||||||
|
</includes>
|
||||||
|
<followSymlinks>false</followSymlinks>
|
||||||
|
</fileset>
|
||||||
|
</filesets>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
<artifactId>tycho-surefire-plugin</artifactId>
|
<artifactId>tycho-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>
|
<argLine>
|
||||||
-DIDEMPIERE_HOME=${idempiere.home}
|
-DIDEMPIERE_HOME=${idempiere.home} ${p1} ${p2} ${p3} ${p4} ${p5}
|
||||||
</argLine>
|
</argLine>
|
||||||
<testRuntime>p2Installed</testRuntime>
|
<testRuntime>p2Installed</testRuntime>
|
||||||
<skipTests>${skipTests}</skipTests>
|
<skipTests>${skipTests}</skipTests>
|
||||||
|
|
|
@ -28,7 +28,9 @@ import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import org.adempiere.util.ServerContext;
|
||||||
import org.compiere.Adempiere;
|
import org.compiere.Adempiere;
|
||||||
import org.compiere.model.MAcctSchema;
|
import org.compiere.model.MAcctSchema;
|
||||||
import org.compiere.model.MClientInfo;
|
import org.compiere.model.MClientInfo;
|
||||||
|
@ -71,6 +73,8 @@ public abstract class AbstractTestCase {
|
||||||
* @param testInfo
|
* @param testInfo
|
||||||
*/
|
*/
|
||||||
protected void init(TestInfo testInfo) {
|
protected void init(TestInfo testInfo) {
|
||||||
|
ServerContext.setCurrentInstance(new Properties());
|
||||||
|
|
||||||
String trxName = Trx.createTrxName(getClass().getName()+"_");
|
String trxName = Trx.createTrxName(getClass().getName()+"_");
|
||||||
trx = Trx.get(trxName, true);
|
trx = Trx.get(trxName, true);
|
||||||
trx.start();
|
trx.start();
|
||||||
|
|
Loading…
Reference in New Issue