maven exec exec , refrence to scripts in other jar

I'm having some problems calling a shell script from within an exec plugin in another plugin , can this be done at all ?

i have a project named scripts packaged as a jar , in that project i want to put all my shell scripts and call them from various projects , e.g.: i want to call s3sync from various projects , i've added the dependency in the other project to my scripts project but i can seem to execute i'm getting no such file or directory , my config :

<plugin>
            <artifactId>exec-maven-plugin</artifactId>
            <groupId>org.codehaus.mojo</groupId>
            <version>1.2.1</version>
            <executions>
                <execution>
                    <id>PrepFIle</id>
                    <phase>test</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <skip>${aws.s3.deploy.skip}</skip>
                        <executable>chmod</executable>
                        <arguments>
                            <argument>777</argument>
                            <argument>s3sync.sh</argument>
                            <!--<argument>${project.build.outputDirectory}/s3sync.sh</argument>-->
                        </arguments>
                    </configuration>
                </execution>
                <execution>
                    <id>RunFile</id>
                    <phase>test</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <skip>${aws.s3.deploy.skip}</skip>
                        <workingDirectory>${project.build.outputDirectory}</workingDirectory>
                        <!--<executable>${project.build.outputDirectory}/s3sync.sh</executable>-->
                        <executable>s3sync.sh</executable>
                        <arguments>
                            <argument>${aws.s3.bucket.name}</argument>
                            <argument>${project.build.outputDirectory}</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>com.company</groupId>
                    <artifactId>scripts</artifactId>
                    <version>0.0.1</version>
                    <type>jar</type>
                </dependency>
            </dependencies>
        </plugin>

can this be done at all ? i've tried many variations ... i can the jar is packaged with the scripts ... i know i can do this in other ways but i need to execute it in this way

Answers


I think you must first unpack the shell scipts from your scripts jar and execute the unpacked version of your script. Unpacking the scipts can be done with the maven-dependency-plugin. Use the upack goal. You can find an example here.


Need Your Help

Google-Related Redirect Chain on Pingdom

javascript php css .htaccess pagespeed

I am trying to improve my website’s Pingdom score by removing a redirect chain linked to Google Analytics and DoubleClick. I have been doing research on this problem, but every similar one dealt with

Knockout.js how do i bind to a sub property

javascript knockout.js

I know how to bind to a property, but how do i bind to a property like: