Publish additional external jar-files to ossrh with maven - maven

I want to publish my projects artifacts with maven to nexus. Therefore I followed this documentation which works for me for artifacts which are also build with maven. But now I want to publish additional artifacts (*.tgz files) which I download from somewhere else. I have not yet found out how to express in maven terms that I want to deploy those "local" artifacts.
What I tried is:
Create a new staging repo on ossrh with the pom file. This works and a new, open staging repository is created containing the pom file and a signature file.
> mvn deploy -DrepositoryId=ossrh
upload additional resources. This fails
> mvn deploy:deploy-file -Dfile=test-tst-0.0.1_linux-ppc64le_bin.tar.gz -Dclassifier=linux-ppc64le -DrepositoryId=ossrh -Durl=https://s01.oss.sonatype.org/content/repositories/iosapmachine-1031 -DgroupId=io.sapmachine -DartifactId=test-tst -Dversion=0.0.1
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< io.sapmachine:test-tst >-----------------------
[INFO] Building io.sapmachine:test-tst 0.0.1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) # test-tst ---
Uploading to ossrh: https://s01.oss.sonatype.org/content/repositories/iosapmachine-1031/io/sapmachine/test-tst/0.0.1/test-tst-0.0.1-linux-ppc64le.gz
Uploading to ossrh: https://s01.oss.sonatype.org/content/repositories/iosapmachine-1031/io/sapmachine/test-tst/0.0.1/test-tst-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.002 s
[INFO] Finished at: 2021-12-08T09:02:40+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project test-tst: Failed to deploy artifacts: Could not find artifact io.sapmachine:test-tst:gz:linux-ppc64le:0.0.1 in ossrh (https://s01.oss.sonatype.org/content/repositories/iosapmachine-1031) -> [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/MojoExecutionException
My pom.xml looks like this:
> cat 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">
<groupId>io.sapmachine</groupId>
<artifactId>test-tst</artifactId>
<version>0.0.1</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Test</description>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<url>https://test.io/</url>
<licenses>
<license>
<name>GPLv2 + Classpath Exception</name>
<url>https://test/LICENSE</url>
</license>
</licenses>
<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>
<developers>
<developer>
<name>Test</name>
<email>test#test.com</email>
<organization>Test AG</organization>
<organizationUrl>http://www.test.com</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/test/tree/test-${project.version}</connection>
<url>http://github.com/test/tree/test-${project.version}</url>
</scm>
<build>
<plugins>
<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>
</project>
>

Related

Missing site information in the distribution management of the project spring-swagger-wordnik-client

I am trying to create a Maven repository for a project of mine.
The relevant lines in my project's pom.xml file are:
<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>edu.mills.cs180a</groupId>
<artifactId>spring-swagger-wordnik-client</artifactId>
<packaging>jar</packaging>
<name>spring-swagger-wordnik-client</name>
<version>0.0.2A-SNAPSHOT</version>
...
<distributionManagement>
<repository>
<id>CS180A site</id>
<url>file:///C:/Users/ellen/Dropbox/Apps/site44/www.spertus.com/cs180a</url>
</repository>
</distributionManagement>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
...
</plugins>
</project>
I get this error when I try to deploy the site:
$ mvn site:deploy
[INFO] Scanning for projects...
[INFO]
[INFO] -----------< edu.mills.cs180a:spring-swagger-wordnik-client >-----------
[INFO] Building spring-swagger-wordnik-client 0.0.2A-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-site-plugin:3.7.1:deploy (default-cli) # spring-swagger-wordnik-client ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.055 s
[INFO] Finished at: 2020-11-11T15:24:38-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7.1:deploy (default-cli) on project spring-swagger-wordnik-client: Missing site information in the distribution management of the project spring-swagger-wordnik-client (edu.mills.cs180a:spring-swagger-wordnik-client:0.0.2A-SNAPSHOT) -> [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/MojoExecutionException
I don't understand why I get this error:
Missing site information in the distribution management of the project spring-swagger-wordnik-client
What else should be in distribution management besides this?
<distributionManagement>
<repository>
<id>CS180A site</id>
<url>file:///C:/Users/ellen/Dropbox/Apps/site44/www.spertus.com/cs180a</url>
</repository>
</distributionManagement>
Looking at your configuration, you need to add element inside distributionManagement as explained here: https://maven.apache.org/plugins/maven-site-plugin/usage.html.

jmeter-maven-plugin repository configuration

I'm trying to use JMeter maven plugin with private nexus repository without success. Here is the POM file
<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>
...
<repositories>
<repository>
<id>KKV nexus</id>
<url>http://kkv:8082/nexus/repository/maven-group</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>KKV nexus</id>
<url>http://kkv:8082/nexus/repository/maven-group</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.9.0</version>
<executions>
<!-- Run JMeter tests -->
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<!-- Fail build on errors in test -->
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterExtensions>
<artifacts>nz.co.breakpoint:jmeter-wssecurity:1.6</artifacts>
</jmeterExtensions>
</configuration>
</plugin>
</plugins>
</build>
</project>
I installed all the transitive dependencies in nexus, but the build still tries to connect maven central
[INFO] --- jmeter-maven-plugin:2.9.0:configure (configure) # 0-jarj-testi-liittyma ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] C O N F I G U R I N G J M E T E R
[INFO] -------------------------------------------------------
[INFO]
[INFO] Building JMeter directory structure...
[INFO] Configuring JMeter artifacts...
[INFO] Populating JMeter directory...
[INFO] Copying extensions to JMeter lib/ext directory C:\Projektit\kkv-e2e-testaus\0-jarj-testi-liittyma\target\jmeter\lib\ext with downloadExtensionDependencies set to true...
Downloading from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.59/bcprov-jdk15on-1.59.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.020 s
[INFO] Finished at: 2019-07-18T13:25:59+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:2.9.0:configure (configure) on project 0-jarj-testi-liittyma: Failed to collect dependencies at org.apache.wss4j:wss4j-ws-security-dom:jar:2.2.2 -> org.apache.wss4j:wss4j-ws-security-common:jar:2.2.2 -> org.opensaml:opensaml-saml-impl:jar:3.3.0 -> org.opensaml:opensaml-saml-api:jar:3.3.0 -> org.opensaml:opensaml-xmlsec-api:jar:3.3.0 -> org.opensaml:opensaml-security-api:jar:3.3.0 -> org.cryptacular:cryptacular:jar:1.1.1 -> org.bouncycastle:bcprov-jdk15on:jar:1.59: Failed to read artifact descriptor for org.bouncycastle:bcprov-jdk15on:jar:1.59: Could not transfer artifact org.bouncycastle:bcprov-jdk15on:pom:1.59 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host 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/MojoExecutionException
How do I configure the plugin to use the nexus? Also, it's weird the missing dependency is bcprov-jdk15on:pom:1.59 as cryptacular-1.1.1.pom defines dependency version as 1.54
Usually, you define your company Nexus in the settings.xml. Using it as a mirror redirects all requests to it and avoids calls to MavenCentral (which may fail due to proxy/firewall restrictions). A standard example can be found at
https://github.com/sonatype/nexus-book-examples/blob/master/maven/settings/settings.xml
Note furthermore that the versions of dependencies may be different from the ones defined in (some of the) poms. You can have only one version of a dependency in your dependencies and if you have more than one, Maven will choose one for you, following various rules.
the jmeter-maven-plugin uses aether to resolve and download artifacts.
By default it should pull in all of the project repositories, it looks like adding additional ones via config is broken. I've just raised an issue here: https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/issues/350.

Maven build - Unable to get resource

I am doing maven clean build , and I am getting the below exception.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building App
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/10/maven-plugins-10.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-plugins:pom:10' from repository central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/10/maven-plugins-10.pom
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-plugins:pom:10' from repository central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:maven-clean-plugin:maven-plugin:2.2
Reason: Cannot find parent: org.apache.maven.plugins:maven-plugins for project: null:maven-clean-plugin:maven-plugin:2.2 for project null:maven-clean-plugin:maven-plugin:2.2
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Sep 30 12:21:41 IST 2014
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
my settings.xml is as below ,
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2</url>
</mirror>
</mirrors>
and my pom.xml is as below,
<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.myapp</groupId>
<artifactId>ExtJsApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>App</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<build>
<finalName>App</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
any one please help me out of this. I have the same settings.xml in my .m2 folder.

Maven build not finding custom jar already installed in local openshift project repo

I am facing an issue when trying to build my project (from the Eclipse Openshift plugin).
1.) I have a custom dependency, which at first I followed instructions on Open Shift Knowledgebase Article "Using your own jar files..."
2.) On commit and publish with above, the error still persisted, thereby I changed the openshift pre_build action hook as noted in this post on the Openshift forums "Resolved custom jar dependency..."
However, I am still getting an error on commit and publish from eclipse. Here's a dump from the console
Repository ssh://53211e7...50000f0#testapp0...312-systix.rhcloud.com/~/git/testapp0...312.git/
Stopping RockMongo cartridge
[Sun Mar 16 12:20:37 2014] [warn] module php5_module is already loaded, skipping
httpd (no pid file) not running
MongoDB already stopped
Stopping jbossas cartridge
Repairing links for 1 deployments
Building git ref 'master', commit bb2def3
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) # standalone-pom ---
[INFO] Installing /var/lib/openshift/app-root/runtime/repo/shared-helper-data-skychart-0.0.1-SNAPSHOT.jar to /var/lib/openshift/53211e...0f0/.m2/repository/com/systix/shared-helper-data-skychart/0.0.1-SNAPSHOT/shared-helper-data-skychart-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.331s
[INFO] Finished at: Sun Mar 16 12:20:48 EDT 2014
[INFO] Final Memory: 4M/78M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) # standalone-pom ---
[INFO] Installing /var/lib/openshift/app-root/runtime/repo/shared-models-skychart-0.0.1-SNAPSHOT.jar to /var/lib/openshift/5321......00f0/.m2/repository/com/systix/shared-models-skychart/0.0.1-SNAPSHOT/shared-models-skychart-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.723s
[INFO] Finished at: Sun Mar 16 12:20:53 EDT 2014
[INFO] Final Memory: 4M/78M
[INFO] ------------------------------------------------------------------------
Found pom.xml... attempting to build with 'mvn -e clean package -Popenshift -DskipTests'
Apache Maven 3.0.3 (r1075437; 2011-06-20 13:22:37-0400)
Maven home: /etc/alternatives/maven-3.0
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.32-431.5.1.el6oso.bz844450.x86_64", arch: "i386", family: "unix"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testapp0...312 1.0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.134s
[INFO] Finished at: Sun Mar 16 12:21:04 EDT 2014
[INFO] Final Memory: 5M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project testapp0...0312: Could not resolve dependencies for project testapp0...0312:testapp0...312:war:1.0: Could not find artifact com.systix:shared-helper-data-skychart:jar:0.0.1-SNAPSHOT -> [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
An error occurred executing 'gear postreceive' (exit code: 1)
Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/5321...00f0/jbossas
For more details about the problem, try running the command again with the '--trace' option.
On reviewing the above it seems like maven is able to add the dependency jars succesfully to the local repo ,but the build for the project does not seem to.
UPDATE: Including the pom.xml from both the libraries that I have marked as to be installed in the pre_build file. Both the jars were built, included in the openshift git repo, and referenced in the pre_build script to be installed in openshift's maven repo (pre_build script included at end)
pom.xml from shared-helper-data-skychart:
<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.systix</groupId>
<artifactId>shared-helper-data-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.4</version>
</dependency>
<dependency>
<groupId>com.systix</groupId>
<artifactId>shared-models-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mongodb.morphia</groupId>
<artifactId>morphia</artifactId>
<version>0.105</version>
</dependency>
</dependencies>
</project>
pom.xml from shared-models-skychart (shared-models-skychart is a dependency in the pom.xml for shared-helper-data-skychart)
<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.systix</groupId>
<artifactId>shared-models-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mongodb.morphia</groupId>
<artifactId>morphia</artifactId>
<version>0.105</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.3</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.4</version>
</dependency>
</dependencies>
</project>
pre_build script used
mvn install:install-file -Dfile=../app-root/runtime/repo/shared-helper-data-skychart-0.0.1-SNAPSHOT.jar -DgroupId=com.systix -DartifactId=shared-helper-data-skychart -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar
mvn install:install-file -Dfile=../app-root/runtime/repo/shared-models-skychart-0.0.1-SNAPSHOT.jar -DgroupId=com.systix -DartifactId=shared-models-skychart -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar
UPDATE 2: Also, the above pom.xml is what I have in my project code files. However, when I ssh intoopenshift servers and review the local maven repos, the following is what I see as pom.xml
cat ./.m2/repository/com/systix/shared-helper-data-skychart/0.0.1-SNAPSHOT/shared-helper-data-skychart-0.0.1-SNAPSHOT.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.systix</groupId>
<artifactId>shared-helper-data-skychart</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>POM was created from install:install-file</description>
</project>
This is what worked for me:
I connected via SSH to OpenShift like described here.
There I found out that in the OpenShift maven repo (under ~/.m2/repository/) the jar had not been installed correctly. In the dependency directory there were *.jar.lastUpdated files instead of the actual jars.
I deleted the whole directory of the problematic dependency from the maven repo (manually)
In my pre_build action hook I changed mvn install:install -Dfile path to an absolute path to the jar (e.g. /var/lib/openshift/___your__id__here____/app-root/runtime/repo/dependencyfile.jar
I pushed my local changes (pre_build action hook changed in point 4.) to the git repo. Now all worked fine :)

Fail of org.apache.maven.plugins goal execution

I'm trying to generate a war file using maven but i'm getting this error (most of downloading log output is omitted to make log more clear):
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.pom
Downloaded:
...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building tn.talan.selenium Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # tn.talan.selenium ---
...
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # tn.talan.selenium ---
...
[INFO] --- maven-war-plugin:2.1.1:war (default-cli) # tn.talan.selenium ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.pom
Downloaded:
...
[INFO] BUILD FAILURE
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-cli) on project tn.talan.selenium: Execution default-cli of goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war failed: Plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 or one of its dependencies could not be resolved: Could not transfer artifact org.codehaus.plexus:plexus-io:jar:1.0.1 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/codehaus/plexus/plexus-io/1.0.1/plexus-io-1.0.1.jar from central failed: Read timed out -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
...
Here's my pom.xml file code:
<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>selenium</groupId>
<artifactId>tn.talan.selenium</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>tn.talan.selenium Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>tn.talan.selenium</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0-beta-1</version>
</plugin>
</plugins>
</build>
</project>
What's wrong with my pom? Any idea please?
Specify version for maven-war-plugin, e.g.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
</plugin>
For solving this error, you don't need to do anything, just change your jdk version. You can prefer any jdk version but don't prefer latest one.Try to use older version. Recommended : JDK 11.0.11

Resources