Search code examples
mavenrdfsemantic-webword-embedding

Why cant I build this maven as an executable


The maven project for rdf2vec builds an executable without any errors however the jar file throws "no main manifest attribute" error.

My attempt to resolve it:

Replace the following snippet :

<manifest> <mainClass>fully.qualified.MainClass</mainClass> </manifest>

with :

<manifest> <addClasspath>true</addClasspath> <mainClass>walks.WalkGenerator</mainClass> </manifest>

Thereby making WalkGenerator as the default main class for the entire package. This sadly, does not do the trick.

Another issue is that I cant find the MANIFEST file.


Solution

  • You need to use maven-jar-plugin to set main class for you jar

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
        <archive>
          <manifest>                              
            <mainClass>walks.WalkGenerator</mainClass>
          </manifest>
        </archive>
      </configuration>
    </plugin>