<plugins>
            

<!– ############   create executable jar   –>
<plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>                                                   <!–  to add classpath to MANIFESTO  –>

                            <classpathPrefix>lib/</classpathPrefix>
                            <!–  to add classpath location prefix  –>

                            <classpathLayoutType>repository</classpathLayoutType>
                            <!–  to add dependencies style (ex> maven repository type, or etc) –>
                            <!– NOTE: Deprecated in version 2.4. Use ‘classpathLayoutType’ instead.
                                <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout> –>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
<!– ############   create executable jar   –>

          

<!– ############  copy dependencies to defined    –>
 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
<!– ############  copy dependencies to fixed   –>

            

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

           

<!– ############  create shell scripts to execute java application  –>
<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>appassembler-maven-plugin</artifactId>
                <configuration>
                    <programs>
                        <program>
                            <mainClass>com.oezsoft.Sample</mainClass>
                          <!–  define class include main method   –>

                            <name>my_cool_app</name>
                           <!–  name of executable shell script file   –>
                        </program>
                    </programs>
                </configuration>
            </plugin>

<!–  to create shell scripts, use maven command
ex> mvn clean package appassembler:assemble
   –>

<!– ############  create shell scripts to execute java application  –>

        </plugins>

Leave a Reply

Your email address will not be published. Required fields are marked *