Q:

IntelliJ Maven JAR "No main manifest attribute error"

Trying to set up a simple project to run a simple http server.
Created Maven project, along with groupId/artifactId/version, and so on, and was able to set up so that an IDE can interpret and run the program. Currently on Java 1.8. 
However, what I'm trying to accomplish is, running statements in terminal with mvn clean package, if I type, "java -jar Some.jar", it should run the program, but it won't.
I tried creating META-INF/MANIFEST.MF on resources folder inside src/ or java/, or the root project directory, but nothing worked.
I have been changing around, trying different thing on pom.xml, but simply just have no luck. It's a simple setup, but I would appreciate if someone can guide me, or what steps I should take. Thanks!

A:

To make the jar built by Maven executable, add the following configuration in pom.xml:
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        ...
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <mainClass>fully.qualified.MainClass</mainClass>
            </manifest>
          </archive>
        </configuration>
        ...
      </plugin>
    </plugins>
  </build>
  ...
</project>

The key line here is <mainClass>fully.qualified.MainClass</mainClass>.

