code: public void newRepositorySystem() {
          DefaultServiceLocator locator = new DefaultServiceLocator();
          locator.setServices(WagonProvider.class, new ManualWagonProvider());
          locator.addService(RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class);
  
          repositorySystem = locator.getService(RepositorySystem.class);
  
          MavenRepositorySystemSession session = new MavenRepositorySystemSession();
          session = (MavenRepositorySystemSession)session.setDependencySelector( new AndDependencySelector( session.getDependencySelector(), new ValidSystemScopeDependencySelector() ) );
          session = (MavenRepositorySystemSession)session.setTransferListener(new LogTransferListener());
          session = (MavenRepositorySystemSession)session.setRepositoryListener(new LogRepositoryListener());
  
          session = (MavenRepositorySystemSession)session.setIgnoreMissingArtifactDescriptor( false );
  
          LocalRepository localRepo = new LocalRepository( localRepoPath );
          session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(localRepo));
  
          systemSession = session;
      }
docs: Create new {@link RepositorySystem}