Reputation: 285
This is my pom.xml how can i make a executable jar, i read in google that it needs to have main class in manifest.mf. I tried with addind plugin but nothing
-
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>Sims_for_Import</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
<!--<scope>system</scope>-->
<!--<systemPath>${basedir}/ojdbc6-11.2.0.3.jar</systemPath>-->
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc42</artifactId>
<version>4.2</version>
</dependency>
</dependencies>
<name>Sims_for_Import</name>
</project>
Upvotes: 0
Views: 1937
Reputation: 11483
You should make use of the maven-jar-plugin
to package your jarfile and provide a main class:
<build>
<plugins>
<!-- ... other plugins ... -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<!-- Your main class -->
<mainClass>sims_for_import.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
You can see the listing of the latest available plugin versions on the maven central repository.
Upvotes: 2