Why is Nant not working with TeamCity? - asp.net-mvc

I have nant set up to build my ASP.NET MVC project and it works fine locally. I add nant to a tools folder and add it to version control. TeamCity picks up my changes and starts the build but it fails.
I believe I'm using the latest version of Nant and I have added the .net framework 3.5 to the nant.exe.config. What am I missing on the server and yes the .net framework is installed on the server as the asp.net mvc app does work if I manually build and deploy there?
The build file is as follows:
<target name="compile" description="Compiles using the AutomatedDebug Configuration">
<msbuild project="Tolt.Sims.sln" />
</target>
Here is the error:
BUILD FAILED Failed to initialize the 'Microsoft .NET Framework 2.0' (net-2.0) target framework.
Property evaluation failed. Expression: ${path::combine(sdkInstallRoot, 'bin')} ^^^^^^^^^^^^^^ Property 'sdkInstallRoot' has not been set.
For more information regarding the cause of the build failure, run the build again in debug mode. Try 'nant -help' for more information

If you're using the beta version of NAnt (which currently is the only way you'll get support for targeting anything greater than the 2.0 framework), you maybe running into a registry problem. A similar problem was reported by Tim Barcz.
Things pretty much boiled down to NAntContrib (provider of msbuild task) pointing to the 2.0 version of msbuild. Check out his solution to see if it applies to your scenario.

Potentially, you dont have the .NET Framework 2.0 SDK installed.
You can install it from
http://www.microsoft.com/downloads/details.aspx?familyid=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en

I fixed this by adding the following in the registry:
New string value at: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework
Named: sdkInstallRootv2.0
With the value: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\
Seemed to spring into life...
w://

This was fixed after the 0.86 beta1 release. On April 1, 2010, 0.90 was released with the fix in case upgrading nant is an option for you. To provide further detail, the fix release in 0.90 appears to have been simple changes to the nant.exe.config file. The bolded text below was added and will likely fix the problem without having to install the 2.0 SDK.
<directory name="${path::combine(sdkInstallRoot, 'bin')}" if="${property::exists('sdkInstallRoot')}" />
Update the net-2.0 section to fix it.

See http://www.mail-archive.com/nant-developers#lists.sourceforge.net/msg07519.html; it's a known bug in 0.86 beta1.

I've run into similar issues with NAnt. I know this isn't the Best solution, but it is one that works if you need to get your project moving.
I've found that installing a development environment (C# Express didn't work for me, but VS 2008 did) on the server makes this issue go away. (Yes, I realize this goes against normal best practices, but it works and lets my scripts run so I can get back to coding.)
Just figured I'd share incase anyone else is in a similar situation..(this has worked for me both with CruiseControl.Net and with Hudson).

Related

Microsoft.Data.Edm not found (Azure Functions v3.1.4)

I have created an Azure Functions project using .NET Core v2 and attempted to migrate it to Azure Functions v3. After upgrading it complains that it cannot find Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 anymore. When I look in the bin folder of my v2.1 version, then this file is copied to that location. My v3.1 version lacks a lot of files, including Microsoft.Data.Edm.dll. It seems the file is copied to the bin folder, but it is being removed afterwards. Does any one know what is happening?
It seems the problems start happening when the Microsoft.NET.Sdk.Functions package is upgraded to a version higher than 1.0.31. To illustrate the problem I have created a very simple Azure Function solution that contains both the V2 and the V3 version. It can be found at https://github.com/ramondeklein/AzureFunctionsWithEdm.
When running the AzureFunctionsWithEdm2 the call http://localhost:7071/api/EdmFunction returns OK, but with AzureFunctionsWithEdm3 it fails, because it cannot load the Microsoft.Data.Edm assembly. When the Microsoft.NET.Sdk.Functions package is upgraded to 1.0.33, then the V2 also fails to work.
It seems that the RemoveRuntimeDependencies task removes this assemblies (source). It doesn't run when the _FunctionsSkipCleanOutput variable is set to true. Adding the following line effectively disables this task and makes it work for 1.0.33 and later too.
<PropertyGroup>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
Item is tracked via this issue.

OfBiz Installation Failure

