无法在项目 nextrtc-signaling-serverrror 上执行目标 org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39197791/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 20:56:46  来源:igfitidea点击:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project nextrtc-signaling-serverrror

javaspringmaveneclipse-rcp

提问by Jason

I tested nextrtc-signaling-server which is opensource for Java. But I encountered building Maven problem. I hope that this is solved.

我测试了 Java 开源的 nextrtc-signaling-server。但是我遇到了构建 Maven 的问题。我希望这能得到解决。

My console log.

我的控制台日志。

 [INFO] Building jar: D:\signallinServer\nextrtc-signaling-server\target\nextrtc-signaling-server-0.0.4-SNAPSHOT-javadoc.jar
 [INFO] 
 [INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ nextrtc-signaling-server ---
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD FAILURE
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 12.430 s
 [INFO] Finished at: 2016-08-29T11:12:34+09:00
 [INFO] Final Memory: 26M/223M
 [INFO] ------------------------------------------------------------------------
 [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project nextrtc-signaling-server: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java are missing or invalid -> [Help 1]
 [ERROR] 
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR] 
 [ERROR] For more information about the errors and possible solutions, please read the following articles:
 [ERROR] [Help 1]  http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException

POM.xml

POM文件

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>org.nextrtc.signalingserver</groupId>
<artifactId>nextrtc-signaling-server</artifactId>
<version>0.0.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>nextrtc-signaling-server</name>
<url>http://nextrtc.org</url>
<description>Library providing signaling protocol for WebRTC</description>

<licenses>
    <license>
        <name>MIT License</name>
        <url>http://www.opensource.org/licenses/mit-license.php</url>
    </license>
</licenses>

<developers>
    <developer>
        <name>Marcin ?lósarz</name>
        <email>[email protected]</email>
        <organization>NextRTC</organization>
        <organizationUrl>http://nextrtc.org</organizationUrl>
    </developer>
</developers>

<issueManagement>
    <url>https://github.com/mslosarz/nextrtc-signaling-server/issues</url>
    <system>GitHub Issues</system>
</issueManagement>

<scm>
    <connection>scm:git:https://github.com/mslosarz/nextrtc-signaling-server.git</connection>
    <developerConnection>scm:git:[email protected]:mslosarz/nextrtc-signaling-server.git</developerConnection>
    <url>https://github.com/mslosarz/nextrtc-signaling-server</url>
</scm>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <spring-version>4.2.4.RELEASE</spring-version>
</properties>

<distributionManagement>
    <snapshotRepository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
</distributionManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
                <execution>
                    <id>sign-artifacts</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>sign</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring-version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-websocket</artifactId>
        <version>${spring-version}</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>2.9.2</version>
    </dependency>
    <dependency>
        <groupId>javax.websocket</groupId>
        <artifactId>javax.websocket-api</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.16.6</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>19.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.5</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.4</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.zohhak</groupId>
        <artifactId>zohhak</artifactId>
        <version>1.1.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <artifactId>hamcrest-core</artifactId>
                <groupId>org.hamcrest</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring-version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
</dependencies>

I've built this source at "clean package exec: Java" (Maven Goals)

我已经在“clean package exec: Java”(Maven 目标)中构建了这个源代码

What do I have to do? I really want to fix it.

我需要做什么?我真的很想修复它。

采纳答案by abaghel

You can build nextrtc-signaling-server project (https://github.com/mslosarz/nextrtc-signaling-server) using below command.

您可以使用以下命令构建 nextrtc-signaling-server 项目(https://github.com/mslosarz/nextrtc-signaling-server)。

mvn clean package

If there is a main class (for example MySampleApplication.java) in a project with package (for example com.sample.my) then you can run that using below command.

如果在带有包(例如 com.sample.my)的项目中有一个主类(例如 MySampleApplication.java),那么您可以使用以下命令运行它。

mvn exec:java -Dexec.mainClass="com.sample.my.MySampleApplication"

If you want to develop new application using "nextrtc-signaling-server" then add below maven dependency in your maven project. Please refer https://nextrtc.org/archives/85

如果您想使用“nextrtc-signaling-server”开发新应用程序,请在您的 maven 项目中添加以下 maven 依赖项。请参考https://nextrtc.org/archives/85

<dependency>
   <groupId>org.nextrtc.signalingserver</groupId>
   <artifactId>nextrtc-signaling-server</artifactId>
   <version>0.0.3</version>
</dependency>

回答by Saliya Hasantha

You don't need to do much work for fix this problem. Simply go to your maven repository which is located under services and then right click and select add repository then add the repository name.In this case it should be org.codehaus... See it works

你不需要做太多的工作来解决这个问题。只需转到位于 services 下的 maven 存储库,然后右键单击并选择添加存储库,然后添加存储库名称。在这种情况下,它应该是 org.codehaus ... 看看它是否有效