小编siv*_*nvi的帖子

Maven多模块项目和Jenkins

我有以下项目以扁平结构的方式组织:

parentProject
+-pom.xml

projectWeb <depends on libraryA and libraryB>
+-pom.xml

libraryA
+-pom.xml

libraryB
+-pom.xml
Run Code Online (Sandbox Code Playgroud)

parentProject中的pom.xml引用了其他模块,并用于继承和dependencyManagement,这里是一个片段:

<project>
    ....
    <modules>
        <module>../projectWeb</module>
        <module>../libraryA</module>
        <module>../libraryB</module>
    </modules>
    <dependencyManagement>
    ...
    </dependencyManagement>
    <build>
    ...
    </build>
    ....
</project>
Run Code Online (Sandbox Code Playgroud)

Jenkins中,我为每个项目都有一个maven作业,当我构建parentProject时,它工作正常,即.构建该modules部分中引用的每个项目.我遇到的问题是当我向SVN提交更改时libraryA,我希望在构建libraryA之后,重建projectWeb将要启动,但这并没有发生.谁知道我做错了什么?

提前致谢.

编辑

当我删除该modules部分时parentProject\pom.xml,它按预期工作,但我放弃了拥有父pom的聚合优势.

java maven multi-module jenkins

6
推荐指数
1
解决办法
8106
查看次数

运行mvn checkstyle时出错:checkstyle

执行命令时出现以下错误mvn checkstyle:checkstyle:

An error has occurred in Checkstyle report generation.
...
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Unable to instantiate GenericIllegalRegexp
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:178)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
    at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:170)
    at org.apache.maven.plugin.checkstyle.AbstractCheckstyleReport.executeReport(AbstractCheckstyleReport.java:259)
    ... 24 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate GenericIllegalRegexp
    at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:155)
    at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:161)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:157)
... 27 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate GenericIllegalRegexpCheck
    at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:98)
    at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:152)
    ... 30 more
Run Code Online (Sandbox Code Playgroud)

我猜这个错误与使用旧版checkstyle创建的规则有关.

pom.xml中的checkstyle插件配置是:

...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
<configuration>
    <configLocation>checkstyle.xml</configLocation>
    <headerLocation>LICENSE.txt</headerLocation>
</configuration>
</plugin> …
Run Code Online (Sandbox Code Playgroud)

java plugins eclipse-plugin checkstyle maven

2
推荐指数
1
解决办法
3725
查看次数