Typically, Android and Java library developers publish their libraries on maven repositories (i.e: MavenCentral), and by giving out its compiled jar file. This makes it simple for developers to import the library into their projects using a java build automation system, which provides built-in capability to resolve dependencies, such as gradle or Apache maven. Unfortunately, importing libraries when developing an extension or component for MIT AppInventor or any of its distributions is limited into using its .jar file (and additionally .aar and .so library files for components).
So, using the maven artifact itself is in fact impossible, unless by collecting and downloading the dependency library file as well as all of its required dependencies one by one, which is indeed a lengthy process and could eventually result in missing libraries, causing a NoClassDefFoundError or compile errors, another option might be to download maven or gradle to build the libraries, although, getting the library files is typically not trivial, since this tools are mainly designed to build java projects, not to work as a dependency resolver.
Dependency resolver is a CLI which supports resolving and downloading dependencies given a maven artifact, without having to download them all one by one.
To learn more about downloading and running dependency resolver, please see the wiki.
This CLI is fully open source, you can find the source code on github:
This library is still under beta, it may not perform as expected in some situations, please let me know about any bugs, suggestions or feature requests by writing a post on this topic, or by opening an issue on github.
Cheers,
Mohamed Tamer
Support Gradle Kotlin implementations, i.e: implementation("com.test:test:1.0")
Implement progress reporting
Changes
Rename --compress flag to --merge
Updates code to Java 11. (Notice: Using a previous version of java when executing the CLI or GUI would fail ). This is change was made to support the javaFX implementation, in case you are OK of using JDK 8 with the CLI only, see the the Building Section in the GitHub wiki, you should be able to build the cli module using java 8. However, the automated CI would build the Jar file using java 11.
Warn when an AAR contains resources when using --jarOnly flag, since the resources will not be included in the output Jar file.
Internal Changes
Restructure the project into multiple gradle modules
Refactor most of the code
Rename packages from io.mohamed.* to io.mohamed.resolver.*.
Bug Fixes
Fix a bug where using the -v flag with the resolve command would prints the version text, instead of being treated as the abbreviation for the --verbose option.
Deprecations
Deprecates the --type flag, it's automatically inferred from the artifact packaging. Setting it automatically was being overwritten.