Apache OfBiz is not installing correctly, and fails to compile in the command prompt.
After creating the system variable JAVA_HOME to C:\Program Files\Java\jdk1.8.0_40, and editing "Path" to be C:\Program Files (x86)\Java\jre7\bin;C:\apache-ant-1.9.4\bin, I downloaded OfBiz 13.07.01 to my C:\ folder and unzipped it there. In the command prompt, I typed the following:
C:\Users\CalS>cd C:\apache-ofbiz-13.07.01
C:\apache-ofbiz-13.07.01>ant load-seed
Then, after about 50 seconds, I get this:
BUILD FAILED
C:\apache-ofbiz-13.07.01\build.xml:229: the following error occurred while executing this line:
C:\apache-ofbiz-13.07.01\build.xml:248: the following error occurred while executing this line:
C:\apache-ofbiz-13.07.01\build.xml:39: the following error occurred while executing this line:
C:\apache-ofbiz-13.07.01\build.xml:91: compile failed; see the compiler error output for details.
Please note it has been years since I dealt with DOS, so I do not know how to access the error output.
This is after I get a few dozen errors like:
[javac16] class file for org.ofbiz.widget.ContentWorkerInterfaice not found
and
[javac16] warning: [options] bootstrap class path not set in conjunctions with -source 1.6
Under 'classes'.
Misc. I have tried 'ant run-install' and 'load-demo' commands without avail. I've followed step-by-step tutorials, but very likely missed something. Please let me know what I can do to fix this and run this program successfully. Thanks!
Please have a look at the following Apache Jira Tickets for OFBiz where your problem is addressed and was fixed, so that OFBiz could be build with java 1.8.
The build errors occur due to missing fileset entries in the build.xml for some applications (party, workeffort, product, order, ebay, and pos), see: OFBIZ-5835
A fix is available in related ticket: OFBIZ-6079
There was another bug in the current release branches (checked 14.12.01, 12.04.06, 13.07.02) that I fixed last week. The fix is already committed to the branches.
See: OFBIZ-6252
You have to compile/run with the same Java version.
Seems you have some inconsistencies: JAVA_HOME ist 1.8, Path is set to jre 7 and the warning states it is using an 1.6 compiler.
With the 13.07. Release, using Java 1.7 or 1.8 is recommended and supported.
Alright, so it looks like Apache OFBiz and Java JDK 1.8.XX don't get along. I found help on another forum that confirmed the discrepancy in compatibility between OFBiz 13.07.01/Apache ant 1.9.4 and JDK 1.8.XX. This will cause the compiling of the Apache Ant to fail (which seems to run off of JDK 1.6).
I remedied the problem by downloading the archived JDK 1.7.0_67 from Oracle, re-mapping the System Variables accordingly, and re-initializing the Command Prompt.
It works now! Thank you all for your contributions.
Though solved, let me add something important. JDK version is not always an issue in such errors. Ofbiz v13.X.X works well on JDK 1.7 and above. The error shown is a peculiar issue with Ofbiz v13.07.01 dist.
As Martin pointed out, one need to add widget jars in the classpath of order, party, product & workeffort. Add the below line
<fileset dir="../../framework/widget/build/lib" includes="*.jar"/>
in build.xml of order, party, product & workeffort under applications directory.

How to generate grails jar components for glassfish

Found in this tuto the cmd to deploy a grails app on Glassfish application server:
asadmin deploy --libraries $GRAILS_HOME/lib/glassfish-grails.jar helloworld-0.1.war
Browsing to $GRAILS_HOME/lib/ , don't find glassfish-grails.jar file .
From where can someone get this library ? i mean :glassfish-grails.jar
That stuff is badly dated and I don't think they've updated it in 4 years. For some reason it didn't even appear to be open source when I look at this a year or so ago.
There was plugin but it's almost as dated. The repo has seen some updates fairly recently, so if you wanted to get this thing to the finish line it seems very doable and I think it'd be a great addition.
I would be willing to help out some after the holidays It looks like just updating the glassfish-embedded-all dependency to 'org.glassfish.main.extras:glassfish-embedded-all:4.1' and ensuring that the plugin code compiles would be a chunk of the work, with ensuring that it functions being the remaining :) See http://mvnrepository.com/ for more info, dependencies, etc.
Feel free to email me if you get stuck or want to know anything about getting a new server to act like Tomcat and Jetty do in run-app - I've worked on both of those.
The tutorial was written for the Glassfish v3 Prelude version, a very early version of Glassfish 3, and seems to be invalid for current versions of Glassfish 3.
The file glassfish-grails.jar doesn't exist anymore in the GRAILS lib folder, but it isn't needed anyway.
To make a shared-war (a WAR without the lib files) work, you have to do the following:
Copy all the libs from $GRAILS_HOME/lib/ to $GLASSFISH_HOME/glassfish/lib/.
Deploy it via: asadmin deploy helloworld-0.1.war (or use the Glassfish Admin GUI)
Everything else should work as described in the tutorial.
See also:
Grails - trying to deploy a nojars application into glassfish 3.0.1

