Week 1: Laying the Plugin Foundation

MarvinMarvin
3 min read

📅 May 15–23

What I Planned to Do

  • Integrate a minimal Maven plugin into the webservices.rest build lifecycle

  • Deep-dive into the module's codebase to understand how representations function

  • Study prior get*Models() implementations and analyze mherman's PRs to derive insights


What I Worked On

  • I began by exploring the REST module's file structure and tracing how a GET request flows through the system. This helped me understand which methods and classes are triggered for different representation types.

  • Much of this understanding came from my pre-GSoC exploration, where I used the debugger extensively and tested various resource calls.

  • My 1:1 calls with Chi Bong and the detailed project brief were invaluable in clarifying the scope and direction of the work.

  • I created a standard Maven plugin structure and implemented a simple Mojo class that printed "Hello World" on invocation.

  • After running mvn clean install, I successfully integrated the plugin into the omod directory's pom.xml. The plugin compiled and executed without errors, a foundational milestone!

  • I then focused on extracting Javadoc comments from resource classes. Based on feedback and research, I compared the Doclet API and JavaParser.

  • JavaParser stood out for its simplicity and ability to parse source-level Java code using Abstract Syntax Trees (ASTs).

  • I implemented basic JavaParser logic and hardcoded it to test with PatientResource. After resolving dependency and path issues, I successfully retrieved the class-level Javadoc!


Challenges Faced

  • While early progress was promising, the approach relied on hardcoded class paths, which won't scale in later stages.

  • Future work — such as dynamically invoking methods via reflection — will introduce complexity that I’ll need to handle robustly.


What I Learned

  • Learned how to implement a Maven plugin from scratch and integrate it into a multi-module Maven project.

  • Understood how to configure plugin execution within pom.xml files for both module and class-level granularity.

  • Explored and compared two Javadoc parsing libraries, Doclet API and JavaParser.

  • Gained hands-on experience with Abstract Syntax Trees (ASTs) through JavaParser and understood how it enables source-level analysis.


Commits/PRs This Week


Plans for Next Week

  • Invoke getRepresentationDescription() within the plugin context

  • Handle mocked contexts and dependencies required for resource introspection

  • Parse and convert Property objects into detailed OpenAPI-compatible JSON schema


Notes/Discussion Points

  • Would love more community involvement, any implementation I am skeptical about should be resolved through the community.

Thank you!

0
Subscribe to my newsletter

Read articles from Marvin directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Marvin
Marvin

21 | cs sophomore @ SPIT Mumbai | GSoC 2025 Contributor @ OpenMRS | Backend Dev | Java, Python, Spring Boot, Maven