首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven pom.xml -构建模块+自构建

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

Stack Overflow用户
提问于 2011-09-22 10:24:16
回答 1查看 1.1K关注 0票数 1

我有下一个项目结构:

代码语言:javascript
复制
app
module1
module2
...
moduleN
parent-pom

项目app只包含属性文件和JasperReports的报表模板。app的Pom.xml:

代码语言:javascript
复制
<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>部分之前),但它不起作用(没有调用自构建):

代码语言:javascript
复制
<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中添加自构建模块?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-22 11:05:30

该应用程序项目打包被设置为pom -因此它不能有任何其他工件。您需要将jasper报告移动到其他模块或单独的模块中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7513268

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档