Deploy Spring Boot war into Jenkins - java

I have a Jenkins job for deploy Spring-Boot war.
When I launch my job I have this error:
[INFO] --- maven-war-plugin:2.5:war (default-war) # rest-api ---
[INFO] Packaging webapp
[INFO] Assembling webapp [rest-api] in [/var/lib/jenkins/jobs/BOAOBJ/workspace/target/rest-api-1.0.0]
[INFO] Processing war project
[INFO] Webapp assembled in [459 msecs]
[INFO] Building war: /var/lib/jenkins/jobs/BOAOBJ/workspace/target/rest-api-1.0.0.war
[INFO]
[INFO] --- spring-boot-maven-plugin:1.3.0.RC1:repackage (default) # rest-api ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.040 s
[INFO] Finished at: 2016-04-22T14:04:30+02:00
[INFO] Final Memory: 29M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RC1:repackage (default) on project rest-api: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RC1:repackage failed: Unable to find main class -> [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]
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.Lyreco.lab</groupId>
<artifactId>rest-api</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.RC1</version>
</parent>
<properties>
<springfox-version>2.2.2</springfox-version>
<java.version>1.7</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>0.19.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>hal-browser</artifactId>
<version>9f96c74</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.6.0</version>
</dependency>
<!-- Swagger 2 -->
<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>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>repository.springsource.milestone</id>
<name>SpringSource Milestone Repository</name>
<url>http://repo.springsource.org/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repository.springsource.milestone</id>
<name>SpringSource Milestone Repository</name>
<url>http://repo.springsource.org/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
Why ?

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RC1:repackage (default) on project rest-api:
Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RC1:repackage failed: **Unable to find main class** -> [Help 1]
The spring-boot-maven-plugin allows you to package executable jar or war archives and run an application(automatically). So, you will need specify the Main class for your application.
See guideline here.
So, in short, you can add main class to your Manifest by:
Add directly to Manifest.MF
Specify Optional Parameters for spring-boot-maven-plugin in your pom.xml. Below is example:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<configuration>
<mainClass>com.test.Application</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>

Related

Cannot deploy artifact to Nexus repository ,status: 401 Unauthorized

