【问题标题】:MAVEN ANT Build ErrorMAVEN ANT 构建错误
【发布时间】:2011-08-09 19:39:57
【问题描述】:

我的系统配置是

MAVEN apache-maven-2.2.1 JAVA_HOME - jdk1.5.0_22 

我想用 Java 1.4.2_04 版本编译我的类

我正在使用 maven-antrun-plugin 1.6

我的模块 POM.XMl 中的以下条目

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>install</id>
                    <phase>install</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <source>${java-version}</source>
                        <target>${java-version}</target>
                        <target>
                            <property environment="env"/>
                            <property name="weblogic.home" value="${env.WL_HOME}"/>
                            <echo message="compile classpath: ${weblogic.home}"/>
                        </target>
                        <project name="WLW build" default="build">
                            <tasks>
                                <taskdef name="wlwBuild" classname="workshop.core.WlwBuildTask">
                                    <classpath refid="maven.dependency.classpath"/>
                                    <classpath>
                                        <fileset dir="C:\bea\weblogic81\workshop">
                                            <include name="wlw-ide.jar"/>
                                        </fileset>
                                    </classpath>
                                </taskdef>
                                <target name="build">
                                    <wlwBuild work="C:\TFS\HPRA\Source\Services\WorkCenterPlatform\Java\WorkCenterPlatform\WorkCenterPlatform.work" serverclasspath="${server.classpath}" classpathref="maven.plugin.classpath">
                                        <build outputdir="C:\CARR" outputfilename="WPSSchemas.jar" project="WPSSchemas"/>
                                    </wlwBuild>
                                </target>
                            </tasks>
                        </project>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>





I am getting following Exception.


[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error configuring: org.apache.maven.plugins:maven-antrun-plugin. Reason: ERROR: Cannot override read-only parameter: project in goal: antrun:run
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Aug 09 12:20:54 PDT 2011
[INFO] Final Memory: 11M/22M
[INFO] -----------------------------------------------------------------------

Any idea where i am wrong ?

【问题讨论】:

  • 我试图删除 TAG 现在我收到以下错误:[INFO] -------- -------------------------------------------------- -------------- [错误] 构建错误 [信息] ---------------------------- -------------------------------------------- [INFO] Ant BuildException已发生:未指定项目 [INFO] ----------------------------------------- ------------------------------- [INFO] 有关更多信息,请使用 -e 开关运行 Maven [INFO] -- -------------------------------------------------- --------------------

标签: maven-ant-tasks


【解决方案1】:

试试这个

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
    <source>1.5</source>
    <target>1.4</target>
</configuration>
</plugin>

【讨论】:

  • 是的,我改变了它,它与下面的错误相同。 [错误] 构建错误 [信息] 配置错误:org.apache.maven.plugins:maven-antrun-plugin。原因:错误:无法覆盖只读参数:目标中的项目:antrun:run
猜你喜欢
  • 1970-01-01
  • 2015-06-10
  • 1970-01-01
  • 2013-09-07
  • 2015-12-30
  • 1970-01-01
  • 2011-07-10
  • 2015-12-01
相关资源
最近更新 更多