Search in sources :

Example 1 with EARComponentExportDataModelProvider

use of org.eclipse.jst.j2ee.application.internal.operations.EARComponentExportDataModelProvider in project azure-tools-for-java by Microsoft.

the class WAExportWarEar method exportEarComponent.

/**
	 * This method export dependent enterprise application project as ear
	 * with their dependent libraries if any.
	 * @param projName
	 * @param destPath
	 * @throws ExecutionException
	 */
public static void exportEarComponent(String projName, String destPath) throws ExecutionException {
    IDataModel earModel = DataModelFactory.createDataModel(new EARComponentExportDataModelProvider());
    earModel.setProperty(IEARComponentExportDataModelProperties.PROJECT_NAME, projName);
    earModel.setProperty(IEARComponentExportDataModelProperties.ARCHIVE_DESTINATION, destPath);
    earModel.setProperty(IEARComponentExportDataModelProperties.OVERWRITE_EXISTING, true);
    try {
        earModel.getDefaultOperation().execute(null, null);
    } catch (org.eclipse.core.commands.ExecutionException e) {
        errorMessage = String.format("%s%s%s%s%s", Messages.crtErrMsg, " ", "EAR", " of project: ", projName);
        Activator.getDefault().log(errorMessage, e);
    }
}
Also used : EARComponentExportDataModelProvider(org.eclipse.jst.j2ee.application.internal.operations.EARComponentExportDataModelProvider) IDataModel(org.eclipse.wst.common.frameworks.datamodel.IDataModel)

Aggregations

EARComponentExportDataModelProvider (org.eclipse.jst.j2ee.application.internal.operations.EARComponentExportDataModelProvider)1 IDataModel (org.eclipse.wst.common.frameworks.datamodel.IDataModel)1