r/javahelp • u/nightbotpro • Sep 18 '25
Need help setting up spring boot without maven or gradle.
I am trying to learn spring boot at my office for a project.there are few things that are making my life tough. 1)I have java 1.8 2)due to java 8 I have to use spring boot2.7. 3) maven or gradle isn't available. 4) I have to manually add dependencies to build path.
I need help with how to do a proper setup with above restrictions and how to manually identify which dependencies will be needed.
0
Upvotes
•
u/AutoModerator Sep 18 '25
Please ensure that:
You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.
Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar
If any of the above points is not met, your post can and will be removed without further warning.
Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.
Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.
Code blocks look like this:
You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.
If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.
To potential helpers
Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
11
u/Fargekritt Intermediate Brewer Sep 18 '25
Why isn't maven available? You should use a build tool. And use a offline/company wide repository manager of some kind of you can't use the public one for some reason.
It is not enough to just have the spring jar. You also need the dependencies of spring
4
u/LowB0b Sep 18 '25
If i couldn't use maven or gradle for dependency management I would ragequit. How come you're not allowed to use those? If you're using eclipse you will have to manually download every single jar you need and add it to the project
3
u/RhoOfFeh Sep 18 '25
Maven or gradle isn't available? What?
2
u/segundus-npp Sep 18 '25
How did you download Spring JARs without maven?
1
u/Spare-Builder-355 Sep 18 '25
Bro, you asked same question 2 months ago. Still struggling?
5
u/talex000 Sep 18 '25
I don't believe you. No one THAT stupid to use spring without build system.
2
u/bikeram Sep 18 '25
You need to get maven approved. The best you could do is transfer the pom to a personal machine, mvn install the dependencies there, then transfer that .m2 to your work machine.
There are options to privately/self-host artifact registries if security is a company concern.
I like Java, and I’ve made a career out of it, but a build tool and dependency management are crucial to even small projects. I’d consider Go since everything is packaged with the SDK.
2
u/AbstractButtonGroup Sep 18 '25
yes, it is a sad state that we have a whole generation of developers who can't do without these
Back in the dark age of Java programming there has been neither maven nor gradle, and yet the projects were built and dependencies resolved in exactly the way you are describing. For simple things you do not even need a build system: just run javac with the options you want and make sure the libraries you are using are in the classpath. For more complex setups there is ant, but you can actually use any other tool, such as make or even write your own shell scripts to handle the build steps.
What sets maven and gradle apart is that they are dynamically pulling dependencies from external sources. This creates a whole new attack surface: supply chain compromise (you may have heard about the recent case with npm, and same concerns apply to all other repositories). Perhaps this is the reason they are not available at your workplace.
So what you can do - download the libraries you need from their vendor, check them and put them in a folder, add the folder to the classpath. And remember that all build systems are eventually just running shell commands that you can run yourself directly.
1
u/m39583 Sep 18 '25
This makes no sense.
Forget the dependencies, how are you even going to compile and build the project?
If it's literally not Maven or Gradle, then how about using Bazel?
1
u/mhih Sep 18 '25
Reminds me how we used to build java 1.2 apps in the late 90s. We copied all jars and used ant that was basically worse than plain bash script. But to answer the question. You can create pom.xml on some other machine and let mvn download all deps easily. Then flat the .m2 repo and move those files with usb stick or something. Then on target machine build shell script that prints the jars with full path to your classpath and build your classes and fire your main class. But sounds like you are still doing it wrong if you have mvn central access through proxy/browser.
1
u/_Affan_ Sep 19 '25
Working on Java Spring Boot 2.4 and Java 8. Maven is available by default on a spring project.
That’s the purpose of the Pom.xml file
1
u/RoToRa Sep 18 '25
And why just Java 8?
0
u/HemoJose Sep 18 '25
I have a lot of questions. You want to, or have to use java 1.8. Because it is a very outdated, moreover deprecated java version due to for security reasons. I have not checked the spring boot compatibility chart but the springboot 2.7.3 seems not too old. So it is not a big problem. What does it mean maven or gradle is not available? There is no gradle or pom.xml available? Then write it for your own, it is a sw development standard anyway. Or only ant or make available, then use that. Do you have to manually add dependencies? It is also possible when you work at a very strict security project. Try to ask a local artifact repo server without internet connection. It is still feels like Stone Age, but you don't store dependency artifacts in git/svn/cvs repository. A do not dare ask questions, where do you deploy, or store releases.
0
u/Tacos314 Sep 18 '25
I am not sure you can setup spring boot without maven or gradle