こんにちは、jenkins/ant/groovy の世界では初めてで、Google は私の問題を解決するのに役立ちませんでした。
私の仕事は、ビルド プロセス (jenkins を使用) で ant スクリプトを取り除き、それらを jenkins ジョブ (システム Groovy スクリプトの実行) に含めることです。
スクリプトの太字部分が失敗の原因ですが、これを解決する方法がわかりません。
誰かがその問題で私を助けてくれることを願っています。
これは私の「システム Groovy スクリプトの実行」です。
antbuild = new AntBuilder()
projectHome = '...Homedirectory'
projectDomainModel = projectHome + '/CSSDomainModel'
projectPresentationBase = projectHome + '/CSSPresentationBase'
projectServices = projectHome + '/CSSServices'
projectResource = projectHome + '/src/main/resources'
Sources = projectHome + '/Presentation/JavaSource'
projectLibraries = 'lib/bin'
projectWebContent = projectHome + '/Presentation/WebContent'
projectWebInf = projectWebContent + '/WEB-INF'
deployHome = projectHome + '/target/servicekundenportal'
deployBuild = deployHome + '/build/classes'
deployWebInf = deployHome + '/WEB-INF'
foreignSources = 'src'
deployWARFile = deployHome + '/serviceportal.war'
j2eeLibraries = 'D:/Programme_x64/tomcat/8.0.21/Instanz_02/lib'
compileTarget = '1.8'
<b>compilerSourceFiles = antbuild.path{
pathelement(path:Sources)
pathelement(path:projectDomainModel + '/' + foreignSources)
pathelement(path:projectPresentationBase + '/' + foreignSources)
pathelement(path:projectServices + '/' + foreignSources)
}
compilerLibraryFiles = antbuild.path{
fileset(dir:projectDomainModel + '/' + projectLibraries) {include name:'**/*.jar'}
fileset(dir:projectPresentationBase + '/' + projectLibraries) {include name:'**/*.jar'}
fileset(dir:projectServices + '/' + projectLibraries) {include name:'**/*.jar'}
fileset(dir:j2eeLibraries) {include name:'**/*.jar'}
}</b>
antbuild.delete(dir:deployHome)
antbuild.delete(file:deployWARFile)
antbuild.mkdir(dir:deployBuild)
build() {
antbuild.javac(
destdir:deployBuild,
target:compileTarget,
debug:true,
fork:true,
executable:'D:/Programme_x64/Java/jdk1.8.0_45/bin/javac')<b>{
src(path:compilerSourceFiles)
classpath(path:compilerLibraryFiles)
}</b>
}
build()
変換できない Ant スクリプトの部分:
<!-- Compiler Source File Definition -->
<path id="compilerSourceFiles">
<pathelement path="${Sources}" />
<pathelement path="${projectDomainModel}/${foreignSources}" />
<pathelement path="${projectPresentationBase}/${foreignSources}" />
<pathelement path="${projectServices}/${foreignSources}" />
</path>
<!-- Compiler Library Definition -->
<path id="compilerLibraryFiles">
<fileset id="librariesDomainModel" dir="${projectDomainModel}/${projectLibraries}">
<include name="**/*.jar" />
</fileset>
<fileset id="librariesPresentationBase" dir="${projectPresentationBase}/${projectLibraries}">
<include name="**/*.jar" />
</fileset>
<fileset id="librariesServices" dir="${projectServices}/${projectLibraries}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${j2eeLibraries}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="executeCompiler" depends="preCompile">
<javac destdir="${deployBuild}" target="${compileTarget}"
debug="true" debuglevel="lines,vars" encoding="ISO8859-1">
<src refid="compilerSourceFiles" />
<classpath refid="compilerLibraryFiles" />
</javac>
</target>