Configurable .M2 Folder and npanday-settings.xml lookup
-------------------------------------------------------

                 Key: NPANDAY-361
                 URL: https://issues.apache.org/jira/browse/NPANDAY-361
             Project: NPanday
          Issue Type: Bug
          Components: Maven Plugins
    Affects Versions: 1.2.1
         Environment: Windows Server 2008 64 bit, Tomcat Hudson
            Reporter: Terence Mill


We are trying to build our software projects with npanday on CI hudson server 
on windows server 2008, while hudson runs as system user.
The ndpanday plugin uses hard coded Local Mavne Repository path and ignores our 
Maven settings.xml property defined via xml property <localRepository>
The Plugin searches  npanday-settings.xml at system user folder instead of 
searching in <localRepository> path. 
We can't and don't want create directory at this place and the server mus run 
on system account. Thre is a thread ( 
http://npanday.codeplex.com/Thread/View.aspx?ThreadId=214981 ) also disussing 
the problem and already indetified one occourence of fixed path usage in code 
(http://npanday.codeplex.com/SourceControl/changeset/view/60509#432200 Line 43) 
.

The error we get is this one:
[ERROR] Unhandled Exception: System.IO.DirectoryNotFoundException: Could not 
find a part of the path 
'C:\Windows\system32\config\systemprofile\.m2\npanday-settings.xml'

A solution would be to use the <localRepository> as base path for lookup or 
better to let use define a property in Maven settings.xml (global/or use) wher 
to search npanday specific configuration files.

Even better would be to include the sdk and framework path settings as profile 
properties in Maven the settings.xml, for exmaple like is done for Sonar .Net 
integration:

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd";>
        <localRepository>C:/srv/usrhome/maven/repository</localRepository>
        <interactiveMode>false</interactiveMode>
        <mirrors>
                <mirror>
                        <id>Nexus</id>
                        <name>Nexus Public Mirror</name>
                        
<url>https://server.com/nexus/content/groups/public</url>
                        <mirrorOf>*</mirrorOf>
                </mirror>
        </mirrors>
        <profiles>
             <profile>
                <id>dotnet</id>
                <activation>
                        <activeByDefault>false</activeByDefault>
                </activation>
                <properties>
                        <!-- Locations of the the .Net installations (pick the 
one you need) -->
                        <!-- (below the default values for each dotnet version 
supported) -->
                        
<dotnet.2.0.sdk.directory>C:/srv/DOTNet/Microsoft.NET/Framework/v2.0.50727</dotnet.2.0.sdk.directory>
                        
<dotnet.3.5.sdk.directory>C:/srv/DOTNet/Microsoft.NET/Framework/v3.5</dotnet.3.5.sdk.directory>
                        
<dotnet.4.0.sdk.directory>C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319</dotnet.4.0.sdk.directory>
                                <!-- Locations of the core assemblies for 
silverlight frameworks -->
                        <!-- (mandatory only if you need to build/analyse 
silverlight projects) -->
                        <silverlight.3.mscorlib.location>C:/Program Files 
(x86)/Reference
                                
Assemblies/Microsoft/Framework/Silverlight/v3.0</silverlight.3.mscorlib.location>
                        <silverlight.4.mscorlib.location>C:/Program Files 
(x86)/Reference
                                
Assemblies/Microsoft/Framework/Silverlight/v4.0</silverlight.4.mscorlib.location>
                                <!-- Location of the Gallio installation -->
                        
<gallio.directory>C:/srv/DOTNet/GallioBundle-3.2.603.0</gallio.directory>
                                <!-- Location of FxCop installation -->
                        <fxcop.directory>C:/srv/DOTNet/Microsoft 
Fxcop_10.0</fxcop.directory>
                                <!-- Location of PartCover installation -->
                        
<partcover.directory>C:/srv/DOTNet/PartCover4</partcover.directory>
                                <!-- Location of Source Monitor installation -->
                        
<sourcemonitor.directory>C:/srv/DOTNet/SourceMonitor2.63</sourcemonitor.directory>
                                <!-- Location of Gendarme installation NOT 
MANDATORY <gendarme.directory>C:/Program 
                                Files/gendarme-2.6-bin</gendarme.directory> -->
                        <!-- Location of StyleCop installation NOT MANDATORY 
<stylecop.directory>C:/Program 
                                Files/Microsoft StyleCop 
4.3.2.1</stylecop.directory> -->
                </properties>
        </profile>
</profiles>

I then can compile the project via "mvn clean compile  -Pdotnet"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to