MAVEN ANT 构建错误

发布于 2024-11-28 18:09:33 字数 3757 浏览 1 评论 0原文

我的系统配置是

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 ?

My System configuration is

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

I want to compile my classes with Java 1.4.2_04 version

I am using maven-antrun-plugin 1.6

Following Entry in my Module 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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尛丟丟 2024-12-05 18:09:33

试试这个

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

Try this

<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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文