I have checked forums and I see that this question was asked before but a very long time ago.
I have a basic application and I am able to create artifacts with mvn package command.
[INFO] --- spring-boot-maven-plugin:2.3.5.RELEASE:repackage (default) # java-maven-app ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.324 s
[INFO] Finished at: 2022-05-10T11:03:24+02:00
Then I am trying to deploy it to remote Nexus Repo via mvn deploy command ,then I am facing with following error.
Failed to retrieve remote metadata com.example:java-maven-app:1.1.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.example:java-maven-app:1.1.0-SNAPSHOT/maven-metadata.xml from/to nexus-snapshots (http://167.71.41.177:8081/repository/maven-snapshots/): authentication failed for http://167.71.41.177:8081/repository/maven-snapshots/com/example/java-maven-app/1.1.0-SNAPSHOT/maven-metadata.xml, status: 401 Unauthorized -> [Help 1]
I am able to login to Nexus repo with this user without any issue and I have following settings.xml in my mac.
<servers>
<server>
<id>nexus-snapshots</id>
<username>nexus</username>
<password>Krakow123</password>
</server>
</servers>
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.example</groupId>
<artifactId>java-maven-app</artifactId>
<version>1.1.0-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- to handle any Java version mismatch, add the following configuration for maven-compiler-plugin -->
<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>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
<!-- https://mvnrepository.com/artifact/org.occurrent/subscription-api-blocking -->
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://167.71.41.177:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>5.0.0-alpha.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.2</version>
</dependency>
<dependency>
<groupId>org.occurrent</groupId>
<artifactId>subscription-api-blocking</artifactId>
<version>0.14.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testcontainers/elasticsearch -->
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.17.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.6.3</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>7.1.1</version>
</dependency>
</dependencies>
</project>
and I have following snippet from pom.xml ,everything should be fine actually ,anybody can help ?

Spring Boot error when deployed on Heroku

I am having trouble deploying my app on Heroku.
It builds successfully on localhost without any errror. It even builds successfully when I do mvn clean install or mvn clean package.
This is my pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
com.furntrade
SpringBoot
1.0
org.springframework.boot
spring-boot-starter-parent
2.5.6
FurntradeManagmentServet
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<webjars-bootstrap.version>4.1.3</webjars-bootstrap.version>
<webjars-jquery-ui.version>1.12.1</webjars-jquery-ui.version>
<webjars-jquery.version>3.3.1-1</webjars-jquery.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${webjars-jquery.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
<version>${webjars-jquery-ui.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.30</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.18.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
<encoding.source>${project.build.sourceEncoding}</encoding.source>
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
<java.source>${maven.compiler.source}</java.source>
<java.target>${maven.compiler.target}</java.target>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
</plugins>
</build>
This is application.properties file (I removed my db credentials)
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.maxActive=10
spring.datasource.maxIdle=5
spring.datasource.minIdle=2
spring.datasource.initialSize=5
spring.datasource.removeAbandoned=true\
spring.datasource.url=jdbc:postgresql://DNLOCATION:5432/DBTANLENAME
spring.datasource.username=USERNAME
spring.datasource.password=PASSWORD
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true
lspring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
logging.level.org.hibernate.type=trace
hibernate.cache.auto_evict_collection_cache=true
server.error.include-message=always
spring.data.rest.base-path=/api
logging.level.org.springframework=INFO
spring.profiles.active=production
server.port=${PORT:5000}
Procfile
web: java $JAVA_OPTS -jar target/SpringBoot-1.0.jar -Dserver.port=$PORT $JAR_OPTS
settings.properties file
java.runtime.version=1.8
This is the error im getting in logs
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /tmp/build_530e329c/src/main/java/com/furntrade/furntrademanagmentservet/Security/SecurityConfig.java:[40,48] cannot find symbol
symbol: method of(java.lang.String,java.lang.String,java.lang.String)
location: interface java.util.List
[ERROR] /tmp/build_530e329c/src/main/java/com/furntrade/furntrademanagmentservet/Security/SecurityConfig.java:[41,48] cannot find symbol
symbol: method of(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
location: interface java.util.List
[ERROR] /tmp/build_530e329c/src/main/java/com/furntrade/furntrademanagmentservet/Security/SecurityConfig.java:[42,48] cannot find symbol
symbol: method of(java.lang.String)
location: interface java.util.List
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.426 s
[INFO] Finished at: 2022-04-14T22:40:26Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project FurntradeManagmentServet: Compilation failure: Compilation failure:
[ERROR] /tmp/build_530e329c/src/main/java/com/furntrade/furntrademanagmentservet/Security/SecurityConfig.java:[40,48] cannot find symbol
[ERROR] symbol: method of(java.lang.String,java.lang.String,java.lang.String)
[ERROR] location: interface java.util.List
[ERROR] /tmp/build_530e329c/src/main/java/com/furntrade/furntrademanagmentservet/Security/SecurityConfig.java:[41,48] cannot find symbol
[ERROR] symbol: method of(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
[ERROR] location: interface java.util.List
[ERROR] /tmp/build_530e329c/src/main/java/com/furntrade/furntrademanagmentservet/Security/SecurityConfig.java:[42,48] cannot find symbol
[ERROR] symbol: method of(java.lang.String)
[ERROR] location: interface java.util.List
[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]
I have to mention that I don't have those java.util.List errors on my localhost.
I have no idea where I am doing wrong.
I suggest you to create a file named system.properties in project directory and write java.runtime.version=11. I hope it should work as because this had worked for me.

Could not resolve dependencies for project: primefaces and modelmapper

I try to import my project on another computer, but when I try to build the project with maven, I get these errors.
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.247 s
[INFO] Finished at: 2022-02-20T10:27:33-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project serpienteemplumada: Could not resolve dependencies for project com.serpienteemplumada:serpienteemplumada:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.primefaces:primefaces:jar:10.0.0, org.primefaces.extensions:primefaces-extensions:jar:10.0.2, org.modelmapper:modelmapper:jar:2.3.5: Could not transfer artifact org.primefaces:primefaces:jar:10.0.0 from/to spring-plugins (https://repo.spring.io/plugins-release/): Access denied to https://repo.spring.io/plugins-release/org/primefaces/primefaces/10.0.0/primefaces-10.0.0.jar. Error code 401, Unauthorized -> [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
I've already tried all the methods I found on the internet, maven:clean, update and install; put the repositories at the beginning, work from another IDE, but still, the error persists in those two dependencies.
Here is my Pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<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 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.5.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.serpienteemplumada</groupId>
<artifactId>serpienteemplumada</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>serpienteemplumada</name>
<description>MarketPlace Serpiente Emplumada</description>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<start-class>com.SerpienteemplumadaApplication</start-class>
</properties>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<repository>
<id>spring-plugins</id>
<name>Spring Plugins Repository</name>
<url>https://repo.spring.io/plugins-release/</url>
<layout>default</layout>
</repository>
<repository>
<id>central</id>
<name>central</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>ICM</id>
<name>ICM</name>
<url>http://maven.icm.edu.pl/artifactory/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>10.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces.extensions/primefaces-extensions -->
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>10.0.2</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.20</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.20</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0.SP1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.5</version>
</dependency>
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
thx to read.
I finally can...
I had to read those dependencies for project with conflicts, then I download manually, for a weird reason my project cannot access to PrimeFace repository
If org.primefaces.themes fail I just download those files from here:
https://search.maven.org/search?q=g:org.primefaces
then I had to join with my maven2 folder
/Users/$user/.m2/repository/org
Also, I changed the versions of the dependencies.

maven package error: SurefireReportParameters

i try to package my maven package but i got this error:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-surefire-plugin:2.17:test': Unable to load the mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.17:test' in the plugin 'org.apache.maven.plugins:maven-surefire-plugin'. A required class is missing: org/apache/maven/plugin/surefire/SurefireReportParameters
org.apache.maven.plugin.surefire.SurefireReportParameters
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-surefire-plugin:2.17:test': Unable to load the mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.17:test' in the plugin 'org.apache.maven.plugins:maven-surefire-plugin'. A required class is missing: org/apache/maven/plugin/surefire/SurefireReportParameters
Hier is a part of my pom.xml with all the dependencies and plugins:
<groupId>org.springframework</groupId>
<artifactId>spring-rest-service-oauth</artifactId>
<version>0.1.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
</parent>
<properties>
<spring-security-oauth2.version>2.0.7.RELEASE</spring-security-oauth2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>${spring-security-oauth2.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path-assert</artifactId>
<version>0.9.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.18.1</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-plugin-releases</id>
<url>https://repo.spring.io/plugins-release</url>
</pluginRepository>
</pluginRepositories>
</project>
when i call this command mvn -e clean package, i got the error above.
I try to test this oauth2-project. The link:
https://github.com/royclarkson/spring-rest-service-oauth
i cloned the project und i try to test it. But i have this error by package.
Any ideas?
Thank
Cheers

gwt-maven-plugin can't compile because of "No source code is available for type org.hibernate.validator.constraints.impl.SizeValidatorForString;"

I'm using client-side validation in my GWT web app, and Maven as a build tool. Running in dev mode doesn't cause any problems. Now I want to build the project with Maven, but get multiple errors such as follows:
[ERROR] Line 52: No source code is available for type org.hibernate.validator.constraints.impl.SizeValidatorForString; did you forget to inherit a required module?
[INFO] [ERROR] Line 52: No source code is available for type org.hibernate.validator.constraints.impl.SizeValidatorForCollection; did you forget to inherit a required module?
[INFO] [ERROR] Line 52: No source code is available for type org.hibernate.validator.constraints.impl.SizeValidatorForMap; did you forget to inherit a required module?
[INFO] [ERROR] Line 75: No source code is available for type org.hibernate.validator.constraints.impl.NotNullValidator; did you forget to inherit a required module?
[INFO] [ERROR] Line 83: No source code is available for type org.hibernate.validator.constraints.NotEmpty; did you forget to inherit a required module?
I wish gwt-maven-plugin could see jar source file hibernate-validator-4.2.0.Final-sources.jar while compiling the project. How to manage this resource to make it work? I've tried to put hibernate-validator-4.2.0.Final-sources.jar into src/main/resources directory, but it doesn't seem to work.
pom.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.szybieka.tarantula</groupId>
<artifactId>parent</artifactId>
<version>0.1</version>
</parent>
<artifactId>tarantula</artifactId>
<packaging>war</packaging>
<name>Tarantula</name>
<url>http://github.com/shebeko/tarantula</url>
<properties>
<gwt.version>2.5.1</gwt.version>
<jackson.version>1.9.10</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>system</scope>
<systemPath>${basedir}/war/WEB-INF/lib/hibernate-validator-4.2.0.Final.jar</systemPath>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>system</scope>
<systemPath>${basedir}/war/WEB-INF/lib/validation-api-1.0.0.GA.jar</systemPath>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
<scope>system</scope>
<systemPath>${basedir}/war/WEB-INF/lib/slf4j-api-1.6.1.jar</systemPath>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
<scope>system</scope>
<systemPath>${basedir}/war/WEB-INF/lib/json-20090211.jar</systemPath>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Catcha from local repository -->
<dependency>
<groupId>com.google.code</groupId>
<artifactId>captcha</artifactId>
<version>1.2.1</version>
</dependency>
<!-- Jackson JSON processor -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.3</version>
</dependency>
<!-- Core -->
<dependency>
<groupId>com.szybieka.tarantula</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Location -->
<dependency>
<groupId>com.szybieka.tarantula</groupId>
<artifactId>location</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Jackson JSON Mapper -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- DataSource -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<finalName>tarantula</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessors>
<annotationProcessor>com.google.web.bindery.requestfactory.apt.RfValidator</annotationProcessor>
</annotationProcessors>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-apt</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
<warSourceDirectory>${basedir}/war</warSourceDirectory>
<archiveClasses>true</archiveClasses>
<warSourceExcludes>WEB-INF/classes/**,WEB-INF/lib/gwt-servlet*,gwtia_requestfactory_*/**</warSourceExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0</version>
<executions>
<execution>
<configuration>
<modules>
<param>com.szybieka.tarantula.gwt.MainModule</param>
</modules>
</configuration>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
After adding hibernate-validator-4.2.0.Final-sources.jar hibernate-validator-4.2.0.Final-sources.jar mvn clean install results in:
[INFO] ------------------------------------------------------------------------
[INFO] Building Tarantula 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # tarantula ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # tarantula ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 50 source files to /home/adam-szybieka/workspace/tarantula/parent/web/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalProxy.java:[3,43] package org.hibernate.validator.constraints does not exist
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalFormProxy.java:[3,43] package org.hibernate.validator.constraints does not exist
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalProxy.java:[14,6] cannot find symbol
symbol: class NotEmpty
location: interface com.szybieka.tarantula.gwt.client.proxy.PrincipalProxy
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalProxy.java:[19,6] cannot find symbol
symbol: class NotEmpty
location: interface com.szybieka.tarantula.gwt.client.proxy.PrincipalProxy
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalFormProxy.java:[9,6] cannot find symbol
symbol: class NotEmpty
location: interface com.szybieka.tarantula.gwt.client.proxy.PrincipalFormProxy
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalFormProxy.java:[14,6] cannot find symbol
symbol: class NotEmpty
location: interface com.szybieka.tarantula.gwt.client.proxy.PrincipalFormProxy
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalFormProxy.java:[19,6] cannot find symbol
symbol: class NotEmpty
location: interface com.szybieka.tarantula.gwt.client.proxy.PrincipalFormProxy
[ERROR] /home/adam-szybieka/workspace/tarantula/parent/web/src/main/java/com/szybieka/tarantula/gwt/client/proxy/PrincipalProxy.java:[15,12] java.util.NoSuchElementException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:396)
....................................................
Without seeing your pom.xml it's a little difficult to say but my first assumption is that you forgot to add a dependency for hibernate-validator-4.2.0.Final-sources.jar in your pom or there is a versioning problem. Could you post your pom?
Got it:
You have this dependency
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>system</scope>
<systemPath>${basedir}/war/WEB-INF/lib/hibernate-validator-4.2.0.Final.jar</systemPath>
</dependency>
which is the 4.2.0.Final jar BUT you do not have the 4.2.0.Final-sources.jar
Add the dependency for final-sources and you should have your answer.
You need Hibernate Validator 4.1 (not 4.0, not 4.2).
See https://code.google.com/p/google-web-toolkit/issues/detail?id=7661
Note: obviously, for server-side validation, you could use whichever version of Hibernate Validator you want.
you need to have in your classpath both:hibernate-validator-4.2.0.Final-sources.jar and hibernate-validator-4.2.0.Final.jar
just add following to your pom.xml:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
<classifier>sources</classifier>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>

Categories

Resources