Ошибка при компиляции исходников в IntelliJ IDEA

ivan.marchenko

Знаменитый
Участник
Сообщения
38
Розыгрыши
0
Репутация
0
Реакции
13
Баллы
1 295
Хроники
  1. The 2nd Throne: Gracia
Исходники
Присутствуют
Сборка
epilogue
ребят прошу помощи, при компиляции кода практически в конце бьет ошибку и я не могу понять в чем проблема , прошу подсказать , заранее спасибо.

JavaScript:
[zip] Building zip: C:\dev\server\build_archive\server.fatal: not a git repository (or any of the parent directories): .git.zip

BUILD FAILED
C:\dev\server\build.xml:462: java.nio.file.InvalidPathException: Illegal char <:> at index 60: C:\dev\server\build_archive\server.fatal: not a git repository (or any of the parent directories): .git.zip
    at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
    at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
    at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:232)
    at java.base/java.io.File.toPath(File.java:2387)
    at org.apache.tools.zip.ZipOutputStream.<init>(ZipOutputStream.java:365)
    at org.apache.tools.ant.taskdefs.Zip.executeMain(Zip.java:706)
    at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:627)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
    at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:449)
    at org.apache.tools.ant.Target.performTasks(Target.java:470)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
    at org.apache.tools.ant.Main.runBuild(Main.java:818)
    at org.apache.tools.ant.Main.startAnt(Main.java:223)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

Total time: 1 minute 14 seconds

Process finished with exit code 1
 
скорее всего в билд скрипте ожидается что исходники будут находиться в гит репозитории чтобы записать версию в манифест jar-ки. Простой выход: создать локальный гит репозиторий и поместить файлы из который вы билдите туда, более сложный - вырезать этот стейдж из билд файла (без файлов которые вы билдите сказать сложно что и где конкретно)
 
