As we learned in the quick-start tutorial, it is possible to run Maven goals from within Visual Studio using NPanday. This section explores the concept of the build lifecycle in more detail.
In the Solution Explorer, right-click on the name of the project you want to compile, then select Current NPanday Project > Build to build the selected project. Or, All NPanday Projects > Build to build the parent and its sub-projects.
Note: In some circumstances, Maven is currently unable to build (compile) without installing the project first. As a workaround, execute All NPanday Projects > Install first before All NPanday Projects > Build [compile].
For projects with dependencies from remote repositories, the build might fail. As a workaround, re-import the project then, execute the build goal (Current NPanday Project > Build or All NPanday Projects > Build).
For projects with web references, a dialog box is prompted for updating the Web Services Description Language (wsdl). Click Yes to continue with the update, or, No to skip updating.
The NPanday .NET Build Tool performs the compile on the project and sends corresponding information to the Output window (including a message saying the build was successful). You can scroll up and down in the output window to display all the text.
You can also execute the normal Visual Studio build on your projects. To invoke Maven to perform build/install/test/clean, you must select the option from the All NPanday Projects or Current NPanday Project sub-menu.
When compiling a web application project, the NPanday .NET Build Tool performs an extra step by calling the Aspnet_compiler to validate the ASP section of the project. The Build Tool performs this step right after calling the CSharp compiler and Visual Basic compiler.
To use the NPanday .NET Build Tool to test a Project:
Note: When the test goal output result is not refreshed for C# test project, the project should be reimported, and the value of the test should also be changed. Then, perform Current Project: Test (or, All NPanday Projects > Test).
From the Solution Explorer, right-click on the name of the project you want to build, then select Current NPanday Project > Install to install the selected project. Or, All NPanday Projects > Install to install the parent project and its sub-projects.
The NPanday .NET Build Tool installs the artifacts into your local repository. For web projects with POM as packaging, the target directory is not created and only the parent pom.xml is put in the local repository which is the default behavior.
For web application projects, the project zip file is produced during this phase, specifically during the package phase.
Corresponding information is sent to the Output window (including a message saying the build was successful). You can scroll up and down in the output window to display all the text.
Next, verify the artifacts were placed into the .NET local repository under the following path: C:\Documents and Settings\[user_home]\.m2\uac\[gac_architecture]\artifactId\Version__GroupId
For example: C:\Documents and Settings\[user_home]\.m2\uac\gac_msil\NPanday.Test\1.0__NPanday
The following explains what each element in the path means:
The contents in C:\Documents and Settings\[user_home]\.m2\uac\gac_msil SHOULD NOT be manually modified or the project build will fail due to artifacts that are not properly indexed and are not synchronized with the repository. In case the contents have been modified, delete the C:\Documents and Settings\[user_home]\.m2\uac directory then re-install the project.
Finally, Verify that the following are also created under the following paths:
Contents of npanday-settings.xml looks similar to the following:
<?xml version="1.0" encoding="utf-8"?> <npandaySettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <operatingSystem> Microsoft Windows NT 5.1.2600 Service Pack 2 </operatingSystem> <defaultSetup> <vendorName>MICROSOFT</vendorName> <vendorVersion>2.0.50727</vendorVersion> <frameworkVersion>2.0.50727</frameworkVersion> </defaultSetup> <vendors> <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>1.1.4322</vendorVersion> <frameworks> <framework> <frameworkVersion>1.1.4322</frameworkVersion> <installRoot> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 </installRoot> </framework> </frameworks> </vendor> <vendor> <vendorName>MICROSOFT</vendorName> <vendorVersion>2.0.50727</vendorVersion> <frameworks> <framework> <frameworkVersion>2.0.50727</frameworkVersion> <installRoot> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 </installRoot> <sdkInstallRoot> C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\ </sdkInstallRoot> </framework> </frameworks> </vendor> </vendors> </npandaySettings>
To use the NPanday .NET Build Tool to clean a project (removes the target\ directory containing the files that were generated at build-time from the project's working directory):
Algorithm that differs the Visual Studio Execution from Console Command.
Continue on to Setting Assembly Keys, or return to the index.