繁体   English   中英

Maven pom.xml-构建模块+自构建

[英]Maven pom.xml - build modules + self build

我有下一个项目结构:

app
module1
module2
...
moduleN
parent-pom

Project app仅包含属性文件和JasperReports的报告模板。 应用程序的Pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

<parent>
    <groupId>my-group</groupId>
    <artifactId>parent-pom</artifactId>
    <version>1.0.0</version>
    <relativePath>../parent-pom</relativePath>
</parent>

<artifactId>app</artifactId>
<version>${app-version}</version>
<packaging>pom</packaging>
<modules>
    <module>../module1</module>
    <module>../module2</module>
    ...
    <module>../moduleN</module>
</modules>

我想为项目应用程序添加jasperreports-maven-plugin 我已经尝试了下一个代码(在<modules>部分之前),但是它不起作用(未调用self build):

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jasperreports-maven-plugin</artifactId>
            <configuration>
                <sourceDirectory>${basedir}/config/templates</sourceDirectory>
                <outputDirectory>${basedir}/config/templates</outputDirectory>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>compile-reports</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>net.sf.jasperreports</groupId>
                    <artifactId>jasperreports</artifactId>
                    <version>${jasperreports.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

是否可以使用模块向pom添加自构建?

该应用程序项目的包装设置为pom-因此它不能包含任何其他工件。 您将需要将jasper报告移至其他模块之一或单独的模块。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM