[
https://jira.codehaus.org/browse/MRPM-92?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anders Hammar updated MRPM-92:
------------------------------
Assignee: (was: Brett Okken)
> Skip empty requires
> -------------------
>
> Key: MRPM-92
> URL: https://jira.codehaus.org/browse/MRPM-92
> Project: Mojo RPM Plugin
> Issue Type: Improvement
> Components: rpm
> Affects Versions: 2.1-alpha-1
> Reporter: Lorenzo Alberton
>
> For similar projects that could share a parent pom.xml (with some common
> dependencies and some extra project-specific ones), it would be nice to allow
> extensibility in the rpm-maven-plugin. As an alternative to MRPM-47, the
> sub-project could define a property with a list of extra dependencies, and
> use that as a variable in the parent pom.xml file:
> {{
> <requires>
> <require>xxx >= 1.0</require>
> <require>yyy >= 1.0</require>
> <require>${projectSpecificDependencies}</require>
> </requires>
> }}
> The problem with this is that if the property is empty or not set, the output
> SPEC file will contain this line:
> {{Requires: null}}
> which results in
> {{rpm-install:
> [exec] error: Failed dependencies:
> [exec] null is needed by XXXX-1.0-SNAPSHOT20110104163359.noarch
> }}
> This problem could be easily circumvented by checking whether each string in
> the collection passed to SpecWriter::writeList() is empty, and discarding it
> if it is:
> {{
> private void writeList( Collection strings, String prefix )
> {
> if ( strings != null )
> {
> for ( Iterator it = strings.iterator(); it.hasNext(); )
> {
> String str = (String) it.next();
> if (str != null && !str.equals("")) {
> spec.print( prefix );
> spec.println( it.next() );
> }
> }
> }
> }
> }}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email