enhance your maven plugins with groovy

12
© Computas AS 06.06.2022 Enhance your Maven plugins with Groovy (experiences with Groovyfication) Harald Søvik hso @ computas.com

Upload: harald-soevik

Post on 31-Oct-2014

799 views

Category:

Documents


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Enhance your Maven plugins with Groovy

© Computas AS 08.04.2023

Enhance your Maven plugins with Groovy

(experiences with Groovyfication)

Harald Søvikhso @ computas.com

Page 2: Enhance your Maven plugins with Groovy

Speakers

Harald Søvik

Java Tech Lead, M.Sc.

[email protected]

2 © Computas AS 08.04.2023

bpm work support systems

knowledge management

consultancy services

custom software solutions

180 employees w/ M.Sc. or Ph.D.

100% owned by employees

Page 3: Enhance your Maven plugins with Groovy

3 © Computas AS 08.04.2023

Groovy

OO

dynamic

run on jvm

Java-like

Java-interoperable

scripting / web / jms ++

Page 4: Enhance your Maven plugins with Groovy

4 © Computas AS 08.04.2023

Pro forma

I’m not a Groovy expert !

I’m focusing on Java <> Groovy

not neccessarily the very best way of solving it alltogether !

Using pure Java libraries would make a different story

Page 5: Enhance your Maven plugins with Groovy

5 © Computas AS 08.04.2023

Goal

Investigate home-brew enterprise Maven plugins

Would Groovyfication™ affect ..

Simplicity?

Maintainability?

Testability?

Page 6: Enhance your Maven plugins with Groovy

6 © Computas AS 08.04.2023

Recipe for your Maven project

add build step with gmaven-plugin

add dependency to gmaven-mojo

src/java vs src/groovy

.java vs .groovy

compile and enjoy !

Page 7: Enhance your Maven plugins with Groovy

9 © Computas AS 08.04.2023

Example 2: Enterprise plugin logic

PurposeExecute external program

Determine exit value

DifferencesException handling

Controlling flow of execution

Page 8: Enhance your Maven plugins with Groovy

10 © Computas AS 08.04.2023

Example 4: Enterprise plugin logic

PurposeCheck if URL has content (~ ping)

DifferencesException handling

Controlling flow of execution (“debug comments”)

Readability

Page 9: Enhance your Maven plugins with Groovy

11 © Computas AS 08.04.2023

Example 5: DTO

PurposeInternal ”entity” class

DifferencesConstructor

Constructor call, readability

Accessor methods

Page 10: Enhance your Maven plugins with Groovy

12 © Computas AS 08.04.2023

Example 6: Testability

PurposeTest a method converting a String with windows style path to posix-style path

Differences”Groovy set of mind”

Highlight low cohesion

Refactoring opportunities

Page 11: Enhance your Maven plugins with Groovy

13 © Computas AS 08.04.2023

Experiences

>>

Task-oriented, high-level operations

Testability readyness

<<

Complex, procedural code

Detailed logging, exception handling

Low cohesion

Page 12: Enhance your Maven plugins with Groovy

Questions or comments ?

14 © Computas AS 08.04.2023

www.computas.com

job openings for experienced developers !

Booth B5