Class MavenProvider

java.lang.Object
io.codemodder.plugins.maven.MavenProvider
All Implemented Interfaces:
io.codemodder.ProjectProvider

public final class MavenProvider extends Object implements io.codemodder.ProjectProvider
Provides Maven dependency management functions to codemods.

Current Limitations are:

a. We skip parent finding if there's not a relativePath declaration (this is by design), so sometimes pom finding will fail on purpose b. there are several flags on ProjectModelFactory which aren't applied. They relate to verisons, upgrading and particularly: Actives Profiles c. If you need anything declared in a ~/.m2/settings.xml, we don't support that (e.g., passwords or proxies) d. Haven't tested, but I'm almost sure that it wouldn't work on any repo other than central e. We allow on this module to do online resolution. HOWEVER by default its offline f. You need to set an `M2_REPO` environment variable and/or property or declare withRepositoryPath to somewhere writable

  • Constructor Details

    • MavenProvider

      public MavenProvider()
  • Method Details

    • updateDependencies

      public io.codemodder.DependencyUpdateResult updateDependencies(Path projectDir, Path file, List<io.codemodder.DependencyGAV> dependencies)
      Specified by:
      updateDependencies in interface io.codemodder.ProjectProvider
    • getAllDependencies

      public Collection<io.codemodder.DependencyGAV> getAllDependencies(Path projectDir, Path file)
      Specified by:
      getAllDependencies in interface io.codemodder.ProjectProvider