Fill mojo file set with cli argument

I like to generate images from .puml files in a maven project.

What I don't like about the archive is the tight binding between the project and the library that generates the images. Therefore, I like to use this build command:

mvn com.github.jeluard:plantuml-maven-plugin:1.2:generate \
  -Dplantuml.outputDirectory=target \
  -Dplantuml.sourceFiles={*.puml}

So the third line fills sourceFiles-class-variable

Unfortunately, the syntax {*.puml}seems to be wrong:

[INFO] --- plantuml-maven-plugin:1.2:generate (default-cli) @ test ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.047 s
[INFO] Finished at: 2018-02-16T14:50:09+01:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.jeluard:plantuml-maven-plugin:1.2:generate 
        (default-cli) on project test: Unable to parse configuration of mojo 
        com.github.jeluard:plantuml-maven-plugin:1.2:generate for parameter sourceFiles: 
        Cannot find default setter in class org.apache.maven.model.FileSet -> [Help 1]
+4
source share
1 answer

It is better to specify the source set of files through pom.xml and specify this file through -f: mvn -f mypom.xml.

See jeluard / maven-plantuml-plugin Usage :

<build>
  <plugins>
    <plugin>
      <groupId>com.github.jeluard</groupId>
      <artifactId>plantuml-maven-plugin</artifactId>
      <version>1.2</version>
      <configuration>
        <sourceFiles>
          <directory>${basedir}</directory>               <=======
          <includes>
            <include>src/main/plantuml/**/*.txt</include> <=======
          </includes>
        </sourceFiles>
      </configuration>
      <dependencies>
        <dependency>
          <groupId>net.sourceforge.plantuml</groupId>
          <artifactId>plantuml</artifactId>
          <version>7999</version>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</build>
-1
source

Source: https://habr.com/ru/post/1693737/


All Articles