Flume Too many unapproved licenses: 1

[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.7:check (verify.rat) on project flume-ng-elasticsearch-sink: Too many unapproved licenses: 1 -> [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/MojoFailureException
[ERROR]

[ERROR] After correcting the problems, you can resume the build with the command

[ERROR] mvn <goals> -rf :flume-ng-elasticsearch-sink

重点是上述红色标记的地方,因为最近项目要从nginx获取数据实时导入到elasticsearch中,flume自带的elasticsearch-sink不能满足我们要求,所以要自定义。在里面flume-ng-elasticsearch-sink中新增了一些类和测试配置文件,本想重新打包发布的。可以一maven打包就报上述异常。


解决办法:

配置文件第一行加如下内容:

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF 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
#
#     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.
#

java类第一行加如下内容:

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF 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
 *
 * 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.
 */


请看根目录的pom配置:

        <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.7</version>
          <executions>
            <execution>
              <id>verify.rat</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <excludes>
                  <exclude>**/.idea/</exclude>
                  <exclude>**/*.iml</exclude>
                  <exclude>**/nb-configuration.xml</exclude>
                  <exclude>.git/</exclude>
                  <exclude>patchprocess/</exclude>
                  <exclude>.gitignore</exclude>
                  <!-- ASF jenkins box puts the Maven repo in our root directory. -->
                  <exclude>.repository/</exclude>
                  <exclude>**/*.diff</exclude>
                  <exclude>**/*.patch</exclude>
                  <exclude>**/*.avsc</exclude>
                  <exclude>**/*.avro</exclude>
                  <exclude>**/docs/**</exclude>
                  <exclude>**/test/resources/**</exclude>
                  <exclude>**/.settings/*</exclude>
                  <exclude>**/.classpath</exclude>
                  <exclude>**/.project</exclude>
                  <exclude>**/target/**</exclude>
                  <exclude>**/derby.log</exclude>
                  <exclude>**/metastore_db/</exclude>
                </excludes>
              </configuration>
            </execution>
          </executions>



注:上述要加的内容,大家最好在源码里面找,java类的,可以在源码中任意一个java类中找,配置文件的,可以在源码中任意一个配置文件里面拷贝出来。

你可能感兴趣的:(Flume)