code: protected RepositorySystemSession newSession( RepositorySystem system )
    {
        MavenRepositorySystemSession session = new MavenRepositorySystemSession();
  
        LocalRepository localRepo = new LocalRepository( localRepository );
        session.setLocalRepositoryManager( system.newLocalRepositoryManager( localRepo ) );
  
        return session;
    }
docs: Creates a new RepositorySystemSession.
  @param system A RepositorySystem to get a LocalRepositoryManager from.
  @return The new instance of a RespositorySystemSession.