</dependencies>
<build>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/annotations/</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
*/
package org.oransc.portal.nonrtric.controlpanel.config;
+import java.lang.invoke.MethodHandles;
import org.apache.catalina.connector.Connector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
@Configuration
public class TomcatWebServerConfiguration {
+ private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+ @Value("${server.http.port}")
+ private int httpPort;
+
@Bean
public ServletWebServerFactory servletContainer() {
+ logger.debug("Http Port: {}", httpPort);
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
- tomcat.addAdditionalTomcatConnectors(getHttpConnector());
+ if (httpPort > 0) {
+ tomcat.addAdditionalTomcatConnectors(getHttpConnector(httpPort));
+ }
return tomcat;
}
- private static Connector getHttpConnector() {
+ private static Connector getHttpConnector(int port) {
Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
connector.setScheme("http");
- connector.setPort(8080);
+ connector.setPort(port);
connector.setSecure(false);
return connector;
}
# A spring property but without a "spring" prefix;
# the port number is chosen RANDOMLY when running tests
-server.port = 8434
+server.port = 8082
server.ssl.key-store-type = PKCS12
server.ssl.key-store-password = ericsson_kwdjfhw
server.ssl.key-store = classpath:keystore.jks
server.ssl.key-password = ericsson_kwdjfhw
+server.http.port = 8080