src/main/java/org/organicelement/deployment/mojo/DeploymentPackageMojo.java
public final void execute() throws MojoExecutionException, MojoFailureException {

		// First, check if we support such type of packaging.
		final Artifact artifact = getProject().getArtifact();
		if (!getSupportedProjectTypes().contains(artifact.getType())) {
			getLogger().debug(
			      "Ignoring project " + artifact + " : type " + artifact.getType()
			            + " is not supported by bundle plugin, supported types are " + getSupportedProjectTypes());
			return;
		}

		// Create a description from the pom metadata.
		DeploymentPackageMetadata deploymentPackageInfo = getDeploymentPackageInfo();
		if (deploymentPackageInfo == null) {
			throw new MojoExecutionException("No deployment package described");
		}

		// add project dependencies
		if (includeDependencies)
			addDependencies(deploymentPackageInfo);

		// add inherited headers
		addHeaders(deploymentPackageInfo);

		DeploymentPackage currentPackage = deploymentPackageInfo.getDeploymentPackage();

		// Populate...
		try {
			populate(currentPackage, deploymentPackageInfo);
		} catch (IOException e1) {
			throw new MojoExecutionException("Cannot analyze the artifact : " + e1.getMessage());
		}

		// Resolve all resources.
		for (BundleResource br : deploymentPackageInfo.getBundleResources()) {
			br.setMojo(this);
			br.resolve(currentPackage, getBaseDir());
		}

		for (ProcessedResource pr : deploymentPackageInfo.getProcessedResources()) {
			pr.resolve(currentPackage, getBaseDir());
		}

		// Check...
		try {
			currentPackage.check();
		} catch (CheckingException e) {
			throw new MojoExecutionException("The deployment package is inconsistent : " + e.getMessage());
		}

		// Now, handle file creation...
		String finalName = getProject().getBuild().getFinalName() + DP_FILE_EXTENSION;
		final File file = new File(getBuildDirectory(), finalName);

		file.getParentFile().mkdirs();

		// // workaround for MNG-1682: force maven to install artifact using the
		// // "jar" handler
		final Artifact mainArtifact = getProject().getArtifact();
		// mainArtifact.setArtifactHandler(getArtifactHandlerManager()
		// .getArtifactHandler("jar"));
		mainArtifact.setFile(file);

		// Build...
		try {
			getLogger().debug("Build the deployment package");
			currentPackage.build(file);
			getLogger().debug("Deployment package built");
		} catch (Exception e) {
			throw new MojoExecutionException("The deployment package cannot be built : " + e.getMessage());
		}

	}
/**
	 * This method will be called by the Maven framework in order to execute this plugin.
	 * 
	 * @throws MojoExecutionException id any error occures
	 * @throws MojoFailureException id any error occures
	 */
This method will be called by the Maven framework in order to execute this plugin.

@throws MojoExecutionException id any error occures
@throws MojoFailureException id any error occures
This method will be called by the Maven framework in order to execute this plugin . @throws MojoExecutionException id any error occures @throws MojoFailureException id any error occures
public final void execute() throws MojoExecutionException, MojoFailureException {
		final Artifact artifact = getProject().getArtifact();
		if (!getSupportedProjectTypes().contains(artifact.getType())) {
			getLogger().debug(
			      "Ignoring project " + artifact + " : type " + artifact.getType()
			            + " is not supported by bundle plugin, supported types are " + getSupportedProjectTypes());
			return;
		}
		DeploymentPackageMetadata deploymentPackageInfo = getDeploymentPackageInfo();
		if (deploymentPackageInfo == null) {
			throw new MojoExecutionException("No deployment package described");
		}
		if (includeDependencies)
			addDependencies(deploymentPackageInfo);
		addHeaders(deploymentPackageInfo);
		DeploymentPackage currentPackage = deploymentPackageInfo.getDeploymentPackage();
		try {
			populate(currentPackage, deploymentPackageInfo);
		} catch (IOException e1) {
			throw new MojoExecutionException("Cannot analyze the artifact : " + e1.getMessage());
		}
		for (BundleResource br : deploymentPackageInfo.getBundleResources()) {
			br.setMojo(this);
			br.resolve(currentPackage, getBaseDir());
		}
		for (ProcessedResource pr : deploymentPackageInfo.getProcessedResources()) {
			pr.resolve(currentPackage, getBaseDir());
		}
		try {
			currentPackage.check();
		} catch (CheckingException e) {
			throw new MojoExecutionException("The deployment package is inconsistent : " + e.getMessage());
		}
		String finalName = getProject().getBuild().getFinalName() + DP_FILE_EXTENSION;
		final File file = new File(getBuildDirectory(), finalName);
		file.getParentFile().mkdirs();
		final Artifact mainArtifact = getProject().getArtifact();
		mainArtifact.setFile(file);
		try {
			getLogger().debug("Build the deployment package");
			currentPackage.build(file);
			getLogger().debug("Deployment package built");
		} catch (Exception e) {
			throw new MojoExecutionException("The deployment package cannot be built : " + e.getMessage());
		}
	}
