How to get built jar during test-time (JUnit)
I'm making an integration testing framework for Minecraft plugins which uses JUnit. My plan is to send a built plugin file during test-time to a docker container, which in term runs a server with that specific plugin file, which will be loaded using the servers class loader. This file should not include test resources
The problem I'm facing is that there's large differences in buildscripts for projects; it would not be feasible to just run something like
./gradlew build
and retrieve the file from it's directory, as there's also maven, and multimodule projects and much more that I don't know about. What is the least painful approach to generate or fetch this file?8 Replies
⌛
This post has been reserved for your question.
Hey @Thorinwasher! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Does your framework need to run the build?
Can't you just let the dev specify where the JARs are located?
Testcontainers
Testcontainers
Testcontainers is an opensource library for providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
Yes, that's one way of doing it, I would rather have a copy paste solution for this though, as it makes the project easier to use
The more I think about it, the more I think a Gradle plugin that moves the compiled JAR to a predefined location is a better idea.
You don't know how people like to build their stuff
you could allow them to configure the command thatÄs executed
Alright, I guess that's the only real way to offer compatibility with all build systems. I think I will still try to make a gradle plugin for this. It would make life easier for at least gradle devs
Thanks for answering by the way!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@270177852157067264>.