This section provides procedures on importing a Visual Studio project using Generate Solution's POM Information... feature. This feature will generate pom.xml files from an existing Visual Studio solution file. The generated pom.xml file will contain the latest versions of the artifact dependencies used for the project.
Note: ASP.NET MVC should be installed to get the proper behavior when importing projects especially those projects with unsupported project types. (Refer to Pre-requisites section.)
Underscores and spaces in artifact's groupId are automatically deleted when added to the project's pom.xml. The table below shows the conversion of certain values of groupIds.
|Artifact Group Id||Converted Group Id|
pom.xml files will be generated for all the projects that are included in the solution file: the parent project and its sub-projects, if there are any.
Note: The Units Tests window is not displayed when importing unsupported project types. Hence, an unsupported project type warning is displayed. For multi-module projects with supported and/or unsupported project types, the supported projects are included in the parent pom while for the unsupported project types, these are not included in the parent pom, and a warning is displayed.
For projects with web references, the pom.xml generated will contain maven-wsdl-plugin configuration similar to the following:
<plugin> <groupId>npanday.plugin</groupId> <artifactId>maven-wsdl-plugin</artifactId> <extensions>true</extensions> <executions> <execution> <goals> <goal>wsdl</goal> </goals> </execution> </executions> <configuration> <webreferences> <webreference> <namespace>AnotherWebService</namespace> <path>Web References/AnotherWebService/AnotherWS.wsdl</path> <output>Web References/AnotherWebService/</output> </webreference> </webreferences> </configuration> </plugin>
The wsdl goal is the one responsible for building and creating webservice proxy classes. And, all the web references used in the project are listed inside the <webreferences> tag. For more instructions on adding, renaming, and deleting web references, refer to Web References section of this document.
If the project you are importing includes a resource file, the maven-resgen plugin is added to pom.xml during import.
In the plugin's configuration, you can find the list of resource (resx) files with corresponding names. By default, RootNamespace is the assembly name and RootNamespace.Filename is the filename of the resx files. To ensure that the plugin works, the following are required:
"public class frmMaestroName" = frmMaestroName.resx = frmMaestroName.cs
Note: Changing the codefile(.cs/.vb) automatically updates the resource(resx) file. In some instances, however, this does not hold true.
Once the above requirements are met, the importer automatically does the work and there is no need to edit pom.xml.
Removing the configuration part of the maven-resgen plugin allows the plugin to locate all the resx files and compile them as ArtifactId.Filename. If you set the namespace as the artifactId, you do not need to list all the resx files in the pom.xml.
Note: This feature does not support cultured esx files such as eu-US, it, jp, de, eu-UK, and even custom culture.
If the project you are Importing is a WPF/WCF project and it contains a XAML file the MSBuildPlugin will be automatically added into that project's pom file.
<plugin> <groupId>npanday.plugin</groupId> <artifactId>NPanday.Plugin.Msbuild.JavaBinding</artifactId> <extensions>true</extensions> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin>
This will generate the needed *.g.cs/*.g.vb files that are needed for those XAML files.
Note: The user would encounter double dependency errors, if the project was created with 3.0 .net framework. We suggest that you change your framework to 3.5 and then delete the references that are already included as defaults in NPanday. This will then allow your project to run successfully.