本文整理了Java中org.apache.maven.model.Organization.getName()
方法的一些代码示例,展示了Organization.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Organization.getName()
方法的具体详情如下:
包路径:org.apache.maven.model.Organization
类名称:Organization
方法名:getName
[英]Get the full name of the organization.
[中]获取组织的全名。
代码示例来源:origin: apache/maven
protected void mergeOrganization_Name( Organization target, Organization source, boolean sourceDominant,
Map<Object, Object> context )
{
String src = source.getName();
if ( src != null )
{
if ( sourceDominant || target.getName() == null )
{
target.setName( src );
target.setLocation( "name", source.getLocation( "name" ) );
}
}
}
代码示例来源:origin: speedment/speedment
private String getCompanyNameFromMavenProject() {
if (mavenProject.getOrganization() != null) {
return mavenProject.getOrganization().getName();
} else {
return null;
}
}
代码示例来源:origin: rapidoid/rapidoid
private void addJarManifest(String uberJar, MavenProject project, String mainClass) throws IOException {
Path path = Paths.get(uberJar);
URI uri = URI.create("jar:" + path.toUri());
String user = System.getProperty("user.name");
String manifestContent = IO.load("manifest-template.mf")
.replace("$user", user)
.replace("$java", Msc.javaVersion())
.replace("$name", project.getName())
.replace("$version", project.getVersion())
.replace("$groupId", project.getGroupId())
.replace("$organization", project.getOrganization() != null ? U.or(project.getOrganization().getName(), "?") : "?")
.replace("$url", U.or(project.getUrl(), "?"))
.replace("$main", U.safe(mainClass));
try (FileSystem fs = FileSystems.newFileSystem(uri, U.map())) {
Path manifest = fs.getPath("META-INF/MANIFEST.MF");
try (Writer writer = Files.newBufferedWriter(manifest, StandardCharsets.UTF_8, StandardOpenOption.CREATE)) {
writer.write(manifestContent);
}
}
}
代码示例来源:origin: org.apache.maven/maven-project
public static Organization cloneOrganization( Organization src )
{
if ( src == null )
{
return null;
}
Organization result = new Organization();
result.setName( src.getName() );
result.setUrl( src.getUrl() );
return result;
}
代码示例来源:origin: apache/maven
/**
* Method writeOrganization.
*
* @param organization
* @param serializer
* @param tagName
* @throws java.io.IOException
*/
private void writeOrganization( Organization organization, String tagName, XmlSerializer serializer )
throws java.io.IOException
{
serializer.startTag( NAMESPACE, tagName );
if ( organization.getName() != null )
{
serializer.startTag( NAMESPACE, "name" ).text( organization.getName() ).endTag( NAMESPACE, "name" );
}
if ( organization.getUrl() != null )
{
serializer.startTag( NAMESPACE, "url" ).text( organization.getUrl() ).endTag( NAMESPACE, "url" );
}
serializer.endTag( NAMESPACE, tagName );
} //-- void writeOrganization( Organization, String, XmlSerializer )
代码示例来源:origin: opensourceBIM/BIMserver
@Override
public String getOrganization() {
return getModel().getOrganization().getName();
}
}
代码示例来源:origin: takari/polyglot-maven
/**
* Method writeOrganization.
*
* @param organization
* @param serializer
* @param tagName
* @throws java.io.IOException
*/
private void writeOrganization( Organization organization, String tagName, XmlSerializer serializer )
throws java.io.IOException
{
serializer.startTag( NAMESPACE, tagName );
if ( organization.getName() != null )
{
serializer.attribute( NAMESPACE, "name", organization.getName() );
}
if ( organization.getUrl() != null )
{
serializer.attribute( NAMESPACE, "url", organization.getUrl() );
}
serializer.endTag( NAMESPACE, tagName );
} //-- void writeOrganization( Organization, String, XmlSerializer )
代码示例来源:origin: opensourceBIM/BIMserver
Model model = mavenreader.read(jarFile.getInputStream(entry));
sPluginBundle.setOrganization(model.getOrganization().getName());
sPluginBundle.setName(model.getName());
代码示例来源:origin: opensourceBIM/BIMserver
@Override
public SPluginBundle getPluginBundle() {
SPluginBundle result = new SPluginBundle();
result.setName(model.getName());
result.setOrganization(model.getOrganization().getName());
return result;
}
代码示例来源:origin: opensourceBIM/BIMserver
public SPluginBundle extractPluginBundleFromJar(Path jarFilePath) throws PluginException {
String filename = jarFilePath.getFileName().toString();
PluginBundleVersionIdentifier pluginBundleVersionIdentifier = PluginBundleVersionIdentifier.fromFileName(filename);
try (JarFile jarFile = new JarFile(jarFilePath.toFile())) {
String pomLocation = "META-INF/maven/" + pluginBundleVersionIdentifier.getPluginBundleIdentifier().getGroupId() + "/" + pluginBundleVersionIdentifier.getPluginBundleIdentifier().getArtifactId() + "/" + "pom.xml";
ZipEntry pomEntry = jarFile.getEntry(pomLocation);
if (pomEntry == null) {
throw new PluginException("No pom.xml found in JAR file " + jarFilePath.toString() + ", " + pomLocation);
}
MavenXpp3Reader mavenreader = new MavenXpp3Reader();
Model model = mavenreader.read(jarFile.getInputStream(pomEntry));
SPluginBundle sPluginBundle = new SPluginBundle();
sPluginBundle.setOrganization(model.getOrganization().getName());
sPluginBundle.setName(model.getName());
return sPluginBundle;
} catch (IOException e) {
throw new PluginException(e);
} catch (XmlPullParserException e) {
throw new PluginException(e);
}
}
代码示例来源:origin: opensourceBIM/BIMserver
throw new PluginException("Plugis are required to have an organization in the pom.xml file");
sPluginBundle.setOrganization(model.getOrganization().getName());
sPluginBundle.setName(model.getName());
代码示例来源:origin: opensourceBIM/BIMserver
sPluginBundleVersion.setOrganization(model.getOrganization().getName());
sPluginBundleVersion.setName(model.getName());
sPluginBundleVersion.setType(SPluginBundleType.MAVEN);
代码示例来源:origin: opensourceBIM/BIMserver
sPluginBundleVersion.setOrganization(mavenPluginVersion.getModel().getOrganization().getName());
sPluginBundleVersion.setArtifactId(mavenPluginLocation.getArtifactId());
sPluginBundleVersion.setGroupId(mavenPluginLocation.getGroupId());
pluginBundle.setOrganization(mavenPluginVersion.getModel().getOrganization().getName());
if (pluginBundle.getLatestVersion() == null) {
pluginBundle.setLatestVersion(sPluginBundleVersion);
代码示例来源:origin: opensourceBIM/BIMserver
sPluginBundle.setOrganization(model.getOrganization().getName());
sPluginBundle.setName(model.getName());
代码示例来源:origin: opensourceBIM/BIMserver
private SPluginBundleVersion createPluginBundleVersionFromMavenModel(Model model, boolean isLocalDev) {
SPluginBundleVersion sPluginBundleVersion = new SPluginBundleVersion();
sPluginBundleVersion.setType(isLocalDev ? SPluginBundleType.LOCAL_DEV : SPluginBundleType.MAVEN);
sPluginBundleVersion.setGroupId(model.getGroupId());
sPluginBundleVersion.setArtifactId(model.getArtifactId());
sPluginBundleVersion.setVersion(model.getVersion());
sPluginBundleVersion.setDescription(model.getDescription());
sPluginBundleVersion.setRepository("local");
sPluginBundleVersion.setMismatch(false); // TODO
sPluginBundleVersion.setOrganization(model.getOrganization().getName());
sPluginBundleVersion.setName(model.getName());
return sPluginBundleVersion;
}
代码示例来源:origin: opensourceBIM/BIMserver
@Override
public SPluginBundleVersion getPluginBundleVersion() {
SPluginBundleVersion sPluginBundleVersion = new SPluginBundleVersion();
sPluginBundleVersion.setType(SPluginBundleType.LOCAL);
sPluginBundleVersion.setGroupId(model.getGroupId());
sPluginBundleVersion.setArtifactId(model.getArtifactId());
sPluginBundleVersion.setVersion(model.getVersion());
sPluginBundleVersion.setDescription(model.getDescription());
sPluginBundleVersion.setRepository("local");
sPluginBundleVersion.setMismatch(false); // TODO
sPluginBundleVersion.setOrganization(model.getOrganization().getName());
sPluginBundleVersion.setName(model.getName());
return sPluginBundleVersion;
}
}
代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin
public static boolean isAtlassianPlugin(MavenProject project)
{
if (project.getOrganization() != null && project.getOrganization().getName() != null)
{
return project.getOrganization().getName().contains("Atlassian");
}
return false;
}
}
代码示例来源:origin: apache/archiva
private org.apache.archiva.metadata.model.Organization convertOrganization( Organization organization )
{
org.apache.archiva.metadata.model.Organization org = null;
if ( organization != null )
{
org = new org.apache.archiva.metadata.model.Organization();
org.setName( organization.getName() );
org.setUrl( organization.getUrl() );
}
return org;
}
代码示例来源:origin: org.apache.archiva/maven2-repository
private org.apache.archiva.metadata.model.Organization convertOrganization( Organization organization )
{
org.apache.archiva.metadata.model.Organization org = null;
if ( organization != null )
{
org = new org.apache.archiva.metadata.model.Organization();
org.setName( organization.getName() );
org.setUrl( organization.getUrl() );
}
return org;
}
代码示例来源:origin: net.jangaroo/jangaroo-maven-plugin
private void configureMetadata(SenchaPackageOrAppConfigBuilder configBuilder) {
String version = SenchaUtils.getSenchaVersionForMavenVersion(project.getVersion());
if (version == null) {
version = SENCHA_FALLBACK_VERSION;
getLog().warn("Could not determine Sencha version from maven version " + project.getVersion() +
", falling back to " + version + ".");
}
configBuilder.name(getSenchaPackageName(project.getGroupId(), project.getArtifactId()));
configBuilder.version(version);
configBuilder.creator(StringUtils.defaultString(project.getOrganization() != null ? project.getOrganization().getName() : ""));
configBuilder.summary(StringUtils.defaultString(project.getDescription()));
}
内容来源于网络,如有侵权,请联系作者删除!