Closed larissaleite closed 4 years ago
See the https://github.com/sylvainlaurent/yaml-json-validator-maven-plugin. It shows how to use <includes>
.
I did, I have a bunch of YAML files under several nested directories inside a top-level configs directory and using <include>${basedir}/configs/**/*.yml</include>
doesn't work.
Closing this issue as I realized that it's not necessary to have ${basedir}
in the path. Without ${basedir}
it works
Sorry to comment on closed issue, but I have the same problem, minimal repro pom + yaml : https://github.com/cvakiitho/yaml-maven-example/blob/master/pom.xml
@cvakiitho You are doing it wrong. You only introduced the plugin management but you forgot to invoke the plugin. Also, you put ...
for a version. This fixes it:
diff --git a/pom.xml b/pom.xml
index 61bae5a..580eacd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
<plugin>
<groupId>com.github.sylvainlaurent.maven</groupId>
<artifactId>yaml-json-validator-maven-plugin</artifactId>
- <version>...</version>
+ <version>1.0.4</version>
<executions>
<execution>
<id>validate</id>
@@ -42,5 +42,11 @@
</plugin>
</plugins>
</pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.github.sylvainlaurent.maven</groupId>
+ <artifactId>yaml-json-validator-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
</build>
</project>
Thanks @wilx! Long time has passed since I used maven plugins, my bad.
Hi! I have been trying to use the plugin but it doesn't find YAML files that are not in src/main/resources. I have a different structure on my project and would very much like to use this to validate my YAML files. Is there a workaround?
Thanks!