Hi,

in a branch of mine I printed the Stacktrace, whenever some piece of code approached the UAC.
http://github.com/lcorneliussen/npanday/commit/56420c24d4382f9bd7574cf0321a682a6467a0e3

I attached the commit as a patch. But I don't know if it applies to the current svn revision.

hope this helps,
Lars



Am 14.09.10 08:31, schrieb Josimpson Ocaba:
Hi Everyone,

Here is our Initial Plans in moving forward towards NPanday 2.0

*UAC REMOVAL

==============================================================================================================================
            Class                   ||                        Location
==============================================================================================================================
PathUtil                           || components/dotnet-core
Projectfactory                     || components/dotnet-dao-project
ConnectionRepository               || components/dotnet-registry
ProjectDaoImpl                     || components/dotnet-dao-project
InstallerMojo                      || plugins/maven-install-plugin
ArtifactManagerMojo                || plugins/maven-repository-plugin
RepositoryAssemblerMojo            || plugins/maven-repository-plugin
RepositoryConverterForArtifactMojo || plugins/maven-repository-plugin
RepositoryRdfExporterMojo          || plugins/maven-repository-plugin
Reference                          || 
dotnet/assemblies/NPanday.ProjectImporter/Engine
ResyncArtifactSnapshot             || 
dotnet/assemblies/NPanday.VisualStudio.Addin
ArtifactRepository                 || dotnet/assemblies/NPanday.Artifact
PathUtil                           || dotnet/assemblies/NPanday.Artifact

==============================================================================================================================
UAC Removal Phases
==============================================================================================================================
1. We need to decide on how to "locate" an artifact/dll since dotnet requires 
the<assemblyname>.dll convention and maven
uses the convention<assemblyname>-<version>.dll (this was one of the main 
reasons for the creation of the uac)
- one of the things I can think up of atm is on the fly generation for the dll. 
since its just a matter of stripping up the version in the dll. I don't know 
how this will affect if there will be thousands of dll involve but I imagine 
that the on the fly process should be negligble.

2. We need to determine the effects of the removal of the UAC implementation on 
the classes mentioned above.

3. Reimplement the new method that we have decided on phase 1 basing from what 
we have found out on phase 2

*VS 2010 SUPPORT

1. Determine the new project types that we need to add
2. Add the VS2010 Framework in the components and configurations of NPanday


These 2 Features that we have determined as top priority for NPanday 2.0 can be 
worked with in parallel since the Removal of the UAC will be branched off from 
the branch.

If ever I have missed something please feel free to speak up :D

Cheers,


From 56420c24d4382f9bd7574cf0321a682a6467a0e3 Mon Sep 17 00:00:00 2001
From: Lars Corneliussen <m...@lcorneliussen.de>
Date: Wed, 10 Mar 2010 15:50:58 +0100
Subject: [PATCH] Print the stack trace whenever a code path approaches the uac

---
 .../src/main/java/npanday/PathUtil.java            |   10 +++-
 .../src/main/java/npanday/dao/ProjectFactory.java  |   53 +++++++++++++------
 .../npanday/registry/ConnectionsRepository.java    |    6 ++
 .../csharp/NPanday/Artifact/ArtifactRepository.cs  |   22 ++++++++
 .../plugin/repository/ArtifactManagerMojo.java     |    6 ++
 .../plugin/repository/RepositoryAssemblerMojo.java |    5 ++
 .../RepositoryConverterForArtifactMojo.java        |    6 ++
 .../repository/RepositoryRdfExporterMojo.java      |    5 ++
 8 files changed, 95 insertions(+), 18 deletions(-)

diff --git a/components/dotnet-core/src/main/java/npanday/PathUtil.java 
b/components/dotnet-core/src/main/java/npanday/PathUtil.java
index fcc50b6..2799f41 100644
=
--- components/dotnet-core/src/main/java/npanday/PathUtil.java
+++ components/dotnet-core/src/main/java/npanday/PathUtil.java
@@ -22,6 +22,7 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 
 import java.io.File;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
@@ -125,10 +126,17 @@ public final class PathUtil
      * @param localRepository the local repository.  This value should not be 
null.
      * @return the path of the artifact within the user assembly cache or null 
if either of the specified
      *         parameters is null
