本文整理了Java中org.apache.maven.continuum.model.project.Project.getVersion()
方法的一些代码示例,展示了Project.getVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getVersion()
方法的具体详情如下:
包路径:org.apache.maven.continuum.model.project.Project
类名称:Project
方法名:getVersion
[英]Get null
[中]获取空值
代码示例来源:origin: org.apache.continuum/continuum-buildagent-core
protected Properties getContinuumSystemProperties( Project project )
{
Properties properties = new Properties();
properties.setProperty( "continuum.project.group.name", project.getProjectGroup().getName() );
properties.setProperty( "continuum.project.lastBuild.state", String.valueOf( project.getOldState() ) );
properties.setProperty( "continuum.project.lastBuild.number", String.valueOf( project.getBuildNumber() ) );
properties.setProperty( "continuum.project.nextBuild.number", String.valueOf( project.getBuildNumber() + 1 ) );
properties.setProperty( "continuum.project.id", String.valueOf( project.getId() ) );
properties.setProperty( "continuum.project.name", project.getName() );
properties.setProperty( "continuum.project.version", project.getVersion() );
return properties;
}
代码示例来源:origin: org.apache.continuum/continuum-core
protected Properties getContinuumSystemProperties( Project project )
{
Properties properties = new Properties();
properties.setProperty( "continuum.project.group.name", project.getProjectGroup().getName() );
properties.setProperty( "continuum.project.lastBuild.state", String.valueOf( project.getOldState() ) );
properties.setProperty( "continuum.project.lastBuild.number", String.valueOf( project.getBuildNumber() ) );
properties.setProperty( "continuum.project.nextBuild.number", String.valueOf( project.getBuildNumber() + 1 ) );
properties.setProperty( "continuum.project.id", String.valueOf( project.getId() ) );
properties.setProperty( "continuum.project.name", project.getName() );
properties.setProperty( "continuum.project.version", project.getVersion() );
return properties;
}
代码示例来源:origin: org.apache.continuum/continuum-core
private void checkForDuplicateProjectInGroup( ProjectGroup projectGroup, Project projectToCheck,
ContinuumProjectBuildingResult result )
{
List<Project> projectsInGroup = projectGroup.getProjects();
if ( projectsInGroup == null )
{
return;
}
for ( Project project : projectGroup.getProjects() )
{
// projectToCheck is first in the equals check, as projectToCheck must be a Maven project and will have
// non-null values for each. project may be an Ant or Shell project and have null values.
if ( projectToCheck.getGroupId().equals( project.getGroupId() ) && projectToCheck.getArtifactId().equals(
project.getArtifactId() ) && projectToCheck.getVersion().equals( project.getVersion() ) )
{
result.addError( ContinuumProjectBuildingResult.ERROR_DUPLICATE_PROJECTS );
return;
}
}
}
代码示例来源:origin: org.apache.continuum/continuum-test
public void assertProjectEquals( Project expected, Project actual )
{
assertProjectEquals( expected.getName(), expected.getNotifiers(), expected.getVersion(), actual );
}
代码示例来源:origin: org.apache.maven.continuum/continuum-test
public void assertProjectEquals( Project expected, Project actual )
{
assertProjectEquals( expected.getName(), expected.getNotifiers(), expected.getVersion(), actual );
}
代码示例来源:origin: org.apache.continuum/continuum-core
if ( !project.getVersion().equals( mavenProjectVersion ) )
代码示例来源:origin: org.apache.continuum/continuum-test
public void assertProjectEquals( String name, List<ProjectNotifier> notifiers, String version, Project actual )
{
assertEquals( "project.name", name, actual.getName() );
// assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );
if ( notifiers != null )
{
assertNotNull( "project.notifiers", actual.getNotifiers() );
assertEquals( "project.notifiers.size", notifiers.size(), actual.getNotifiers().size() );
for ( int i = 0; i < notifiers.size(); i++ )
{
ProjectNotifier notifier = notifiers.get( i );
ProjectNotifier actualNotifier = (ProjectNotifier) actual.getNotifiers().get( i );
assertEquals( "project.notifiers.notifier.type", notifier.getType(), actualNotifier.getType() );
assertEquals( "project.notifiers.notifier.configuration.address", notifier.getConfiguration().get(
"address" ), actualNotifier.getConfiguration().get( "address" ) );
}
}
assertEquals( "project.version", version, actual.getVersion() );
}
代码示例来源:origin: org.apache.maven.continuum/continuum-test
public void assertProjectEquals( String name, List notifiers, String version, Project actual )
{
assertEquals( "project.name", name, actual.getName() );
// assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );
if ( notifiers != null )
{
assertNotNull( "project.notifiers", actual.getNotifiers() );
assertEquals( "project.notifiers.size", notifiers.size(), actual.getNotifiers().size() );
for ( int i = 0; i < notifiers.size(); i++ )
{
ProjectNotifier notifier = (ProjectNotifier) notifiers.get( i );
ProjectNotifier actualNotifier = (ProjectNotifier) actual.getNotifiers().get( i );
assertEquals( "project.notifiers.notifier.type", notifier.getType(), actualNotifier.getType() );
assertEquals( "project.notifiers.notifier.configuration.address",
notifier.getConfiguration().get( "address" ),
actualNotifier.getConfiguration().get( "address" ) );
}
}
assertEquals( "project.version", version, actual.getVersion() );
}
代码示例来源:origin: org.apache.continuum/continuum-buildagent-core
if ( StringUtils.isNotEmpty( project.getVersion() ) )
projectMap.put( ContinuumBuildAgentUtil.KEY_PROJECT_VERSION, project.getVersion() );
代码示例来源:origin: org.apache.maven.continuum/continuum-model
serializer.writeEndElement();
if ( project.getVersion() != null )
serializer.writeCharacters( project.getVersion() );
serializer.writeEndElement();
代码示例来源:origin: org.apache.continuum/continuum-xmlrpc-server
String version = project.getVersion();
int idx = version.indexOf( "-SNAPSHOT" );
代码示例来源:origin: org.apache.continuum/continuum-builder
context.put( ContinuumBuildConstant.KEY_PROJECT_ID, project.getId() );
context.put( ContinuumBuildConstant.KEY_PROJECT_NAME, project.getName() );
context.put( ContinuumBuildConstant.KEY_PROJECT_VERSION, project.getVersion() );
context.put( ContinuumBuildConstant.KEY_EXECUTOR_ID, project.getExecutorId() );
context.put( ContinuumBuildConstant.KEY_PROJECT_BUILD_NUMBER, project.getBuildNumber() );
代码示例来源:origin: org.apache.maven.continuum/continuum-core
private static String getProjectId( Project project )
{
String groupId;
String artifactId;
if ( project.getGroupId() == null )
{
groupId = project.getName();
}
else
{
groupId = project.getGroupId();
}
if ( project.getArtifactId() == null )
{
artifactId = project.getName();
}
else
{
artifactId = project.getArtifactId();
}
return groupId + ":" + artifactId + ":" + project.getVersion();
}
代码示例来源:origin: org.apache.maven.continuum/continuum-core
":" + project.getVersion() );
getLogger().info( " " + project.getId() + ":" + project.getName() + ":" + project.getVersion() + ":" +
project.getExecutorId() );
代码示例来源:origin: org.apache.continuum/continuum-api
private static String getProjectId( Project project )
{
String groupId;
String artifactId;
if ( project.getGroupId() == null )
{
groupId = project.getName();
}
else
{
groupId = project.getGroupId();
}
if ( project.getArtifactId() == null )
{
artifactId = project.getName();
}
else
{
artifactId = project.getArtifactId();
}
String projectGroupId = "[" + project.getProjectGroup().getId() + "]";
return projectGroupId + ":" + groupId + ":" + artifactId + ":" + project.getVersion();
}
代码示例来源:origin: org.apache.continuum/continuum-buildagent-core
String version = getValue( mavenProject, "currentVersion", project.getVersion() );
if ( StringUtils.isEmpty( project.getVersion() ) && StringUtils.isEmpty( version ) )
代码示例来源:origin: org.apache.maven.continuum/continuum-core
&& StringUtils.equalsIgnoreCase( project.getVersion(), storedProject.getVersion() )
&& StringUtils.equalsIgnoreCase( project.getScmUrl(), storedProject.getScmUrl() ) )
代码示例来源:origin: org.apache.continuum/continuum-core
StringUtils.equalsIgnoreCase( project.getVersion(), storedProject.getVersion() ) &&
StringUtils.equalsIgnoreCase( project.getScmUrl(), storedProject.getScmUrl() ) )
代码示例来源:origin: org.apache.continuum/continuum-core
project.getVersion() );
log.info( " " + project.getId() + ":" + project.getName() + ":" + project.getVersion() + ":" +
project.getExecutorId() );
代码示例来源:origin: org.apache.maven.continuum/continuum-core
String version = getValue( mavenProject, "currentVersion", project.getVersion() );
if ( StringUtils.isEmpty( project.getVersion() ) && StringUtils.isEmpty( version ) )
内容来源于网络,如有侵权,请联系作者删除!