Grails 2.5.4 WAR packaging error - grails

I am trying to build a war from a grails 2.5.4 project but I am getting an error.
.Error
|
WAR packaging error: error=2, No such file or directory
Here is the command I ran and the full trace.
grails dev war --plain-output --stacktrace --verbose
Base Directory: /Users/anupshrestha/workspaces/biblio
|Loading Grails 2.5.4
|Configuring classpath
.
|Environment set to development
.................................
|Packaging Grails application
..................................................
|Compiling 4 GSP files for package [biblio]
..
|Compiling 2 GSP files for package [springSecurityCore]
. [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage
.
|Building WAR file
[copy] Copying 406 files to /Users/anupshrestha/workspaces/biblio/target/work/stage
[copy] Copied 121 empty directories to 2 empty directories under /Users/anupshrestha/workspaces/biblio/target/work/stage
............... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/plugins/resources-1.2.14
. [copy] Copying 7 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/plugins/resources-1.2.14
.......... [copy] Copying 5 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/grails-app
[copy] Copied 4 empty directories to 1 empty directory under /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/grails-app
. [copy] Copying 659 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/classes
. [copy] Copying 1354 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/classes
. [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/spring
.. [copy] Copying 3 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/classes
. [copy] Copying 152 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/lib
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF
. [delete] Deleting: /Users/anupshrestha/workspaces/biblio/target/work/resources/web.xml
. [copy] Copying 4 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/lib
...[propertyfile] Updating property file: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/classes/application.properties
[mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/mongodb-5.0.12.RELEASE
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/mongodb-5.0.12.RELEASE
.. [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/cache-1.1.8
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/cache-1.1.8
... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/webxml-1.4.1
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/webxml-1.4.1
... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/resources-1.2.14
. [copy] Copying 2 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/resources-1.2.14
.. [copy] Copying 2 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/classes
. [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/spring-security-cas-2.0-RC1
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/spring-security-cas-2.0-RC1
... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/spring-security-core-2.0-RC4
. [copy] Copying 11 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/spring-security-core-2.0-RC4
... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/spring-security-ldap-2.0.1
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/spring-security-ldap-2.0.1
... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/ldap-0.8.2
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/ldap-0.8.2
... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/xss-sanitizer-0.4.0
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/xss-sanitizer-0.4.0
.. [copy] Copying 2 files to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/classes
. [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/quartz-1.0.1
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/quartz-1.0.1
... [mkdir] Created dir: /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/codenarc-0.25.2
. [copy] Copying 1 file to /Users/anupshrestha/workspaces/biblio/target/work/stage/WEB-INF/plugins/codenarc-0.25.2
.... [delete] Deleting directory /Users/anupshrestha/workspaces/biblio/target/work/stage
.Error
|
WAR packaging error: error=2, No such file or directory

There are many possibilities:
First try to restart your IDE
Not solved? Check below steps:
When we run compile or create war command it create files and stores them by default in the project's working directory. Where default directory name is target
If our project workspace contains previously created war. It will not deleted automatically. It will overwritten with new.
SO run the clean command and check the contents of the target directory. If still you notice that target/work directory still exists.
run clean-all command and now check target/work are deleted or not.
Now try to create war
If still getting issue then exclude particular classes or jars which cause to create war
Hope this help's you

I had a similar error with message:
| Error WAR packaging error: /Users/xxx/.grails/2.5.3/projects/my-proyect/resources/grails-app does not exist.
The error was caused by removing i18n directory. Fix is to re-instate the i18n directory and add an empty messages.properties file.
Reference

Related

Which "empty directories" are being copied by ant?

On a project that uses ant as a build tool, I have the following simplified directory structure:
src/
com/
foo/
bar/
(some files)
bar2/
(some other files)
And the following simplified ant script:
<project default="all">
<target name="all">
<delete dir="dst"/>
<mkdir dir="dst"/>
<copy todir="dst">
<fileset dir="src" excludes="com/foo/bar/*"/>
</copy>
</target>
</project>
When I run this ant script, I see the following output:
all:
[delete] Deleting directory /home/grodriguez/workspace/_test/anttest/dst
[mkdir] Created dir: /home/grodriguez/workspace/_test/anttest/dst
[copy] Copying 1 file to /home/grodriguez/workspace/_test/anttest/dst
[copy] Copied 4 empty directories to 1 empty directory under /home/grodriguez/workspace/_test/anttest/dst
Question: Why is ant reporting that "4 empty directories" are being copied? Shouldn't that be 1 empty directory (com/foo/bar)?
Creating the directory com/foo/bar implies first creating com and then com/foo - i.e. three directories.
My version of Ant is slightly more verbose and shows each creation action:
$ ant -v
Apache Ant(TM) version 1.10.2 compiled on February 3 2018
... deleted for brevity ....
[mkdir] Created dir: /stack/ant/dst
[copy] com/foo/bar2/x.txt added as com/foo/bar2/x.txt doesn't exist.
[copy] omitted as /stack/ant/dst is up to date.
1 [copy] com added as com doesn't exist.
2 [copy] com/foo added as com/foo doesn't exist.
3 [copy] com/foo/bar added as com/foo/bar doesn't exist.
4 [copy] com/foo/bar2 added as com/foo/bar2 doesn't exist.
[copy] Copying 1 file to /stack/ant/dst
[copy] Copying /stack/ant/src/com/foo/bar2/x.txt to /stack/ant/dst/com/foo/bar2/x.txt
[copy] Copied 4 empty directories to 1 empty directory under /stack/ant/dst
When bar2 is created it is (obviously) empty and so gets included in the count of four, even though it is non-empty by the time the copy completes.

References to NuGet packages cannot be resolved in F# project being built in VSTS

With Visual Studio 2017 Community I have created a solution with a F# library project (regular, not PCL) targeting the .NET 4.5.2 framework and the F# 4.1 (FSharp.Core, 4.4.1.0) runtime. Visual Studio added for me the NuGet reference to System.ValueType (4.3.0) by default.
The only code in this project is the following which is using System.ValueType:
type TupleCreator() =
member this.Create x =
System.ValueTuple.Create(x)
Building the project locally works fine, unfortunately this is not the case with VSTS. I have a build definition (with default agent queue set to Hosted VS2017) with a NuGet restore step and a build solution step (with Visual Studio Version set to Latest).
When the build runs it succeeds in restoring the nuget packages:
##[section]Starting: NuGet restore **\*.sln
=================================================================
Task : NuGet Installer
Description : Installs or restores missing NuGet packages
Version : 0.2.31
Author : Microsoft Corporation
=================================================================
[command]C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 3.3.0.212 / 3.3.0
SYSTEMVSSCONNECTION exists true
To connect to NuGet feeds hosted in your Team Services account/TFS project collection on this build agent, edit your build definition to choose a higher version of nuget or specify a path to a NuGet.config containing the package sources you wish to use.
[command]d:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.sln
MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.
Feeds used:
C:\Users\buildguest\AppData\Local\NuGet\Cache
https://api.nuget.org/v3/index.json
Restoring NuGet package System.ValueTuple.4.3.0.
Adding package 'System.ValueTuple.4.3.0' to folder 'd:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\packages'
Added package 'System.ValueTuple.4.3.0' to folder 'd:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\packages'
##[section]Finishing: NuGet restore **\*.sln
The build step then yields the following log:
##[section]Starting: Build solution $/tfs1/Apps/Sandbox/FSharpWithNugetDemo/FSharpWithNugetDemo.sln
==============================================================================
Task : Visual Studio Build
Description : Build with MSBuild and set the Visual Studio version property
Version : 1.117.0
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613727)
==============================================================================
##[command]"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.117.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,15.1) -latest -format json
##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.sln" /nologo /nr:false /dl:CentralLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.117.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=d08ecee6-b628-4743-9e80-d31a64026956|SolutionDir=d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo"*ForwardingLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.117.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:TreatWarningsAsErrors=False /p:platform="any cpu" /p:configuration="debug" /p:VisualStudioVersion="15.0" /p:_MSDeployUserAgent="VSTS_1e91f890-819e-4329-aa62-069b62ae16d0_build_4_116"
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 5/24/2017 6:32:52 PM.
Project "d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "debug|any cpu".
Project "d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.sln" (1) is building "d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj" (2) on node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Debug\".
Creating directory "obj\Debug\".
ResolveAssemblyReferences:
Primary reference "System.ValueTuple".
##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1964,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ValueTuple". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ValueTuple". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj]
For SearchPath "{HintPathFromItem}".
Considered "..\..\Sandbox (local)\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll", but it didn't exist.
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.ValueTuple.winmd", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.ValueTuple.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.ValueTuple.exe", but it didn't exist.
.
.
.
Considered "bin\Debug\System.ValueTuple.exe", but it didn't exist.
CoreCompile:
C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\fsc.exe -o:obj\Debug\FSharpWithNugetDemo.dll
-g
--debug:full
--noframework
--define:DEBUG
--define:TRACE
--doc:bin\Debug\FSharpWithNugetDemo.XML
--optimize-
--tailcalls-
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.1.0\FSharp.Core.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\mscorlib.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Core.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Numerics.dll
--target:library
--warn:3
--warnaserror:76
--fullpaths
--flaterrors
--subsystemversion:6.00
--highentropyva+
d:\a\_temp\.NETFramework,Version=v4.5.2.AssemblyAttributes.fs
AssemblyInfo.fs
Library1.fs
##[error]Apps\Sandbox\FSharpWithNugetDemo\Library1.fs(5,12): Error FS0039: The value, constructor, namespace or type 'ValueTuple' is not defined. Maybe you want one of the following: ValueType
d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\Library1.fs(5,12): error FS0039: The value, constructor, namespace or type 'ValueTuple' is not defined. Maybe you want one of the following: ValueType [d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj]
Done Building Project "d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj" (default targets) -- FAILED.
Done Building Project "d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.sln" (default targets) -- FAILED.
Build FAILED.
"d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.sln" (default target) (1) ->
"d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj" (default target) (2) ->
(ResolveAssemblyReferences target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1964,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ValueTuple". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj]
"d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.sln" (default target) (1) ->
"d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj" (default target) (2) ->
(CoreCompile target) ->
d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\Library1.fs(5,12): error FS0039: The value, constructor, namespace or type 'ValueTuple' is not defined. Maybe you want one of the following: ValueType [d:\a\3\s\Apps\Sandbox\FSharpWithNugetDemo\FSharpWithNugetDemo.fsproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:06.14
##[error]Process 'msbuild.exe' exited with code '1'.
This is not an issue with System.ValueType because the build process is unable to build with references to any nuget packages. This is also not an issue with my VSTS because my C# projects with NuGet references get built fine.
What is wrong with my F# project? Are there additional steps to be taken in order to enable NuGet in F# projects on VSTS?
EDIT
I just compared the output of the CoreCompile section with what is printed in Visual Studio. In Visual Studio it says:
C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\fsc.exe -o:obj\Debug\FSharpWithNugetDemo.dll
-g
--debug:full
--noframework
--define:DEBUG
--define:TRACE
--doc:bin\Debug\FSharpWithNugetDemo.XML
--optimize-
--tailcalls-
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.1.0\FSharp.Core.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\mscorlib.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Core.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.dll
-r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Numerics.dll
-r:D:\Projects\Sandbox\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll
.
.
.
--target:library
--warn:3
--warnaserror:76
--vserrors
--utf8output
--fullpaths
--flaterrors
--subsystemversion:6.00
--highentropyva+
C:\Users\David\AppData\Local\Temp\.NETFramework,Version=v4.5.2.AssemblyAttributes.fs
AssemblyInfo.fs
Library1.fs
FSharpWithNugetDemo -> D:\Projekte\VisualStudio.com\sphereutfs\Dev\Apps\Sandbox\FSharpWithNugetDemo\bin\Debug\FSharpWithNugetDemo.dll
The difference is that there is a -r: line with a path to the System.ValueTuple.dll obtained from NuGet which is missing in the log of the VSTS build. How can I tell the VSTS build to include this reference when compiling?
This is caused the setting in your FSharpWithNugetDemo.fsproj file. You set the path for System.ValueTuple as your local path:
<Reference Include="System.ValueTuple">
<HintPath>..\..\Sandbox (local)\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
It should be use relate path so that when it build by VSTS, System.ValueTuple will be searched in $(build.sourcesdirectory):
<Reference Include="System.ValueTuple">
<HintPath>..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>

Ant ignoring copy task file?

I have the following :
<mkdir dir="${build.dir}/serverNIO" />
<copy todir="${build.dir}/serverNIO" overwrite="true" verbose="true">
<fileset dir="resources/serverresources">
<include name="*.properties" />
</fileset>
</copy>
I want to copy the properties file from one folder to the other, all other tasks work fine except this one.
Why does this happen? I do not even get any error message,and the file are in the location mentioned.
So when I try to run my server:
MacBook-Pro:ClientServerNio ramapriyasridharan$ ant run_server
Buildfile: /Users/ramapriyasridharan/Downloads/ClientServerNio/build.xml
init:
[mkdir] Created dir: /Users/ramapriyasridharan/Downloads/ClientServerNio/bin
[mkdir] Created dir: /Users/ramapriyasridharan/Downloads/ClientServerNio/dist
compile_server:
[mkdir] Created dir: /Users/ramapriyasridharan/Downloads/ClientServerNio/bin/serverNIO
[copy] Copying 1 file to /Users/ramapriyasridharan/Downloads/ClientServerNio/bin/serverNIO
[copy] Copying /Users/ramapriyasridharan/Downloads/ClientServerNio/resources/serverresources/server.properties to /Users/ramapriyasridharan/Downloads/ClientServerNio/bin/serverNIO/server.properties
init:
compile_common_server:
[javac] Compiling 3 source files to /Users/ramapriyasridharan/Downloads/ClientServerNio/bin/serverNIO
init:
compile_database_api:
[javac] Compiling 1 source file to /Users/ramapriyasridharan/Downloads/ClientServerNio/bin/serverNIO
[javac] Compiling 5 source files to /Users/ramapriyasridharan/Downloads/ClientServerNio/bin/serverNIO
jar_server:
[jar] Building jar: /Users/ramapriyasridharan/Downloads/ClientServerNio/dist/server.jar
run_server:
[java] Exception in thread "main" java.io.FileNotFoundException: /ClientServerNio/bin/serverNIO/server.properties (No such file or directory)
[java] at java.io.FileInputStream.open(Native Method)
[java] at java.io.FileInputStream.<init>(FileInputStream.java:146)
[java] at java.io.FileInputStream.<init>(FileInputStream.java:101)
[java] at ch.ethz.rama.asl.server.MessageServer.main(Unknown Source)
[java] Java Result: 1
EDIT :
Now it suddenly seems to copy files, only thing is my server program cannot find the properties file,even tought its in the same directory, what should I do?
The Ant script copies server.properties to...
/Users/ramapriyasridharan/Downloads/ClientServerNio/bin/serverNIO/server.properties
...but the Java program launched in the run_server target is looking for the file at...
/ClientServerNio/bin/serverNIO/server.properties
To fix this, either:
<copy> in the Ant script needs to copy server.properties to /ClientServerNio/bin/serverNIO
MessageServer.main needs to change so it looks for server.properties under /Users/ramapriyasridharan

TFS: Wix using TfvcTemplate.12 unable to find source files

I need to use TfvcTemplate.12.xaml because of its Pre and Post build script execution support and I need to run a Powershell script as PreBuild event.
On TFS 2013, Building a Wix project using old DefaultTemplate.xaml works fine. While trying to build using new default template TfvcTemplate.12.xaml builds the csharp project fine, but Wix is unable to find its files, while files are present at same location.
Here is Wix code:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define SourceDir=$(var.OutDir)?>
<?warning **************** Target=$(var.TargetDir) ***********?>
<?warning **************** src=$(var.SourceDir) **************?>
<Product Id="*" Language="1033" Manufacturer="Test" Name="Testing" UpgradeCode="DB7DAC5A-ED29-45E6-8029-89F6486A9ACA" Version="1.0.0.0">
<Package Compressed="yes" InstallerVersion="200" Platform="x64" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="ProgFiles">
<Directory Id="bin" Name="bin">
<Component Id="AddProjToSln.exe" Guid="*">
<File Id="AddProjToSln.exe" KeyPath="yes" Source="$(var.SourceDir)AddProjToSln.exe" />
</Component>
<Component Id="AddProjToSln.exe.config" Guid="*">
<File Id="AddProjToSln.exe.config" KeyPath="yes" Source="$(var.SourceDir)AddProjToSln.exe.config" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Level="1" Title="TestFe">
<ComponentGroupRef Id="Testing" />
</Feature>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
</Product>
<Fragment>
<ComponentGroup Id="Testing">
<ComponentRef Id="AddProjToSln.exe" />
<ComponentRef Id="AddProjToSln.exe.config" />
</ComponentGroup>
</Fragment>
</Wix>
Here is the log from TFS:
Build started 10/13/2014 5:24:15 PM.
1>Project "D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln.sln"
on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
1>Project "D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln.sln"
(1) is building
"D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln\AddProjToSln.csproj"
(2) on node 1 (default targets).
2>PrepareForBuild:
Creating directory "obj\Debug\".
1>Project "D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln.sln"
(1) is building
"D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj"
(3) on node 2 (default targets).
3>PrepareForBuild:
Creating directory "obj\Debug\".
Compile:
C:\Program Files (x86)\WiX Toolset v3.8\bin\candle.exe -dDebug -d"DevEnvDir=Undefined if not building from within Visual Studio"
-dSolutionDir=D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\
-dSolutionExt=.sln -dSolutionFileName=AddProjToSln.sln -dSolutionName=AddProjToSln -dSolutionPath=D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln.sln
-dConfiguration=Debug -dOutDir=D:\Builds\31\47\bin\ -dPlatform=x86 -dProjectDir=D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\
-dProjectExt=.wixproj -dProjectFileName=test_install.wixproj -dProjectName=test_install -dProjectPath=D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj
-dTargetDir=D:\Builds\31\47\bin\ -dTargetExt=.msi -dTargetFileName=test.msi -dTargetName=test -dTargetPath=D:\Builds\31\47\bin\test.msi -out obj\Debug\ -arch x86 Product.wxs
3>D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(4):
warning CNDL1096: **************** Target=D:\Builds\31\47\bin\
*********** [D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
3>D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(5):
warning CNDL1096: **************** src=D:\Builds\31\47\bin\
************** [D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
Link:
C:\Program Files (x86)\WiX Toolset v3.8\bin\Light.exe -out D:\Builds\31\47\bin\test.msi -pdbout D:\Builds\31\47\bin\test.wixpdb
-cultures:null -contentsfile obj\Debug\test_install.wixproj.BindContentsFileListnull.txt
-outputsfile obj\Debug\test_install.wixproj.BindOutputsFileListnull.txt
-builtoutputsfile obj\Debug\test_install.wixproj.BindBuiltOutputsFileListnull.txt
-wixprojectfile D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj
obj\Debug\Product.wixobj
2>GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input
files.
3>D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(12):
error LGHT0103: The system cannot find the file
'D:\Builds\31\47\bin\AddProjToSln.exe'.
[D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
3>D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(15):
error LGHT0103: The system cannot find the file
'D:\Builds\31\47\bin\AddProjToSln.exe.config'.
[D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
3>Done Building Project "D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj"
(default targets) -- FAILED.
2>CoreCompile:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:AnyCPU
/errorreport:prompt /warn:4 /main:AddProjToSln.Program /highentropyva+
/reference:"c:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PublicAssemblies\envdte.dll" /reference:"c:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PublicAssemblies\envdte100.dll" /reference:"c:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PublicAssemblies\envdte80.dll" /reference:"c:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PublicAssemblies\envdte90.dll" /reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\Microsoft.CSharp.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\Microsoft.VisualBasic.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Core.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.DataSetExtensions.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\System.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Windows.Forms.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.dll"
/reference:"C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.Linq.dll"
/debug+ /debug:full /filealign:512 /optimize-
/out:obj\Debug\AddProjToSln.exe /subsystemversion:6.00 /target:exe
/utf8output /win32icon:"Crystal_Clear_mimetype_recycled (2).ico"
Program.cs Properties\AssemblyInfo.cs
"C:\Users\tfsbuild\AppData\Local\Temp.NETFramework,Version=v4.5.AssemblyAttributes.cs"
_CopyAppConfigFile:
Copying file from "App.config" to "D:\Builds\31\47\bin\AddProjToSln.exe.config".
CopyFilesToOutputDirectory:
Copying file from "obj\Debug\AddProjToSln.exe" to "D:\Builds\31\47\bin\AddProjToSln.exe".
AddProjToSln -> D:\Builds\31\47\bin\AddProjToSln.exe
Copying file from "obj\Debug\AddProjToSln.pdb" to "D:\Builds\31\47\bin\AddProjToSln.pdb".
2>Done Building Project "D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln\AddProjToSln.csproj"
(default targets).
1>Done Building Project "D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln.sln"
(default targets) -- FAILED.
Build FAILED.
"D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln.sln"
(default target) (1) ->
"D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj"
(default target) (3) ->
(Compile target) ->
D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(4):
warning CNDL1096: **************** Target=D:\Builds\31\47\bin\
*********** [D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(5):
warning CNDL1096: **************** src=D:\Builds\31\47\bin\
************** [D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
"D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\AddProjToSln.sln"
(default target) (1) ->
"D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj"
(default target) (3) ->
(Link target) ->
D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(12):
error LGHT0103: The system cannot find the file
'D:\Builds\31\47\bin\AddProjToSln.exe'.
[D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\Product.wxs(15):
error LGHT0103: The system cannot find the file
'D:\Builds\31\47\bin\AddProjToSln.exe.config'.
[D:\Builds\31\47\src\MyComp\Playground\MyUser\Utilities\VisualStudio\TestInstall\test_install.wixproj]
2 Warning(s)
2 Error(s)
Time Elapsed 00:00:01.04
I verified multiple times that files are there and it builds without any problem at command line using MsBuild and Wix Tool set as well.
I'm unable to figure out why using TfvcTemplate.12.xaml, wix is unable to see its files while these are present intact there....
Any help would be really appreciated.
So, finally I was able to solve this after a whole day struggle. Like Digg a mountain and got a mice :).
Actually TfvcTemplate.12.xaml seems to be executing MsBuild with parallel processing enabled (/m), while in my VS Solution, Wix project was added independently i.e. in Build Order it was the last project to build, but I never set other projects as its dependencies. So MSBuild found that it has no dependency and ignored its Build Order and simply building it either on random order or as first project. So naturally installer project was unable to find its source files and so failing.
I verified this phenomena by removing /m:1 argument to MSBuild and declaring all other projects as Dependencies of Wix Project: i.e. in VS, PROJECT –> Project Dependencies. This caused MsBuild to build all other projects before Wix Project and now Wix is able to find its Source files properly…
Here is the screenshot for illustration:

Ant Build failing because of wrong classpath to JBoss server

How can I fix it or where do I fix it?
It should point to:
C:\jboss\jboss-5.1.0.GA\server\default\lib
Console log
C:\PSC Updated\src>ant build-ejb
Buildfile: C:\PSC Updated\src\build.xml
clean:
build-core:
[mkdir] Created dir: C:\PSC Updated\src\build\classes
[javac] Compiling 159 source files to C:\PSC Updated\src\build\classes
BUILD FAILED
C:\PSC Updated\src\build.xml:110: C:\home\apps\jboss-5.1.0.GA\server\default\lib does not exist.
Worked: When I pointed to my {jboss.home}\server\default\lib
Try double slash for windows path on ant files.
C:\\jboss\\jboss-5.1.0.GA\\server\\default\\lib
Could you post your build.xml for more clarification.

Resources