forax / pro

A Java build tool that works seamlessly with modules
GNU General Public License v3.0
103 stars 15 forks source link

Provide resolver service #52

Closed sormuras closed 7 years ago

sormuras commented 7 years ago

The module name to (maven) module coordinates mapping like done in https://github.com/forax/mjolnir/blob/master/build.pro#L10

resolver.dependencies(list(
    // ASM API
    "org.objectweb.asm.all.debug=org.ow2.asm:asm-debug-all:6.0_BETA",

    // JUnit 5 API
    "org.opentest4j=org.opentest4j:opentest4j:1.0.0-M2",
    "org.junit.platform.commons=org.junit.platform:junit-platform-commons:1.0.0-M5",
    "org.junit.jupiter.api=org.junit.jupiter:junit-jupiter-api:5.0.0-M5"
))

...could be extracted partly from the module-info.java files. With the help of a

  1. initially static or later
  2. dynamic (web/REST)

service. That service provides the mapping of well-known modules - pointing to latest stable version by default.

The snippet from above could be replaced by

resolver.dependencies(Pro.scanModuleDescriptorsAndCreateListOfRequiredModules(VersionStrategy.STABLE))
forax commented 7 years ago

Hi, as far as i know, there is no such web service exists.

and by default, if you do not set a version, the resolver will ask the repository for the latest version.