I'm trying to build a jar from my Maven project using IntelliJ, but i get Error: Could not find or load main class
when running the jar.
I have 3 classes (one contains my main method and a simple print, the 2 others are empty). I have a pom file with one dependency:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<mainClass>MyMainClass</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>red-hat</id>
<url>https://maven.repository.redhat.com/earlyaccess/all/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-io-google-cloud-platform</artifactId>
<version>2.22.0</version>
</dependency>
</dependencies>
I've tried getting help from here, here and here, but nothing seems to help. I'm most likely missing some basic understanding of how the jar is being built. This is the project structure. Any help would be appreciated.