Bug 1375667

Summary: The RPM for version 4 of the Java SDK doesn't include the Maven POM file
Product: Red Hat Enterprise Virtualization Manager Reporter: Juan Hernández <juan.hernandez>
Component: ovirt-engine-sdk-javaAssignee: Ondra Machacek <omachace>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.0.1CC: amarchuk, gklein, lsurette, mgoldboi, mperina, msivak, omachace, srevivo, ykaul
Target Milestone: ovirt-4.0.4Keywords: ZStream
Target Release: 4.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-ovirt-engine-sdk4-4.0.1-2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-17 13:09:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Proposed patch to fix the issue omachace: review+

Description Juan Hernández 2016-09-13 15:51:55 UTC
The RPM for version 4.0.1 of the Java SDK doesn't include the POM files, as a result the 'build-jar-repository' command fails:

  # build-jar-repository /tmp/somedir org.ovirt.engine.api:sdk
  xmvn-resolve: Unable to resolve artifact org.ovirt.engine.api:sdk:jar:SYSTEM
  /usr/bin/build-jar-repository: error: Some specified jars were not found for this jvm

Comment 1 Juan Hernández 2016-09-13 16:18:26 UTC
Created attachment 1200558 [details]
Proposed patch to fix the issue

Comment 2 Juan Hernández 2016-09-13 16:56:16 UTC
The proposed patch changes the .spec so that the POM file is installed:

  # rpm -ql java-ovirt-engine-sdk4
  /usr/share/doc/java-ovirt-engine-sdk4-4.0.1
  /usr/share/doc/java-ovirt-engine-sdk4-4.0.1/README.adoc
  /usr/share/java/java-ovirt-engine-sdk4
  /usr/share/java/java-ovirt-engine-sdk4/sdk.jar
  /usr/share/licenses/java-ovirt-engine-sdk4-4.0.1
  /usr/share/licenses/java-ovirt-engine-sdk4-4.0.1/LICENSE.txt
  /usr/share/maven-fragments/java-ovirt-engine-sdk4
  /usr/share/maven-poms/JPP.java-ovirt-engine-sdk4-sdk.pom <-- Here it is

But it doesn't solve the problem with build-jar-respository, at least not in my environment:

  $ build-jar-repository /tmp/jars org.ovirt.engine.api:sdk
  xmvn-resolve: Unable to resolve artifact org.ovirt.engine.api:sdk:jar:SYSTEM
  /usr/bin/build-jar-repository: error: Some specified jars were not found for this jvm

But I can't make build-jar-repository work using artifact coordinates, not even for other packages that have been part of the distribution for a long time:

  $ build-jar-repository /tmp/jars org.slf4j:slf4j-api
  xmvn-resolve: Unable to resolve artifact org.slf4j:slf4j-api:jar:SYSTEM
  /usr/bin/build-jar-repository: error: Some specified jars were not found for this jvm

Are you sure that this worked in your environment? Did you use artifact coordinates as the argument?

It does work if I use the package name:

  $ build-jar-repository /tmp/jars java-ovirt-engine-sdk4
  $ find /tmp/jars
  /tmp/jars
  /tmp/jars/[java-ovirt-engine-sdk4]sdk.jar

Note that I used latest RHEL 7.2 for these tests.

Comment 3 Juan Hernández 2016-09-14 07:44:14 UTC
Installing the "maven-local" package and its dependencies solved the problem described in the previous comment:

  $ build-jar-repository /tmp/jars org.ovirt.engine.api:sdk
  $ find /tmp/jars/
  /tmp/jars/
  /tmp/jars/[org.ovirt.engine.api:sdk].jar
  $ ls -l /tmp/jars/[org.ovirt.engine.api:sdk].jar
  lrwxrwxrwx. 1 builder builder 46 Sep 14 09:38 /tmp/jars/[org.ovirt.engine.api:sdk].jar -> /usr/share/java/java-ovirt-engine-sdk4/sdk.jar

Comment 4 Juan Hernández 2016-09-14 11:02:41 UTC
Ondra, can you take care of the erratum for this? If so, please assign it to yourself.

Comment 5 Ondra Machacek 2016-09-20 12:13:05 UTC
Moving to 4.0.4, as fix is contained in 4.0.2 release of Java SDK, which is shipped with in 4.0.4.

Comment 6 Gonza 2016-09-22 10:10:02 UTC
Verified with:
java-ovirt-engine-sdk4-4.0.2-1.el7ev.noarch
maven-local-3.4.1-11.el7.noarch

# rpm -ql java-ovirt-engine-sdk4-4.0.2-1.el7ev.noarch
/usr/share/doc/java-ovirt-engine-sdk4-4.0.2
/usr/share/doc/java-ovirt-engine-sdk4-4.0.2/README.adoc
/usr/share/java/java-ovirt-engine-sdk4
/usr/share/java/java-ovirt-engine-sdk4/sdk.jar
/usr/share/licenses/java-ovirt-engine-sdk4-4.0.2
/usr/share/licenses/java-ovirt-engine-sdk4-4.0.2/LICENSE.txt
/usr/share/maven-fragments/java-ovirt-engine-sdk4
/usr/share/maven-poms/JPP.java-ovirt-engine-sdk4-sdk.pom

# build-jar-repository /tmp/jars org.ovirt.engine.api:sdk
No error msgs here