I am trying to schedule my project on Maven. It uses Apache POI. Project works fine on my Laptop but it fails to compile Maven on Jenkins that is on a remote machine in our office. The error I face is:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile** (default-testCompile) on project GunAV-test-automation: Compilation failure: Compilation failure:
[ERROR] /C:/Program Files (x86)/Jenkins/workspace/Mytest/-42/src/test/java/utilities/ReadExcel.java:[11,37] **package org.apache.poi.xssf.usermodel does not exist**
[ERROR] /C:/Program Files (x86)/Jenkins/workspace/Mytest/-42/src/test/java/utilities/ReadExcel.java:[12,37] package org.apache.poi.xssf.usermodel does not exist**
[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
How could I fix this issue?
To fix a compilation error
package org.apache.poi.xssf.usermodel does not exist
you should add a poi-ooxml maven dependency:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
This dependency contains org.apache.poi.xssf.usermodel package.
Related
While building my project I am getting unknown host exception while downloading the org.opensaml:opensaml:jar:2.6.6 jar.
I am using below dependencies in my project. And error I was receiving is as below.
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>1.0.10.RELEASE</version>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml</artifactId>
<version>2.6.1</version>
</dependency>
Error:
Could not resolve dependencies for project security:jar:1.0.0: Failed to collect dependencies at org.springframework.security.extensions:spring-security-saml2-core:jar:1.0.10.RELEASE -> org.opensaml:opensaml:jar:2.6.6: Failed to read artifact descriptor for org.opensaml:opensaml:jar:2.6.6: Could not transfer artifact org.opensaml:opensaml:pom:2.6.6 from/to central (https://repo.maven.apache.org/maven2/): transfer failed for https://repo.maven.apache.org/maven2/org/opensaml/opensaml/2.6.6/opensaml-2.6.6.pom: Unknown host No such host is known (repo.maven.apache.org) -> [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 problem with release:prepare in Maven. When I enter "mvn release:prepare" I get error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project com.joledzki.petclinic2: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-commit command failed.
[ERROR] Command output:
[ERROR]
[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
pom.xml
<scm>
<developerConnection>scm:git:git#github.com:JakubOledzki/petclinic2.git</developerConnection>
<tag>com.joledzki.petclinic2-0.0.2</tag>
Build work correct. Someone has a solution ?
I have a large java project managed using maven.
We are using Maven 3 for management (specifically 3.6.0).
In the project, there is a sub=project with a runtime-v5.pom.xml.
In said pom, there is a version property
<properties>
<platform-v5.version>73.2.05</platform-v5.version>
</properties>
Which is used later in the file
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.company.thing.platform</groupId>
<artifactId>platform-parent</artifactId>
<version>${platform-v5.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.company.release</groupId>
<artifactId>platform-v5</artifactId>
<version>${platform-v5.version}</version>
<type>resolved-pom</type>
</dependency>
</dependencies>
</dependencyManagement>
My goal is to get maven to pull in the most recent version of platform and I don't want to update the version in this file every time. I thought that changing the specific version to a range would allow the project to always pull in the most recent version in accordance with the given range.
When the platform-v5.version is set to a specific existing version, it builds just fine, but when setting the version to a range such as [73.2.05,), I get errors such as
[INFO] Scanning for projects...
[INFO] Downloading from all_global_universal: https://nexus.company/platform-parent/%5B73.2.05,).pom
[ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not find artifact com.company.thing.platform:platform-parent:pom:[73.2.05,) in all_global_universal (https://nexus.company/content/groups/all_global_universal) # com.company:runtime-v5:[unknown-version], path/to/runtime-v5.pom.xml, line XX, column YY
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.company:runtime-v5:1.0.2 (path/to/runtime-v5.pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Could not find artifact com.company.thing.platform:platform-parent:pom:[73.2.05,) in all_global_universal (https://nexus.company/content/groups/all_global_universal) # com.company:runtime-v5:[unknown-version], path/to/runtime-v5.pom.xml, line XX, column YY -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Essentially, I want to know: Why can't you provide version ranges in the maven dependency management import scope?
While version ranges are not exactly deprecated, they are no longer considered a best practise. The modern way would be to run an appropriate update goal before the build so that the version numbers in the pom are the newest ones available.
This is a duplicate of Using maven dependency management import scope with version ranges
This Maven issue was resolved and will be released in Maven 4.0.0: https://issues.apache.org/jira/browse/MNG-4463
I am trying to do build and deployment from a JENKINS job for my Spring Maven Project but getting below error:
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/6.0.0/ojdbc6-6.0.0.pom
[WARNING] The POM for com.oracle:ojdbc6:jar:6.0.0 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/6.0.0/ojdbc6-6.0.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.942 s
[INFO] Finished at: 2018-09-16T23:17:15+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SpringBootSmaple: Could not resolve dependencies for project com.springboot.practise:SpringBootSmaple:war:0.1: Could not find artifact com.oracle:ojdbc6:jar:6.0.0 in central (https://repo.maven.apache.org/maven2) -> [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
Build step 'Invoke top-level Maven targets' marked build as failure
Unable to deploy to IBM WebSphere Application Server, Build Result = FAILURE
Finished: FAILURE
I also installed ojdbc jar in maven by using below command:
mvn install:install-file -Dfile=C:\Documents\SharedJars\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=6.0.0 -Dpackaging=jar
But still getting the same error. Someone please guide.
I have downloaded and imported all the tutorials available in the below git
https://github.com/opendaylight/coretutorials/tree/master/toaster
While doing a maven install i am getting the below issue
[INFO] Scanning for projects...
[INFO] Downloading: http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/odlparent/odlparent/1.6.0-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata org.opendaylight.odlparent:odlparent:1.6.0-SNAPSHOT/maven-metadata.xml from/to opendaylight-snapshot (http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/): connect timed out
[INFO] Downloading: http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/odlparent/odlparent/1.6.0-SNAPSHOT/odlparent-1.6.0-SNAPSHOT.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.opendaylight.toaster:toaster-parent:0.1.0-SNAPSHOT: Could not transfer artifact org.opendaylight.odlparent:odlparent:pom:1.6.0-SNAPSHOT from/to opendaylight-snapshot (http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/): connect timed out and 'parent.relativePath' points at no local POM # line 16, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.opendaylight.toaster:toaster-parent:0.1.0-SNAPSHOT (C:\Users\609620968\Documents\coretutorials\toaster\ch7-ToasterJMX\parent\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.opendaylight.toaster:toaster-parent:0.1.0-SNAPSHOT: Could not transfer artifact org.opendaylight.odlparent:odlparent:pom:1.6.0-SNAPSHOT from/to opendaylight-snapshot (http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/): connect timed out and 'parent.relativePath' points at no local POM # line 16, column 13 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Am i missing some thing?. it is not able to find the oldparent odlparentlite etc. is there a way to add this into my local maven.
The version specified for the artifact is wrong. Please check this link and correct the version.