打包包含wro4j maven插件的maven项目时出现问题

问题描述 投票:0回答:2

我正在尝试打包maven项目,但出现以下错误:

"C:\Program Files\Java\jdk-18.0.1.1\bin\java.exe" "-Dmaven.multiModuleProjectDirectory=C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic" -Dmaven.home=C:\Users\User\.m2\wrapper\dists\apache-maven-3.5.3-bin\2c22a6s60afpuloj4v181qvild\apache-maven-3.5.3 -Dclassworlds.conf=C:\Users\User\.m2\wrapper\dists\apache-maven-3.5.3-bin\2c22a6s60afpuloj4v181qvild\apache-maven-3.5.3\bin\m2.conf "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA 2022.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2022.2\lib\idea_rt.jar=52152:C:\Program Files\JetBrains\IntelliJ IDEA 2022.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\User\.m2\wrapper\dists\apache-maven-3.5.3-bin\2c22a6s60afpuloj4v181qvild\apache-maven-3.5.3\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2022.2 package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] sfg-pet-clinic                                                     [pom]
[INFO] pet-clinic-data                                                    [jar]
[INFO] pet-clinic-web                                                     [jar]
[INFO] 
[INFO] ----------------< guru.springframework:sfg-pet-clinic >-----------------
[INFO] Building sfg-pet-clinic 0.0.5-SNAPSHOT                             [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.0.3.RELEASE:repackage (default) @ sfg-pet-clinic ---
[INFO] 
[INFO] ----------------< guru.springframework:pet-clinic-data >----------------
[INFO] Building pet-clinic-data 0.0.5-SNAPSHOT                            [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ pet-clinic-data ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-data\src\main\resources
[INFO] skip non existing resourceDirectory C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-data\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ pet-clinic-data ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ pet-clinic-data ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-data\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ pet-clinic-data ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ pet-clinic-data ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ pet-clinic-data ---
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.0.3.RELEASE:repackage (default) @ pet-clinic-data ---
[INFO] 
[INFO] ----------------< guru.springframework:pet-clinic-web >-----------------
[INFO] Building pet-clinic-web 0.0.5-SNAPSHOT                             [3/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- wro4j-maven-plugin:1.8.0:run (default) @ pet-clinic-web ---
[INFO] C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-web/src/main/less
[INFO] Executing the mojo: 
[INFO] Wro4j Model path: C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-web\src\main\wro\wro.xml
[INFO] targetGroups: null
[INFO] minimize: true
[INFO] ignoreMissingResources: null
[INFO] parallelProcessing: false
[INFO] buildDirectory: C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-web\target
[INFO] destinationFolder: C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-web\target
[INFO] cssDestinationFolder: C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-web\target\classes\static\resources\css
[INFO] The following groups will be processed: [petclinic]
[INFO] folder: C:\Users\User\Desktop\Main\Self Education\Java\Projects\sfg-pet-clinic\pet-clinic-web\target\classes\static\resources\css
[INFO] processing group: petclinic.css
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] sfg-pet-clinic 0.0.5-SNAPSHOT ...................... SUCCESS [  5.159 s]
[INFO] pet-clinic-data .................................... SUCCESS [  3.809 s]
[INFO] pet-clinic-web 0.0.5-SNAPSHOT ...................... FAILURE [ 18.727 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.788 s
[INFO] Finished at: 2022-09-16T17:34:08+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal ro.isdc.wro4j:wro4j-maven-plugin:1.8.0:run (default) on project pet-clinic-web: Execution default of goal ro.isdc.wro4j:wro4j-maven-plugin:1.8.0:run failed: An API incompatibility was encountered while executing ro.isdc.wro4j:wro4j-maven-plugin:1.8.0:run: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>ro.isdc.wro4j:wro4j-maven-plugin:1.8.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/User/.m2/repository/ro/isdc/wro4j/wro4j-maven-plugin/1.8.0/wro4j-maven-plugin-1.8.0.jar
[ERROR] urls[1] = file:/C:/Users/User/.m2/repository/org/webjars/bootstrap/3.3.6/bootstrap-3.3.6.jar
[ERROR] urls[2] = file:/C:/Users/User/.m2/repository/org/webjars/jquery/1.11.1/jquery-1.11.1.jar
[ERROR] urls[3] = file:/C:/Users/User/.m2/repository/ro/isdc/wro4j/wro4j-core/1.8.0/wro4j-core-1.8.0.jar
[ERROR] urls[4] = file:/C:/Users/User/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
[ERROR] urls[5] = file:/C:/Users/User/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] urls[6] = file:/C:/Users/User/.m2/repository/ro/isdc/wro4j/wro4j-extensions/1.8.0/wro4j-extensions-1.8.0.jar
[ERROR] urls[7] = file:/C:/Users/User/.m2/repository/org/mozilla/rhino/1.7.7.1/rhino-1.7.7.1.jar
[ERROR] urls[8] = file:/C:/Users/User/.m2/repository/org/apache/commons/commons-exec/1.1/commons-exec-1.1.jar
[ERROR] urls[9] = file:/C:/Users/User/.m2/repository/commons-pool/commons-pool/1.6/commons-pool-1.6.jar
[ERROR] urls[10] = file:/C:/Users/User/.m2/repository/org/springframework/spring-web/3.1.1.RELEASE/spring-web-3.1.1.RELEASE.jar
[ERROR] urls[11] = file:/C:/Users/User/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[12] = file:/C:/Users/User/.m2/repository/org/springframework/spring-beans/3.1.1.RELEASE/spring-beans-3.1.1.RELEASE.jar
[ERROR] urls[13] = file:/C:/Users/User/.m2/repository/org/springframework/spring-context/3.1.1.RELEASE/spring-context-3.1.1.RELEASE.jar
[ERROR] urls[14] = file:/C:/Users/User/.m2/repository/org/springframework/spring-aop/3.1.1.RELEASE/spring-aop-3.1.1.RELEASE.jar
[ERROR] urls[15] = file:/C:/Users/User/.m2/repository/org/springframework/spring-expression/3.1.1.RELEASE/spring-expression-3.1.1.RELEASE.jar
[ERROR] urls[16] = file:/C:/Users/User/.m2/repository/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.jar
[ERROR] urls[17] = file:/C:/Users/User/.m2/repository/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar
[ERROR] urls[18] = file:/C:/Users/User/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
[ERROR] urls[19] = file:/C:/Users/User/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar
[ERROR] urls[20] = file:/C:/Users/User/.m2/repository/com/google/javascript/closure-compiler/v20160315/closure-compiler-v20160315.jar
[ERROR] urls[21] = file:/C:/Users/User/.m2/repository/com/google/javascript/closure-compiler-externs/v20160315/closure-compiler-externs-v20160315.jar
[ERROR] urls[22] = file:/C:/Users/User/.m2/repository/args4j/args4j/2.0.26/args4j-2.0.26.jar
[ERROR] urls[23] = file:/C:/Users/User/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar
[ERROR] urls[24] = file:/C:/Users/User/.m2/repository/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar
[ERROR] urls[25] = file:/C:/Users/User/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
[ERROR] urls[26] = file:/C:/Users/User/.m2/repository/com/github/lltyk/dojo-shrinksafe/1.7.2/dojo-shrinksafe-1.7.2.jar
[ERROR] urls[27] = file:/C:/Users/User/.m2/repository/org/jruby/jruby-core/9.0.5.0/jruby-core-9.0.5.0.jar
[ERROR] urls[28] = file:/C:/Users/User/.m2/repository/com/github/jnr/jnr-netdb/1.1.5/jnr-netdb-1.1.5.jar
[ERROR] urls[29] = file:/C:/Users/User/.m2/repository/com/github/jnr/jnr-enxio/0.10/jnr-enxio-0.10.jar
[ERROR] urls[30] = file:/C:/Users/User/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar
[ERROR] urls[31] = file:/C:/Users/User/.m2/repository/com/github/jnr/jnr-unixsocket/0.10/jnr-unixsocket-0.10.jar
[ERROR] urls[32] = file:/C:/Users/User/.m2/repository/com/github/jnr/jnr-posix/3.0.27/jnr-posix-3.0.27.jar
[ERROR] urls[33] = file:/C:/Users/User/.m2/repository/com/github/jnr/jnr-constants/0.9.0/jnr-constants-0.9.0.jar
[ERROR] urls[34] = file:/C:/Users/User/.m2/repository/com/github/jnr/jffi/1.2.10/jffi-1.2.10.jar
[ERROR] urls[35] = file:/C:/Users/User/.m2/repository/com/github/jnr/jffi/1.2.10/jffi-1.2.10-native.jar
[ERROR] urls[36] = file:/C:/Users/User/.m2/repository/org/jruby/joni/joni/2.1.9/joni-2.1.9.jar
[ERROR] urls[37] = file:/C:/Users/User/.m2/repository/org/jruby/extras/bytelist/1.0.13/bytelist-1.0.13.jar
[ERROR] urls[38] = file:/C:/Users/User/.m2/repository/org/jruby/jcodings/jcodings/1.0.17/jcodings-1.0.17.jar
[ERROR] urls[39] = file:/C:/Users/User/.m2/repository/org/jruby/dirgra/0.3/dirgra-0.3.jar
[ERROR] urls[40] = file:/C:/Users/User/.m2/repository/com/headius/invokebinder/1.7/invokebinder-1.7.jar
[ERROR] urls[41] = file:/C:/Users/User/.m2/repository/com/headius/options/1.4/options-1.4.jar
[ERROR] urls[42] = file:/C:/Users/User/.m2/repository/com/jcraft/jzlib/1.1.3/jzlib-1.1.3.jar
[ERROR] urls[43] = file:/C:/Users/User/.m2/repository/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar
[ERROR] urls[44] = file:/C:/Users/User/.m2/repository/joda-time/joda-time/2.8.2/joda-time-2.8.2.jar
[ERROR] urls[45] = file:/C:/Users/User/.m2/repository/org/jruby/jruby-stdlib/9.0.5.0/jruby-stdlib-9.0.5.0.jar
[ERROR] urls[46] = file:/C:/Users/User/.m2/repository/com/darrinholst/sass-java-gems/3.4.20.0/sass-java-gems-3.4.20.0.jar
[ERROR] urls[47] = file:/C:/Users/User/.m2/repository/nz/co/edmi/bourbon-gem-jar/2.1.0/bourbon-gem-jar-2.1.0.jar
[ERROR] urls[48] = file:/C:/Users/User/.m2/repository/me/n4u/sass/sass-gems/3.1.19/sass-gems-3.1.19.jar
[ERROR] urls[49] = file:/C:/Users/User/.m2/repository/com/github/sommeri/less4j/1.17.2/less4j-1.17.2.jar
[ERROR] urls[50] = file:/C:/Users/User/.m2/repository/org/antlr/antlr-runtime/3.5.2/antlr-runtime-3.5.2.jar
[ERROR] urls[51] = file:/C:/Users/User/.m2/repository/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar
[ERROR] urls[52] = file:/C:/Users/User/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-1.7/1.3/gmaven-runtime-1.7-1.3.jar
[ERROR] urls[53] = file:/C:/Users/User/.m2/repository/org/codehaus/gmaven/feature/gmaven-feature-support/1.3/gmaven-feature-support-1.3.jar
[ERROR] urls[54] = file:/C:/Users/User/.m2/repository/org/codehaus/gmaven/feature/gmaven-feature-api/1.3/gmaven-feature-api-1.3.jar
[ERROR] urls[55] = file:/C:/Users/User/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-support/1.3/gmaven-runtime-support-1.3.jar
[ERROR] urls[56] = file:/C:/Users/User/.m2/repository/org/codehaus/gmaven/runtime/gmaven-runtime-api/1.3/gmaven-runtime-api-1.3.jar
[ERROR] urls[57] = file:/C:/Users/User/.m2/repository/org/sonatype/gshell/gshell-io/2.0/gshell-io-2.0.jar
[ERROR] urls[58] = file:/C:/Users/User/.m2/repository/com/thoughtworks/qdox/qdox/1.10/qdox-1.10.jar
[ERROR] urls[59] = file:/C:/Users/User/.m2/repository/org/codehaus/groovy/groovy-all/1.7.4/groovy-all-1.7.4.jar
[ERROR] urls[60] = file:/C:/Users/User/.m2/repository/org/apache/ant/ant/1.8.2/ant-1.8.2.jar
[ERROR] urls[61] = file:/C:/Users/User/.m2/repository/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.jar
[ERROR] urls[62] = file:/C:/Users/User/.m2/repository/jline/jline/0.9.94/jline-0.9.94.jar
[ERROR] urls[63] = file:/C:/Users/User/.m2/repository/org/webjars/webjars-locator/0.30/webjars-locator-0.30.jar
[ERROR] urls[64] = file:/C:/Users/User/.m2/repository/org/webjars/webjars-locator-core/0.30/webjars-locator-core-0.30.jar
[ERROR] urls[65] = file:/C:/Users/User/.m2/repository/org/apache/commons/commons-compress/1.9/commons-compress-1.9.jar
[ERROR] urls[66] = file:/C:/Users/User/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.3.3/jackson-databind-2.3.3.jar
[ERROR] urls[67] = file:/C:/Users/User/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.3.0/jackson-annotations-2.3.0.jar
[ERROR] urls[68] = file:/C:/Users/User/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.3.3/jackson-core-2.3.3.jar
[ERROR] urls[69] = file:/C:/Users/User/.m2/repository/org/webjars/jshint/2.6.3-2/jshint-2.6.3-2.jar
[ERROR] urls[70] = file:/C:/Users/User/.m2/repository/org/webjars/less/1.3.3/less-1.3.3.jar
[ERROR] urls[71] = file:/C:/Users/User/.m2/repository/org/webjars/emberjs/1.9.0-1/emberjs-1.9.0-1.jar
[ERROR] urls[72] = file:/C:/Users/User/.m2/repository/org/webjars/handlebars/3.0.3/handlebars-3.0.3.jar
[ERROR] urls[73] = file:/C:/Users/User/.m2/repository/org/webjars/coffee-script/1.10.0/coffee-script-1.10.0.jar
[ERROR] urls[74] = file:/C:/Users/User/.m2/repository/org/webjars/envjs/1.2/envjs-1.2.jar
[ERROR] urls[75] = file:/C:/Users/User/.m2/repository/org/webjars/jslint/20140708-394bf29/jslint-20140708-394bf29.jar
[ERROR] urls[76] = file:/C:/Users/User/.m2/repository/org/webjars/json2/20110223/json2-20110223.jar
[ERROR] urls[77] = file:/C:/Users/User/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar
[ERROR] urls[78] = file:/C:/Users/User/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.3.0/sisu-inject-bean-2.3.0.jar
[ERROR] urls[79] = file:/C:/Users/User/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
[ERROR] urls[80] = file:/C:/Users/User/.m2/repository/org/sonatype/sisu/sisu-guava/0.9.9/sisu-guava-0.9.9.jar
[ERROR] urls[81] = file:/C:/Users/User/.m2/repository/org/mockito/mockito-core/2.0.42-beta/mockito-core-2.0.42-beta.jar
[ERROR] urls[82] = file:/C:/Users/User/.m2/repository/net/bytebuddy/byte-buddy/1.2.1/byte-buddy-1.2.1.jar
[ERROR] urls[83] = file:/C:/Users/User/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar
[ERROR] urls[84] = file:/C:/Users/User/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar
[ERROR] urls[85] = file:/C:/Users/User/.m2/repository/org/sonatype/aether/aether-util/1.13.1/aether-util-1.13.1.jar
[ERROR] urls[86] = file:/C:/Users/User/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[87] = file:/C:/Users/User/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[88] = file:/C:/Users/User/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[89] = file:/C:/Users/User/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[90] = file:/C:/Users/User/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[91] = file:/C:/Users/User/.m2/repository/org/slf4j/slf4j-log4j12/1.7.16/slf4j-log4j12-1.7.16.jar
[ERROR] urls[92] = file:/C:/Users/User/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : Cannot invoke "org.mockito.internal.configuration.plugins.PluginRegistry.getStackTraceCleanerProvider()" because "org.mockito.internal.configuration.plugins.Plugins.registry" is null
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :pet-clinic-web

Process finished with exit code 1

错误文字:

Cannot invoke "org.mockito.internal.configuration.plugins.PluginRegistry.getStackTraceCleanerProvider()" because "org.mockito.internal.configuration.plugins.Plugins.registry" is null

我的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
    <artifactId>sfg-pet-clinic</artifactId>
    <groupId>guru.springframework</groupId>
    <version>0.0.5-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>pet-clinic-web</artifactId>

<properties>
    <!-- Web dependencies -->
    <webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
    <webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
    <webjars-jquery.version>2.2.4</webjars-jquery.version>
    <wro4j.version>1.8.0</wro4j.version>
</properties>

<dependencies>

    <dependency>
        <artifactId>pet-clinic-data</artifactId>
        <groupId>guru.springframework</groupId>
        <version>0.0.5-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>

    <!-- webjars -->
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>webjars-locator-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery</artifactId>
        <version>${webjars-jquery.version}</version>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>jquery-ui</artifactId>
        <version>${webjars-jquery-ui.version}</version>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>bootstrap</artifactId>
        <version>${webjars-bootstrap.version}</version>
    </dependency>
    <!-- end of webjars -->

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>ro.isdc.wro4j</groupId>
            <artifactId>wro4j-maven-plugin</artifactId>
            <version>${wro4j.version}</version>
            <executions>
                <execution>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
                <cssDestinationFolder>${project.build.directory}/classes/static/resources/css</cssDestinationFolder>
                <wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
                <extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
                <contextFolder>${basedir}/src/main/less</contextFolder>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.webjars</groupId>
                    <artifactId>bootstrap</artifactId>
                    <version>${webjars-bootstrap.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

我发现错误就在这段代码中:

       <executions>
            <execution>
                <phase>generate-resources</phase>
                <goals>
                    <goal>run</goal>
                </goals>
            </execution>
        </executions>

因为如果我将其注释掉,所有内容都会成功打包,但不会出现任何结果。 我是 Maven 技术的新手,正在经历 Spring 框架初学者到大师课程。这篇作品来自创建春季宠物诊所的部分,所以我尝试在教练之后重复,但我在这里,出现了错误。

java spring maven wro4j
2个回答
1
投票

目前,我正在学习相同的课程,并且遇到了相同的问题。 在你的插件配置中没有预先的mockito依赖。

<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-core</artifactId>
    <version>2.23.0</version>
</dependency>

将其添加到插件中的 webjars 依赖项之后。


0
投票

提供更多内容:

   <build>
    <plugins>
        <plugin>
            <groupId>ro.isdc.wro4j</groupId>
            <artifactId>wro4j-maven-plugin</artifactId>
            <version>${wro4j.version}</version>
            <executions>
                <execution>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
                <cssDestinationFolder>${project.build.directory}/classes/static/resources/css</cssDestinationFolder>
                <wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
                <extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
                <contextFolder>${basedir}/src/main/less</contextFolder>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.webjars</groupId>
                    <artifactId>bootstrap</artifactId>
                    <version>${webjars-bootstrap.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-core</artifactId>
                    <version>2.23.0</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
© www.soinside.com 2019 - 2024. All rights reserved.