1919/**
2020 * The type Sql components mojo.
2121 */
22- @ Mojo (name = SQLComponentsMojo . GENERATED_SOURCES , defaultPhase =
23- LifecyclePhase .GENERATE_SOURCES , requiresDependencyResolution =
24- ResolutionScope .RUNTIME )
22+ @ Mojo (name = "generate" ,
23+ defaultPhase = LifecyclePhase .GENERATE_SOURCES ,
24+ requiresDependencyResolution = ResolutionScope .RUNTIME )
2525public final class SQLComponentsMojo extends AbstractMojo {
2626 /**
2727 * The Generated sources.
@@ -73,6 +73,12 @@ public void execute() {
7373 Application lApplication = null ;
7474 try {
7575 lApplication = createApplicationFromYMLSpec ();
76+ if (lApplication .getRootPackage () == null
77+ || lApplication .getRootPackage ().trim ().isEmpty () ) {
78+ lApplication .setRootPackage (this .project .getGroupId () + "."
79+ + this .project .getArtifactId ());
80+ }
81+
7682 lApplication .getOrm ()
7783 .setApplicationClassLoader (getClassLoader (this .project ));
7884 lApplication .compile (
@@ -93,7 +99,7 @@ public void execute() {
9399 */
94100 private ClassLoader getClassLoader (final MavenProject paramProject ) {
95101 try {
96- List classpathElements = paramProject .getCompileClasspathElements ();
102+ List < Object > classpathElements = paramProject .getCompileClasspathElements ();
97103 classpathElements .add (paramProject .getBuild ().getOutputDirectory ());
98104 classpathElements .add (
99105 paramProject .getBuild ().getTestOutputDirectory ());
@@ -121,7 +127,7 @@ private Application createApplicationFromYMLSpec() throws IOException {
121127 lApplication .setSrcFolder (
122128 project .getBuild ().getDirectory () + GENERATE_SOURCES_DIR
123129 + lApplication .getName ().toLowerCase ());
124- getLog ().info ("'" + GENERATED_SOURCES + "' directory is : "
130+ getLog ().info ("'SQL Components' are created at : "
125131 + lApplication .getSrcFolder ());
126132 project .addCompileSourceRoot (lApplication .getSrcFolder ());
127133 return lApplication ;
0 commit comments