Uploaded image for project: 'NPanday'
  1. NPanday
  2. NPANDAY-562

[possible regression to NPANDAY-231] Resolving gac and system assemblies has to be revisited

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 1.5.0-incubating
    • 1.5.0-incubating
    • Maven Plugins
    • None

    Description

      I'm not sure how important that code is.

                       // resolve system scope dependencies
                      if ( projectDependency.getScope() != null && projectDependency.getScope().equals( "system" ) )
                      {
                          if ( projectDependency.getSystemPath() == null )
                          {
                              throw new ProjectDaoException( "systemPath required for System Scoped dependencies " + "in Group ID = "
                                  + projectDependency.getGroupId() + ", Artiract ID = " + projectDependency.getArtifactId() );
                          }
      
                          File f = new File( projectDependency.getSystemPath() );
      
                          if ( !f.exists() )
                          {
                              throw new IOException( "Dependency systemPath File not found:"
                                  + projectDependency.getSystemPath() + "in Group ID = " + projectDependency.getGroupId()
                                  + ", Artiract ID = " + projectDependency.getArtifactId() );
                          }
      
                          assembly.setFile( f );
                          assembly.setResolved( true );
                          artifactDependencies.add( assembly );
      
                          projectDependency.setResolved( true );
      
                          logger.finer( "NPANDAY-180-011.1: Project Dependency Resolved: Artifact ID = "
                              + projectDependency.getArtifactId() + ", Group ID = " + projectDependency.getGroupId()
                              + ", Version = " + projectDependency.getVersion() + ", Scope = " + projectDependency.getScope()
                              + "SystemPath = " + projectDependency.getSystemPath()
      
                          );
      
                          continue;
                      }
      

      This does more then the current new GacResolver:

            
                      // resolve gac references
                      // note: the old behavior of gac references, used to have system path properties in the pom of the
                      // project
                      // now we need to generate the system path of the gac references so we can use
                      // System.getenv("SystemRoot")
                      //we have already set file for the assembly above (in createArtifactFrom) so we do not need re-resovle it
                      if ( !projectDependency.isResolved() )
                      {
                          if ( ArtifactTypeHelper.isDotnetAnyGac( projectDependency.getArtifactType() ) )
                          {
                              try
                              {
                                  if (assembly.getFile().exists())
                                  {
                                      projectDependency.setSystemPath( assembly.getFile().getAbsolutePath());
                                      projectDependency.setResolved( true );
                                      assembly.setResolved( true );
                                  }
                                  artifactDependencies.add( assembly );
                              }
                              catch ( ExceptionInInitializerError e )
                              {
                                  logger.warning( "NPANDAY-180-516.82: Project Failed to Resolve Dependency: Artifact ID = "
                                      + projectDependency.getArtifactId() + ", Group ID = " + projectDependency.getGroupId()
                                      + ", Version = " + projectDependency.getVersion() + ", Scope = "
                                      + projectDependency.getScope() + "SystemPath = " + projectDependency.getSystemPath() );
                              }
                          }
                          else
                          {
                              try
                              {
                                  // re-resolve snapshots
                                  if ( !assembly.isSnapshot() )
                                  {
                                      Project dep =
                                          this.getProjectFor( projectDependency.getGroupId(), projectDependency.getArtifactId(),
                                                              projectDependency.getVersion(),
                                                              projectDependency.getArtifactType(),
                                                              projectDependency.getPublicKeyTokenId(), localRepository, outputDir );
                                      if ( dep.isResolved() )
                                      {
                                          projectDependency = (ProjectDependency) dep;
                                          artifactDependencies.add( assembly );
                                          Set<Artifact> deps = this.storeProjectAndResolveDependencies( projectDependency,
                                                                                                        localRepository,
                                                                                                        artifactRepositories,
                                                                                                        cache, outputDir );
                                          artifactDependencies.addAll( deps );
                                      }
                                  }
                              }
                              catch ( ProjectDaoException e )
                              {
                                  logger.log( Level.WARNING, e.getMessage() );
                                  // safe to ignore: dependency not found
                              }
                          }
                      }    
      

      Attachments

        Issue Links

          Activity

            People

              brettporter Brett Porter
              lcorneliussen Lars Corneliussen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: