ralf0131 closed pull request #1647: [DUBBO-9]add apache-rat-plugin to check asf license header URL: https://github.com/apache/incubator-dubbo/pull/1647
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/codestyle/checkstyle-header.txt b/codestyle/checkstyle-header.txt deleted file mode 100644 index e87628e475..0000000000 --- a/codestyle/checkstyle-header.txt +++ /dev/null @@ -1,16 +0,0 @@ -^\Q/*\E$ -^\Q * Licensed to the Apache Software Foundation (ASF) under one or more\E$ -^\Q * contributor license agreements. See the NOTICE file distributed with\E$ -^\Q * this work for additional information regarding copyright ownership.\E$ -^\Q * The ASF licenses this file to You under the Apache License, Version 2.0\E$ -^\Q * (the "License"); you may not use this file except in compliance with\E$ -^\Q * the License. You may obtain a copy of the License at\E$ -^\Q *\E$ -^\Q * http://www.apache.org/licenses/LICENSE-2.0\E$ -^\Q *\E$ -^\Q * Unless required by applicable law or agreed to in writing, software\E$ -^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$ -^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$ -^\Q * See the License for the specific language governing permissions and\E$ -^\Q * limitations under the License.\E$ -^\Q */\E$ \ No newline at end of file diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index a8923fa6ac..ffdafd15f4 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -6,11 +6,6 @@ <module name="Checker"> <property name="charset" value="UTF-8"/> <property name="fileExtensions" value="java"/> - <!-- Root Checks --> - <module name="com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck"> - <property name="headerFile" value="${checkstyle.header.file}" /> - <property name="fileExtensions" value="java" /> - </module> <!-- TreeWalker Checks --> <module name="TreeWalker"> diff --git a/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/Ext9Empty.java b/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/Ext9Empty.java index b13bea6244..388e8f90a1 100644 --- a/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/Ext9Empty.java +++ b/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/Ext9Empty.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package com.alibaba.dubbo.common.extensionloader.ext9_empty; import com.alibaba.dubbo.common.extension.SPI; diff --git a/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/impl/Ext9EmptyImpl.java b/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/impl/Ext9EmptyImpl.java index 68430c595f..cc9dad1927 100644 --- a/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/impl/Ext9EmptyImpl.java +++ b/dubbo-common/src/test/java/com/alibaba/dubbo/common/extensionloader/ext9_empty/impl/Ext9EmptyImpl.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package com.alibaba.dubbo.common.extensionloader.ext9_empty.impl; import com.alibaba.dubbo.common.extensionloader.ext9_empty.Ext9Empty; diff --git a/dubbo-common/src/test/java/com/alibaba/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java b/dubbo-common/src/test/java/com/alibaba/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java index a9aeca2c94..67b5882f2b 100644 --- a/dubbo-common/src/test/java/com/alibaba/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java +++ b/dubbo-common/src/test/java/com/alibaba/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java @@ -1,11 +1,27 @@ +/* + * 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. + */ package com.alibaba.dubbo.common.threadpool.support.eager; - import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.extension.ExtensionLoader; import com.alibaba.dubbo.common.threadpool.ThreadPool; import com.alibaba.dubbo.common.threadpool.support.AbortPolicyWithReport; import com.alibaba.dubbo.common.utils.NamedThreadFactory; + import org.junit.Assert; import org.junit.Test; @@ -62,12 +78,8 @@ public void testEagerThreadPool() throws Exception { executor.execute(new Runnable() { @Override public void run() { - System.out.println("thread number in current pool:" - + executor.getPoolSize() - + ", task number in task queue:" - + executor.getQueue().size() - + " executor size: " - + executor.getPoolSize()); + System.out.println("thread number in current pool:" + executor.getPoolSize() + ", task number in task queue:" + executor.getQueue() + .size() + " executor size: " + executor.getPoolSize()); try { Thread.sleep(1000); } catch (InterruptedException e) { @@ -83,11 +95,12 @@ public void run() { @Test public void testSPI() { - ExecutorService executorService = (ExecutorService) ExtensionLoader - .getExtensionLoader(ThreadPool.class) + ExecutorService executorService = (ExecutorService) ExtensionLoader.getExtensionLoader(ThreadPool.class) .getExtension("eager") .getExecutor(URL); Assert.assertTrue("test spi fail!", - executorService.getClass().getSimpleName().equals("EagerThreadPoolExecutor")); + executorService.getClass() + .getSimpleName() + .equals("EagerThreadPoolExecutor")); } } \ No newline at end of file diff --git a/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/context/annotation/provider/HelloServiceImpl.java b/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/context/annotation/provider/HelloServiceImpl.java index ac369c530f..9d0fdbb19b 100644 --- a/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/context/annotation/provider/HelloServiceImpl.java +++ b/dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/context/annotation/provider/HelloServiceImpl.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package com.alibaba.dubbo.config.spring.context.annotation.provider; import com.alibaba.dubbo.config.annotation.Service; diff --git a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/$__ClassNameTestDubboStub.java b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/$__ClassNameTestDubboStub.java index d2da761f79..a60c7b60a1 100644 --- a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/$__ClassNameTestDubboStub.java +++ b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/$__ClassNameTestDubboStub.java @@ -1,4 +1,20 @@ -/** +/* + * 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. + */ +/* * Autogenerated by Dubbo Compiler (0.1.0) * <p> * Thrift (0.7.0) diff --git a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/ClassNameTestDubbo.java b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/ClassNameTestDubbo.java index 2ca0e79830..f0a203c0af 100644 --- a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/ClassNameTestDubbo.java +++ b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/ClassNameTestDubbo.java @@ -1,4 +1,20 @@ -/** +/* + * 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. + */ +/* * Autogenerated by Dubbo Compiler (0.1.0) * <p> * Thrift (0.7.0) diff --git a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/$__DemoStub.java b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/$__DemoStub.java index 57e5800cc5..0b49afb7ee 100644 --- a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/$__DemoStub.java +++ b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/$__DemoStub.java @@ -1,4 +1,20 @@ -/** +/* + * 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. + */ +/* * Autogenerated by Dubbo Compiler (0.1.0) * <p> * Thrift (0.7.0) diff --git a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/Demo.java b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/Demo.java index c6bfbc14f3..382adf31a1 100644 --- a/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/Demo.java +++ b/dubbo-rpc/dubbo-rpc-thrift/src/test/java/com/alibaba/dubbo/rpc/gen/dubbo/Demo.java @@ -1,4 +1,20 @@ -/** +/* + * 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. + */ +/* * Autogenerated by Dubbo Compiler (0.1.0) * <p> * Thrift (0.7.0) diff --git a/hessian-lite/pom.xml b/hessian-lite/pom.xml index 584c84a123..07eec26931 100644 --- a/hessian-lite/pom.xml +++ b/hessian-lite/pom.xml @@ -1,4 +1,3 @@ -<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with diff --git a/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/LocaleSerializerTest.java b/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/LocaleSerializerTest.java index 73cdd3f174..a345dda5a6 100644 --- a/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/LocaleSerializerTest.java +++ b/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/LocaleSerializerTest.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package com.alibaba.com.caucho.hessian.io; import java.io.IOException; diff --git a/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/base/SerializeTestBase.java b/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/base/SerializeTestBase.java index ab889f7fef..587070f2d5 100644 --- a/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/base/SerializeTestBase.java +++ b/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/base/SerializeTestBase.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package com.alibaba.com.caucho.hessian.io.base; import com.alibaba.com.caucho.hessian.io.Hessian2Input; diff --git a/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/beans/SubUser.java b/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/beans/SubUser.java index 1bf6b6ccf8..3c7214f226 100644 --- a/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/beans/SubUser.java +++ b/hessian-lite/src/test/java/com/alibaba/com/caucho/hessian/io/beans/SubUser.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package com.alibaba.com.caucho.hessian.io.beans; import java.io.Serializable; diff --git a/pom.xml b/pom.xml index f7bcffff44..96ba40242e 100644 --- a/pom.xml +++ b/pom.xml @@ -115,6 +115,7 @@ <maven_jetty_version>6.1.26</maven_jetty_version> <maven_checkstyle_version>3.0.0</maven_checkstyle_version> <maven_jacoco_version>0.8.1</maven_jacoco_version> + <apache-rat-plugin.version>0.12</apache-rat-plugin.version> </properties> <modules> @@ -443,6 +444,56 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <version>${apache-rat-plugin.version}</version> + <executions> + <execution> + <id>verify.rat</id> + <phase>verify</phase> + <goals> + <goal>check</goal> + </goals> + <configuration> + <excludes> + <exclude>**/*.versionsBackup</exclude> + <exclude>**/.idea/</exclude> + <exclude>**/*.iml</exclude> + <exclude>**/*.txt</exclude> + <exclude>**/*.load</exclude> + <exclude>**/*.flex</exclude> + <exclude>**/*.fc</exclude> + <exclude>**/*.javascript</exclude> + <exclude>**/*.properties</exclude> + <exclude>**/*.thrift</exclude> + <exclude>**/*.sh</exclude> + <exclude>**/*.bat</exclude> + <exclude>**/*.md</exclude> + <exclude>.git/</exclude> + <exclude>.gitignore</exclude> + <!-- ASF jenkins box puts the Maven repo in our root directory. --> + <exclude>.repository/</exclude> + <exclude>**/.settings/*</exclude> + <exclude>**/.classpath</exclude> + <exclude>**/.project</exclude> + <exclude>**/target/**</exclude> + <exclude>**/*.log</exclude> + <exclude>CODE_OF_CONDUCT.md</exclude> + <exclude>.codecov.yml</exclude> + <exclude>.travis.yml</exclude> + <exclude>PULL_REQUEST_TEMPLATE.md</exclude> + <exclude>CONTRIBUTING.md</exclude> + <exclude>README.md</exclude> + <exclude>**/codestyle/*</exclude> + <exclude>**/resources/META-INF/**</exclude> + <!-- exclude the hessian-lite files --> + <exclude>**/com/caucho/hessian/**</exclude> + </excludes> + </configuration> + </execution> + </executions> + </plugin> </plugins> <pluginManagement> @@ -520,6 +571,9 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.4.3</version> + <configuration> + <createDependencyReducedPom>false</createDependencyReducedPom> + </configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
