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

时间:2015-04-14 05:19:25

标签: 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.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>

上面写的

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

行给出错误。

我的build.properties文件如下:

project.name=FCPBMain\12.0.1
delta.name=DELTA
root.base.dir=C:/CORE_DELTA/${project.name}
settings.localRepository=C:/FCPBRepository/12.0.1
tomcat.local=D:/apache-tomcat-6.0.35
version=12.0.1
root.artifact.dir=${root.base.dir}
root.src.dir=.
#ivy properties
ivy.user.dir=C:/WmIvyRepository/12.0.1
#ivy shared repository properties
ivy.shared.dir=\\\\iflblw-wm-21/WMIvyRepository/cache
#ivy shared repository ivy.xml retrieve pattern
ivy.shared.ivy.pattern=[organisation]/[module]/ivy-[revision].xml
#ivy shared repository artifact retrieve pattern
ivy.shared.artifact.pattern=[organisation]/[module]/[type]s/[artifact].[ext]
#Added by MP for more deployment options
#Choose the target server
deploy.tomcat=true
deploy.weblogic=false
deploy.weblogic92=false
deploy.websphere=false
#Choose the ear file creation option
deploy.bankonly=false
deploy.custonly=false
deploy.both=true
#True if to be build without integration with core banking
#False when integratiion is done
fcpbkernelserviceadaptor.build=true
#MP: choose the options for customer login sso options
customerlogin.sso=false

我做了以下事情:

  1. 将ant选项设置为

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

    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;
    
  3. 将ANT_home设置为环境变量。

  4. 尝试构建上述xml文件时,将成功创建以下目录结构C:\CORE_DELTA\FCPBMain12.0.1\build\dist。 在这个dist文件夹中,创建了earArtifacts,warArtifacts,ivy-12.0.1.xml和wminfra-12.0.1.jar。其中,ivy.xml文件总是0KB,它是空的。

1 个答案:

答案 0 :(得分:0)

猜猜,问题出在\1 project.name属性值的一部分 - 它被解释为转义序列。就我而言,同样的错误是由评论中的非ASCII符号引起的。