1

我正在尝试在我的构建中实现Maven Replacer Plugin 。

但是我被这个问题困住了:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.code.maven-replacer-plugin:replacer:1.5.2:replace (default) on project ReportBCSIS: Execution default of goal com.google.code.maven-replacer-plugin:replacer:1.5.2:replace failed: A required class was missing while executing com.google.code.maven-replacer-plugin:replacer:1.5.2:replace: org/apache/commons/lang/StringUtils
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.google.code.maven-replacer-plugin:replacer:1.5.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/grudy/.m2/repository/com/google/code/maven-replacer-plugin/replacer/1.5.2/replacer-1.5.2.jar
[ERROR] urls[1] = file:/C:/Users/grudy/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.apache.commons.lang.StringUtils
[ERROR] -> [Help 1]

以下是我当前的 pom 配置:

    <plugin>
       <groupId>com.google.code.maven-replacer-plugin</groupId>
       <artifactId>replacer</artifactId>
       <version>1.5.2</version>
       <executions>
           <execution>
               <phase>prepare-package</phase>
               <goals>
                   <goal>replace</goal>
               </goals>                   
           </execution>
       </executions>
       <configuration>
           <file>target/${project.artifactId}/index.jsp</file>
           <replacements>
               <replacement>
                   <token>BUILDID-TOKEN</token>
                   <value>121212-HAHA</value>
               </replacement>         
           </replacements>
        </configuration>
    </plugin>

任何的想法 ?

4

1 回答 1

2

在插件下面添加文本可以解决问题:

<dependencies>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.0.1</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
</dependencies>
于 2012-12-21T09:04:13.850 回答