How to Distributable Artifact/Classifier Jars : Complaining of missing pom file - java

Project background; large amounts of JNI projects for my group. Looking to simplify the build/release strategies as the JNI projects themselves have dependency chains.
Used a model similar to here: http://mail-archives.apache.org/mod_mbox/maven-users/200706.mbox/%3C56761.84.233.182.145.1181035390.squirrel#www.sharp.fm%3E as a prototype that works well. A distribution module adds the appropriate jars and the classifier is used. Example final jar would be CiscoJ-dist-unix-amd64.jar.
Problem I'm hitting appears that install creates the project pom but attempting to use the classifier jar in a project, its is looking for the pom file matching the classifier; thus from above its looking for J-dist-unix-amd64.pom. The only pom that exists is of course the project pom J-dist.pom.
[WARNING]
The POM for com.cisco.ciscossl:CiscoJ-dist:jar:unix-amd64:1.00 is missing, no
dependency information available [DEBUG] Dependency collection stats:
{ConflictMarker.analyzeTime=1, ConflictMarker.markTime=0,
ConflictMarker.nodeCount=4, ConflictIdSorter.graphTime=0,
ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=3,
ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=2,
ConflictResolver.conflictItemCount=3,
DefaultDependencyCollector.collectTime=290,
DefaultDependencyCollector.transformTime=6}
In project attempting to build with architecture dependent information.
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>com.cisco.ciscossl</groupId>
<artifactId>CiscoJ-dist</artifactId>
<classifier>${os.family}-${os.arch}</classifier>
<version>1.00</version>
</dependency>
</dependencies>
According to this; http://maven.40175.n5.nabble.com/pom-does-not-get-installed-if-classifier-used-td120388.html; it should be fixed with my version of maven (3.1.1).
Pom File of Project
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.cisco.ciscossl.CiscoJ</groupId>
<artifactId>CiscoJ-dist</artifactId>
<version>1.00</version>
<packaging>jar</packaging>
<parent>
<groupId>com.cisco.ciscossl</groupId>
<artifactId>CiscoJ</artifactId>
<version>1.00</version>
</parent>
<dependencies>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>CiscoJUtils</artifactId>
<version>1.00</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>CiscoJCE</artifactId>
<version>1.00</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>CiscoJSafeC</artifactId>
<version>1.00</version>
<classifier>${os.family}-${os.arch}</classifier>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>CiscoJCEJNI</artifactId>
<version>1.00</version>
<classifier>${os.family}-${os.arch}</classifier>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/dist-jar.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Assembler:
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>${os.family}-${os.arch}</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<excludes>
<exclude>org.slf4j:slf4j-simple</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>junit:junit</exclude>
</excludes>
<unpack>true</unpack>
<useTransitiveDependencies>false</useTransitiveDependencies>
</dependencySet>
</dependencySets>
</assembly>
I messed a bit with the maven-install-plugin install-file for the artifact, not much success yet though.

I think I determined that I had an invalid artifact in the file attempting to use the artifact. I believe, and looks like it worked, that should be accessing it with the parent project as part of the group id/path. Like below...
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>com.cisco.ciscossl.CiscoJ</groupId>
<artifactId>CiscoJ-dist</artifactId>
<classifier>${os.family}-${os.arch}</classifier>
<version>1.00</version>
</dependency>
</dependencies>
khmarbaise, much appreciated to comments of the above. Leaving open for now until further determine that this wasn't the valid answer. At least for now I can see a valid dependency tree being picked up....
[INFO] Building test-CiscoJ-disk 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # test-CiscoJ-dist ---
[INFO] com.cisco.ciscossl:test-CiscoJ-dist:jar:0.0.1-SNAPSHOT
[INFO] +- junit:junit:jar:4.11:compile
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] \- com.cisco.ciscossl.CiscoJ:CiscoJ-dist:jar:unix-amd64:1.00:compile
[INFO] +- org.slf4j:slf4j-simple:jar:1.7.2:compile
[INFO] \- org.slf4j:slf4j-api:jar:1.7.2:compile
[INFO] ------------------------------------------------------------------------

Related

Jenkins - Could not find artifact org.apache.maven:maven:pom:3.1.0 in Repo

