本文整理汇总了Java中org.apache.maven.model.Build.setFinalName方法的典型用法代码示例。如果您正苦于以下问题:Java Build.setFinalName方法的具体用法?Java Build.setFinalName怎么用?Java Build.setFinalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Build
的用法示例。
在下文中一共展示了Build.setFinalName方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
AbstractProjectStub(String pomResourceName) throws IOException, XmlPullParserException {
super(new MavenXpp3Reader().read(ITCompileBundleMojo.class.getResourceAsStream(pomResourceName)));
Model model = getModel();
setGroupId(model.getGroupId());
setArtifactId(model.getArtifactId());
setVersion(model.getVersion());
setName(model.getName());
setUrl(model.getUrl());
setPackaging(model.getPackaging());
SimpleArtifactStub artifact = new SimpleArtifactStub(
model.getGroupId(), model.getArtifactId(), model.getVersion(), model.getPackaging());
artifact.setArtifactHandler(new SimpleArtifactHandlerStub(model.getPackaging()));
setArtifact(artifact);
Build build = new Build();
build.setFinalName(model.getArtifactId() + '-' + model.getVersion());
setBuild(build);
for (Dependency dependency: model.getDependencies()) {
if (dependency.getScope() == null) {
dependency.setScope(JavaScopes.COMPILE);
}
}
}
示例2: testTwoExpressions
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public void testTwoExpressions()
throws Exception
{
Build build = new Build();
build.setDirectory( "expected-directory" );
build.setFinalName( "expected-finalName" );
Model model = new Model();
model.setBuild( build );
ExpressionEvaluator expressionEvaluator =
createExpressionEvaluator( new MavenProject( model ), null, new Properties() );
Object value = expressionEvaluator.evaluate( "${project.build.directory}" + FS + "${project.build.finalName}" );
assertEquals( "expected-directory" + File.separatorChar + "expected-finalName", value );
}
示例3: ProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
* Default constructor
*/
public ProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try {
model = pomReader.read(ReaderFactory.newXmlReader(new File(getBasedir(), "pom.xml")));
setModel(model);
} catch (Exception e) {
throw new RuntimeException(e);
}
setGroupId(model.getGroupId());
setArtifactId(model.getArtifactId());
setVersion(model.getVersion());
setName(model.getName());
setUrl(model.getUrl());
setPackaging(model.getPackaging());
Build build = new Build();
build.setFinalName(model.getArtifactId());
build.setDirectory(getBasedir() + "/target");
build.setSourceDirectory(getBasedir() + "/src/main/java");
build.setOutputDirectory(getBasedir() + "/target/classes");
build.setTestSourceDirectory(getBasedir() + "/src/test/java");
build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
setBuild(build);
List<String> compileSourceRoots = new ArrayList<String>();
compileSourceRoots.add(getBasedir() + "/src/main/java");
setCompileSourceRoots(compileSourceRoots);
List<String> testCompileSourceRoots = new ArrayList<String>();
testCompileSourceRoots.add(getBasedir() + "/src/test/java");
setTestCompileSourceRoots(testCompileSourceRoots);
}
示例4: setupBuild
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private void setupBuild(Model model) {
Build build = new Build();
build.setFinalName(model.getArtifactId());
build.setDirectory(getBasedir() + "/target");
build.setSourceDirectory(getBasedir() + "/src/main/java");
build.setOutputDirectory(getBasedir() + "/target/classes");
build.setTestSourceDirectory(getBasedir() + "/src/test/java");
build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
build.setPlugins(model.getBuild().getPlugins());
setBuild(build);
}
示例5: TypeScriptDTOGeneratorMojoProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/** Default constructor */
public TypeScriptDTOGeneratorMojoProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try {
model = pomReader.read(ReaderFactory.newXmlReader(new File(getBasedir(), "pom.xml")));
setModel(model);
} catch (Exception e) {
throw new RuntimeException(e);
}
setGroupId(model.getGroupId());
setArtifactId(model.getArtifactId());
setVersion(model.getVersion());
setName(model.getName());
setUrl(model.getUrl());
setPackaging(model.getPackaging());
Build build = new Build();
build.setFinalName(model.getArtifactId());
build.setDirectory(getBasedir() + "/target");
build.setSourceDirectory(getBasedir() + "/src/main/java");
build.setOutputDirectory(getBasedir() + "/target/classes");
build.setTestSourceDirectory(getBasedir() + "/src/test/java");
build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
setBuild(build);
List compileSourceRoots = new ArrayList();
compileSourceRoots.add(getBasedir() + "/src/main/java");
setCompileSourceRoots(compileSourceRoots);
List testCompileSourceRoots = new ArrayList();
testCompileSourceRoots.add(getBasedir() + "/src/test/java");
setTestCompileSourceRoots(testCompileSourceRoots);
}
示例6: DynaModuleListGeneratorMojoProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/** Default constructor */
public DynaModuleListGeneratorMojoProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try {
model = pomReader.read(ReaderFactory.newXmlReader(new File(getBasedir(), "pom.xml")));
setModel(model);
} catch (Exception e) {
throw new RuntimeException(e);
}
setGroupId(model.getGroupId());
setArtifactId(model.getArtifactId());
setVersion(model.getVersion());
setName(model.getName());
setUrl(model.getUrl());
setPackaging(model.getPackaging());
setDependencies(model.getDependencies());
Build build = new Build();
build.setFinalName(model.getArtifactId());
build.setDirectory(getBasedir() + "/target");
build.setSourceDirectory(getBasedir() + "/src/main/java");
build.setOutputDirectory(getBasedir() + "/target/classes");
build.setTestSourceDirectory(getBasedir() + "/src/test/java");
build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
setBuild(build);
List compileSourceRoots = new ArrayList();
compileSourceRoots.add(getBasedir() + "/src/main/java");
setCompileSourceRoots(compileSourceRoots);
List testCompileSourceRoots = new ArrayList();
testCompileSourceRoots.add(getBasedir() + "/src/test/java");
setTestCompileSourceRoots(testCompileSourceRoots);
}
示例7: initiate
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private void initiate()
{
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try
{
model = pomReader.read( ReaderFactory.newXmlReader( new File( getBasedir(), "pom.xml" ) ) );
setModel( model );
}
catch ( Exception e )
{
throw new RuntimeException( e );
}
setGroupId( model.getGroupId() );
setArtifactId( model.getArtifactId() );
setVersion( model.getVersion() );
setName( model.getName() );
setUrl( model.getUrl() );
setPackaging( model.getPackaging() );
Build build = new Build();
build.setFinalName( model.getArtifactId() );
build.setDirectory( getBasedir() + "/target" );
build.setSourceDirectory( getBasedir() + "/src/main/java" );
build.setOutputDirectory( getBasedir() + "/target/classes" );
build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
build.setTestOutputDirectory( getBasedir() + "/target/test-classes" );
setBuild( build );
List<String> compileSourceRoots = new ArrayList<String>();
compileSourceRoots.add( getBasedir() + "/src/main/java" );
setCompileSourceRoots( compileSourceRoots );
List<String> testCompileSourceRoots = new ArrayList<String>();
testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
setTestCompileSourceRoots( testCompileSourceRoots );
}
示例8: CreateSpdxMavenProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public CreateSpdxMavenProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try
{
model = pomReader.read( ReaderFactory.newXmlReader( new File( getBasedir(), "pom.xml" ) ) );
setModel( model );
}
catch ( Exception e )
{
throw new RuntimeException( e );
}
setGroupId( model.getGroupId() );
setArtifactId( model.getArtifactId() );
setVersion( model.getVersion() );
setName( model.getName() );
setUrl( model.getUrl() );
setPackaging( model.getPackaging() );
Build build = new Build();
build.setFinalName( model.getArtifactId() );
build.setDirectory( getBasedir() + "/target" );
build.setSourceDirectory( getBasedir() + "/src/main/java" );
build.setOutputDirectory( getBasedir() + "/target/classes" );
build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
build.setTestOutputDirectory( getBasedir() + "/target/test-classes" );
setBuild( build );
List<String> compileSourceRoots = new ArrayList<String>();
compileSourceRoots.add( getBasedir() + "/src/main/java" );
setCompileSourceRoots( compileSourceRoots );
List<String> testCompileSourceRoots = new ArrayList<String>();
testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
setTestCompileSourceRoots( testCompileSourceRoots );
}
示例9: testGetArtifactLocalFileNameOverride
import org.apache.maven.model.Build; //导入方法依赖的package包/类
@Test
public void testGetArtifactLocalFileNameOverride() {
Model model = new Model();
Build build = new Build();
build.setFinalName("test");
model.setBuild(build);
model.setGroupId("group.subgroup");
model.setArtifactId("artifact.subartifact");
model.setVersion("1.0");
model.setPackaging("jar");
assertEquals("test.jar", getArtifactLocalFileName(model));
}
示例10: nestedPropertyFoundSincePropertyIsSet
import org.apache.maven.model.Build; //导入方法依赖的package包/类
@Test
public void nestedPropertyFoundSincePropertyIsSet()
{
final String finalName = "buildmetadata-maven-plugin-1.0.0.jar";
final Build build = new Build();
build.setFinalName(finalName);
projectModel.setBuild(build);
final String value = uut.getProperty("project.build.finalName");
assertEquals(finalName, value);
}
开发者ID:release-engineering,项目名称:buildmetadata-maven-plugin,代码行数:13,代码来源:MavenPropertyHelperProjectPropertyTest.java
示例11: CreateSpdxMavenProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public CreateSpdxMavenProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try
{
model = pomReader.read( ReaderFactory.newXmlReader( new File( getBasedir(), "pom.xml" ) ) );
setModel( model );
}
catch ( Exception e )
{
throw new RuntimeException( e );
}
setGroupId( model.getGroupId() );
setArtifactId( model.getArtifactId() );
setVersion( model.getVersion() );
setName( model.getName() );
setUrl( model.getUrl() );
setPackaging( model.getPackaging() );
Build build = new Build();
build.setFinalName( model.getArtifactId() );
build.setDirectory( getBasedir() + "/target" );
build.setSourceDirectory( getBasedir() + "/src/main/java" );
build.setOutputDirectory( getBasedir() + "/target/classes" );
build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
build.setTestOutputDirectory( getBasedir() + "/target/test-classes" );
setBuild( build );
Reporting reporting = new Reporting();
reporting.setOutputDirectory( getBaseDir() + "/target/site" );
setReporting( reporting );
List<String> compileSourceRoots = new ArrayList<String>();
compileSourceRoots.add( getBasedir() + "/src/main/java" );
setCompileSourceRoots( compileSourceRoots );
List<String> testCompileSourceRoots = new ArrayList<String>();
testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
setTestCompileSourceRoots( testCompileSourceRoots );
}
示例12: ProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
* Default constructor
*/
public ProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try {
model = pomReader.read(ReaderFactory.newXmlReader(new File(getBasedir(), "pom.xml")));
setModel(model);
} catch (Exception e) {
throw new RuntimeException(e);
}
Artifact artifact = new ArtifactStub();
artifact.setArtifactId(model.getArtifactId());
artifact.setGroupId(model.getGroupId());
artifact.setVersion(model.getVersion());
setArtifact(artifact);
setGroupId(model.getGroupId());
setArtifactId(model.getArtifactId());
setVersion(model.getVersion());
setName(model.getName());
setUrl(model.getUrl());
setPackaging(model.getPackaging());
Build build = new Build();
build.setFinalName(model.getArtifactId());
build.setDirectory(getBasedir() + "/target");
build.setSourceDirectory(getBasedir() + "/src/main/java");
build.setOutputDirectory(getBasedir() + "/target/classes");
build.setTestSourceDirectory(getBasedir() + "/src/test/java");
build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
setBuild(build);
List<String> compileSourceRoots = new ArrayList<String>();
compileSourceRoots.add(getBasedir() + "/src/main/java");
setCompileSourceRoots(compileSourceRoots);
List<String> testCompileSourceRoots = new ArrayList<String>();
testCompileSourceRoots.add(getBasedir() + "/src/test/java");
setTestCompileSourceRoots(testCompileSourceRoots);
}
示例13: assembleBuildInheritance
import org.apache.maven.model.Build; //导入方法依赖的package包/类
@SuppressWarnings( "unchecked" )
public void assembleBuildInheritance( Build childBuild, Build parentBuild, boolean handleAsInheritance )
{
// The build has been set but we want to step in here and fill in
// values that have not been set by the child.
if ( childBuild.getSourceDirectory() == null )
{
childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
}
if ( childBuild.getScriptSourceDirectory() == null )
{
childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
}
if ( childBuild.getTestSourceDirectory() == null )
{
childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
}
if ( childBuild.getOutputDirectory() == null )
{
childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
}
if ( childBuild.getTestOutputDirectory() == null )
{
childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
}
// Extensions are accumulated
mergeExtensionLists( childBuild, parentBuild );
if ( childBuild.getDirectory() == null )
{
childBuild.setDirectory( parentBuild.getDirectory() );
}
if ( childBuild.getDefaultGoal() == null )
{
childBuild.setDefaultGoal( parentBuild.getDefaultGoal() );
}
if ( childBuild.getFinalName() == null )
{
childBuild.setFinalName( parentBuild.getFinalName() );
}
ModelUtils.mergeFilterLists( childBuild.getFilters(), parentBuild.getFilters() );
List<Resource> resources = childBuild.getResources();
if ( ( resources == null ) || resources.isEmpty() )
{
childBuild.setResources( parentBuild.getResources() );
}
resources = childBuild.getTestResources();
if ( ( resources == null ) || resources.isEmpty() )
{
childBuild.setTestResources( parentBuild.getTestResources() );
}
// Plugins are aggregated if Plugin.inherit != false
ModelUtils.mergePluginLists( childBuild, parentBuild, handleAsInheritance );
// Plugin management :: aggregate
PluginManagement dominantPM = childBuild.getPluginManagement();
PluginManagement recessivePM = parentBuild.getPluginManagement();
if ( ( dominantPM == null ) && ( recessivePM != null ) )
{
// FIXME: Filter out the inherited == false stuff!
childBuild.setPluginManagement( recessivePM );
}
else
{
ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(), false );
}
}
示例14: PkgProjectStub
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
* Default constructor
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public PkgProjectStub(File pom) {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model;
try {
model = pomReader.read(ReaderFactory.newXmlReader(pom));
setModel(model);
} catch (Exception e) {
throw new RuntimeException(e);
}
setGroupId(model.getGroupId());
setArtifactId(model.getArtifactId());
setVersion(model.getVersion());
setName(model.getName());
setUrl(model.getUrl());
setPackaging(model.getPackaging());
List<ArtifactRepository> artifacRepoList = Collections.emptyList();
setRemoteArtifactRepositories(artifacRepoList);
Build build = new Build();
build.setFinalName(model.getArtifactId());
build.setDirectory(getBasedir() + "/target");
build.setSourceDirectory(getBasedir() + "/src/main/java");
build.setOutputDirectory(getBasedir() + "/target/classes");
build.setTestSourceDirectory(getBasedir() + "/src/test/java");
build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
setBuild(build);
setDependencies(model.getDependencies());
this.setDependencyArtifacts(new HashSet());
List compileSourceRoots = new ArrayList();
compileSourceRoots.add(getBasedir() + "/src/main/java");
setCompileSourceRoots(compileSourceRoots);
List testCompileSourceRoots = new ArrayList();
testCompileSourceRoots.add(getBasedir() + "/src/test/java");
setTestCompileSourceRoots(testCompileSourceRoots);
}