无法执行目标org.codehaus.mojo exec-maven-plugin [英] Failed to execute goal org.codehaus.mojo exec-maven-plugin

查看:240
本文介绍了无法执行目标org.codehaus.mojo exec-maven-plugin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我花了5天没有解决它: 执行mvn exec:java时,它无法正确解析配置参数,并引发以下错误:

I have an issue that I spend 5 days without resolving it: When executing mvn exec:java it fails to correctly parse the configuration arguments, throwing the following error:

"Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project poll-translator: An exception occured while executing the Java class. null: InvocationTargetException: Error creating bean with name 'serviceLocator' defined in class path resource [META-INF/dsol/dsol.xml]: Cannot resolve reference to bean 'dsol-service-proxy' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dsol-service-proxy' defined in class path resource [META-INF/dsol/dsol.xml]: Instantiation of bean failed; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.NullPointerException-->null -> [Help 1]"

这是POM配置使用的文件(使用 Apache Maven 3.0.4):

This is the POM configuration used file (using Apache Maven 3.0.4):

<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.dsol</groupId>
    <artifactId>dsol-parent</artifactId>
    <version>1-SNAPSHOT</version>
    <relativePath>../dsol/dsol-parent/pom.xml</relativePath>
</parent>

<groupId>org.dsol.project</groupId>
<artifactId>poll-translator</artifactId>
<version>0.1-SNAPSHOT</version>

<properties>
    <dsol.version>0.1-SNAPSHOT</dsol.version>
</properties>

<repositories>
    <repository>
        <id>dsol.internal</id>
        <url>http://maven.dsol-lang.net:8080/archiva/repository/internal/</url>
    </repository>
    <repository>
        <id>dsol.snapshots</id>
        <url>http://maven.dsol-lang.net:8080/archiva/repository/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.dsol</groupId>
        <artifactId>dsol-interpreter</artifactId>
        <version>${dsol.version}</version>
    </dependency>
    <dependency>
        <groupId>org.dsol</groupId>
        <artifactId>dsol-default-planner-plugin-impl</artifactId>
        <version>${dsol.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http-jetty</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>java</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <mainClass>org.dsol.engine.DSOLServer</mainClass>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.thoughtworks.paranamer</groupId>
            <artifactId>paranamer-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>run</id>  <!-- id is optional -->
                    <configuration>
                        <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                        <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                    </configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        com.thoughtworks.paranamer
                                    </groupId>
                                    <artifactId>
                                        paranamer-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.3,)
                                    </versionRange>
                                    <goals>
                                        <goal>generate</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

我不知道问题出在哪里,我该如何解决!你能帮我吗?

Idon't know where is the problem and how can i resolve it! Can you help me please?

关于, 萨那.

推荐答案

问题出在您的spring配置上,而不是您的maven配置上. 在您的情况下,当spring尝试创建dsol-service-proxy对象时,其构造函数需要 依次创建serviceLocatorserviceLocator和spring在创建serviceLocator时遇到了一些问题.检查您的dsol.xml并确保正确配置serviceLocator.

The problem is with your spring configuration and not with your maven config. In your case, when spring tries to create dsol-service-proxy object its constructor requires serviceLocator which inturn creates serviceLocator and spring encountered some problem in creating your serviceLocator. Check your dsol.xml and make sure serviceLocator is configured correctly.

这篇关于无法执行目标org.codehaus.mojo exec-maven-plugin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