Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 运行Maven-exec-Maven-plugin时,可以选择包含具有所提供范围的依赖项,如Intellij_Java_Maven_Intellij Idea_Maven Plugin_Exec Maven Plugin - Fatal编程技术网

Java 运行Maven-exec-Maven-plugin时,可以选择包含具有所提供范围的依赖项,如Intellij

Java 运行Maven-exec-Maven-plugin时,可以选择包含具有所提供范围的依赖项,如Intellij,java,maven,intellij-idea,maven-plugin,exec-maven-plugin,Java,Maven,Intellij Idea,Maven Plugin,Exec Maven Plugin,我想使用exec maven插件运行一个主类,该插件带有Intellij Idea提供的选项“include dependencies with'“scope”。当我使用execmaven插件运行代码时,我收到了大量的classNotFoundException和NoClassDefFoundError。 我能够使用选项“include dependencies with'provided'scope”成功运行主类 如果不使用IDE,如何从Maven或以编程方式运行主类 <profiles

我想使用exec maven插件运行一个主类,该插件带有Intellij Idea提供的选项“include dependencies with'“scope”。当我使用execmaven插件运行代码时,我收到了大量的classNotFoundException和NoClassDefFoundError。 我能够使用选项“include dependencies with'provided'scope”成功运行主类

如果不使用IDE,如何从Maven或以编程方式运行主类

<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>

文档生成器
org.codehaus.mojo
execmaven插件
1.6.0
安装
JAVA
真的
XXXXXXXXXXXXXXXX

能否添加pom中与依赖项相关的部分?为什么要包含提供的依赖项,提供意味着它将在运行时提供。如果你想包含那些依赖项,就把它改为compile。在插件中添加compile是一个相关的问题