+     * @throws Throwable 
      */
     public static File getUserAssemblyCacheFileFor( Artifact artifact, File 
localRepository )
     {
-        if ( artifact == null )
+               try {
+                       throw new Exception("approaching UAC");
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       
+       if ( artifact == null )
         {
             logger.warning( "NPANDAY-040-005: Artifact is null - Cannot get 
application file." );
             return null;
diff --git 
a/components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java 
b/components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java
index 04a7af8..dac0835 100644
=
--- components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java
+++ components/dotnet-dao-project/src/main/java/npanday/dao/ProjectFactory.java
@@ -212,14 +212,23 @@ public final class ProjectFactory
                                                                           
project.getArtifactType(),
                                                                           
project.getPublicKeyTokenId() );
 
-        File artifactFile = ( ( project.getArtifactType().startsWith( "gac" ) 
) ) ? new File(
-            "C:\\WINDOWS\\assembly\\" + project.getArtifactType() + 
File.separator + project.getArtifactId() + File.separator +
-                project.getVersion() + "__" + project.getPublicKeyTokenId() + 
File.separator + project.getArtifactId() + ".dll" )
-            : new File( localRepository.getParentFile(), File.separator + 
"uac" + File.separator + "gac_msil" + File.separator
+        File artifactFile;
+               if (project.getArtifactType().startsWith( "gac" ))
+                       artifactFile = new File(
+                           "C:\\WINDOWS\\assembly\\" + 
project.getArtifactType() + File.separator + project.getArtifactId() + 
File.separator +
+                               project.getVersion() + "__" + 
project.getPublicKeyTokenId() + File.separator + project.getArtifactId() + 
".dll" );
+               else {
+                       artifactFile = new File( 
localRepository.getParentFile(), File.separator + "uac" + File.separator + 
"gac_msil" + File.separator
                 + project.getArtifactId() + File.separator +
                 project.getVersion() + "__" + project.getGroupId() + 
File.separator + project.getArtifactId() + "." +
                 ArtifactType.getArtifactTypeForPackagingName( 
project.getArtifactType() ).getExtension() );
-
+                       
+                       try {
+                               throw new Exception("approaching UAC");
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
         assembly.setFile( artifactFile );
         return assembly;
     }
@@ -244,19 +253,29 @@ public final class ProjectFactory
                                                                       
projectDependency.getPublicKeyTokenId(), scope,
                                                                       null );
         //System.out.println("Scope = " + assembly.getScope() + ", Type = " + 
assembly.getType() + ", Classifier = " + assembly.getClassifier());
-        File artifactFile = ( ( 
projectDependency.getArtifactType().startsWith( "gac" ) ) ) ? new File(
-            "C:\\WINDOWS\\assembly\\" + projectDependency.getArtifactType() + 
File.separator + projectDependency.getArtifactId() +
-                File.separator + projectDependency.getVersion() + "__" + 
projectDependency.getPublicKeyTokenId() + File.separator +
-                projectDependency.getArtifactId() + ".dll" ) : new File( 
System.getProperty( "user.home" ),
-                                                                         
File.separator + ".m2" +File.separator + "uac" + File.separator + "gac_msil" 
+File.separator +
-                                                                             
projectDependency.getArtifactId() + File.separator +
-                                                                             
projectDependency.getVersion() + "__" +
-                                                                             
projectDependency.getGroupId() + File.separator +
-                                                                             
projectDependency.getArtifactId() + "." +
-                                                                             
ArtifactType.getArtifactTypeForPackagingName(
-                                                                               
  projectDependency.getArtifactType() ).getExtension() );
-
+        File artifactFile;
+               if (projectDependency.getArtifactType().startsWith( "gac" ))
+                       artifactFile = new File(
+                           "C:\\WINDOWS\\assembly\\" + 
projectDependency.getArtifactType() + File.separator + 
projectDependency.getArtifactId() +
+                               File.separator + projectDependency.getVersion() 
+ "__" + projectDependency.getPublicKeyTokenId() + File.separator +
+                               projectDependency.getArtifactId() + ".dll" );
+               else {
+                       artifactFile = new File( System.getProperty( 
"user.home" ),"uac" +File.separator + "gac_msil" +File.separator +
+                                                                               
     projectDependency.getArtifactId() + File.separator +
+                                                                               
     projectDependency.getVersion() + "__" +
+                                                                               
     projectDependency.getGroupId() + File.separator +
+                                                                               
     projectDependency.getArtifactId() + "." +
+                                                                               
     ArtifactType.getArtifactTypeForPackagingName(
+                                                                               
         projectDependency.getArtifactType() ).getExtension() );
+                       try {
+                               throw new Exception("approaching UAC");
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
         assembly.setFile( artifactFile );
+        
+        
         return assembly;
     }
 
diff --git 
a/components/dotnet-registry/src/main/java/npanday/registry/ConnectionsRepository.java
 
b/components/dotnet-registry/src/main/java/npanday/registry/ConnectionsRepository.java
index 84d09ed..87916fe 100644
=
--- 
components/dotnet-registry/src/main/java/npanday/registry/ConnectionsRepository.java
+++ 
components/dotnet-registry/src/main/java/npanday/registry/ConnectionsRepository.java
@@ -57,6 +57,12 @@ public class ConnectionsRepository
     {
         long start = System.currentTimeMillis();
 
+               try {
+                       throw new Exception("approaching UAC");
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+                       
         File dataDir = new File( System.getProperty( "user.home" ), 
".m2/uac/rdfRepository" );
         MemoryStore store = new MemoryStore( dataDir );
         store.setPersist( true );
diff --git 
a/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
 
b/dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
index 032f819..31b159f 100644
=
--- 
dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
+++ 
dotnet/assemblies/NPanday.Artifact/src/main/csharp/NPanday/Artifact/ArtifactRepository.cs
@@ -34,6 +34,11 @@ namespace NPanday.Artifact
 
         public string GetLocalUacPath(Artifact artifact, string ext)
         {
+                       try {
+                               throw new Exception("approaching UAC");
+                       } catch (Exception e) {
+                               Console.WriteLine(e.ToString());
+                       }
             return Path.Combine(localRepository.FullName, 
string.Format(@"uac\gac_msil\{1}\{2}__{0}\{1}{3}", artifact.GroupId, 
artifact.ArtifactId, artifact.Version, ext));
         }
 
@@ -51,6 +56,12 @@ namespace NPanday.Artifact
         {
             Artifact artifact = new Artifact();
 
+                       try {
+                               throw new Exception("approaching UAC");
+                       } catch (Exception e) {
+                               Console.WriteLine(e.ToString());
+                       }
+                       
             DirectoryInfo uac = new DirectoryInfo(localRepository.FullName + 
@"\uac\gac_msil\");
 
             String[] tokens = uri.Split("/".ToCharArray(), 
StringSplitOptions.RemoveEmptyEntries);
@@ -98,6 +109,11 @@ namespace NPanday.Artifact
             List<Artifact> artifacts = new List<Artifact>();
             try
             {
+                               try {
+                                       throw new Exception("approaching UAC");
+                               } catch (Exception e) {
+                                       Console.WriteLine(e.ToString());
+                               }
                 DirectoryInfo uac = new DirectoryInfo(localRepository.FullName 
+ @"\uac\gac_msil\");
                 int directoryStartPosition = uac.FullName.Length;
 
@@ -127,6 +143,12 @@ namespace NPanday.Artifact
 
         public Artifact GetArtifact(FileInfo artifactFile)
         {
+                       try {
+                               throw new Exception("approaching UAC");
+                       } catch (Exception e) {
+                               Console.WriteLine(e.ToString());
+                       }
+
             DirectoryInfo uacDirectory = new 
DirectoryInfo(localRepository.FullName + @"\uac\gac_msil\");
             return GetArtifact(uacDirectory, artifactFile);
         }
diff --git 
a/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/ArtifactManagerMojo.java
 
b/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/ArtifactManagerMojo.java
index d0e25ad..af2baec 100644
=
--- 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/ArtifactManagerMojo.java
+++ 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/ArtifactManagerMojo.java
@@ -82,6 +82,12 @@ public class ArtifactManagerMojo
         String artifactValue = System.getProperty( "artifact" );
         String[] tokens = artifactValue.split( "[:]" );
 
+               try {
+                       throw new Exception("approaching UAC");
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+                       
         File dataDir = new File( localRepository.getParentFile(), 
"/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( 
new MemoryStore( dataDir ) );
         try
diff --git 
a/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryAssemblerMojo.java
 
b/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryAssemblerMojo.java
index 73ea7fb..a4df9bb 100644
=
--- 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryAssemblerMojo.java
+++ 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryAssemblerMojo.java
@@ -130,6 +130,11 @@ public class RepositoryAssemblerMojo
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+               try {
+                       throw new Exception("approaching UAC");
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
         File dataDir = new File( localRepository.getParentFile(), 
"/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( 
new MemoryStore( dataDir ) );
         try
diff --git 
a/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryConverterForArtifactMojo.java
 
b/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryConverterForArtifactMojo.java
index 23bfe91..5a0b8ca 100644
=
--- 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryConverterForArtifactMojo.java
+++ 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryConverterForArtifactMojo.java
@@ -65,6 +65,12 @@ public class RepositoryConverterForArtifactMojo
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+               try {
+                       throw new Exception("approaching UAC");
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               
         File dataDir = new File( localRepository.getParentFile(), 
"/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( 
new MemoryStore( dataDir ) );
         try
diff --git 
a/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryRdfExporterMojo.java
 
b/plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryRdfExporterMojo.java
index 9246d0a..3b08930 100644
=
--- 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryRdfExporterMojo.java
+++ 
plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryRdfExporterMojo.java
@@ -53,6 +53,11 @@ public class RepositoryRdfExporterMojo
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+               try {
+                       throw new Exception("approaching UAC");
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
         File dataDir = new File( localRepository.getParentFile(), 
"/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( 
new MemoryStore( dataDir ) );
         try
-- 
1.7.0.2

Reply via email to