Grails extension in SpringSource Tool Suite errors

I recently installed SpringSource Tool Suite. And I want to start working with Grails projects. So, I went to the Dashboard -> Extension, where I saw two extensions: Grails (current production release) and Grails Support as in the image below.
But when I try to install them, I get the following errors :
Problems occurred while performing installation: Operation details
Operation details
Cannot complete the install because one or more required items could not be found.
Software currently installed: Shared profile 1.0.0.1340820181092 (SharedProfile_com.springsource.sts.ide 1.0.0.1340820181092)
Missing requirement: Shared profile 1.0.0.1340820181092 (SharedProfile_com.springsource.sts.ide 1.0.0.1340820181092) requires 'org.maven.ide.eclipse [1.0.100.20110804-1717]' but it could not be found
What can I do to resolve this error ? Or are there any other options I can follow to install Grails extension?
Thank you!
I would switch to the new "Groovy/Grails Tool Suite" that was recently announced (see http://www.springsource.org/node/3582). Go to the standard download page at http://www.springsource.org/downloads/sts and click "Other Downloads >". Download the version for your OS under "Milestone Version - Groovy/Grails Tool Suite 3.0.0.M2".
It is a beta/milestone release but I've been using it since it was released and it's as stable as a final release so far. It's convenient since the Groovy-Eclipse plugin and the Grails support are already configured for you, in addition to the latest Grails (2.0.4). Any other plugins that you need from the standard STS can always be installed using the standard install/update procedure.
Yes, what #BurtBeckwith said. You should move to the new GGTS.
However, to address your particular problem, you installed STS into a read-only directory (or in C:\Program files). You need to re-install it somewhere else.
The Eclipse p2 installer cannot handle installing feature patches into a read-only directory. Groovy-Eclipse ships with a feature patch to extend the JDT compiler. I believe that this problem was fixed in the Juno release of Eclipse (4.2), which came out last week.
Deleting corresponding application from Windows memory removed the problem (Grails extension in SpringSource Tool Suite errors). Double running applications (earlier and new) could also be reason why GGS or STS sometimes cannot save .groovy files (with error message or without).

IntelliJ IDEA/ Grails not resolving plugins

I have been using IntelliJ for almost a year ad I have always been really happy with it. However, yesterday I set it up on my new laptop (Ubuntu 11.04), and haven't seen the plugins module since.. :-(
Ran grails clean, tried to change the project structure/settings to include $HOME/.grails/1.3.x/projects/projectName/plugins, but still nothing. My understanding is that it should pick up the plugins automatically, am I right?
For the record, I am using Grails 1.3.4, IntelliJ IDEA Ultimate 9.0.4.
I'd strongly recommend switching to the latest Intellij version (10.5.1 as of now). Support for Grails has been improved a lot since 9.x. If you don't want to upgrade, check the following areas:
are all used classpath variables set correctly?
are you referencing the correct Grails version?
I'm using IntelliJ 11.1.3 with Grails 2.1.1.
General Issue:
The IDE Build/Make Project/Run Unit-tests sometimes fails to resolve classes referenced as dependencies within Plugins and produces 'no class...' errors. Normal grails targets (compile, run-app, test-app) work without issue!
Workaround:
Restarting IntelliJ 'magically' corrected my Plugin related 'no class...' errors.
What didn't work:
grails resolve-dependencies (makes sense because grails run-app worked fine!)
grails clean (again makes sense this is just purging the output)
Seems like the IDE Build/Make Project/Run Unit-tests uses a stale classpath in some circumstances. Unfortunately I don't have a repeatable test case but noticed that modifying BuildConfig and doing grails refresh-dependencies or compile or run-app doesn't make the IDE update it's list of grailsPlugins!
I've had IDEA do this once in a while to me as well. Even in the latest version (though I do agree you should upgrade, but 9->10 isn't free). For me, I just had to kill IDEA and restarted it.
IMPORTANT UPDATE! It will be fixed in 11.1.2! YEEAAAH!
In my case plugins not resolving because of custom system property 'grails.work.dir'. If your project using default 'grails.work.dir' than OK otherwise plugins won't be resolved. Tested on Idea 10.5.4, 11.1.1 and windows 7.

Resources