本文整理匯總了Java中org.apache.maven.model.Model.setPackaging方法的典型用法代碼示例。如果您正苦於以下問題:Java Model.setPackaging方法的具體用法?Java Model.setPackaging怎麽用?Java Model.setPackaging使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.maven.model.Model
的用法示例。
在下文中一共展示了Model.setPackaging方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: pomFileWithDependencies
import org.apache.maven.model.Model; //導入方法依賴的package包/類
@And("^POM file with dependencies:$")
public void pomFileWithDependencies(List<MavenDependencySpec> dependencies) throws Throwable {
for (MavenDependencySpec dependency : dependencies) {
dependency.setExcludes(dependency.excludes);
}
Model model = new Model();
model.setModelVersion("4.0.0");
model.setGroupId("com.example");
model.setArtifactId("example-artifact");
model.setVersion("1.0.0-SNAPSHOT");
model.setPackaging("pom");
dependencies.forEach(model::addDependency);
Path pomFile = projectDir.resolve("pom.xml");
new MavenXpp3Writer().write(Files.newBufferedWriter(pomFile), model);
}
示例2: pomExecution
import org.apache.maven.model.Model; //導入方法依賴的package包/類
@Override
protected TOExecutionResult pomExecution(String relativePomFile, Model model) {
model.setPackaging(packagingType);
String details = String.format("Packaging for POM file %s has been changed to %s", relativePomFile, packagingType);
return TOExecutionResult.success(this, details);
}