openhab-core/itests/pom.xml

232 lines
7.6 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openhab.core</groupId>
<artifactId>org.openhab.core.reactor</artifactId>
<version>5.0.0-SNAPSHOT</version>
</parent>
<groupId>org.openhab.core.itests</groupId>
<artifactId>org.openhab.core.reactor.itests</artifactId>
<packaging>pom</packaging>
<name>openHAB Core :: Integration Tests</name>
<modules>
<module>org.openhab.core.tests</module>
<module>org.openhab.core.auth.oauth2client.tests</module>
<module>org.openhab.core.automation.tests</module>
<module>org.openhab.core.automation.module.core.tests</module>
<module>org.openhab.core.automation.module.timer.tests</module>
<module>org.openhab.core.automation.module.script.tests</module>
<module>org.openhab.core.automation.integration.tests</module>
<module>org.openhab.core.addon.tests</module>
<module>org.openhab.core.config.core.tests</module>
<module>org.openhab.core.config.discovery.mdns.tests</module>
<module>org.openhab.core.config.discovery.tests</module>
<module>org.openhab.core.config.discovery.usbserial.tests</module>
<module>org.openhab.core.config.dispatch.tests</module>
<module>org.openhab.core.ephemeris.tests</module>
<module>org.openhab.core.io.net.tests</module>
<module>org.openhab.core.io.rest.core.tests</module>
<module>org.openhab.core.model.item.tests</module>
<module>org.openhab.core.model.rule.tests</module>
<module>org.openhab.core.model.script.tests</module>
<module>org.openhab.core.model.thing.testsupport</module>
<module>org.openhab.core.model.thing.tests</module>
<module>org.openhab.core.storage.json.tests</module>
<module>org.openhab.core.thing.tests</module>
<module>org.openhab.core.voice.tests</module>
</modules>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<m2e.jdt.annotationpath>target/dependency</m2e.jdt.annotationpath>
Always run OSGi HTTP service on random port in itests (#2759) It is probably always a good idea to run the OSGi HTTP service on a random available port in itests. This fixes some stacktraces when running itests and it will also prevent future issues when tests using the HTTP service are written. These stacktraces often show when running itests in parallel: ``` org.ops4j.pax.web.pax-web-runtime [org.ops4j.pax.web.service.internal.HttpServiceStarted] ERROR : Could not start the servlet context for context path [] java.io.IOException: Failed to bind to /0.0.0.0:8080 at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349) at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) at org.eclipse.jetty.server.Server.doStart(Server.java:401) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:350) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:255) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:226) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:210) at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:69) at org.openhab.core.io.http.servlet.BaseOpenHABServlet.activate(BaseOpenHABServlet.java:56) at org.openhab.core.io.http.servlet.OpenHABServlet.activate(OpenHABServlet.java:40) ... ``` Similar to: openhab/openhab-addons#11523 Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-14 08:09:55 +01:00
<org.osgi.service.http.port>9090</org.osgi.service.http.port>
</properties>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.3.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.openhab-core</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.compile</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>unpack-eea</id>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.lastnpe.eea</groupId>
<artifactId>eea-all</artifactId>
<version>${eea.version}</version>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>itests-os-unix-only</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<modules>
<module>org.openhab.core.config.discovery.usbserial.linuxsysfs.tests</module>
</modules>
</profile>
<profile>
<id>itests-common</id>
<activation>
<file>
<exists>itest.bndrun</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.test</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.test-index</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.openhab-core-index</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openhab.core.bom</groupId>
<artifactId>org.openhab.core.bom.runtime-index</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bndfile>itest.bndrun</bndfile>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-indexer-maven-plugin</artifactId>
<configuration>
<includeJar>true</includeJar>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-testing-maven-plugin</artifactId>
<configuration>
<bndruns>
<bndrun>itest.bndrun</bndrun>
</bndruns>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-resolver-maven-plugin</artifactId>
<configuration>
<bndruns>
<bndrun>itest.bndrun</bndrun>
</bndruns>
</configuration>
</plugin>
Always run OSGi HTTP service on random port in itests (#2759) It is probably always a good idea to run the OSGi HTTP service on a random available port in itests. This fixes some stacktraces when running itests and it will also prevent future issues when tests using the HTTP service are written. These stacktraces often show when running itests in parallel: ``` org.ops4j.pax.web.pax-web-runtime [org.ops4j.pax.web.service.internal.HttpServiceStarted] ERROR : Could not start the servlet context for context path [] java.io.IOException: Failed to bind to /0.0.0.0:8080 at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349) at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) at org.eclipse.jetty.server.Server.doStart(Server.java:401) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:350) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:255) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:226) at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:210) at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:69) at org.openhab.core.io.http.servlet.BaseOpenHABServlet.activate(BaseOpenHABServlet.java:56) at org.openhab.core.io.http.servlet.OpenHABServlet.activate(OpenHABServlet.java:40) ... ``` Similar to: openhab/openhab-addons#11523 Signed-off-by: Wouter Born <github@maindrain.net>
2022-02-14 08:09:55 +01:00
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<portNames>
<portName>org.osgi.service.http.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>