0

I would like to run a Main class with exec-maven-plugin with an option like "include dependencies with 'provided' scope" from Intellij Idea. As I run the code with exec-maven-plugin I receive a lot of classNotFoundException and NoClassDefFoundError. I am able to run successfully the Main class with the option "include dependencies with 'provided' scope".

How could I run the main class from Maven or programatically without using the IDE ?

<profiles>
    <profile>
        <id>documentation-generator</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.6.0</version>
                    <executions>
                        <execution>
                            <phase>install</phase>
                            <goals>
                                <goal>java</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <includePluginDependencies>true</includePluginDependencies>
                        <mainClass>XXXXXXXXXXXXXXXXXX</mainClass>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>
Sorin Penteleiciuc
  • 653
  • 1
  • 10
  • 26

0 Answers0