Integration test with maven - java

I want to be able to run Unit tests and integration tests separately.
The problem is that even though from my child pom.xml I specify that, when I run:
mvn verify -P integration-test
I want to just run the tests in src/it/java, but it just executes all the tests.
My directories are:
edms-pro
pom.xml (the general one)
...
rest-servides
src
it
java
resources
pom.xml (the child one)
pom.xml (the child one)
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.everis</groupId>
<artifactId>edms-pro</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<name>Big Content Services</name>
<artifactId>rest-services</artifactId>
<packaging>jar</packaging>
<properties>
<skip.unit.tests>false</skip.unit.tests>
<skip.integration.tests>true</skip.integration.tests>
</properties>
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>integration-test</id>
<properties>
<!--
Only integration tests are run when the integration-test profile is active
-->
<skip.integration.tests>false</skip.integration.tests>
<skip.unit.tests>true</skip.unit.tests>
</properties>
</profile>
</profiles>
<dependencies>
<!-- Spring components -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>com.ryantenney.metrics</groupId>
<artifactId>metrics-spring</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Lombok Java extensions -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- Apache Commons -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- JSR-305 annotations for Software Defect Detection -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<!-- Google Guava core libraries for Java -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- Logging -->
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
</dependency>
<!-- Apache http components -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.everis</groupId>
<artifactId>edms-mocks</artifactId>
<version>${com.everis.edms.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.everis</groupId>
<artifactId>edms-backend-couchbase</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.everis</groupId>
<artifactId>multitenancy-test</artifactId>
<version>${com.everis.edms.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>${dist.classifier}</classifier>
</configuration>
</plugin>
<!-- A partir d'aqui afegir per Hector respecte diseny original-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<!--<version>1.12</version> -->
<executions>
<execution>
<id>add-integration-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<!-- Configures the source directory of our integration tests -->
<sources>
<source>src/it/java</source>
</sources>
</configuration>
</execution>
<!-- Add a new resource directory to our build -->
<execution>
<id>add-integration-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<!-- Configures the resource directory of our integration tests -->
<resources>
<resource>
<filtering>true</filtering>
<directory>src/it/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!--<version>3.5</version> -->
<configuration>
<!--<source>${jdk.version}</source>
<target>${jdk.version}</target> -->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!--<version>2.19.1</version> -->
<configuration>
<!--<groups>com.testwithspring.intermediate.unittests.UnitTest</groups>-->
<!--
Skips unit tests if the value of skip.unit.tests
property is true
-->
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<!--<id>integration-tests</id>-->
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<testSourceDirectory>src/it/java</testSourceDirectory>
<!--
<includes>
<include>src/it/*.java</include>
</includes> -->
<!--<groups>com.testwithspring.intermediate.integrationtests.IntegrationTest</groups>-->
<!--
Skips integration tests if the value of skip.integration.tests
property is true
-->
<skipTests>${skip.integration.tests}</skipTests>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I run mvn verify -P integration-test from the main directory and I would like just to test the scripts inside the folders called "it".

Here's what we do on my projects.
First, /src/it/java is non-standard, so we put all test source under /src/test/java.
With a shared test source root directory, you can keep integration tests and unit test separate by adopting a naming convention for your test classes. For example, *UT.java, or UT_*.java for unit tests, and *IT.java or IT_*.java for integration tests.
Then, you can use both the includes/excludes options on the failsafe and surefire plug-ins to execute the correct tests in each. In the surefire plugin, include only the UT sources, and exclude the IT sources. In failsafe, simply do the opposite.
For example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!--<version>2.19.1</version> -->
<configuration>
<includes>
<include>**/*UT.java</include>
</includes>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<!--<id>integration-tests</id>-->
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
<excludes>
<exclude>**/*UT.java</exclude>
</excludes>
<skipTests>${skip.integration.tests}</skipTests>
</configuration>
</execution>
</executions>
</plugin>

Related

Exc after update dependencies pom.xm Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplicationAotProcessor

Error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplicationAotProcessor
at org.springframework.boot.devtools.system.DevToolsEnablementDeducer.<clinit>(DevToolsEnablementDeducer.java:40)
at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:39)
at org.springframework.boot.devtools.restart.Restarter.<init>(Restarter.java:140)
at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:534)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartingEvent(RestartApplicationListener.java:90)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:50)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:47)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:304)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1247)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1236)
at com.inventoryweb.InventoryWebApplication.main(InventoryWebApplication.java:24)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplicationAotProcessor
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 16 more
Process finished with exit code 1
Very thankful for your time.
This is my pom.xml
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Run specific spring boot profile through command line -->
<!-- ./mvnw spring-boot:run -Dspring-boot.run.profiles={profile_name} -->
<!-- Run integration tests -->
<!-- ./mvnw verify -P integration-test -->
<!-- Run unit tests -->
<!-- ./mvnw clean install -DskipITs -->
<!-- Build specific war profiles without running IT -->
<!-- ./mvnw clean install -P<profile> package -DskipTests -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.inventoryweb</groupId>
<artifactId>inventoryweb</artifactId>
<version>SNAPSHOT.0.1</version>
<packaging>war</packaging>
<properties>
<!-- Test -->
<skip.integration.tests>true</skip.integration.tests>
<skip.unit.tests>false</skip.unit.tests>
<project.finalName>${project.artifactId}-${env.name}-${project.version}</project.finalName>
<!-- Tomcat -->
<tomcat.version>9.0.40</tomcat.version>
<!-- Spring Framework -->
<springframework.version>5.3.9</springframework.version>
</properties>
<build>
<finalName>${project.finalName}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
<configuration>
<addResources>true</addResources>
</configuration>
</plugin>
<!-- Used for unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>${skip.unit.tests}</skipTests>
<excludes>
<exclude>**/IT*.java</exclude>
</excludes>
</configuration>
</plugin>
<!-- Integration tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
<executions>
<!-- States that both integration-test and verify goals of the Failsafe
Maven plugin are executed. -->
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<!-- Skips integration tests if the value of skip.integration.tests
property is true -->
<skipTests>${skip.integration.tests}</skipTests>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-integration-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/integration-test/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-integration-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/integration-test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Provides commit hash -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.9.10</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
</generateGitPropertiesFilename>
<verbose>true</verbose>
<includeOnlyProperties>
<includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
<includeOnlyProperty>^git.branch$</includeOnlyProperty>
</includeOnlyProperties>
</configuration>
</plugin>
<!-- Data base migration -->
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>9.8.2</version>
</plugin>
</plugins>
</build>
<!-- Inherit defaults from Spring Boot -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.12.RELEASE</version>
</parent>
<dependencies>
<!-- Add typical dependencies for a web application -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.5.0</version>
</dependency>
<!-- Allow custom validation messages for annotations -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.3.12.RELEASE</version>
</dependency>
<!-- Web server -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>2.3.12.RELEASE</version>
<scope>provided</scope>
</dependency>
<!-- <!– To compile JSP files –>-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<!-- Provides configuration tools for lifecycle application events -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Useful dependency to restart and quick pick up configuration changes
(Server (Domain) and Client side - JSP) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>3.0.0</version>
</dependency>
<!-- Provides proper dependencies for DB interaction -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- JDBC connection -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<!--Auto generate property setters and getters together with constructors-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
<!-- Mail -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- Templates este-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
<version>3.0.0</version>
</dependency>
<!-- Runtime data base access for test -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Db migrations -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>9.8.3</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Conditional Logging -->
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
</dependency>
<!-- ASI-Graylog Server -->
<dependency>
<groupId>de.siegmar</groupId>
<artifactId>logback-gelf</artifactId>
<version>3.0.0</version>
</dependency>
<!-- Encrypt properties sensitive information -->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- Allows testing security configuration -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>5.7.3</version>
<scope>test</scope>
</dependency>
<!-- Allows toString by reflection which is useful on logging -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<!-- Password validation rules -->
<dependency>
<groupId>org.passay</groupId>
<artifactId>passay</artifactId>
<version>1.6.0</version>
</dependency>
<!-- Messages joiner (Consider implementing project utility instead of adding another library) -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
</dependency>
<!-- Thymeleaf -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>3.0.0</version>
</dependency>
<!-- Thymeleaf security -->
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity5</artifactId>
</dependency>
<!-- Allow to work whit json-->
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>ittest</id>
<properties>
<build.profile.id>ittest</build.profile.id>
<skip.integration.tests>false</skip.integration.tests>
<skip.unit.tests>true</skip.unit.tests>
</properties>
</profile>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring.profiles.active>dev</spring.profiles.active>
<env.name>dev</env.name>
</properties>
</profile>
<profile>
<id>qa</id>
<properties>
<spring.profiles.active>qa</spring.profiles.active>
<env.name>qa</env.name>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
<env.name>prod</env.name>
</properties>
</profile>
</profiles>
</project>

Using Failsafe-Plugin, I can't execute my tests in parallel mode

Using Failsafe-Plugin, I can't execute my tests in parallel mode.
My execution is well but only in one thread.
Here is my pom.xml
Properties :
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<junit.version>5.8.2</junit.version>
<cucumber.version>7.3.4</cucumber.version>
<!--<maven.compiler.version>3.10.1</maven.compiler.version>-->
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.surefire.version>3.0.0-M3</maven.surefire.version>
<maven.failsafe.plugin>3.0.0-M3</maven.failsafe.plugin>
</properties>
Dependencies :
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/tech.grasshopper/extentreports-cucumber7-adapter -->
<dependency>
<groupId>tech.grasshopper</groupId>
<artifactId>extentreports-cucumber7-adapter</artifactId>
<version>1.6.0</version>
<scope>test</scope>
</dependency>
Plugins :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe.plugin}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<!-- UNCOMMENT - To add any exclusions if required-->
<!-- <excludes><exclude>**/*IT*.java</exclude></excludes>-->
<includes>
<!-- UNCOMMENT BELOW LINE - To execute feature files with a single runner-->
<include>**/MyTestRunner.java</include>
<!-- UNCOMMENT BELOW LINE - To execute feature files with multiple runners-->
<!-- <include>**/*Runner.java</include>-->
</includes>
<!-- UNCOMMENT BELOW 3 LINES - To execute using parallel or combination option-->
<parallel>methods</parallel>
<threadCount>4</threadCount>
<perCoreThreadCount>true</perCoreThreadCount>
<!-- UNCOMMENT BELOW 3 LINES - To execute using forking or combination option -->
<!-- <forkCount>2</forkCount> <reuseForks>true</reuseForks> <reportsDirectoty>${project-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
I use also :
junit-jupiter-api 5.8.2,
selenium-java 4.2.2,
cucumber-java and cucumber-junit 7.3.4,
maven-compiler-plugin 3.10.1,
maven-surfire-plugin 3.0.0-M3
I tried to change some versions, erase testng from eclipse without results.

nexus-staging-maven-plugin: maven deploy failed: An API incompatibility was encountered while executing

This worked fine for me be building under Java 8. Now under Java 17.01 I get this when I do mvn deploy.
mvn install works fine. I tried 3.6.3 and 3.8.4 and updated (I think) all my plugins to the newest versions.
Any ideas?
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project persism: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:de
ploy failed: An API incompatibility was encountered while executing org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy: java.lang.ExceptionInInitializerError: null
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module #149f5761
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project persism: Execution injected-nexus-deploy of goal org.sona
type.plugins:nexus-staging-maven-plugin:1.6.8:deploy failed: An API incompatibility was encountered while executing org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy: java.lang.ExceptionInInitializerError: null
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy failed: An API incompatibility was encountered while executing org.son
atype.plugins:nexus-staging-maven-plugin:1.6.8:deploy: java.lang.ExceptionInInitializerError: null
POM:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.sproket</groupId>
<artifactId>persism</artifactId>
<version>2.0.0</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>./src</sourceDirectory>
<testSourceDirectory>./test</testSourceDirectory>
<testResources>
<testResource>
<directory>./test</directory>
<!-- <includes>-->
<!-- <include>*.*</include>-->
<!-- </includes>-->
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<!-- MSSQL does not seem to able to connect with 16 -->
<configuration>
<source>17</source>
<target>17</target>
<!-- <compilerArgs>-->
<!-- <arg>-parameters</arg>-->
<!-- </compilerArgs>-->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>sproket.github.io.persism</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludePackageNames>net.sf.persism.log*;net.sf.persism.logging.*</excludePackageNames>
<source>17</source>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<excludedGroups>net.sf.persism.categories.ExternalDB,net.sf.persism.categories.TestContainerDB
</excludedGroups>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<name>persism</name>
<description>A zero ceremony ORM for Java</description>
<url>https://github.com/sproket/Persism</url>
<properties>
<java.version>17</java.version>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<licenses>
<license>
<name>BSD-3-Clause License</name>
<url>https://github.com/sproket/Persism/blob/master/license.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>Dan Howard</name>
<email>--------------------------</email>
<organization>io.github</organization>
<organizationUrl>https://sproket.github.io/Persism/</organizationUrl>
</developer>
</developers>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<scm>
<connection>scm:git:git://github.com/sproket/Persism.git</connection>
<developerConnection>scm:git:ssh://github.com/sproket/Persism.git</developerConnection>
<url>https://github.com/sproket/Persism</url>
</scm>
<profiles>
<profile>
<id>include-test-containers-db</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<excludedGroups>net.sf.persism.categories.ExternalDB</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>exclude-test-containers-db</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<excludedGroups>net.sf.persism.categories.TestContainerDB</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>sproket.github.io.persism</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<release>17</release>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>junit-benchmarks</artifactId>
<version>0.7.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.14.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.14.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.firebirdsql.jdbc</groupId>
<artifactId>jaybird</artifactId>
<version>4.0.2.java8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.firebirdsql</groupId>
<artifactId>firebird-testcontainers-java</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- using older version as 2.5.1 collides with ucanaccess -->
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.5.1</version>
<scope>test</scope>
<!-- <classifier>debug</classifier>-->
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.8.2.2</version>
<scope>test</scope>
</dependency>
<!-- OR -Djdk.tls.client.protocols=TLSv1 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>8.4.1.jre8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mssqlserver</artifactId>
<version>1.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.23</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<version>1.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>21.3.0.0</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.oracle</groupId>-->
<!-- <artifactId>ojdbc6</artifactId>-->
<!-- <version>11.2.0.4</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1004-jdbc41</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.34.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.ucanaccess</groupId>
<artifactId>ucanaccess</artifactId>
<version>5.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>informix-jdbc-complete</artifactId>
<version>4.50.4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.toddfast.typeconverter</groupId>
<artifactId>typeconverter</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.persistence/javax.persistence-api -->
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/cobertura-maven-plugin -->
<!-- DOES NOT WORK with JAVA 8 + -->
<!-- <dependency>-->
<!-- <groupId>org.codehaus.mojo</groupId>-->
<!-- <artifactId>cobertura-maven-plugin</artifactId>-->
<!-- <version>2.7</version>-->
<!-- <scope>test</scope>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>com.sun</groupId>-->
<!-- <artifactId>tools</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
</dependencies>
</project>
Update: Version 1.6.13 has been released and should fix this issue! 🎉
This is actually a known bug, which is now open for quite a while: OSSRH-66257. There are two known workarounds:
1. Open Modules
As a workaround, use --add-opens to give the library causing the problem access to the required classes:
export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
mvn deploy
2. Manage Upstream Dependencies
Or you can update the library that causes the problem:
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
<dependencies>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.15</version> <!-- apparently this needs to be exactly this version -->
</dependency>
</dependencies>
</plugin>
There are some broken internal dependencies in the library
Updating nexus-staging-maven-plugin to 1.6.13 will solve your problem:
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>

"MasterNotRunningException Failed to find any Kerberos tgt" when connecting to localhost standalone HBase without Kerberos with Java

I've got a standalone HBase running on my local Windows 10 machine. It starts up fine, I can connect to it with hbase shell and do puts, gets, scans and deletes no problem. I'm very sure it is set up and working.
But connecting to it with Java has been a nightmare. It now seems to be looking for kerberos, but I haven't specified kerberos anywhere in my config and I am NOT trying to use kerberos:
Failed to complete request: org.apache.hadoop.hbase.MasterNotRunningException: org.apache.hadoop.hbase.MasterNotRunningException: java.io.IOException: Call to myHostName/myBindAddress:16000 failed on local exception: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]
Here's my setup in brief:
hbase-site.xml
<configuration>
<property>
<name>hbase.master.port</name>
<value>16000</value>
</property>
<property>
<name>hbase.master.info.bindAddress</name>
<value>localhost</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>false</value>
</property>
java code to connect from:
Configuration configuration = HBaseConfiguration.create();
// Have tried not adding the hbase-site.xml to config, seems to have no effect
configuration.addResource(new Path(hbaseSiteXMLPath));
// Manually specifying these just to be sure
configuration.set("zookeeper.znode.parent", "/hbase");
configuration.set("hbase.zookeeper.quorum", "localhost");
configuration.set("hbase.zookeeper.property.clientPort", "2181");
UserGroupInformation.setConfiguration(configuration);
Connection connection = ConnectionFactory.createConnection(configuration);
Table table = connection.getTable(TableName.valueOf(myTableName));
Result result = table.get(get);
table.close();
connection.close();
It may be relevant to add that I'm using Spring Framework and I'm still learning it so there's a chance that some autoconfiguration is possibly happening in my pom.xml? I'm posting it as well just in case its possible.
<dependencies>
<!-- TESTING -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId> org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.7.2</version>
</dependency>
<!-- HBASE & HADOOP -->
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>2.0.0</version>
</dependency>
<!-- JSON Handlers -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.1</version>
</dependency>
<!-- Amazon AWS -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.104</version>
<scope>compile</scope>
</dependency>
<!-- SWAGGER -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>${springfox.version}</version>
</dependency>
<!-- LOGGING -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- SECURITY -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
</dependency>
<!-- DISCOVERY -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!-- DATA -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- SECURITY -->
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.1.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- DATA -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- FORMATTER AND REPORTS -->
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven.surefire.plugin}</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
<configuration>
<xmlOutput>true</xmlOutput>
<xmlOutputDirectory>target/site</xmlOutputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.11.0</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
<configuration>
<configFile>formatter.xml</configFile>
<lineEnding>LF</lineEnding>
<includes>
<include>**/src/main/java/**/*.java</include>
<include>**/src/test/java/**/*.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<append>true</append>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- MAVEN ENFORCER IS OPTIONAL - USED AS A SANITY CHECK -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!--
<banDuplicatePomDependencyVersions/>
<dependencyConvergence/>
-->
<requireMavenVersion>
<version>[3.3.9,)</version>
</requireMavenVersion>
<requireJavaVersion>
<version>(1.8.0_212, )</version>
</requireJavaVersion>
<requireSnapshotVersion>
<message>No Snapshots Allowed!</message>
<failWhenParentIsRelease>false</failWhenParentIsRelease>
</requireSnapshotVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven.surefire.plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${maven.project.info.reports.plugin}</version>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>summary</report>
<report>scm</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${maven.findbugs.plugin}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
</plugins>
</reporting>
Any help appreciated.
Solved this by adding the following
configuration.set("hbase.security.authentication", "simple");
configuration.set("hbase.security.authorization", "false");
I don't know why the HBase API was defaulting to Kerberos but this was all I needed.

Camel: Unresolved dependency exception for Camel Component

I am creating a Maven based Camel Component. I have added relevant dependencies in POM.xml but still I get below exception:
Unresolved dependency: (&(component=FileFormatConversion)(objectClass=org.apache.camel.spi.ComponentResolver))
I was able to build & run the Maven project. My component jar is however present in the component Folder:
Component Folder
Can anyone advise if there is some issue with my POM or the reason behind this exception. Here is my POM.
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>FileFormatConversion</groupId>
<artifactId>FileFormatConversion</artifactId>
<version>1.0.0</version>
<packaging>bundle</packaging>
<name>${project.groupId}.${project.artifactId}</name>
<properties>
<camel.version>2.18.0</camel.version>
<import.packages>*;version="0";resolution:=optional</import.packages>
<private.packages>!*</private.packages>
<symbolic.name>${project.groupId}</symbolic.name>
<embed-dep>*;scope=compile;type=!pom;inline=true</embed-dep>
<unpack-bundle>false</unpack-bundle>
<maven.test.skip>true</maven.test.skip>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
</properties>
<dependencies>
<!-- Check for the latest version of this artifact in central maven repository -->
<dependency>
<groupId>com.sap.cloud.adk</groupId>
<artifactId>com.sap.cloud.adk.build.archive</artifactId>
<version>1.24.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.camel/camel-component -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-component</artifactId>
<version>1.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/in.jlibs/jlibs-xsd -->
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-xsd</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-xml</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-visitor</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>in.jlibs</groupId>
<artifactId>jlibs-core</artifactId>
<version>2.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache/xerces -->
<dependency>
<groupId>org.apache</groupId>
<artifactId>xerces</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<version>${camel.version}</version>
<scope>test</scope>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<version>4.2.0</version>
<inherited>true</inherited>
<configuration>
<excludeDependencies>true</excludeDependencies>
<instructions>
<Include-Resource>src/main/resources/,lib/</Include-Resource>
<Bundle-SymbolicName>${symbolic.name}</Bundle-SymbolicName>
<Bundle-Classpath>.,jax-qname.jar,jaxmexs-0.5.jar,xsd-2.2.3.jar,jlibs-core-2.2.1.jar,jlibs-visitor-2.2.1.jar,jlibs-xml-2.2.1.jar,
jlibs-xsd-2.2.1.jar,xercesImpl-2.11.0.jar,xml-apis-1.4.01.jar,FileFormatConversion-1.0.0.jar
</Bundle-Classpath>
<Import-Package>${import.packages}</Import-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeTransitive>true</excludeTransitive>
<!-- Specify the artifacts to be excluded in the dependencies -->
<excludeArtifactIds></excludeArtifactIds>
<!-- Specify the group ids to be excluded in the dependencies -->
<excludeGroupIds>com.sap.cloud.adk,org.apache.camel,org.slf4j,log4j,in.jlibs,xerces,org.apache</excludeGroupIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.sap.cloud.adk</groupId>
<artifactId>com.sap.cloud.adk.build.archive</artifactId>
<version>1.24.0</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.sap.cloud.adk</groupId>
<artifactId>com.sap.cloud.adk.build.archive</artifactId>
<executions>
<execution>
<id>build-adapter</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<adapterProjectDirectory>${project.basedir}</adapterProjectDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
What is this?
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-component</artifactId>
<version>1.4.0</version>
</dependency>
That does not look correct as its some old stuff from Camel 1.x. You should remove that.
And you need to tell more how you run this? It seems like you use OSGi/Karaf or something. But take a look at how any of the existing components as an example to build custom components, or the Camel Maven archetype for component.
I resolved the issue myself. The Problem was in below Statement:
${import.packages}

Categories

Resources