use of com.liferay.ide.maven.core.util.DefaultMaven2OsgiConverter in project liferay-ide by liferay.
the class MavenBundlePluginProject method getSymbolicName.
@Override
public String getSymbolicName() throws CoreException {
String bsn = ProjectUtil.getBundleSymbolicNameFromBND(getProject());
if (!CoreUtil.empty(bsn)) {
return bsn;
}
String retval = null;
IProgressMonitor monitor = new NullProgressMonitor();
IMavenProjectFacade projectFacade = MavenUtil.getProjectFacade(getProject(), monitor);
MavenProject mavenProject = projectFacade.getMavenProject(monitor);
Artifact artifact = mavenProject.getArtifact();
File file = artifact.getFile();
if (FileUtil.exists(file) && !file.getName().equals("classes")) {
retval = new DefaultMaven2OsgiConverter().getBundleSymbolicName(artifact);
} else {
IProject project = getProject();
// fallback to project name
retval = project.getLocation().lastSegment();
}
return retval;
}
Aggregations