jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (JCRVLT-326) Embedded files Map stored in project properties breaks Jenkins+Artifactory integration
Date Mon, 18 Feb 2019 08:21:00 GMT

     [ https://issues.apache.org/jira/browse/JCRVLT-326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tobias Bocanegra updated JCRVLT-326:
------------------------------------
    Fix Version/s: package-maven-plugin-1.0.4

> Embedded files Map stored in project properties breaks Jenkins+Artifactory integration
> --------------------------------------------------------------------------------------
>
>                 Key: JCRVLT-326
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-326
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: package maven plugin
>    Affects Versions: package-maven-plugin-1.0.3
>            Reporter: Kyle Giovannetti
>            Assignee: Tobias Bocanegra
>            Priority: Major
>              Labels: newbie
>             Fix For: package-maven-plugin-1.0.4
>
>
> The issue is caused by placing a Map object, containing the embedded files, as a value
in the project properties. This is done in AbstractPackageMojo#setEmbeddedFilesMap(Map<String,
File> embeddedFiles)
> The project properties is an object of type java.util.Properties. 
> The Properties class extends java.util.Hashtable, and by using the Hashtable#get(Object
key) and Hashtable#put(Object key, Object value) methods, any object may be stored in the
Properties object. However, it is not recommended to store any key or value other than a
String. [Properties#getProperty(String key)|https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#getProperty(java.lang.String)] and
[Properties#setProperty(String key, String value)|https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#setProperty(java.lang.String,%20java.lang.String)] should
be used instead.
> The issue is discussed here: [https://stackoverflow.com/questions/30381563/putting-objects-into-java-util-properties/30381798#30381798]
> And the API documentation for [java.util.Properties|https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html] states
that "Each key and its corresponding value in the property list is a string.".
> Many other projects will assume that the properties contain only String key/value pairs,
and will cause a ClassCastException if the value cannot be cast to a String. This is the
case when building a package using filevault-package-maven-plugin in Jenkins while also
using the [Jenkins Artifactory Plugin|https://www.jfrog.com/confluence/display/RTF/Jenkins+Artifactory+Plug-in],
which attempts to capture the build properties and store them in an Artifactory server.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message