无法在项目dukes-store上执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec(默认)

时间:2016-02-20 20:53:34

标签: maven pom.xml glassfish-4 java-ee-7 maven-install-plugin

我想在glassfish上设置duke forest应用程序,因此我使用了javaee 7 sdk,然后在从命令行执行maven install时出现以下错误

    [INFO] ------------------------------------------------------------------------
[INFO] Building dukes-store 7.0.5
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dukes-store ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/yogesh/Downloads/glassfish4/docs/javaee-tutorial/examples/case-studies/dukes-forest/dukes-store/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ dukes-store ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- exec-maven-plugin:1.2.1:exec (default) @ dukes-store ---
Authentication failed for user: null
(Usually, this means invalid user name and/or password)
Command set failed.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] dukes-forest ....................................... SUCCESS [  1.007 s]
[INFO] events ............................................. SUCCESS [  1.257 s]
[INFO] entities ........................................... SUCCESS [  1.925 s]
[INFO] dukes-resources .................................... SUCCESS [  0.064 s]
[INFO] dukes-payment ...................................... SUCCESS [  3.276 s]
[INFO] dukes-store ........................................ FAILURE [  1.706 s]
[INFO] dukes-shipment ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.568 s
[INFO] Finished at: 2016-02-21T02:00:34+05:30
[INFO] Final Memory: 14M/183M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default) on project dukes-store: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [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/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :dukes-store

这是duke -store的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>org.glassfish.javaeetutorial</groupId>
    <artifactId>dukes-forest</artifactId>
    <version>7.0.5</version>
</parent>

<groupId>org.glassfish.javaeetutorial</groupId>
<artifactId>dukes-store</artifactId>
<packaging>war</packaging>

<name>dukes-store</name>

<dependencies>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>events</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>entities</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>dukes-payment</artifactId>
        <version>${project.version}</version>
        <type>war</type>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>dukes-resources</artifactId>
        <version>${project.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${maven.exec.plugin.version}</version>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <skip>false</skip>
                <executable>/home/yogesh/Downloads/glassfish4/bin/asadmin${glassfish.executables.suffix}</executable>
                <arguments>
                    <argument>set</argument>
                    <argument>server.security-service.activate-default-principal-to-role-mapping=true</argument>
                    <argument>server.http-service.sso-enabled=true</argument>
                </arguments>
            </configuration>
        </plugin>          
    </plugins>

</build>

</project>

1 个答案:

答案 0 :(得分:0)

输出中的相关错误是:

Authentication failed for user: null (Usually, this means invalid user name and/or password)

运行exec-maven-plugin时会生成此错误。此插件配置为执行asadmin。您可能为admin用户创建了密码。 exec-maven-plugin不知道,因此无法成功执行asadmin命令。将以下内容添加到<arguments>部分:

<argument>--user=admin</argument>
<argument>--passwordfile=myprivatefile.txt</argument>

myprivatefile.txt是一个看起来像this

的密码文件