Resources files in maven:
Maven looks for resources files inside "src/main/resources" by default. So if it is missing you can manually create one and you can directly give path of your resources file from your application.
Copying all API's .jar files inside "lib" folder next to application's .jar file (just like ANT)
NOTE: <plugin> must be inside <build> after closing <dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Including mainclass and library path in menifest file
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.mycompany.springhttpinvokerclient.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
No comments:
Post a Comment