You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2018/07/30 18:21:13 UTC

Working with branches related to issue - Simplyfying work Part II

Hi,

I have finished my write up about my current working scripts to make my 
life easier...

If someone is interested in take a look at:

https://blog.soebes.de/blog/2018/07/30/automate-it-part-ii/

suggestions/ideas are always welcome...

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Working with branches related to issue - Simplyfying work Part II

Posted by Jörg Schaible <jo...@bpm-inspire.com>.
Hi Karl-Heinz,

Am Mon, 30 Jul 2018 20:21:13 +0200 schrieb Karl Heinz Marbaise:

> Hi,
> 
> I have finished my write up about my current working scripts to make my
> life easier...
> 
> If someone is interested in take a look at:
> 
> https://blog.soebes.de/blog/2018/07/30/automate-it-part-ii/
> 
> suggestions/ideas are always welcome...

An invaluable source of processing XML files is the xmlstarlet package 
(typically installed as /usr/bin/xml), e.g. for extracting the URL for 
the issues.

Example: I have a short bash script to generate recursively minimal 
Eclipse project files for packaging types that are ignored by the maven-
eclipse-plugin:

========== %< ============
#!/bin/sh

packaging=pom
if [ "$1" = "-p" ]; then
    shift
    packaging=$1
    shift
fi

if [ $# -lt 1 ]; then 
    echo "Usage ${0##*/} [-p packaging] dir ..."
else
    idx=0
    poms=( "$@" )
    while [ $idx -lt ${#poms[@]} ]; do
        pom=${poms[$idx]}/pom.xml
        path=${pom%/*}
        let idx=$idx+1
        if [ -f "$pom" ]; then
            modules=`xml sel -N pom=$XMLNS_POM -t -m pom:project -m 
pom:modules -v pom:module $pom`
            if [ -n "$modules" ]; then
                for module in ${modules[*]}; do
                    poms+=( $path/$module )
                done
            else
                if [ "$packaging" = "`xml sel -N \"pom=$XMLNS_POM" -t -m 
pom:project -v pom:packaging \"$pom\"`" ]; then
                    if [ ! -f "$path"/.project ]; then
                        name=`xml sel -N "pom=$XMLNS_POM" -t -m 
pom:project -v pom:artifactId "$pom"`
                        echo '<projectDescription><name>'"$name"'</name></
projectDescription>' > "$path"/.project && echo "$path/.project"
                    fi
                fi
            fi
        fi
    done
fi
========== %< ============

The variable XMLNS_POM is declared in my .bashrc:

export XMLNS_POM="http://maven.apache.org/POM/4.0.0"

If you look at the script I use xmlstarlet to extract the modules, the 
project name and to compare the packaging type. 

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Working with branches related to issue - Simplyfying work Part II

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Enrico,

On 30/07/18 21:01, Enrico Olivelli wrote:
> awesome reading!
> 
> Thank you for sharing your experience
> 
> Enrico
> 
> (Nit: There is a little typo 'appriopriate')

Great..thanks for finding this. Fixed. will be online in a few minutes..

Kind regards
Karl Heinz Marbaise
> 
> Il lun 30 lug 2018, 20:21 Karl Heinz Marbaise <khmarbaise@gmx.de 
> <ma...@gmx.de>> ha scritto:
> 
>     Hi,
> 
>     I have finished my write up about my current working scripts to make my
>     life easier...
> 
>     If someone is interested in take a look at:
> 
>     https://blog.soebes.de/blog/2018/07/30/autiomate-it-part-ii/
>     <https://blog.soebes.de/blog/2018/07/30/automate-it-part-ii/>
> 
>     suggestions/ideas are always welcome...
> 
>     Kind regards
>     Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Working with branches related to issue - Simplyfying work Part II

Posted by Enrico Olivelli <eo...@gmail.com>.
awesome reading!

Thank you for sharing your experience

Enrico

(Nit: There is a little typo 'appriopriate')

Il lun 30 lug 2018, 20:21 Karl Heinz Marbaise <kh...@gmx.de> ha
scritto:

> Hi,
>
> I have finished my write up about my current working scripts to make my
> life easier...
>
> If someone is interested in take a look at:
>
> https://blog.soebes.de/blog/2018/07/30/autiomate-it-part-ii/
> <https://blog.soebes.de/blog/2018/07/30/automate-it-part-ii/>
>
> suggestions/ideas are always welcome...
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
> --


-- Enrico Olivelli