https://github.com/way-zer/librarymanager
A library helps you manage jvm runtime dependencies
https://github.com/way-zer/librarymanager
dependency-manager java kotlin runtime
Last synced: 2 months ago
JSON representation
A library helps you manage jvm runtime dependencies
- Host: GitHub
- URL: https://github.com/way-zer/librarymanager
- Owner: way-zer
- License: mit
- Created: 2019-07-10T13:16:57.000Z (about 7 years ago)
- Default Branch: useBintray
- Last Pushed: 2023-01-06T13:46:46.000Z (over 3 years ago)
- Last Synced: 2025-04-21T01:10:29.454Z (over 1 year ago)
- Topics: dependency-manager, java, kotlin, runtime
- Language: Java
- Homepage:
- Size: 125 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://jitpack.io/#way-zer/LibraryManager)
**A library helps you manage jvm runtime dependencies** (Such as Kotlin)
## Features
* Finished in pure java (no other dependency)
* Download from maven Repository
* Add dependencies into Classpath
* Get a classloader with dependencies you need
## Env
MAVEN_REPOSITORY :replace the default repository (default: the first repository added)
## Example
#### Usage
```java
import cf.wayzer.libraryManager.*;
class Example{
void load(){
LibraryManager libraryManager=new LibraryManager();
//select 1 from 3 ways
libraryManager.addMavenCentral();
libraryManager.addJCenter();
libraryManager.addRepository("the name you want","the_url");
//select 1 from 3 ways
libraryManager.require(Dependency.KOTLIN_RUNTIME);
libraryManager.require(Dependency("org.jetbrains.kotlin","kotlin-stdlib","1.3.41"));
libraryManager.require(Dependency("org.jetbrains.kotlin:kotlin-stdlib:1.3.41","the name you add before"));
try {
//select 1 from 2 ways
libraryManager.loadToClasspath();
libraryManager.getClassloader(getClass().getClassLoader()).loadClass("kotlin.Lazy");
} catch (LibraryLoadException e) {
e.printStackTrace();
}
}
}
```
#### For kotlin main
```kotlin
package example
import cf.wayzer.libraryManager.LibraryManager
//You can't use kotlin Function or Type before loadKotlinStd()
//val v = listOf(123)
fun main() {
LibraryManager.loadKotlinStd()
// Now can use kotlin
listOf(123)
}
```
## Licence
* Keep the name of package.
* If you think it is good, leave a link to this page.
## Contribution
Issues and Pull requests for better library are always welcome!