Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/353.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
常春藤错误:Java IO异常:重置为无效标记_Java_Maven_Ivy - Fatal编程技术网

常春藤错误:Java IO异常:重置为无效标记

常春藤错误:Java IO异常:重置为无效标记,java,maven,ivy,Java,Maven,Ivy,我正在努力建立我的项目。这是我的build.xml <?xml version="1.0"?> <project xmlns:ivy="antlib:org.apache.ivy.ant" name="WMCOMMONINFRASTRUCTURE-WMINFRASTRUCTURE" default="dist"> <import file="../build.xml" /> <property file="../../build.

我正在努力建立我的项目。这是我的build.xml

<?xml version="1.0"?>
   <project xmlns:ivy="antlib:org.apache.ivy.ant" name="WMCOMMONINFRASTRUCTURE-WMINFRASTRUCTURE" default="dist">

    <import file="../build.xml" />
    <property file="../../build.properties" />

    <!-- ===================================================================
      - init - initialization for this submodule
      - ==================================================================== -->
    <target name="init" depends="module-init">
        <!-- Submodule properties -->
        <property name="submodule.name" value="wminfra" />
        <property name="dist.jar.name" value="wminfra-${version}.jar" />
        <property name="dist.jar" value="${root.dist.dir}/${dist.jar.name}" />

        <!-- Submodule paths -->
        <path id="submodule.path">
            <path refid="common.path" />
        </path>
        <path id="test.path">
            <path refid="submodule.path" />
            <path refid="test.root.path" />
        </path>

    </target>

    <target name="prepare" depends="init">
        <mkdir dir="${root.build.dir}" />
        <mkdir dir="${root.dist.dir}" />
        <mkdir dir="${build.dir}" />
        <mkdir dir="${classes.dir}" />
        <mkdir dir="${test-classes.dir}" />
        <mkdir dir="${docs.dir}" />
        <mkdir dir="${api.dir}" />
        <mkdir dir="${test.docs.dir}" />
        <!--<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[revision].[ext]" sync="true"/>-->
        <ivy:retrieve sync="true"/>
    </target>

    <!-- ===================================================================
      -  clean - clean all build remnants from this submodule
      - ==================================================================== -->
    <target name="clean" depends="init">
        <echo message="cleaning ${module.name}-${submodule.name}" />

        <delete file="${warArtifacts.dir}/${dist.jar.name}" />
        <delete file="${earArtifacts.dir}/${dist.jar.name}" />

        <delete file="${dist.jar}" />

        <delete dir="${build.dir}" />
    </target>

    <!-- ===================================================================
      -  checkstyle - ensures all non-generated code meets the company
      -
      -  =================================================================== -->
    <target name="checkstyle" depends="init">
        <echo message="verifying code adheres to coding standards..." />
        <!-- doesn't do anything yet -->
    </target>

    <!-- ===================================================================
      -  compile - compile Java source files
      -  =================================================================== -->
    <target name="compile" depends="checkstyle,compile-sources" />

    <!-- ===================================================================
      -  dist - create distribution jars (which will be used for deployment)
      -  =================================================================== -->
    <target name="dist" depends="compile">

        <jar jarfile="${dist.jar}">
            <fileset dir="${classes.dir}">
                <include name="**/*.class" />
            </fileset>
            <fileset dir="${resources.dir}">
                <include name="**/*.*" />
            </fileset>
        </jar>

        <!-- we want the dist jar in the ear file, so copy it over to the
             ear staging directory: -->
        <copy toDir="${earArtifacts.dir}" file="${dist.jar}" />

        <!-- we also want it available to the web application: -->
        <copy toDir="${warArtifacts.dir}" file="${dist.jar}" />

         <ivy:publish resolver="local" pubrevision="${version}" status="integration" forcedeliver="true" overwrite="true"/>

     <echo message="project ${ant.project.name} published locally with version ${version}" />
        <delete file="${root.dist.dir}/${dist.jar.name}"/>
    </target>

    <!-- ===================================================================
      -  deploy - recreates the platform ear file with only the changes made
      -           in this submodule, and then deploys this newly created ear
      -           file, replacing any old one that existed previously.
      -  =================================================================== -->
    <target name="deploy" depends="dist,undeploy,quick-deploy" />

    <!-- ===================================================================
      -  all - everything
      -  =================================================================== -->
    <target name="all" depends="deploy" />
    </project>
我做了以下几件事:

  • 将ant选项设置为

    set ANT_OPTS=-Xmx1024m -XX:MaxPermSize=512m
    
  • 将环境变量中的路径设置为

    C:\Program Files\Java\jdk1.6.0_13;C:\Program Files\Java\jdk1.6.0_13\jre\bin;D:\product\11.2.0\dbhome_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;D:\Ant1.7.1\bin;
    
  • 将ANT_home设置为环境变量

  • 尝试生成上述xml文件时,将成功创建以下目录结构
    C:\CORE\u DELTA\FCPBMain12.0.1\build\dist

    在这个dist文件夹中,创建了earArtifacts、warArtifacts、ivy-12.0.1.xml和wminfra-12.0.1.jar。其中,ivy.xml文件始终为0KB,为空。

    猜测,问题出在
    \1
    项目的一部分。name属性值-它被解释为转义序列。在我的例子中,相同的错误是由非ASCII符号
    在注释中。

    您的问题很难理解。请将生成输出和ivy.xml文件包括在内好吗?
    set ANT_OPTS=-Xmx1024m -XX:MaxPermSize=512m
    
    C:\Program Files\Java\jdk1.6.0_13;C:\Program Files\Java\jdk1.6.0_13\jre\bin;D:\product\11.2.0\dbhome_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;D:\Ant1.7.1\bin;