public final void execute ( ) throws MojoExecutionException , MojoFailureException { final Artifact artifact = getProject ( ) . getArtifact ( ) ; if ( ! getSupportedProjectTypes ( ) . contains ( artifact . getType ( ) ) ) { getLogger ( ) . debug ( "Ignoring project " + artifact + " : type " + artifact . getType ( ) + " is not supported by bundle plugin, supported types are " + getSupportedProjectTypes ( ) ) ; return ; } DeploymentPackageMetadata deploymentPackageInfo = getDeploymentPackageInfo ( ) ; if ( deploymentPackageInfo == null ) { throw new MojoExecutionException ( "No deployment package described" ) ; } if ( includeDependencies ) addDependencies ( deploymentPackageInfo ) ; addHeaders ( deploymentPackageInfo ) ; DeploymentPackage currentPackage = deploymentPackageInfo . getDeploymentPackage ( ) ; try { populate ( currentPackage , deploymentPackageInfo ) ; } catch ( IOException e1 ) { throw new MojoExecutionException ( "Cannot analyze the artifact : " + e1 . getMessage ( ) ) ; } for ( BundleResource br : deploymentPackageInfo . getBundleResources ( ) ) { br . setMojo ( this ) ; br . resolve ( currentPackage , getBaseDir ( ) ) ; } for ( ProcessedResource pr : deploymentPackageInfo . getProcessedResources ( ) ) { pr . resolve ( currentPackage , getBaseDir ( ) ) ; } try { currentPackage . check ( ) ; } catch ( CheckingException e ) { throw new MojoExecutionException ( "The deployment package is inconsistent : " + e . getMessage ( ) ) ; } String finalName = getProject ( ) . getBuild ( ) . getFinalName ( ) + DP_FILE_EXTENSION ; final File file = new File ( getBuildDirectory ( ) , finalName ) ; file . getParentFile ( ) . mkdirs ( ) ; final Artifact mainArtifact = getProject ( ) . getArtifact ( ) ; mainArtifact . setFile ( file ) ; try { getLogger ( ) . debug ( "Build the deployment package" ) ; currentPackage . build ( file ) ; getLogger ( ) . debug ( "Deployment package built" ) ; } catch ( Exception e ) { throw new MojoExecutionException ( "The deployment package cannot be built : " + e . getMessage ( ) ) ; } }
This method will be called by the Maven framework in order to execute this plugin.
This method will be called by the Maven framework in order to execute this plugin .
// First, check if we support such type of packaging. // Create a description from the pom metadata. // add project dependencies // add inherited headers // Populate... // Resolve all resources. // Check... // Now, handle file creation... // // workaround for MNG-1682: force maven to install artifact using the // // "jar" handler // mainArtifact.setArtifactHandler(getArtifactHandlerManager() // .getArtifactHandler("jar")); // Build...