本文整理汇总了Java中org.springframework.roo.project.maven.Pom.getGroupId方法的典型用法代码示例。如果您正苦于以下问题:Java Pom.getGroupId方法的具体用法?Java Pom.getGroupId怎么用?Java Pom.getGroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.roo.project.maven.Pom
的用法示例。
在下文中一共展示了Pom.getGroupId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTopLevelPackage
import org.springframework.roo.project.maven.Pom; //导入方法依赖的package包/类
public JavaPackage getTopLevelPackage(final String moduleName) {
final Pom pom = getPomFromModuleName(moduleName);
if (pom != null) {
return new JavaPackage(pom.getGroupId());
}
return null;
}
示例2: get
import org.springframework.roo.project.maven.Pom; //导入方法依赖的package包/类
public MetadataItem get(final String metadataId) {
Validate.isTrue(ProjectMetadata.isValid(metadataId),
"Unexpected metadata request '%s' for this provider",
metadataId);
// Just rebuild on demand. We always do this as we expect
// MetadataService to cache on our behalf
final Pom pom = pomManagementService
.getPomFromModuleName(ProjectMetadata.getModuleName(metadataId));
// Read the file, if it is available
if (pom == null || !fileManager.exists(pom.getPath())) {
return null;
}
final JavaPackage topLevelPackage = new JavaPackage(pom.getGroupId());
// Update UAA with the project name
uaaRegistrationService.registerProject(
UaaRegistrationService.SPRING_ROO,
topLevelPackage.getFullyQualifiedPackageName());
// Update UAA with the well-known Spring-related open source
// dependencies
for (final ProductInfo productInfo : uaaDetectedProducts
.getDetectedProductInfos()) {
if (productInfo.getProductName().equals(
UaaRegistrationService.SPRING_ROO.getName())) {
// No need to register with a less robust pom.xml-declared
// dependency metadata when we did it ourselves with a proper
// bundle version number lookup a moment ago...
continue;
}
if (productInfo.getProductName().equals(
UaaDetectedProducts.SPRING_UAA.getProductName())) {
// No need to register Spring UAA as this happens automatically
// internal to UAA
continue;
}
final Dependency dependency = new Dependency(
productInfo.getGroupId(), productInfo.getArtifactId(),
"version_is_ignored_for_searching");
final Set<Dependency> dependenciesExcludingVersion = pom
.getDependenciesExcludingVersion(dependency);
if (!dependenciesExcludingVersion.isEmpty()) {
// This dependency was detected
final Dependency first = dependenciesExcludingVersion
.iterator().next();
// Convert the detected dependency into a Product as best we can
String versionSequence = first.getVersion();
// Version sequence given; see if it looks like a property
if (versionSequence != null && versionSequence.startsWith("${")
&& versionSequence.endsWith("}")) {
// Strip the ${ } from the version sequence
final String propertyName = versionSequence.replace("${",
"").replace("}", "");
final Set<Property> prop = pom
.getPropertiesExcludingValue(new Property(
propertyName));
if (!prop.isEmpty()) {
// Take the first one's value and treat that as the
// version sequence
versionSequence = prop.iterator().next().getValue();
}
}
// Handle there being no version sequence
if (versionSequence == null || "".equals(versionSequence)) {
versionSequence = "0.0.0.UNKNOWN";
}
final Product product = VersionHelper.getProduct(
productInfo.getProductName(), versionSequence);
// Register the Spring Product with UAA
uaaRegistrationService.registerProject(product,
topLevelPackage.getFullyQualifiedPackageName());
}
}
return new ProjectMetadata(pom);
}
示例3: getTopLevelPackageForModule
import org.springframework.roo.project.maven.Pom; //导入方法依赖的package包/类
public String getTopLevelPackageForModule(final Pom module) {
return module.getGroupId();
}