internal package 존재하여 org.eclipse.jst.j2ee.web 프로젝트를 부모로하는 fragment project 이어여 합니다. 소스코드는 변수 이름이 직관적이어서 설명이 없어도 쉽게 이해할수 있을듯 하여 생략합니다.
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
IProject project = root.getProject(projectName);
if(project == null) {
throw new Exception(projectName + Messages.WARExporter_0);
}
WebComponentExportDataModelProvider provider = new WebComponentExportDataModelProvider();
IDataModel dataModel = DataModelFactory.createDataModel(provider);
dataModel.setProperty(IJ2EEComponentExportDataModelProperties.PROJECT_NAME, project.getName());
dataModel.setBooleanProperty(IJ2EEComponentExportDataModelProperties.OPTIMIZE_FOR_SPECIFIC_RUNTIME, false);
dataModel.setBooleanProperty(IJ2EEComponentExportDataModelProperties.EXPORT_SOURCE_FILES, exportSource);
dataModel.setBooleanProperty(IJ2EEComponentExportDataModelProperties.OVERWRITE_EXISTING, overwrite);
dataModel.setProperty(IJ2EEComponentExportDataModelProperties.ARCHIVE_DESTINATION, destnateion);
IVirtualComponent component = ComponentCore.createComponent(project);
dataModel.setProperty(IJ2EEComponentExportDataModelProperties.COMPONENT, component);
WebComponentExportOperation operation = new WebComponentExportOperation(dataModel);
return operation.execute(new NullProgressMonitor(), null);
다음에는 톰켓 프로젝트 구성과 설치등을 적어볼게요.
댓글 없음:
댓글 쓰기