I need a lombok hello word using Mavon

24 views
Skip to first unread message

Karl Schmitt

unread,
Jun 24, 2024, 2:45:47 PM (5 days ago) Jun 24
to Project Lombok
Dear mighty Lombok experts,

can somebody point me to a simple lombok hello world example 
using Mavon?

Right now I do not get any totorial to work :-(

So I want just one, to work fine.

Yours,
Karl

Zoltán Csorba

unread,
Jun 25, 2024, 2:56:20 AM (5 days ago) Jun 25
to Project Lombok
Hello Karl,
  in my opinion, the "setup" section on the Project Lombok site is pretty comprehensive. For example, if you are using Eclipse, then this page describes the steps you need to follow:

To make Lombok work in a maven build you need to add the lombok dependency to the pom.xml. See this page for more details 

This site has some code examples too for the annotations

Thorsten Glaser

unread,
Jun 25, 2024, 8:19:32 PM (4 days ago) Jun 25
to Project Lombok
On Mon, 24 Jun 2024, Zoltán Csorba wrote:

> in my opinion, the "setup" section on the Project Lombok site is pretty

It’s good, unless you have no idea how things have to look in
the first place.

>On Monday 24 June 2024 at 19:45:47 UTC+1 Karl Schmitt wrote:
>
>> Dear mighty Lombok experts,
>>
>> can somebody point me to a simple lombok hello world example
>> using Mavon?

I just made a tiny example for you: in a new directory “lombokdemo”,
save the attached files:

• src/main/java/com/example/lombokdemo/Main.java
• lombok.config
• pom.xml

Then run “mvn clean package”. And:

$ java -jar target/lombokdemo-0.1-SNAPSHOT.jar foo bar baz
0=<foo>
1=<bar>
2=<baz>

This shows how to use the “val” feature, for other features,
use appropriate Java code, but this shows the integration
(also with a very nice useful (authored by me) parent POM to
reduce boilerplate from Maven, which supports building with
and for Java 8, 11, 17 and 21 currently, you’d fill the fields
url, licenses, developers, organization[sic!] and scm and the
properties yourself of course (outputTimestamp will be updated
by the Maven Release Plugin) and update groupId, artifactId,
version and description to suit your needs (retain name, this
is the recommended format for Maven Central). For more, see:
https://github.com/qvest-digital/maven-parent/blob/master/NOTES

(That also provides a test artefact you can include which makes
all logging, for all frameworks, log into target/tests-*.log and
at only INFO level to the console. This is useful for Lombok’s
log, but I wanted to avoid the discussion about what to use.)

Please feel free to take from these 3 files at will (consider
them CC0-licenced, but they are really trivial).

gl hf,
//mirabilos
--
Infrastrukturexperte • Qvest Digital AG
Am Dickobskreuz 10, D-53121 Bonn • https://www.qvest-digital.com/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 18196 • USt-ID (VAT): DE274355441
Vorstand: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg
Vorsitzender Aufsichtsrat: Peter Nöthen
Main.java
lombok.config
pom.xml
Reply all
Reply to author
Forward
0 new messages