给js.css文件压缩,添加版本号,打包报错

左手想花开 发布于 2015/09/17 16:33
阅读 400
收藏 0

这是我在pom.xml文件中的配置,用来给js.css文件压缩,添加版本号用的,可是在mvn package 的时候,总是报错,望指点一下

No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <
plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-
sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, p
rocess-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integrati
on-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specified for this build. You must specify a valid lifecycle phase or a g
oal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: val
idate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, pro
cess-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integ
ration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-depl
oy.
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:90)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

==========================================================

<plugin>

<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.3.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create-timestamp</goal> 
</goals>
</execution>
</executions>
       <configuration>
       <configuration>
                <format>{0,date,yyyy-MM-dd HH:mm:ss}</format>
                    <items>
                        <item>timestamp</item>
                    </items>
        </configuration>
        </configuration>
  </plugin>
   <plugin>
            <groupId>net.alchim31.maven</groupId>
                 <artifactId>yuicompressor-maven-plugin</artifactId>
                                  <version>1.5.0</version>
                                  <executions>
                                     <execution>
                                     <phase>${assert.compress}</phase>
                                     <goals>
                                        <goal>compress</goal>  
                                        </goals>   
                                     </execution>   
                                  </executions>    
                                 <configuration> 
                                  <!--<nosuffix>true</nosuffix>-->  
                                   <suffix>.${timestamp}</suffix>  
                                    <force>true</force>
                                     <encoding>utf-8</encoding> 
                                   <excludes>
                                      <exclude>**/*.js</exclude>
                                      <exclude>**/*.css</exclude> 
                                      </excludes> 
                                   </configuration>
        </plugin> 
加载中
0
叫我刀刀
叫我刀刀
压缩静态文件  不都是用gulp插件吗?   我写java,我不懂前台
0
wms1
wms1

https://github.com/wu560130911/MultimediaDesktop/blob/master/Client/pom.xml#L302

参考这个

返回顶部
顶部