'How to compile and extract the packages with classes in a java maven module

I have been trying to create a custom MavenPlugin to extract packages and classes of the current Project.

Here is my code so far:

@Parameter(defaultValue = "${project}")
MavenProject project;


public void execute() throws MojoExecutionException, MojoFailureException {

    File projectBaseDirectory = project.getBasedir(); 
     //Todo?

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source