MiGo
MiGo

Reputation: 763

How can I access my elements and attributes from custom xml file into pom.xml of project?

I have an xml file in my project named ifs.xml containing some xml elements and attributes. I want to read some value from it into my pom.xml file which is at root directlry. Is there a way to achieve this? Do I need some plugin for that ?

For example my ifs.xml is:

        <client name="abc" identifier="xyz">
            <description>asaascasc</description>
        </client>

and in my pom.xml i want to read these values say "name" attribute of "client" element. How can i do that ???? Can i do that via xpath expressions???

Upvotes: 0

Views: 148

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35785

No.

You cannot read external XML into a POM.

You can read properties from external properties files, but these properties can then only be used at certain places in the POM.

My advice: Ask a new question here on SO where you describe the concrete problem that you want to solve and we can try to find a solution for that (which does not need any XML importing mechanism).

Upvotes: 0

Related Questions