why is “test-jar” dependency required for “mvn compile”

后端 未结 4 1495
名媛妹妹
名媛妹妹 2021-02-02 13:38

I\'m having trouble using test-jar dependencies in a multi-module project. For example, when I declare that the cleartk-syntax module depends on the

4条回答
  •  耶瑟儿~
    2021-02-02 14:21

    So I did some serious debugging, and discovered that the problem seems to be an interaction between the exec:java plugin, test-jar dependencies and mvn compile.

    In short, if you attach exec:java to an execution phase, mvn compile starts looking for test-jar dependencies at compile time. If you remove the element from the exec:java plugin declaration, mvn compile works fine again.

    I filed a bug report for the exec:java plugin here, though I can't really tell whether the bug is in exec:java, test-jar or mvn compile so perhaps the bug will be moved somewhere else if/when someone figures that out:

    http://jira.codehaus.org/browse/MEXEC-91

    Update: It's not really a bug, the maven-exec-plugin is documented as requiring test dependencies here:

    http://mojo.codehaus.org/exec-maven-plugin/java-mojo.html

    That doesn't mean it wouldn't make a great feature. ;-)

提交回复
热议问题