Skip to content

Latest commit

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

CLibrary logo

Java CI with MavenGitHub starsGitHub IssuesGitHub Pull RequestsGitHub license


Api to download and load the necessary dependencies into the classloader.

📝 Table of Contents

🧐 About

This library is used to not have too large jar files. The dependencies are downloaded at startup if they have not yet been downloaded otherwise they are downloaded from the central repository of maven or a selected repository.

🏁 Getting Started

These instructions could be use in any type of java project.

First you need to retrieve CLibrary.

Prerequisites

You can download the jar file in the releases. GitHub release (latest by date)

Or get it from github packages: https://github.com/Cleymax/CLibrary/packages

Or get it from my personal repository:

  • Maven
<!-- Add to repositories -->
<repository>
<id>cleymax-releases</id>
<url>https://repo.cleymax.fr/repository/maven-releases/</url>
</repository>
<!-- Add to dependencies -->
<dependency>
<groupId>fr.cleymax</groupId>
<artifactId>CLibrary</artifactId>
<version>1.0.3</version>
<scope>compile</scope>
</dependency>
  • Gradle
// Add to repositories
maven {
name ='cleymax-releases'
url ='https://repo.cleymax.fr/repository/maven-releases/'
}
// Add to dependencies
compile 'fr.cleymax:CLibrary:1.0.3'

Use

Example, you need Gson in your project. Add the annotation @Dependency on any class to load Gson .

importfr.cleymax.clibrary.CLibrary;
importfr.cleymax.clibrary.Dependency;
@Dependency(groupId = "com.google.code.gson", artifactId = "gson", version = "2.8.6")
publicclassMain {
publicstaticvoidmain(String[] args)
{
finalCLibrarylibrary = newCLibrary(Main.class); //Initialize a new instance of `CLibrary`.library.loads(); //Load all dependencies of the class that is set as a parameter when initializing the `CLibrary' instance.
}
}

You can load several dependencies in one class.

importfr.cleymax.clibrary.CLibrary;
importfr.cleymax.clibrary.Dependencies;
importfr.cleymax.clibrary.Dependency;
@Dependencies({
@Dependency(groupId = "com.google.code.gson", artifactId = "gson", version = "2.8.6"),
@Dependency(groupId = "com.googlecode.json-simple", artifactId = "json-simple", version = "1.1.1")
})
publicclassMain {
publicstaticvoidmain(String[] args)
{
finalCLibrarylibrary = newCLibrary(Main.class); //Initialize a new instance of `CLibrary`.library.loads(); //Load all dependencies of the class that is set as a parameter when initializing the `CLibrary' instance.
}
}

You can choose where the dependencies are stored and downloaded.

finalCLibrarylibrary = newCLibrary(Main.class, newFile("dependancies/"));

You can initialize an instance of CLibrary without any parameters. But the method CLibrary#loads() can no longer be used!

finalCLibrarylibrary = newCLibrary();

You can choose the repository or you have to download the dependency. Note that if the file cannot be uploaded with the custom repository then it will try to upload to maven's central repository.

@Repository(url = "https://repo.cleymax.fr/repository/maven-releases/")
@Dependency(groupId = "com.google.code.gson", artifactId = "gson", version = "2.8.6")

✍️ Authors

  • @Cleymax - Idea & Initial work Discord: Cleymax#7002

See also the list of contributors who participated in this project.

⛏️ Built Using

🎉 License

CLibrary is licensed under the MIT license.

About

⚙ Api to download and load the necessary dependencies into the classloader.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages