July 8th, 2024

1JPM: A Maven/Gradle alternative in a single Java file

The project "1JPM" is a Java Project Manager offering an alternative to Maven and Gradle. It is a single customizable Java file for project configuration, eliminating XML or Groovy. Users can integrate it by adding the JPM.java file and executing commands in the terminal. 1JPM treats everything as a plugin, allowing the addition of third-party plugins. It covers essential functions like build, clean, assemble, check, dependencies, help, tasks, and jar, but may lack some advanced features. The project is in early stages, providing basic build capabilities. Users can seek further assistance for details or support.

Read original articleLink Icon
1JPM: A Maven/Gradle alternative in a single Java file

The GitHub URL provided contains information about "1JPM" (1 Java Project Manager), a project offering an alternative to Maven and Gradle. 1JPM is a single Java file that can be customized for project configuration, eliminating the need for XML or Groovy. Users can integrate 1JPM by adding the JPM.java file to their project and executing commands in the terminal for project building. Similar to Gradle, 1JPM treats everything as a plugin, including tasks, with the option to add third-party plugins by appending Java code to the JPM class. While 1JPM may not offer the full range of features found in Maven and Gradle, it covers essential functions like `build`, `clean`, `assemble`, `check`, `dependencies`, `help`, `tasks`, and `jar`. The project is still in its early stages but provides fundamental build capabilities. For further details or support, users are encouraged to inquire for assistance.

Related

Moving to Java 17 or how I learned to stop worrying and love NoSuchMethodError

Moving to Java 17 or how I learned to stop worrying and love NoSuchMethodError

Icon Solutions upgraded to Java 17 in IPF 2024.1 for Spring 6 and Spring Boot 3 compatibility. Challenges included plugin and dependency adjustments, emphasizing centralized management and code cleanliness post-upgrade for smoother transitions.

JEP 401: Value Classes and Objects (Preview)

JEP 401: Value Classes and Objects (Preview)

JEP 401 introduces value classes and objects in Java, focusing on optimizing memory efficiency by distinguishing objects solely by their field values, not identity. This feature enhances performance for simple domain values.

A Better Merge Workflow with Jujutsu

A Better Merge Workflow with Jujutsu

A new merge workflow using Jujutsu, a modern VCS compatible with Git, introduces The Austin™ Mega Merge Strategy®. It simplifies merge commits, amending commits, and selecting commits efficiently, enhancing collaboration and code review processes with advanced commit graph manipulation.

Mako – fast, production-grade web bundler based on Rust

Mako – fast, production-grade web bundler based on Rust

Mako, a Rust-based front-end build tool, is now open-source, aiming to enhance build speed. Tested at Ant Group, it surpasses Webpack in speed, especially with React Server Components, offering an SSU feature. Users can engage via WeChat, Telegram, or RSS, contribute to development, and join support services.

Jqjq: Jq Implementation of Jq

Jqjq: Jq Implementation of Jq

The GitHub URL hosts the "jqjq" project, an implementation of jq in the jq language. It showcases progress, design, issues, references, tools, and acknowledgments. Inquire for further details.

Link Icon 21 comments
By @whartung - 3 months
I like the clever use of the "java prog.java" style.

I don't know how many folks know, although its been there for a bit, that you no longer have to specifically compile single file java programs.

You can just run them with with "java prog.java".

(Honestly, I haven't used the technique myself, still old school -- even with silly small x.java tests and such. Muscle memory and all that.)

By @spullara - 3 months
As much as I hate adding more build tools to the Java ecosystem this one is pretty interesting since it is entirely Java based and version controllable without any additional dependencies to install. Obviously this won't solve all build problems but its simplicity is attractive.

(my hate for new build tools https://javarants.com/why-your-new-jvm-build-tool-is-making-...)

By @twic - 3 months
It doesn't handle transitive dependencies. So it's only a "Maven/Gradle alternative" to the extent that you don't need those. Enjoy!
By @jareds - 3 months
This would have interested me before wrappers for Maven and Gradle became common. Now that you can check in wrappers and easily upgrade the build tool version I don't see this being worth while for general use. I could see it being useful in situations where you needed full code auditability of everything involved in the build process but I've never run into that requirement in my work.
By @abeppu - 3 months
So given that its intended mode of use is to be copied into another project and modified ... when would this maven build file in it be used? Also, I don't see that the dependencies (e.g. their `jlib`) actually get used.

https://github.com/Osiris-Team/1JPM/blob/main/pom.xml

By @mohaine - 3 months
Isn't this the exact opposite of what you want security wise? To even read the most basic project metadata (project name, version, deps, ... ), you have to run arbitrary in project code. So you have to do a code review of the project file before you can even open the project in your IDE. Programmatic project scanning is right off the list.
By @noisy_boy - 3 months
Maven has plugins for practically every conceivable use case - if I have to implement all that, this single Java file will become another giant file that will bring its own can of worms minus the advantages of the Maven ecosystem.
By @overtomanu - 3 months
There is also another similar tool for building projects with Java code

https://jeka-dev.github.io/jeka/tutorials/build-projects/#ex...

https://jeka.dev/

By @exabrial - 3 months
I love seeing small Java projects like this and I always enjoy reading through the code.

On build tools: I don't actually mind Maven: I use a proper editor that can read and understand an XSD schema. But if it weren't for that I'd totally understand why people dislike it!

By @grishka - 3 months
To those who say that it's not a good idea to use a full programming language for your build scripts.

Gradle uses "a full programming language" and I hate it but I have to use it for Android projects. Debugging Gradle problems is as fun as you'd imagine. There's a lot of dark matter in your build scripts that you don't see but that influences what happens. And because Android tooling is a clusterfuck ever since the demise of Eclipse+ADT, any change you make to your build process runs the risk of the entire thing exploding in your face.

This one is at least fully predictable, self-contained and doesn't randomly download 150 MB of crap when you're on a slow coffee shop wifi. I'm gonna try it sometime.

By @oftenwrong - 3 months
You can quite easily get by with the standard JDK tools (javac, jlink, etc) + a tool for fetching dependencies, such as https://github.com/coursier/coursier or https://github.com/bowbahdoe/jresolve .
By @afavour - 3 months
As someone who doesn't dabble with Java too often, this looks nice. I do cross-platform mobile work from time to time and whenever I pick up Android I end up bashing my head against the wall with all the Maven/Gradle stuff. I'm sure it's intuitive when you're using it a ton but it always feels overcomplicated to me.
By @bokchoi - 3 months
I remember seeing a single file "build.java" from Cliff Click a while ago. I wonder if he's still using that technique.

It took a while to find an example:

https://github.com/edwardw/high-scale-java-lib/blob/master/b...

By @invalidname - 3 months
How is it different from: https://rife2.com/bld
By @systemerror - 3 months
I hate reading documentation too.
By @thiht - 3 months
Oh I expected to see a Java project with a single Java file inside, glad to see it’s nested in 3 folder levels. Java never disappoints
By @hu3 - 3 months
I'm fascinated by one file solutions.

Anyone have more examples?

By @Osiris-Team - 3 months
Well, thanks for reposting from Reddit! Got way more attention over here than there.
By @sgammon - 3 months
This is cool. Even if we can't use it, it's cool to see innovation in Java build tools.
By @tpoacher - 3 months
And then there's me, still preferring make + @argfiles like a madman :p
By @2d8a875f-39a2-4 - 3 months
build systems logging libraries application frameworks

Every dev at some stage early in their career always thinks that they can create a better one.