Modifications in order to return the warning message if there are system path references.
git-svn-id: https://svn.apache.org/repos/asf/incubator/npanday/trunk@993990 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs b/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
index db5522c..87653f8 100644
--- a/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
+++ b/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
@@ -130,35 +130,28 @@
tokens = tk.ToArray();
}
- string artifactId;
- string groupId;
- string version;
-
- Artifact artifact = new Artifact();
-
+
//artifact for system path
- if (!artifactFile.FullName.Contains(uacDirectory.ToString()))
+ if (!artifactFile.FullName.Contains(".m2"))
{
return null;
}
- else
- {
- string ext = Path.GetExtension(tokens[2]);
+
+ string ext = Path.GetExtension(tokens[2]);
- // first file token is the artifact
- // eg. NPanday.VisualStudio.Addin\1.1.1.1__NMaven.VisualStudio\NPanday.VisualStudio.Addin.dll
- artifactId = tokens[0];
- groupId = getGroupId(tokens[1]);
- version = getVersion(tokens[1]);
-
- artifact.FileInfo = new FileInfo(GetLocalUacPath(artifact, ext));
- }
+ // first file token is the artifact
+ // eg. NPanday.VisualStudio.Addin\1.1.1.1__NMaven.VisualStudio\NPanday.VisualStudio.Addin.dll
+ string artifactId = tokens[0];
+ string groupId = getGroupId(tokens[1]);
+ string version = getVersion(tokens[1]);
+
+ Artifact artifact = new Artifact();
artifact.ArtifactId = artifactId;
artifact.Version = version;
artifact.GroupId = groupId;
-
+ artifact.FileInfo = new FileInfo(GetLocalUacPath(artifact, ext));
return artifact;
}
diff --git a/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/AddArtifactsForm.cs b/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/AddArtifactsForm.cs
index a822c26..0b4ecbb 100644
--- a/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/AddArtifactsForm.cs
+++ b/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/AddArtifactsForm.cs
@@ -131,6 +131,7 @@
else
{
MessageBox.Show("Sorry, but no settings.xml file was found in your Local Repository.", "Repository Configuration", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ return;
}
}
catch(Exception)
@@ -1063,6 +1064,7 @@
if (settingsPath == null)
{
MessageBox.Show("Sorry, but you cannot Configure Remote Repository without a Settings.xml file", "Repository Configuration", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ AddArtifactsForm.ActiveForm.Hide();
artifactTabControl.SelectedIndex = 0;
}
else
diff --git a/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs b/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs
index 62b60cc..0ebdb25 100644
--- a/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs
+++ b/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs
@@ -388,7 +388,10 @@
try
{
artifact = artifactContext.GetArtifactRepository().GetArtifact(new FileInfo(pReference.Path));
- iNPandayRepo = true;
+ if (artifact != null)
+ {
+ iNPandayRepo = true;
+ }
}
catch
{
@@ -459,8 +462,10 @@
dep.groupId = refName;
dep.version = pReference.Version;
dep.type = refType;
- dep.classifier = refToken;
+
+ if (!string.IsNullOrEmpty(refToken))
+ dep.classifier = refToken;
if (!string.IsNullOrEmpty(systemPath))
dep.systemPath = systemPath;
if (!string.IsNullOrEmpty(scope))