Java 8, maven compile issue on Jenkins
struggling for ages with this one. I can locally build, compile and test everything without a problem. I use same maven command as I use on my Jenkins. I wiped my .m2 folder so I have same empty repo and still everything fine.
This is the maven command I use:
(mvn) -U clean install -PTestExecutor -Dheadless=true -C
this 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxx</groupId>
<artifactId>testing</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<cucumber.version>7.3.3</cucumber.version>
<selenium.version>4.1.4</selenium.version>
<awaitility.version>4.2.0</awaitility.version>
<assertj.version>3.22.0</assertj.version>
<commonsmodel.version>5.3.3</commonsmodel.version>
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.surefire.version>3.0.0-M6</maven.surefire.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<junit-jupiter-engine.version>5.8.2</junit-jupiter-engine.version>
<maven-cucumber-reporting.version>5.7.0</maven-cucumber-reporting.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>1.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter-engine.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jodah</groupId>
<artifactId>failsafe</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>${maven-cucumber-reporting.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>TestExecutor</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter-engine.version}</version>
</dependency>
</dependencies>
<configuration>
<includes>
<includes>**/ExecutorTest.java</includes>
</includes>
</configuration>
</plugin>
<!--cucumber report plugin-->
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>${maven-cucumber-reporting.version}</version>
<executions>
<execution>
<id>generate-cucumber-reports</id>
<phase>test</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>Automation report</projectName>
<outputDirectory>${project.build.directory}/cucumber-reports</outputDirectory>
<inputDirectory>${project.build.directory}/cucumber</inputDirectory>
<jsonFiles>
<param>**/*.json</param>
</jsonFiles>
<checkBuildResult>false</checkBuildResult>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
and this is the full error report on Jenkins output:
Executing Maven: -B -f /appl/xxx/jenkins/workspace/Customer_Portal/web-full-suite/pom.xml -s /appl/xxx/maven/apache-maven-3.3.9/conf/settings.xml -U clean install -PTestExecutor -Dheadless=true -C
[INFO] Scanning for projects...
[HUDSON] Collecting dependencies info
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testing 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/org/apache/maven/maven-core/3.1.0/maven-core-3.1.0.pom
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/org/apache/maven/maven-core/3.1.0/maven-core-3.1.0.pom
[WARNING] The POM for org.apache.maven:maven-core:jar:3.1.0 is missing, no dependency information available
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/org/apache/maven/maven-plugin-api/3.1.0/maven-plugin-api-3.1.0.pom
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/org/apache/maven/maven-plugin-api/3.1.0/maven-plugin-api-3.1.0.pom
[WARNING] The POM for org.apache.maven:maven-plugin-api:jar:3.1.0 is missing, no dependency information available
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/io/cucumber/messages/maven-metadata.xml
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/io/cucumber/messages/maven-metadata.xml
[INFO] Downloaded: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/io/cucumber/messages/maven-metadata.xml (421 B at 20.6 KB/sec)
[WARNING] The POM for org.apache.maven:maven-plugin-api:jar:3.8.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/org/apache/maven/maven/3.1.0/maven-3.1.0.pom
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/org/apache/maven/maven/3.1.0/maven-3.1.0.pom
[WARNING] Attempt to (de-)serialize anonymous class org.jfrog.hudson.maven2.MavenDependenciesRecorder$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.828 s
[INFO] Finished at: 2022-06-13T16:59:43+02:00
[INFO] Final Memory: 18M/152M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal on project testing: Could not resolve dependencies for project com.xxx:testing:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0-M6 -> org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M6 -> org.apache.maven.shared:maven-common-artifact-filters:jar:3.1.1 -> org.apache.maven:maven-artifact:jar:3.1.0: Failed to read artifact descriptor for org.apache.maven:maven-artifact:jar:3.1.0: Could not find artifact org.apache.maven:maven:pom:3.1.0 in XXX-Repo (http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[JENKINS] Archiving /appl/xxx/jenkins/workspace/Customer_Portal/web-full-suite/pom.xml to com.xxx/testing/1.0-SNAPSHOT/testing-1.0-SNAPSHOT.pom
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /cucumber/cucumber.html to /appl/xxx/jenkins/jobs/Customer_Portal/jobs/web-full-suite/htmlreports/HTML_20Report
ERROR: Specified HTML directory '/cucumber/cucumber.html' does not exist.
Publishing Selenium report...
Copying the reports.
parsing resultFile cucumber/cucumber.html
Unable to parse cucumber/cucumber.html: java.io.IOException: org.xml.sax.SAXParseException; systemId: file:/appl/xxx/jenkins/jobs/Customer_Portal/jobs/web-full-suite/builds/160/seleniumReports/cucumber/cucumber.html; lineNumber: 1; columnNumber: 10; DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
Set result to FAILURE
Finished: FAILURE

error compiling[m: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor

I am facing below error while building code Spring Boot and Apache Avro example from STS, however if I run this code command line it works well.
[INFO] [1m--- [0;32mmaven-compiler-plugin:3.8.1:compile[m [1m(default-compile)[m # [36mavroposgen[0;1m ---[m
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to E:\Kafka-Streams-with-Spring-Cloud\avroposgen\target\classes
[INFO] [1m------------------------------------------------------------------------[m
[INFO] [1;31mBUILD FAILURE[m
[INFO] [1m------------------------------------------------------------------------[m
[INFO] Total time: 5.729 s
[INFO] Finished at: 2021-12-15T22:00:20+05:30
[INFO] [1m------------------------------------------------------------------------[m
[ERROR] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile[m [1m(default-compile)[m on project [36mavroposgen[m: [1;31mFatal error compiling[m: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module #0x18ff1520) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module #0x18ff1520 -> [1m[Help 1][m
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the [1m-e[m switch.
[ERROR] Re-run Maven using the [1m-X[m switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [1m[Help 1][m http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
pom.xml
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>learningjournal.guru.examples</groupId>
<artifactId>avroposgen</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Avro Pos Generator</name>
<description>Avro Pos Generator by Learning Journal</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.8.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<sourceDirectory>src/main/avro</sourceDirectory>
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
<imports>
<import>${project.basedir}/src/main/avro/LineItem.avsc</import>
<import>${project.basedir}/src/main/avro/DeliveryAddress.avsc</import>
</imports>
<stringType>String</stringType>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>confluent</id>
<url>https://packages.confluent.io/maven/</url>
</repository>
</repositories>
</project>
In eclipse go to->
Step 1 : window->preference->java->complier-> set compiler compliance level to 1.8 if you are using jdk1.8 or java8
Step 2:window->preference->java->installed JREs->
EDIT(if your installed JRE is not being used)->
JRE HOME : (the one which you have installed in your system jre path
should be that of inside jdk)
in my case it is-> C:\Program Files\Java\jdk1.8.0_291\jre
Please try to change these config of your ide.
Seems your compiler or jre version is not matched in ide as per installed
java version.

Blank Allure report due to misconfigured pom.xml

I'm trying to use Allure - framework to generate a report for my Rest Assured tests. I run tests with mvn test -Dtest=${MyClass} command and all tests pass, and then generate a report using mvn allure:report. After all, I start jetty server mvn jetty:run and when I navigate to localhost I can see a completely empty report (there is only template with no info).
This seems to be a misconfiguration problem, but what am I doing wrong? Here is my pom.xml:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testtask</groupId>
<artifactId>com.testtask</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
<maven.surefire.plugin.version>3.0.0-M3</maven.surefire.plugin.version>
<aspectj.version>1.9.3.RC1</aspectj.version>
<jetty.maven.plugin.version>9.3.9.v20160517</jetty.maven.plugin.version>
<allure.maven.version>2.10.0</allure.maven.version>
<rest.assured.version>3.3.0</rest.assured.version>
<allure.rest.assured.version>2.10.0</allure.rest.assured.version>
<allure.testng.version>2.10.0</allure.testng.version>
<junit.version>4.12</junit.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!--Running tests-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<!--Server to view the report-->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.maven.plugin.version}</version>
<configuration>
<webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
<stopKey>stop</stopKey>
<stopPort>1234</stopPort>
</configuration>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>${allure.maven.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<!--Rest Assured section-->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${rest.assured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-path</artifactId>
<version>${rest.assured.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>xml-path</artifactId>
<version>${rest.assured.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId>
<version>${rest.assured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-rest-assured</artifactId> <!--generates attachment for allure-->
<version>${allure.rest.assured.version}</version>
</dependency>
<!--Allure TestNG Dependency-->
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>${allure.testng.version}</version>
</dependency>
<!-- Java 6 = JAX-B Version 2.0 -->
<!-- Java 7 = JAX-B Version 2.2.3 -->
<!-- Java 8 = JAX-B Version 2.2.8 -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
mvn allure:report
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.testtask:com.testtask >----------------------
[INFO] Building com.testtask 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- allure-maven:2.10.0:report (default-cli) # com.testtask ---
[INFO] Allure installation directory C:\PRJ\X\PetAPI/.allure
[INFO] Try to finding out allure 2.8.1
[INFO] Generate Allure report (report) with version 2.8.1
[INFO] Generate Allure report to C:\PRJ\X\PetAPI\target\site/allure-maven-plugin
[INFO] Found results directory C:\PRJ\X\PetAPI\target\allure-results
[INFO] Can't find information about categories.
[INFO] Generate report to C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
Report successfully generated to C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
[INFO] Report generated successfully.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.631 s
[INFO] Finished at: 2019-03-16T18:48:34+04:00
[INFO] ------------------------------------------------------------------------
mvn jetty:run
...
[INFO] --- jetty-maven-plugin:9.3.9.v20160517:run (default-cli) # com.testtask ---
[INFO] Configuring Jetty for project: com.testtask
[INFO] Webapp source directory = C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
[INFO] Reload Mechanic: automatic
[INFO] Classes = C:\PRJ\X\PetAPI\target\classes
[INFO] Logging initialized #7207ms
[INFO] Context path = /
[INFO] Tmp directory = C:\PRJ\X\PetAPI\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = null
[INFO] Webapp directory = C:\PRJ\X\PetAPI\target\site\allure-maven-plugin
[INFO] jetty-9.3.9.v20160517
[INFO] Started o.e.j.m.p.JettyWebAppContext#4a734c04{/,file:///C:/PRJ/X/PetAPI/target/site/allure-maven-plugin/,AVAILABLE}{file:///C:/PRJ/X/PetAPI/target/site/allure-maven-plugin/}
[INFO] Started ServerConnector#24841372{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO] Started #12047ms
[INFO] Started Jetty Server
Solution found: it was necessary to add a dependency on TestNG
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
and remove the dependency on Junit.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
Currently an Allure report is generated correctly

Lombok and Maven

I'm trying to use Lombok with Maven and VRaptor on IntelliJ but it doesn't work.
I already read some info in stackoverflow but none solved my problem, i already enabled the Annotation Processor in Intellij but still nothing.
I tryied to compile it from command-line too (Windows) and didn't work.
I also tryed to create another project without maven and add the library, create some classes for test and it works, compile and run perfectly.
Any help?
The project has only 2 class, 1 entity and 1 controller
Here is my pom.xml
<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>
<groupId>razor</groupId>
<artifactId>controle-de-ponto</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<description>Um sistema de controlo de ponto</description>
<repositories>
<repository>
<id>projectlombok.org</id>
<url>http://projectlombok.org/mavenrepo</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<weld.version>2.1.2.Final</weld.version>
</properties>
<dependencies>
<dependency>
<groupId>br.com.caelum</groupId>
<artifactId>vraptor</artifactId>
<version>4.1.4</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>0.11.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
<version>2.1.2.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-impl</artifactId>
<version>2.1.2.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>5.1.1.Final</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<!-- uncomment this line on app servers -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.8.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>br.com.caelum.vraptor</groupId>
<artifactId>vraptor-jpa</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>br.com.caelum.vraptor</groupId>
<artifactId>vraptor-java8</artifactId>
<version>4.0.0.Final</version>
</dependency>
</dependencies>
<build>
<finalName>controle-de-ponto</finalName>
<!--<outputDirectory>/Users/turini/Documents/workspace/vraptor4/vraptor-blank-project/src/main/webapp/WEB-INF/classes</outputDirectory>-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerVersion>1.8</compilerVersion>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
Error when i try to compile:
[INFO] ------------------------------------------------------------------------
[INFO] Building controle-de-ponto 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # controle-de-ponto ---
[INFO] Using 'ISO-8859-1' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # controle-de-ponto ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\Kennedy\Desktop\controle-de-ponto\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Kennedy/Desktop/controle-de-ponto/src/main/java/br/com/caelum/vraptor/controller/IndexController.java:[37,16] cannot find symbol
symbol: method setNome(java.lang.String)
location: variable usuario of type org.razor.cponto.beans.Usuario
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.167 s
[INFO] Finished at: 2015-02-04T13:41:01-02:00
[INFO] Final Memory: 17M/204M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project controle-de-ponto: Compilation failure
[ERROR] /C:/Users/Kennedy/Desktop/controle-de-ponto/src/main/java/br/com/caelum/vraptor/controller/IndexController.java:[37,16] cannot find symbol
[ERROR] symbol: method setNome(java.lang.String)
[ERROR] location: variable usuario of type org.razor.cponto.beans.Usuario
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
This might work
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.12</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
Latest versions:
https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin
https://mvnrepository.com/artifact/org.projectlombok/lombok
This should work as is, and has nothing to do with IntelliJ idea. But I would:
make sure the #Data annotation is the lombok one
remove the repository definition (maven central is fine)
use a recent lombok version (1.16.0 as of this writing)
rebuild (mvn clean package)
I think the lombok jar is not found by maven in your case or that you might have another #Data.
Try this dependency
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.16</version>
<scope>provided</scope>
</dependency>
In the projectId tag, try to replace projectlombok.org with org.projectlombok
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
this should solve the problem same issue on my vs code
You need add lombok plugin:
<build>
<plugins>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.8.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Eclipse Web application deployment problem with Maven on JBoss

I have the following pom.xml (see below) for building a web-app on JBoss. I run maven like this :
mvn clean compile war:exploded jboss:hard-undeploy jboss:hard-deploy jboss:start-and-wait
Every goals run fine until i hit jboss:start-and-wait goal :\ JBoss refuses to start.
I got the following error :
(...)
[INFO] [jboss:start-and-wait {execution: default-cli}]
[INFO] Starting JBoss...
[INFO] Waiting to retrieve JBoss JMX MBean connection...
[INFO] Waiting to retrieve JBoss JMX MBean connection...
[INFO] Waiting to retrieve JBoss JMX MBean connection...
[INFO] Waiting to retrieve JBoss JMX MBean connection...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to get JBoss JMX MBean connection: null
org.jboss.jmx.adaptor.rmi.RMIAdaptor
(...)
By activating the DEBUG option on maven, i detected that the root cause is a ClassNotFoundException
org.jboss.jmx.adaptor.rmi.RMIAdaptor. Why do I get this exception since my pom.xml
does contain org.jboss.jmx.adaptor.rmi.RMIAdaptor in the jmx-adaptor-plugin jar dependency ?
Using jboss-all-client jar as dependency gives no more results.
What am I missing ?
Stephan
Configuration
Maven 2.2.1
JBoss 5.1.0.GA
JBoss Maven Plugin 1.5.0
pom.xml
<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>
<parent>
<artifactId>foo</artifactId>
<groupId>com.company.foo</groupId>
<version>1.0.0</version>
</parent>
<groupId>com.company.foo</groupId>
<artifactId>foo-webapp</artifactId>
<packaging>war</packaging>
<name>foo-webapp</name>
<version>1.0.0</version>
<dependencies>
<!-- JSF 2.0 -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.3-b02</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.3-b02</version>
</dependency>
<!-- Primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<!-- <version>3.0.M1</version> -->
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>redmond</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Others -->
<dependency>
<groupId>com.company.record</groupId>
<artifactId>record-dao</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Postgresql -->
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>8.3-606.jdbc4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jboss</groupId>
<artifactId>jmx-adaptor-plugin</artifactId>
<version>3.2.1</version>
</dependency>
</dependencies>
<build>
<finalName>foo.war</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<useCache>false</useCache>
<!-- Prevent a bug from plugin (see http://jira.codehaus.org/browse/MWAR-248) -->
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<fileName>${project.build.directory}/${project.build.finalName}</fileName>
<serverName>web</serverName>
</configuration>
</plugin>
</plugins>
</build>
(...)
Try adding it to your plugin dependencies:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<fileName>${project.build.directory}/${project.build.finalName}</fileName>
<serverName>web</serverName>
</configuration>
<dependencies>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<type>pom</type>
<version>5.1.0.GA</version>
</dependency>
</dependencies>
</plugin>

Categories

Resources