本文整理了Java中org.apache.maven.model.Model.setPomFile()
方法的一些代码示例,展示了Model.setPomFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.setPomFile()
方法的具体详情如下:
包路径:org.apache.maven.model.Model
类名称:Model
方法名:setPomFile
暂无
代码示例来源:origin: apache/maven
@Override
public Model read( File input, Map<String, ?> options )
throws IOException
{
Objects.requireNonNull( input, "input cannot be null" );
Model model = read( new FileInputStream( input ), options );
model.setPomFile( input );
return model;
}
代码示例来源:origin: stackoverflow.com
Model model = null;
FileReader reader = null;
MavenXpp3Reader mavenreader = new MavenXpp3Reader();
try {
reader = new FileReader(pomfile);
model = mavenreader.read(reader);
model.setPomFile(pomfile);
}catch(Exception ex){}
MavenProject project = new MavenProject(model);
代码示例来源:origin: apache/maven
model.setPomFile( pomFile );
代码示例来源:origin: takari/polyglot-maven
@Override
public Model read(final File input, final Map<String, ?> options) throws IOException, ModelParseException {
Model model;
Reader reader = new BufferedReader(new FileReader(input));
try {
model = read(reader, options);
model.setPomFile(input);
} finally {
IOUtil.close(reader);
}
return model;
}
代码示例来源:origin: takari/polyglot-maven
public Model read(final File input, final Map<String, ?> options) throws IOException {
Model model;
Reader reader = new BufferedReader(new FileReader(input));
try {
model = read(reader, options);
model.setPomFile(input);
} finally {
IOUtil.close(reader);
}
return model;
}
代码示例来源:origin: mulesoft/mule
/**
* Creates a {@link Model} by reading the {@code pom.xml} file.
*
* @param pomFile to parse and read the model
* @return {@link Model} representing the Maven project from pom file.
*/
public static Model createMavenProject(File pomFile) {
MavenXpp3Reader mavenReader = new MavenXpp3Reader();
if (pomFile != null && pomFile.exists()) {
try (FileReader reader = new FileReader(pomFile)) {
Model model = mavenReader.read(reader);
model.setPomFile(pomFile);
return model;
} catch (Exception e) {
throw new RuntimeException("Couldn't get Maven Artifact from pom: " + pomFile);
}
}
throw new IllegalArgumentException("pom file doesn't exits for path: " + pomFile);
}
}
代码示例来源:origin: apache/maven
interpolatedModel.setPomFile( model.getPomFile() );
代码示例来源:origin: takari/polyglot-maven
public synchronized Model parse( String ruby, File source, Map<String, ?> options )
{
Model model = this.jruby.callMethod( this.parser,
"parse",
new Object[] { ruby,
this.factory,
source != null ? source.getAbsolutePath() : null },
Model.class );
model.setPomFile( source );
executeManager.register( model, this.factory.getExecuteTasks() );
executeManager.install( model, options );
return model;
}
}
代码示例来源:origin: takari/polyglot-maven
model.setPomFile(pom);
return model;
} else {
代码示例来源:origin: com.buschmais.jqassistant.plugin/jqassistant.plugin.m2repo
@Override
public void setPomFile(File pomFile) {
delegate.setPomFile(pomFile);
}
代码示例来源:origin: mojohaus/flatten-maven-plugin
@Override
public void set( Model model, File value )
{
model.setPomFile( value );
};
};
代码示例来源:origin: ru.yandex.qatools.clay/clay-maven-settings-builder
public FluentModelBuilder withPomFile(File pomFile) {
model.setPomFile(pomFile);
return this;
}
代码示例来源:origin: org.sonatype.pmaven/pmaven-common
public Model read(final File input, final Map<String,?> options) throws IOException {
Model model;
Reader reader = new BufferedReader(new FileReader(input));
try {
model = read(reader, options);
model.setPomFile(input);
}
finally {
IOUtil.close(reader);
}
return model;
}
代码示例来源:origin: org.apache.maven/maven-model-builder
@Override
public Model read( File input, Map<String, ?> options )
throws IOException
{
Objects.requireNonNull( input, "input cannot be null" );
Model model = read( new FileInputStream( input ), options );
model.setPomFile( input );
return model;
}
代码示例来源:origin: org.sonatype.pmaven/pmaven-common
public Model read(final File input, final Map<String,?> options) throws IOException, ModelParseException {
Model model;
Reader reader = new BufferedReader(new FileReader(input));
try {
model = read(reader, options);
model.setPomFile(input);
}
finally {
IOUtil.close(reader);
}
return model;
}
代码示例来源:origin: net.wetheinter/xapi-dev-maven
@Override
public Model loadPomFile(String pomLocation) throws IOException,
XmlPullParserException {
File pomfile = new File(pomLocation);
FileReader reader = null;
MavenXpp3Reader mavenreader = new MavenXpp3Reader();
reader = new FileReader(pomfile);
Model model = mavenreader.read(reader);
model.setPomFile(pomfile);
return model;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-maven-embedder
static void normalizePath(Model model) {
if (model != null) {
File f = model.getPomFile();
if (f != null) {
model.setPomFile(FileUtil.normalizeFile(f));
}
}
}
代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin
public Project(String groupId, String artifactId, String version, String path) {
model = new Model();
model.setGroupId(groupId);
model.setArtifactId(artifactId);
model.setVersion(version);
if (path != null) {
model.setPomFile(new File(path, "pom.xml"));
}
}
代码示例来源:origin: hmvictor/radar-netbeans
public static Model createModel(Project project) throws MvnModelInputException {
FileObject pomFile = getPomFileObject(project);
MavenXpp3Reader mavenreader = new MavenXpp3Reader();
try (Reader reader = new InputStreamReader(pomFile.getInputStream())) {
Model model = mavenreader.read(reader);
model.setPomFile(new File(pomFile.getPath()));
return model;
} catch (XmlPullParserException | IOException ex) {
throw new MvnModelInputException(ex);
}
}
代码示例来源:origin: hmvictor/radar-netbeans
public Model createModel(FileObject projectDir) throws MvnModelInputException {
FileObject pomFile = projectDir.getFileObject("pom.xml");
MavenXpp3Reader mavenreader = new MavenXpp3Reader();
try(Reader reader=new InputStreamReader(pomFile.getInputStream())){
Model model = mavenreader.read(reader);
model.setPomFile(new File(pomFile.getPath()));
return model;
}catch(XmlPullParserException | IOException ex) {
throw new MvnModelInputException(ex);
}
}
内容来源于网络,如有侵权,请联系作者删除!