Package org.apache.ivy.plugins.parser.m2
Class PomModuleDescriptorParser
java.lang.Object
org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser
- All Implemented Interfaces:
ModuleDescriptorParser
A parser for Maven 2 POM.
The configurations used in the generated module descriptor mimics the behavior defined by Maven 2 scopes, as documented here. The PomModuleDescriptorParser use a PomDomReader to read the pom, and the PomModuleDescriptorBuilder to write the ivy module descriptor using the info read by the PomDomReader.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PomModuleDescriptorParserprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprivate voidaddSourcesAndJavadocArtifactsIfPresent(PomModuleDescriptorBuilder mdBuilder, ParserSettings ivySettings) private voidaddTo(PomModuleDescriptorBuilder mdBuilder, PomDependencyMgt dep, ParserSettings ivySettings) static PomModuleDescriptorParsergetMetadataArtifact(ModuleRevisionId mrid, Resource res) Returns the module metadata artifact corresponding to the given module revision id that this parser parsesgetType()Return the 'type' of module artifacts this parser is parsingprivate ParseExceptionparseDescriptor(ParserSettings ivySettings, URL descriptorURL, boolean validate) parseDescriptor(ParserSettings ivySettings, URL descriptorURL, Resource res, boolean validate) private ResolvedModuleRevisionparseOtherPom(ParserSettings ivySettings, ModuleRevisionId parentModRevID, boolean isParentPom) voidtoIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md) Convert a module descriptor to an ivy file.toString()
-
Field Details
-
INSTANCE
-
PARENT_MAP_KEY
-
-
Constructor Details
-
PomModuleDescriptorParser
private PomModuleDescriptorParser()
-
-
Method Details
-
getInstance
-
toIvyFile
public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md) throws ParseException, IOException Description copied from interface:ModuleDescriptorParserConvert a module descriptor to an ivy file. This method MUST close the given input stream when job is finished- Specified by:
toIvyFilein interfaceModuleDescriptorParser- Parameters:
is- input stream with opened on original module descriptor resourceres- ResourcedestFile- Filemd- ModuleDescriptor- Throws:
ParseException- if something goes wrongIOException- if something goes wrong
-
accept
- Specified by:
acceptin interfaceModuleDescriptorParser
-
toString
-
getMetadataArtifact
Description copied from interface:ModuleDescriptorParserReturns the module metadata artifact corresponding to the given module revision id that this parser parses- Specified by:
getMetadataArtifactin interfaceModuleDescriptorParser- Parameters:
mrid- the module revision id for which the module artifact should be returnedres- the resource for which the module artifact should be returned- Returns:
- the module artifact corresponding to the given mrid and resource
-
getType
Description copied from interface:ModuleDescriptorParserReturn the 'type' of module artifacts this parser is parsing- Specified by:
getTypein interfaceModuleDescriptorParser- Returns:
- the 'type' of module artifacts this parser is parsing
-
parseDescriptor
public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL, boolean validate) throws ParseException, IOException - Specified by:
parseDescriptorin interfaceModuleDescriptorParser- Throws:
ParseExceptionIOException
-
parseDescriptor
public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL, Resource res, boolean validate) throws ParseException, IOException - Specified by:
parseDescriptorin interfaceModuleDescriptorParser- Throws:
ParseExceptionIOException
-
addTo
private void addTo(PomModuleDescriptorBuilder mdBuilder, PomDependencyMgt dep, ParserSettings ivySettings) throws ParseException, IOException - Throws:
ParseExceptionIOException
-
addSourcesAndJavadocArtifactsIfPresent
private void addSourcesAndJavadocArtifactsIfPresent(PomModuleDescriptorBuilder mdBuilder, ParserSettings ivySettings) -
parseOtherPom
private ResolvedModuleRevision parseOtherPom(ParserSettings ivySettings, ModuleRevisionId parentModRevID, boolean isParentPom) throws ParseException - Throws:
ParseException
-
newParserException
-