Bug 996960

Summary: Provide list of GAVs used in build, easy enhancement for maven plugin which overrides versions to versions defined in BOMs
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Rostislav Svoboda <rsvoboda>
Component: BuildAssignee: Vladimir Dosoudil <dosoudil>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Jelinek <pjelinek>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dosoudil, myarboro, psakar
Target Milestone: ER7   
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:23:38 UTC Type: Task
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rostislav Svoboda 2013-08-14 11:20:00 UTC
Provide list of GAVs used in build to make component version check easier and enabled for automation. 

Current Docspace document DOC-131321 [1] doesn't contain all artifacts and can't be easily parsed because username/password is needed and format can change.

It's easy enhancement for maven plugin which is used to override versions in build to versions defined in BOMs (don't know exact name of that plugin)

Goal is to have it for EAP 6.2.0 ER1 and I hope it would be achievable.

Location of that list - there are several possibilities
 - maven repo zip
 - src zip
 - standalone txt file next to readme.txt
  -- e.g. http://download.devel.redhat.com/devel/candidates/JBEAP/JBEAP-6.2.0-ER1/jboss-eap-6.2.0.ER1-build-GAVs.txt

I would prefer last option - standalone txt file for easy work and we still have option to deliver it or not to customers - it could be excluded from upload to customer portal


[1] https://docspace.corp.redhat.com/docs/DOC-131321

Comment 1 Paul Gier 2013-08-16 16:33:17 UTC
I'm not sure I understand this request.  What is the difference between this list and the BOM?

Comment 2 Rostislav Svoboda 2013-08-19 08:12:04 UTC
BOM is maven readable. We need something human readable and easy to find and access. Secondary goal is to eliminate manual updates of DOC-131321.

Imagine someone without deeper knowledge of maven repo structure, EAP BOM and its location, name which is defined somewhere in readme.txt etc. It's really problematic to get supported artifacts and versions now.

Expected format is 'G:A:V' per line to have it easily readable + easily parsable

Comment 3 Rostislav Svoboda 2013-09-25 14:42:55 UTC
Any update on this item? We would really appreciate this list.

Comment 4 Vladimir Dosoudil 2013-10-14 14:04:49 UTC
The Jenkins job creating Maven repository zip [URL] modified to create text file with suffix -supported-GAVs.txt. It's the list of supported artifacts in expected format 'G:A:V' per line.

[URL] https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/jboss-eap-6.2.x-maven-repository/

Comment 5 Rostislav Svoboda 2013-10-17 09:05:19 UTC
Hi Vladimir. Thank you for provided jboss-eap-6.2.0.ER6-supported-GAVs.txt 

As discussed we would like to include information about type and classifier.


Current format:
   groupId:artifactId:version

Extended format:
   groupId:artifactId:version:type:classifier

Comment 6 Vladimir Dosoudil 2013-10-23 13:41:36 UTC
The Jenkins job creating Maven repository zip [URL] modified to create text file with suffix -supported-GAVs.txt containing artifacts in the proposed extended format. Type field is empty if the type of artifact is jar. Classifier field is empty if the classifier of artifact is null (not defined).

[URL] https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/jboss-eap-6.2.x-maven-repository/

Comment 7 Petr Sakaƙ 2013-11-04 07:09:51 UTC
Verified for EAP 6.2.0.ER7
Compared http://download.devel.redhat.com/devel/candidates/JBEAP/JBEAP-6.2.0.ER7/jboss-eap-6.2.0.ER7-supported-GAVs.txt with list generated from org/jboss/bom/eap6-supported-artifacts/6.2.0.GA/eap6-supported-artifacts-6.2.0.GA.pom from http://download.devel.redhat.com/devel/candidates/JBEAP/JBEAP-6.2.0.ER7/jboss-eap-6.2.0.ER7-maven-repository.zip using following XSLT stylesheet:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:m="http://maven.apache.org/POM/4.0.0" exclude-result-prefixes="m">
<xsl:output method="text"/>
<xsl:param name="versions_file"/>
<xsl:variable name="LF" select="'&#10;'"/>
<xsl:template match="/">
	<!-- xsl:text>List of supported dependencies</xsl:text><xsl:value-of select="$LF"/ -->
    <xsl:apply-templates select="/m:project/m:dependencyManagement/m:dependencies/m:dependency" />
</xsl:template>

<xsl:template match="m:dependency">
	<xsl:value-of select="normalize-space(m:groupId)" />
	<xsl:text>:</xsl:text>
	<xsl:value-of select="normalize-space(m:artifactId)" />
	<xsl:text>:</xsl:text>
	<xsl:call-template name="find_version" >
		<xsl:with-param name="version" select="normalize-space(m:version)"/>
	</xsl:call-template>
	<xsl:text>:</xsl:text>
	<xsl:value-of select="m:type" />
	<xsl:value-of select="$LF"/>
</xsl:template>

<xsl:template name="find_version" >
	<xsl:param name="version"/>
	<xsl:variable name="name" select="substring($version, 3, string-length($version) - 3)"/>
	<xsl:variable name="value" select="normalize-space(document($versions_file)/m:project/m:properties/*[local-name(.)=$name])"/>
	<xsl:choose>
		<xsl:when test="substring($value, 1, 1) = '$'">
			<xsl:call-template name="find_version" >
				<xsl:with-param name="version" select="$value"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="$value"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>
	
</xsl:stylesheet>