使用不同的构建文件启动 java Eclipse 无头构建
Start java Eclipse headless build with different Build files
我正在尝试为 Java 源文件启动 Eclipse 无头构建。一个 Build.xml
的代码工作正常,但我想为目录的所有 Build.xml
文件启动 Headless Build。这对我来说是困难的地方。
用于列出目录 Build.xml
文件的批处理文件如下所示:
for /r C:\ProjektNEU\Source\java_extensions %i in (*build.xml) do echo %i
用于构建一个 java 源代码的批处理文件看起来像这样:
java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^
-application org.eclipse.ant.core.antRunner^
-buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeIPObjectProperties\build.xml^
-DbuildDirectory=C:/temp^
-DbaseLocation=C:/Polarion/polarion^
-Ddata=C:/Users/Administrator/eclipse-workspace
现在我正在尝试将从第一个批处理文件接收到的路径整合到第二个批处理文件中,直至 -buildfile
我的尝试是这样的,但没有成功:
for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (SET "PATH=!PATH!" & do java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^
-application org.eclipse.ant.core.antRunner^
-buildfile !PATH!^ -DbuildDirectory=C:/temp^
-DbaseLocation=C:/Polarion/polarion^
-Ddata=C:/Users/Administrator/eclipse-workspace)
cmd 显示的前四个 build.xml
文件的结果是这样的,但根本没有任何信息:
C:\Users\Administrator>for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (SET "PATH=!PATH!" AND do java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^ -application org.eclipse.ant.core.antRunner^ -buildfile !PATH!^ -DbuildDirectory=C:/temp^ -DbaseLocation=C:/Polarion/polarion^ -Ddata=C:/Users/Administrator/eclipse-workspace)
但是像这样构建没有开始。有没有人知道我必须更改什么才能开始构建每个 build.xml
文件?
我解决了问题,PATH 变量无关紧要,因为 %x 变量已经定义了找到的 Build.xml 文件的路径。所以我们可以轻松地将 %x 变量作为构建文件的路径。
for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (
java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^
-application org.eclipse.ant.core.antRunner^
-buildfile %x^
-DbuildDirectory=C:/temp^
-DbaseLocation=C:/Polarion/polarion^
-Ddata=C:/Users/Administrator/eclipse-workspace)
结果:
C:\Users\Administrator>for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^ -application org.eclipse.ant.core.antRunner^ -buildfile %x^ -DbuildDirectory=C:/temp^ -DbaseLocation=C:/Polarion/polarion^ -Ddata=C:/Users/Administrator/eclipse-workspace)
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeIPObjectProperties\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk1004281732:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk1004281732:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeIPObjectProperties\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 1 minute 12 seconds
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeProcedureObject\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk821087498:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk821087498:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeProcedureObject\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 16 seconds
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.createBranchedDocument\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk551374888:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk551374888:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.createBranchedDocument\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 16 seconds
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.formextension.sonarQubeMeasurements\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk1229264274:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk1229264274:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.formextension.sonarQubeMeasurements\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 15 seconds
我正在尝试为 Java 源文件启动 Eclipse 无头构建。一个 Build.xml
的代码工作正常,但我想为目录的所有 Build.xml
文件启动 Headless Build。这对我来说是困难的地方。
用于列出目录 Build.xml
文件的批处理文件如下所示:
for /r C:\ProjektNEU\Source\java_extensions %i in (*build.xml) do echo %i
用于构建一个 java 源代码的批处理文件看起来像这样:
java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^
-application org.eclipse.ant.core.antRunner^
-buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeIPObjectProperties\build.xml^
-DbuildDirectory=C:/temp^
-DbaseLocation=C:/Polarion/polarion^
-Ddata=C:/Users/Administrator/eclipse-workspace
现在我正在尝试将从第一个批处理文件接收到的路径整合到第二个批处理文件中,直至 -buildfile
我的尝试是这样的,但没有成功:
for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (SET "PATH=!PATH!" & do java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^
-application org.eclipse.ant.core.antRunner^
-buildfile !PATH!^ -DbuildDirectory=C:/temp^
-DbaseLocation=C:/Polarion/polarion^
-Ddata=C:/Users/Administrator/eclipse-workspace)
cmd 显示的前四个 build.xml
文件的结果是这样的,但根本没有任何信息:
C:\Users\Administrator>for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (SET "PATH=!PATH!" AND do java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^ -application org.eclipse.ant.core.antRunner^ -buildfile !PATH!^ -DbuildDirectory=C:/temp^ -DbaseLocation=C:/Polarion/polarion^ -Ddata=C:/Users/Administrator/eclipse-workspace)
但是像这样构建没有开始。有没有人知道我必须更改什么才能开始构建每个 build.xml
文件?
我解决了问题,PATH 变量无关紧要,因为 %x 变量已经定义了找到的 Build.xml 文件的路径。所以我们可以轻松地将 %x 变量作为构建文件的路径。
for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (
java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^
-application org.eclipse.ant.core.antRunner^
-buildfile %x^
-DbuildDirectory=C:/temp^
-DbaseLocation=C:/Polarion/polarion^
-Ddata=C:/Users/Administrator/eclipse-workspace)
结果:
C:\Users\Administrator>for /r C:\ProjektNEU\Source\java_extensions %x in (*build.xml) do (java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar^ -application org.eclipse.ant.core.antRunner^ -buildfile %x^ -DbuildDirectory=C:/temp^ -DbaseLocation=C:/Polarion/polarion^ -Ddata=C:/Users/Administrator/eclipse-workspace)
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeIPObjectProperties\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk1004281732:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk1004281732:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeIPObjectProperties\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 1 minute 12 seconds
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeProcedureObject\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk821087498:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk821087498:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.changeProcedureObject\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 16 seconds
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.createBranchedDocument\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk551374888:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk551374888:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.createBranchedDocument\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 16 seconds
C:\Users\Administrator>(java -jar C:\Users\Administrator\Documents\eclipse\plugins\org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar -application org.eclipse.ant.core.antRunner -buildfile C:\ProjektNEU\Source\java_extensions\com.polarion.idl.formextension.sonarQubeMeasurements\build.xml -DbuildDirectory=C:/temp -DbaseLocation=C:/Polarion/polarion -Ddata=C:/Users/Administrator/eclipse-workspace )
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1.13.0.20190716-1624.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://952.fwk1229264274:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://952.fwk1229264274:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
Buildfile: C:\ProjektNEU\Source\java_extensions\com.polarion.idl.formextension.sonarQubeMeasurements\build.xml
plugin_export:
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 15 seconds