techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.6K
active users

#maven

2 posts2 participants0 posts today
Continued thread

This is not a new tool or idea, but a set of good practices explained in a tool-independent way. I want to make the topic more approachable to Java newcomers, since most info on this is currently quite confusing.

For the talk, I built a special presentation app that lets me switch tools and highlight the important bits.

I’d love to share this at more events in Europe — suggestions welcome! An online video series is planned for later this year.

#Java#Gradle#Maven

How to do better Dependency Management in modern Java?

☕️ JAVA
📜 Recipe for
🌻 Carefree dependency
📚 Administration

👉 javarca.de

📣 I'll talk about it:

July 10th - Stuttgart @jugstuttgart
java-forum-stuttgart.de/vortra

Sep 16th - Hannover @JavaForumNord
javaforumnord.de/2025/programm

👾 If you clone, build, run the example (see: Explore > Readme) you get to play a little game. The high score is 3680, held by my son (and game tester)

#Java#Gradle#Maven
Replied in thread

It’s been taken by execs from Google, Nike, Bloomberg, The New York Times—and was just named one of #Maven’s top 5 courses.

Next cohort starts July 14 (there's a 20% discount for anyone who signs up today.)

Last Easter, I was running a checkpoint at Imbil as I’ve done before… operating a checkpoint at Derrier Hill Grid with horses passing through from three different events simultaneously, coming from two different directions, and getting more confused than a moth in a light shop. At that time I thought it’d be really handy to have a software program that could “sort ’em all out”. I punch in the competitor numbers, it tells me what division they’re in and records the time… I then assign the check-points and update the paperwork.

We have such a program, a VisualBASIC 6 application written by one of the other amateurs, however I use Linux. My current tablet, a Panasonic FZ-G1 Mk1, won’t run any supported version of Windows well (Windows 10 on 4GB RAM is agonisingly slow… and it goes out of support in October anyway), but otherwise would be an ideal workhorse for this, if I could write a program.

So I rolled up my sleeves, and wrote a checkpoint reporting application. Java was used because then it can be used on Windows too, as well as any Linux distribution with OpenJDK’s JRE. I wanted a single “distribution package” that would run on any system with the appropriate runtime, that way I wouldn’t need a build environment for each OS/architecture I wanted to support.

One thing that troubled me through this process… was getting image resources working. I used the Netbeans IDE to try and make it easier for others to contribute later on if desired: it has a GUI form builder that can help with all the GUI creation boilerplate, and helps keep the project structure more-or-less resembling a “standard” structure. (This is something that Python’s tkinter seriously lacks: a RAD tool for producing the UIs. The author of the aforementioned VB6 software calls it “T-stinker”, and I find it hard to disagree!)

Netbeans defaults to using the Maven build system for Java projects, although Ant and Gradle are both supported as well. (Not sure which one of the three is “preferred”, I know Android often use Gradle… thoughts Java people?) It also supports adding bitmap resources to a project for things like icons. I used some icons from the GTK+ v3 (LGPLv2) and Gnome Adwaita Legacy (CCBYSA3) projects.

The problem I faced, was actually using them in the UI. I was getting a NullPointerException every time I tried setting one, and Netbeans’ documentation was no help at all. It just wasn’t finding the .png files no matter what I did:

2025-06-15T06:32:54.461Z [FINEST] com.vk4msl.checkpointreporter.ui.ReporterForm: Choose nav tree node testException in thread "AWT-EventQueue-0" java.lang.NullPointerException        at javax.swing.ImageIcon.<init>(ImageIcon.java:217)        at com.vk4msl.checkpointreporter.ui.event.EventPanel.initComponents(EventPanel.java:239)        at com.vk4msl.checkpointreporter.ui.event.EventPanel.<init>(EventPanel.java:63)        at com.vk4msl.checkpointreporter.ui.ReporterForm.showEvent(ReporterForm.java:895)        at com.vk4msl.checkpointreporter.CheckpointReporter.showEntity(CheckpointReporter.java:532)        at com.vk4msl.checkpointreporter.ui.ReporterForm.navTreeValueChanged(ReporterForm.java:480)        at com.vk4msl.checkpointreporter.ui.ReporterForm.access$100(ReporterForm.java:70)        at com.vk4msl.checkpointreporter.ui.ReporterForm$2.valueChanged(ReporterForm.java:182)

Maybe it’s my search skills, or the degradation of search, but I could not put my finger on why it kept failing… the file was where it should be, the path in the code was correct according to the docs, why was it failing?

Turns out, when Maven does a build, it builds all the objects in a target/classes directory. When Netbeans runs your project, it does so out of that directory. Maven did not bother to copy the .png files across, because Netbeans never told it to.

I needed the following bit of code in my pom.xml file:

       <resources>         <resource>           <targetPath>com/vk4msl/checkpointreporter/ui/components/icons</targetPath>           <directory>${project.basedir}/src/main/java/com/vk4msl/checkpointreporter/ui/components/icons</directory>           <includes>             <include>**/README.md</include>             <include>**/*.png</include>           </includes>         </resource>       </resources>

That tells Maven to pick up those .png files (in the com.vk4msl.checkpointreporter.ui.components.icons package) and put them, along with the README.md, in the staging directory for the application. Then Java would be able to find those resources, and they’d be in the .jar file in the right place.

Other suggestions have been to move the project to using Ant (which was the old way Java projects were built, but seems to be out of favour now?)… not sure if Gradle has this problem… maybe some people more familiar with Java’s build systems can comment. This is probably the most serious Java stuff I’ve done in the last 20 years.

I used Java because it produced a single platform-independent binary that could run anywhere with the appropriate runtime, and featured a runtime that had everything I needed in a format that was easy to pick back up. C# I’ve used for command-line applications at university, but I’ve never done anything with Windows Forms, so I’d have to learn that from scratch as well as wrestling MSBuild (yuck!). Python almost was it, but as I say, dealing with tkinter and trying to map that to all the TK docs out there that assume you’re using TCL, made it a nightmare to use. I didn’t want to bring in third-party libraries like Qt or wxWidgets as that’d complicate deployment, and other options like C++, Rust and Go all produce native binaries, meaning I’d have to compile for each platform. (Or force people to build it themselves.)

Java did the job nicely. Not the prettiest application, but the end result is I have a basic Java program, using the classical Swing UI interface that should be a big help at Southbrook later this month. I’ll probably build on this further, but this should go a big way to scratching the itch I had.

https://vk4msl.com/2025/06/15/using-image-resources-with-maven-java-projects-in-netbeans/

Summary card of repository sjlongland/checkpoint-reporter
Codeberg.orgcheckpoint-reporterAmateur radio check-point logging and reporting tool

As far as I can tell, a #Maven plugin can be configured:

1. inside <pluginManagement/> or <plugins/>
2. using <configuration/> or <execution>

Does anyone know where can I read how this works and what is the priority order in which such configurations are considered?

@aalmiray any help?

Maven 3.9.10 released. One fix: When running a build using Java 24 with an earlier version of Maven, there were many errors and warnings because many dependencies were incompatible with a Java 24 runtime.
In Maven 3.9.10 those got updated, resulting in Maven 3.9.10 now has a far better support if you want to run your builds on Java 24.
maven.apache.org/docs/3.9.10/r
#maven #java #apache #apachefoundation

maven.apache.orgRelease Notes [–] Maven 3.9.10 – Maven

Palantir’s Value Soars With Dystopian Spy Tool that Will Centralize Data on Americans
consortiumnews.com/2025/06/06/
By contracting the surveillance firm to agglomerate the U.S. population’s personal data across government agencies, the White House has turbo-charged the company&#8217;s value, Kit Klarenberg reports. By Kit Klarenberg The Grayzone During an end-of-year investor call this February, Palantir CEO,&#8230;
#Politics #AdvancedTechnologies #CivilRights #Commentary #Genocide #Israel #Surveillance #TrumpAdministration #U.s. #UnitedKingdon #AlexKarp #BritishUnionOfFascists #C.i.a. #CentersForDiseaseControlAndPrevention #CovidVaccine #DepartmentOfGovernmentEfficiency(doge) #DepartmentOfHomelandSecurity(dhs) #EdwardSnowden #ElonMusk #Foundry #FutureInvestmentInitiativeInstitute #GothamAiTool #HealthAndHumanServicesDepartment #InQTel #InternalRevenueService #InternationalAtomicEnergyAgency(iaea) #IranSNuclearProgram #KitKlarenberg #Kpmg #LavenderAi #LouisMosley #Maven #NationalSecurityAgency(nsa) #Nhs #Palantir #PeterThiel #SirOswaldMosley #SocialSecurityAdministration #StockMarket #TheNewYorkTimes #U.k.PrimeMinisterKeirStarmer #U.s.ImmigrationAndCustomsEnforcement(ice) #U.s.PresidentDonaldTrump

Consortium News · Palantir's Value Soars With Dystopian Spy Tool that Will Centralize Data on AmericansBy contracting the surveillance firm to agglomerate the U.S. population’s personal data across government agencies, the White House has turbo-charged the company's value, Kit Klarenberg reports. By Kit Klarenberg The Grayzone During an end-of-year investor call this February, Palantir CEO,

Tonight #Maven and Maven Exec plugin in combination with Weld brought me to me knees.

Weld refused to load my classes and resources even if Maven reports compilation is successful, I can see the classes in target/classes, and when using -X I see it adds the jars and target/classes to the classpath.

Still Weld throws a bunch of ClassNotFound exceptions.

To make things a lot worse, there're no good hits when searching.

😖 emoji-with-pulling-my-hair emoji-with-me-banging-my-head-against-the-desk 😩