大数据前端cas4.0遇到坑

大数据前端cas4.0遇到坑
问题:编译cas-server-webapp出现如下错误

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.733 s
[INFO] Finished at: 2018-01-28T18:51:01+08:00
[INFO] Final Memory: 23M/273M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.mycila.maven-license-plugin:maven-license-plugin:1.9.0:check (default) on project cas-server-webapp: Some files do not have the expected license header -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.mycila.maven-license-plugin:maven-license-plugin:1.9.0:check (default) on project cas-server-webapp: Some files do not have the expected license header
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:353)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:198)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some files do not have the expected license header
    at com.google.code.mojo.license.LicenseCheckMojo.execute(LicenseCheckMojo.java:64)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 24 more
[ERROR] 
[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/MojoExecutionException

解决方案:
第一步:
在pom.xml中可以排除一些文件,防止maven-license-plugin检查文件头license。

 <plugin>
        <groupId>com.mycila.maven-license-plugin</groupId>
        <artifactId>maven-license-plugin</artifactId>
        <configuration>
          <header>${cs.dir}/src/licensing/header.txt</header>
          <skipExistingHeaders>true</skipExistingHeaders>
          <strictCheck>true</strictCheck>
          <headerDefinitions>
            <headerDefinition>${cs.dir}/src/licensing/header-definitions.xml</headerDefinition>
          </headerDefinitions>
          <aggregate>true</aggregate>
          <excludes>
            <exclude>LICENSE</exclude>
            <exclude>**/INSTALL*</exclude>
            <exclude>**/NOTICE*</exclude>
            <exclude>**/README*</exclude>
            <exclude>**/readme*</exclude>
            <exclude>**/*.log</exclude>
            <exclude>**/*.license</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>**/*.crt</exclude>
            <exclude>**/*.crl</exclude>
            <exclude>**/*.key</exclude>
            <exclude>**/*.checkstyle</exclude>
            <exclude>**/*.properties</exclude>
            <exclude>**/.gitignore</exclude>
            <exclude>**/overlays/**</exclude>
            <exclude>src/licensing/**</exclude>
            <exclude>**/testCA/**</exclude>
            <exclude>**/.idea/**</exclude>
            <exclude>**/*.keystore</exclude>
            <exclude>**/*.example</exclude>
            <exclude>**/*.sample</exclude>
            <exclude>**/*.conf</exclude>
            <exclude>**/*.doc</exclude>
            <exclude>**/*.jmx</exclude>
            <exclude>**/css/**</exclude>
            <exclude>**/img/**</exclude>
            <exclude>**/js/**</exclude>
            <exclude>**/fonts/**</exclude>
            <exclude>**/plugins/**</exclude>
          </excludes>
        </configuration>
        <executions>
            <execution>
                <phase>compile</phase>
                <goals>
                    <goal>check</goal>
                </goals>
            </execution>
        </executions>
      </plugin>

第二步:
修改文件cas-4.0.0\cas-server-webapp\src\main\webapp\WEB-INF\cas-servlet.xml
加入

<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to Jasig under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Jasig licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file
    except in compliance with the License.  You may obtain a
    copy of the License at the following location:

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值