Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
tesla-polyglot
pomless-tycho.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pomless-tycho.patch of Package tesla-polyglot
--- polyglot-maven-polyglot-0.4.5/polyglot-common/src/main/java/org/sonatype/maven/polyglot/TeslaModelProcessor.java +++ polyglot-maven-polyglot-0.4.5/polyglot-common/src/main/java/org/sonatype/maven/polyglot/TeslaModelProcessor.java @@ -60,22 +60,20 @@ assert manager != null; File pomFile = manager.locatePom(dir); - if (pomFile == null) { - throw new AssertionError("pom file must not be null from PolyglotModelManager as per API"); - } - if (pomFile.getName().equals("pom.xml") && pomFile.getParentFile().equals(dir)) { - // behave like proper maven in case there is no pom from manager - return pomFile; - } - File polyglotPomFile = new File(pomFile.getParentFile(), ".polyglot." + pomFile.getName()); - try { - if (polyglotPomFile.createNewFile()) { - polyglotPomFile.deleteOnExit(); + if (pomFile != null && !pomFile.getName().endsWith(".pom") && !pomFile.getName().endsWith(".xml")) { + pomFile = new File(pomFile.getParentFile(), ".polyglot." + pomFile.getName()); + try { + pomFile.createNewFile(); + pomFile.deleteOnExit(); + } catch (IOException e) { + throw new RuntimeException("error creating empty file", e); } - } catch (IOException e) { - throw new RuntimeException("error creating empty file", e); + } else { + // behave like proper maven in case there is no pom from manager + pomFile = new File(dir, "pom.xml"); } - return polyglotPomFile; + + return pomFile; } @Override @@ -108,13 +106,13 @@ log.debug(source.getLocation()); File pom = new File(source.getLocation()); - File realPom = new File(pom.getPath().replaceFirst("[.]polyglot[.]", "")); + source = new FileModelSource(new File(pom.getPath().replaceFirst("[.]polyglot[.]", ""))); - ((Map) options).put(ModelProcessor.SOURCE, new FileModelSource(realPom)); + ((Map) options).put(ModelProcessor.SOURCE, source); ModelReader reader = manager.getReaderFor(options); - Model model = reader.read(realPom, options); - PolyglotPropertiesEnhancer.enhanceModel(manager.getEnhancementPropertiesFor(options), model); + Model model = reader.read(source.getInputStream(), options); + MavenXpp3Writer xmlWriter = new MavenXpp3Writer(); StringWriter xml = new StringWriter(); xmlWriter.write(xml, model);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor