Pacific-Design.com

    
Home Index

1. Java

2. Maven

+ Executable

+ Oracle

+ Profiles

+ Spring4

+ pom.xml

Java / Maven /

Maven compile and executable bash script

#!/bin/bash
#--------------------------------------------------------------------------------------#
if [ -z "$1" ]; then
    echo "+----------------------------------------+"
    echo "|  ./run.sh   -- Help                    |"
    echo "|  ./run.sh 0 -- mvn clean install       |"
    echo "|  ./run.sh 1 -- run                     |"
    echo "+----------------------------------------+"
#--------------------------------------------------------------------------------------#
elif [ "$1" == "0" ] 2>/dev/null; then
    mvn clean install

#--------------------------------------------------------------------------------------#
elif [ "$1" == "1" ] 2>/dev/null; then
    mvn exec:java -Dexec.mainClass=bitly.url.api.App

fi
#--------------------------------------------------------------------------------------#

Basic build with destroy threadgroup - IllegalThreadStateException for MySQL

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.5.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>                                
                </executions>
                <configuration>
                    <mainClass>bitly.url.api.App</mainClass> 
                    <cleanupDaemonThreads>false</cleanupDaemonThreads>
                </configuration>
            </plugin>
        </plugins>
    </build>