rules_jvm_external
rules_jvm_external copied to clipboard
pom_file generate pom.xml without project header.
I define a pom_file
pom_file(
name = "yak_core_pom",
targets = [
"//yakboot/yak-core",
],
template_file = "pom_template.xml",
)
when i build this file , it generate pom like
we expected like
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>yak-core</artifactId>
.......
anyone can help?
This is WAI, the pom_file
rule only generates the dependency closure, which is the complex part of the pom file. Have you tried writing a simple genrule
that adds the header you want to the generated pom?
The rule does a substitution within the pom file. A basic one might look something like:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>{groupId}</groupId>
<artifactId>{artifactId}</artifactId>
<version>{version}</version>
<dependencies>
{dependencies}
</dependencies>
</project>