Revision 33696

View differences:

branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.maven/src/main/java/org/gvsig/installer/maven/GenerateInstallerMojo.java
30 30
import org.apache.maven.plugin.AbstractMojo;
31 31
import org.apache.maven.plugin.MojoExecutionException;
32 32
import org.apache.maven.plugin.MojoFailureException;
33
import org.apache.maven.plugin.logging.Log;
33 34

  
34 35
import org.gvsig.installer.lib.api.InstallerLocator;
35 36
import org.gvsig.installer.lib.api.InstallerManager;
......
94 95
    private String artifactId;
95 96

  
96 97
    /**
98
     * Plugin project packaging, to check it is of jar type.
99
     * 
100
     * @parameter expression="${project.packaging}"
101
     * @required
102
     */
103
    private String packaging;
104

  
105
    /**
97 106
     * Plugin project name.
98 107
     * 
99 108
     * @parameter expression="${project.name}"
......
188 197
     */
189 198
    private String installableType = "plugin";
190 199

  
200
    /**
201
     * If the mojo execution is disabled. Useful for projects that inherit
202
     * the maven plugin configuration but don't generate installer.
203
     * 
204
     * @parameter
205
     */
206
    private boolean disabled = false;
207

  
191 208
    public void execute() throws MojoExecutionException, MojoFailureException {
192
        getLog().info(
193
            "Generating a installable for the plugin: " + artifactId
194
                + " with the following information:");
195
        getLog().info("\tPlugin name: " + name);
196
        getLog().info("\tPlugin description: " + description);
197
        getLog().info("\tPlugin version: " + version);
198
        getLog().info("\tPlugin build number: " + buildNumber);
199
        getLog().info("\tPlugin state: " + state);
200
        getLog().info("\tPlugin official: " + official);
201
        getLog().info("\tPlugin operatingSystem: " + operatingSystem);
202
        getLog().info("\tPlugin architecture: " + architecture);
203
        getLog().info("\tPlugin javaVM: " + javaVM);
204
        getLog().info("\tPlugin gvSIGVersion: " + gvSIGVersion);
205
        getLog().info("\tgvSIG Plugin's folder: " + pluginsFolder);
206
        getLog().info("\tBundle installation file to create: " + bundleFolder);
209
        Log log = getLog();
207 210

  
211
        if (disabled) {
212
            log.info("Installer generation disabled.");
213
            return;
214
        }
215

  
216
        if (!"jar".equals(packaging)) {
217
            log.info("Running on a project with packaging of type " + packaging
218
                + ". Do nothing, as we only create installers for projects "
219
                + "with jar packaging");
220
            return;
221
        }
222

  
223
        log.info("Generating a installable for the plugin: " + artifactId
224
            + " with the following information:");
225
        log.info("\tPlugin name: " + name);
226
        log.info("\tPlugin description: " + description);
227
        log.info("\tPlugin version: " + version);
228
        log.info("\tPlugin build number: " + buildNumber);
229
        log.info("\tPlugin state: " + state);
230
        log.info("\tPlugin official: " + official);
231
        log.info("\tPlugin operatingSystem: " + operatingSystem);
232
        log.info("\tPlugin architecture: " + architecture);
233
        log.info("\tPlugin javaVM: " + javaVM);
234
        log.info("\tPlugin gvSIGVersion: " + gvSIGVersion);
235
        log.info("\tgvSIG Plugin's folder: " + pluginsFolder);
236
        log.info("\tBundle installation file to create: " + bundleFolder);
237

  
208 238
        File packageBundleFile = null;
209 239

  
210 240
        try {
......
267 297
                    + packageBundleFile, e);
268 298
        }
269 299

  
270
        getLog().info("Bundle installation file created successfully");
300
        log.info("Bundle installation file created successfully");
271 301
    }
272 302
}

Also available in: Unified diff