ivan.marchenko, решение:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Build All" default="dist" basedir=".">

    <property name="debug" value="true" />
    <property name="debuglevel" value="lines,vars,source" />
    <property name="optimize" value="true" />
    <property name="nowarn" value="true" />
    <property name="compiler" value="javac10+" />
    <property name="src.dataparser" location="dataparser/src/main" />
    <property name="src.gameserver" location="gameserver/src/main" />
    <property name="src.authserver" location="authserver/src/main" />
    <property name="src.commons" location="commons/src/main" />
    <property name="src.scripts" location="dist/gameserver/data/scripts" />
    <property name="src.prothelper" location="prothelper/src/main" />

    <property name="dist" location="dist" />
    <property name="lib" location="lib" />

    <property name="build" location="build" />
    <property name="build_archive" location="build_archive" />
    <property name="build.classes" location="${build}/classes" />

    <property name="build.dist" location="${build}/dist" />
    <property name="build.dist.gameserver" location="${build.dist}/gameserver" />
    <property name="build.dist.authserver" location="${build.dist}/authserver" />
    <property name="build.dist.lib" location="${build.dist}/lib" />
    <property name="build.dist.tools" location="${build.dist}/tools" />
    <property name="build.version" value="Epilogue" />
    <property name="build.team" value="j2dev" />
    <property name="build.teamsite" value="http://j2dev.ru" />
    <property name="build.licensetype" value="Private" />
    <property name="build.coredev" value="JunkyFunky" />
    <property name="build.datadev" value="JunkyFunky" />

    <path id="classpath">
        <fileset dir="${lib}">
            <include name="**/*.jar" />
        </fileset>
    </path>

    <pathconvert property="jar.list" pathsep=" " refid="classpath">
        <mapper type="flatten" />
    </pathconvert>

    <property name="build.classpath" refid="classpath"/>

    <tstamp>
        <format property="build.tstamp" pattern="yyyy.MM.dd HH:mm" />
    </tstamp>

    <target name="clean" description="Remove the output directories.">
        <delete dir="${build}" />
    </target>

    <target name="init" depends="checkRequirements" description="Create the output directories.">
        <mkdir dir="${build}" />
        <mkdir dir="${build.classes}" />
        <mkdir dir="${build.dist}" />
        <mkdir dir="${build.dist.gameserver}" />
        <mkdir dir="${build.dist.lib}" />
        <mkdir dir="${build.dist.authserver}" />
        <mkdir dir="${build.dist.tools}" />
    </target>

    <!--компилим commons-->
    <target name="compile-commons" depends="init">

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

        <javac srcdir="${src.commons}"
        destdir="${build.classes}"
        debuglevel="${debuglevel}"
        compiler="${compiler}"
        debug="${debug}"
        source="14"
        target="14"
        includeantruntime="false"
        encoding="UTF-8"
        nowarn="${nowarn}"
        classpath="${build.classpath}">
            <compilerarg value="-Xlint:unchecked,rawtypes,-serial" />
        </javac>
    </target>

    <!--собираем commons в jar-->
    <target name="commons-jar" depends="compile-commons">
        <jar destfile="${build}/commons.jar" level="9">
            <fileset dir="${build.classes}" />
            <manifest>
                <attribute name="Build-By" value="${user.name}" />
                <attribute name="Build-Date" value="${build.tstamp}" />
                <attribute name="Chronicle" value="${build.version}" />
                <attribute name="Team-Name" value="${build.team}" />
                <attribute name="Team-Site" value="${build.teamsite}" />
                <attribute name="License-Type" value="${build.licensetype}" />
                <attribute name="Core-Dev" value="${build.coredev}" />
                <attribute name="Data-Dev" value="${build.datadev}" />
            </manifest>
        </jar>

    </target>

    <!--компилим scripts-->
    <target name="compile-scripts" depends="commons-jar">
        <mkdir dir="${build.classes}/scripts"/>

        <javac srcdir="${src.scripts}"
        destdir="${build.classes}"
        debuglevel="${debuglevel}"
        compiler="${compiler}"
        debug="${debug}"
        source="14"
        target="14"
        includeantruntime="false"
        encoding="UTF-8"
        nowarn="${nowarn}"
        classpath="${build.classpath}:${build}/commons.jar:${build}/gameserver.jar">
            <compilerarg value="-Xlint:unchecked,rawtypes,-serial" />
        </javac>
    </target>

    <!--собираем scripts в jar-->
    <target name="scripts-jar" depends="compile-scripts">
        <jar destfile="${build}/scripts.jar" level="9">
            <fileset dir="${build.classes}" />
            <manifest>
                <attribute name="Build-By" value="${user.name}" />
                <attribute name="Build-Date" value="${build.tstamp}" />
                <attribute name="Chronicle" value="${build.version}" />
                <attribute name="Team-Name" value="${build.team}" />
                <attribute name="Team-Site" value="${build.teamsite}" />
                <attribute name="License-Type" value="${build.licensetype}" />
                <attribute name="Core-Dev" value="${build.coredev}" />
                <attribute name="Data-Dev" value="${build.datadev}" />
            </manifest>
        </jar>

    </target>

    <target name="scripts" depends="scripts-jar">
        <copy todir="${build.dist}/lib">
            <fileset dir="${build}">
                <include name="scripts.jar" />
            </fileset>
        </copy>
    </target>

    <!--компилим gameserver-->
    <target name="compile-gameserver" depends="commons-jar">

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

        <javac srcdir="${src.gameserver}"
        destdir="${build.classes}"
        debuglevel="${debuglevel}"
        compiler="${compiler}"
        optimize="${optimize}"
        debug="${debug}"
        source="14"
        target="14"
        includeantruntime="false"
        encoding="UTF-8"
        nowarn="${nowarn}"
        classpath="${build.classpath}:${build}/commons.jar">
            <compilerarg value="-Xlint:unchecked,rawtypes,-serial" />
        </javac>
    </target>

    <!--собираем gameserver в jar-->
    <target name="gameserver-jar" depends="compile-gameserver">
        <concat destfile="${build}/dist/gameserver/config/version.ini">
            Build-By=${user.name}
            Version=${build.version}
            Revision=${build.revision}
            Build Date=${build.tstamp}
            OS=${os.name} ${os.version} ${os.arch}
            JDK=${ant.java.version} ${java.vendor}
        </concat>

        <concat destfile="${build}/classes/l2p/gameserver/version.ini">
            Build-By=${user.name}
            Version=${build.version}
            Revision=${build.revision}
            Build Date=${build.tstamp}
            OS=${os.name} ${os.version} ${os.arch}
            JDK=${ant.java.version} ${java.vendor}
        </concat>
        <jar destfile="${build}/gameserver.jar" level="9">
            <fileset dir="${build.classes}" />
            <manifest>
                <attribute name="Main-Class" value="l2p.gameserver.GameServer" />
                <attribute name="Class-Path" value="${jar.list} commons.jar" />
                <attribute name="Build-By" value="${user.name}" />
                <attribute name="Build-Date" value="${build.tstamp}" />
                <attribute name="Build-Os" value="${os.name}" />
                <attribute name="Chronicle" value="${build.version}" />
                <attribute name="Team-Name" value="${build.team}" />
                <attribute name="Team-Site" value="${build.teamsite}" />
                <attribute name="License-Type" value="${build.licensetype}" />
                <attribute name="Core-Dev" value="${build.coredev}" />
                <attribute name="Data-Dev" value="${build.datadev}" />
            </manifest>
        </jar>

    </target>

    <target name="gameserver" depends="gameserver-jar">

        <mkdir dir="${build.dist}" />
        <mkdir dir="${build.dist.gameserver}" />
        <mkdir dir="${build.dist.gameserver}/geodata" />
        <mkdir dir="${build.dist.gameserver}/log" />

        <copy todir="${build.dist}/lib">
            <fileset dir="${build}">
                <include name="gameserver.jar" />
            </fileset>
        </copy>

        <fixcrlf srcdir="${build.dist.gameserver}" eol="lf" eof="remove" includes="**/*.sh"/>
        <fixcrlf srcdir="${build.dist.gameserver}" eol="crlf" eof="remove" includes="**/*.bat"/>

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

        <copy todir="${build.dist.gameserver}" preservelastmodified="true">
            <fileset dir="${dist}/gameserver">
                <include name="**/*.*"/>
                <exclude name="/data/**/*.iml" />
                <exclude name="/data/*.iml" />
                <exclude name="/data/**/*.java"/>
                <exclude name="/*.iml" />
            </fileset>
        </copy>
        <copy todir="${build.dist.authserver}" preservelastmodified="true">
            <fileset dir="${dist}/authserver">
                <include name="**/*.*"/>
                <exclude name="/*.iml" />
            </fileset>
        </copy>
        <copy todir="${build.dist.tools}" preservelastmodified="true">
            <fileset dir="${dist}/tools">
                <include name="**/*.*"/>
            </fileset>
        </copy>
    </target>

    <!--компилим authserver-->
    <target name="compile-authserver" depends="commons-jar">


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

        <javac srcdir="${src.authserver}"
        optimize="${optimize}"
        debuglevel="${debuglevel}"
        compiler="${compiler}"
        destdir="${build.classes}"
        debug="${debug}"
        source="14"
        target="14"
        includeantruntime="false"
        encoding="UTF-8"
        nowarn="${nowarn}"
        classpath="${build.classpath}:${build}/commons.jar">
            <compilerarg value="-Xlint:unchecked,rawtypes,-serial" />
        </javac>
    </target>

    <!--собираем authserver в jar-->
    <target name="authserver-jar" depends="compile-authserver">
        <jar destfile="${build}/authserver.jar" level="9">
            <fileset dir="${build.classes}" />
            <manifest>
                <attribute name="Main-Class" value="l2p.authserver.authserver" />
                <attribute name="Class-Path" value="${jar.list} commons.jar" />
                <attribute name="Build-By" value="${user.name}" />
                <attribute name="Build-Date" value="${build.tstamp}" />
                <attribute name="Chronicle" value="${build.version}" />
                <attribute name="Team-Name" value="${build.team}" />
                <attribute name="Team-Site" value="${build.teamsite}" />
                <attribute name="License-Type" value="${build.licensetype}" />
                <attribute name="Core-Dev" value="${build.coredev}" />
                <attribute name="Data-Dev" value="${build.datadev}" />
            </manifest>
        </jar>

    </target>

    <target name="authserver" depends="authserver-jar">

        <mkdir dir="${build.dist}" />
        <mkdir dir="${build.dist.authserver}" />
        <mkdir dir="${build.dist.authserver}/log" />

        <copy todir="${build.dist}/lib">
            <fileset dir="${build}">
                <include name="authserver.jar" />
                <include name="commons.jar" />
            </fileset>
        </copy>

        <copy todir="${build.dist}/lib">
            <fileset dir="${lib}">
                <include name="*.jar" />
                <exclude name="stringer-annotations.jar" />
            </fileset>
        </copy>

        <fixcrlf srcdir="${build.dist.authserver}" eol="lf" eof="remove" includes="**/*.sh"/>
        <fixcrlf srcdir="${build.dist.authserver}" eol="crlf" eof="remove" includes="**/*.bat"/>

    </target>


    <!--компилим dataparser-->
    <target name="compile-dataparser" depends="commons-jar">
        <mkdir dir="${build.classes}"/>

        <javac srcdir="${src.dataparser}"
        destdir="${build.classes}"
        debuglevel="${debuglevel}"
        compiler="${compiler}"
        debug="${debug}"
        source="14"
        target="14"
        includeantruntime="false"
        encoding="UTF-8"
        nowarn="${nowarn}"
        classpath="${build.classpath}:${build}/commons.jar">
            <compilerarg value="-Xlint:unchecked,rawtypes,-serial" />
        </javac>
    </target>

    <!--собираем dataparser в jar-->
    <target name="dataparser-jar" depends="compile-dataparser">
        <jar destfile="${build}/dataparser.jar" level="9">
            <fileset dir="${build.classes}" />
            <manifest>
                <attribute name="Build-By" value="${user.name}" />
                <attribute name="Build-Date" value="${build.tstamp}" />
                <attribute name="Chronicle" value="${build.version}" />
            </manifest>
        </jar>

    </target>

    <target name="dataparser" depends="dataparser-jar">
        <copy todir="${build.dist}/lib">
            <fileset dir="${build}">
                <include name="dataparser.jar" />
            </fileset>
        </copy>
    </target>

    <target name="checkRequirements" description="Check Requirements.">
        <echo message="Check ANT version" />
        <fail message="Ant 1.9.4 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
            <condition>
                <not>
                    <antversion atleast="1.9.4" />
                </not>
            </condition>
        </fail>
        <echo message="Check JDK version" />
        <available classname="java.util.stream.Stream" property="JDK8.present" />
        <fail unless="JDK8.present" message="Java 13 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
    </target>

    <target name="dist" depends="authserver, gameserver, scripts">
        <!-- cleanup -->
        <delete file="${build}/authserver.jar" />
        <delete file="${build}/commons.jar" />
        <delete file="${build}/gameserver.jar" />
        <delete file="${build}/scripts.jar" />
        <delete dir="${build.classes}" />
        <echo message="Creating Zip archive"/>
        <zip destfile="${build_archive}/${build.team}_${build.version}_Rev.zip" basedir="${build.dist}" update="true" level="9" />
        <echo message="Creating Zip archive done"/>
    </target>
</project>
 
ANZO и Òbi большое спасибо , Оби с твоим билдом все пошло , Анзо попробую тоже гит запустить думал об этом) большое спасибо
 
А простой ли? Скачать и установить гит (человек им судя по всему и не пользуется), настроить локальный репозиторий для чего?
И все ради того, чтобы при компилировании в манифесте стало на одну строчку больше?
Код:
<attribute name="Revision" value="${build.revision}" />

:Wahaha:
 
Назад
Сверху Снизу