I am creating a new Maven plugin, following the instructions here.
I can create a new parameter, as per the documentation, like this:
@Parameter( property = "sayhi.greeting", defaultValue = "Hello World!" )
private String greeting;
Now I want to use this in my pom.xml
<plugin>
<groupId>com.foo</groupId>
<artifactId>my-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate-client-source</goal>
</goals>
</execution>
</executions>
<configuration>
<greeting>Hello, world!</greeting>
</configuration>
</plugin>
However my editor of choice (IntelliJ) doesn't know about my plugin's parameter, so the <greeting>
element is turned red, warning me of a possible syntax error.
I could create an XSD and add it to the <project>
element, but I have a couple of questions.
- Is it possible to auto-generate the XSD from my source files, and have it packaged as part of the plugin build process?
- How do I reference it in my
<project>
element?