In Maven, how output the classpath being used?

后端 未结 7 1314
庸人自扰
庸人自扰 2020-12-12 23:31

For my current purposes I have a Maven project which creates a war file, and I want to see what actual classpath it is using when creating the war.

7条回答
  •  再見小時候
    2020-12-13 00:12

    The command mvn dependency:list will list the classpath with all the jars used for compilation, runtime and test in the following format:

    INFO] --- maven-dependency-plugin:2.8:list (default-cli) @ MyProject ---
    [INFO]
    [INFO] The following files have been resolved:
    [INFO]    org.netbeans.api:org-openide-filesystems:jar:RELEASE80:compile
    [INFO]    org.netbeans.api:org-netbeans-modules-queries:jar:RELEASE80:compile
    [INFO]    org.netbeans.api:org-netbeans-api-progress:jar:RELEASE80:compile
    [INFO]    org.netbeans.api:org-openide-dialogs:jar:RELEASE80:compile
    [INFO]    org.apache.derby:derby:jar:10.11.1.1:compile
    [INFO]    org.netbeans.api:org-openide-windows:jar:RELEASE80:compile
    

    The only requirement is that the compilation is finished. It doesn't work if the compilation isn't ran.

    An other command is The command mvn dependency:tree.

提交回复
热议问题