【发布时间】:2018-07-18 22:29:11
【问题描述】:
我正在练习 Maven,但我碰壁了。我已经在 IntelliJ 上安装了 PlantUml 插件,我正在尝试对其进行设置,以便它始终在编译时从源文件生成新图像。我正在使用this 插件生成图像,并且我已将 pom.xml 文件配置如下:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.jeluard</groupId>
<artifactId>plantuml-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>GeneratePlantUml</id>
<phase>generate-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/images</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<sourceFiles>
<directory>${basedir}/plantuml</directory>
<includes>
<include>TestGeneratorDiagram.puml</include>
</includes>
</sourceFiles>
<outputDirectory>${basedir}/images</outputDirectory>
</configuration>
<dependencies>
<dependency>
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>8031</version>
</dependency>
</dependencies>
</plugin>
<plugins>
</pluginManagement>
<build>
当我使用指定目标的终端命令时,这可以正常工作:
mvn compile com.github.jeluard:plantuml-maven-plugin:generate
但是,如果我只是写它是行不通的:
mvn compile
据我所知,这也应该有效。我尝试在编译时设置阶段,但它没有改变任何东西。我已经搜索了几个小时来寻找解决方案,但我还没有找到。有谁知道我如何通过配置 pom 强制插件在编译时生成新图像?
【问题讨论】:
标签: java xml maven intellij-idea pom.xml