I am trying to start an Eclipse Headless Build for Java Source Files. The Code for one Build.xml
works fine, but I want to start the Headless Build for all Build.xml
files of a directory. And this is where it gets difficult for me.
The Batch file for listing the Build.xml
files of the directory looks like this:
for /r C:\ProjektNEU\Source\java_extensions %i in (*build.xml) do echo %i
The Batch file for the build of one java Source, that works looks like this:
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
Now I am trying to integrate the paths I receive from the first batch file to the second batch, to the point -buildfile
My try with this was like that but it didnt work:
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)
The Result the cmd shows for the first four build.xml
files is this, but there is no information at all:
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)
But like this the Build is not starting. Does anybody has an idea what I have to change so the build for each build.xml
file does start?
I solved the problem, the PATH variable was irrelevant because the %x variable already defines the path of the found Build.xml file. So we can easily but the %x variable as the path to the buildfile.
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)
Result:
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