mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-15 17:31:31 +02:00
Generate copyright year in swagger template code
- exclude generated source code from checkstyle by default Change-Id: I3f79183a8aae1f24d36558860555b5b0298cd8c3
This commit is contained in:
parent
4e360499cc
commit
bcc2ce9c3f
@ -39,7 +39,7 @@
|
||||
<onos-build-conf.version>1.13.0-SNAPSHOT</onos-build-conf.version>
|
||||
<netty4.version>4.1.8.Final</netty4.version>
|
||||
<openflowj.version>3.2.0.onos</openflowj.version>
|
||||
<onos-maven-plugin.version>1.11</onos-maven-plugin.version>
|
||||
<onos-maven-plugin.version>${project.version}</onos-maven-plugin.version>
|
||||
<onos-yang-tools.version>2.4</onos-yang-tools.version>
|
||||
<osgi.version>5.0.0</osgi.version>
|
||||
<karaf.version>3.0.8</karaf.version>
|
||||
@ -714,6 +714,7 @@
|
||||
<artifactId>grpc-core</artifactId>
|
||||
<version>${grpccore.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
1
pom.xml
1
pom.xml
@ -70,6 +70,7 @@
|
||||
|
||||
<module>tools/package/archetypes</module>
|
||||
<module>tools/package/branding</module>
|
||||
<module>tools/package/maven-plugin</module>
|
||||
|
||||
<module>pipelines</module>
|
||||
</modules>
|
||||
|
@ -33,6 +33,7 @@ import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.time.Year;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -502,7 +503,9 @@ public class SwaggerGenerator {
|
||||
src = src.replace("${api.package}", apiPackage)
|
||||
.replace("${web.context}", webContext)
|
||||
.replace("${api.title}", apiTitle)
|
||||
.replace("${api.description}", apiDescription);
|
||||
.replace("${api.description}", apiDescription)
|
||||
.replace("${year}", Year.now().toString());
|
||||
|
||||
Files.write(src.getBytes(), reg);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Unable to write " + reg, e);
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
* Auto-generated by OnosSwaggerMojo.
|
||||
*
|
||||
* Copyright 2016-present Open Networking Foundation
|
||||
* Copyright ${year}-present Open Networking Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -14,6 +12,9 @@
|
||||
* 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.
|
||||
*
|
||||
* Auto-generated by OnosSwaggerMojo.
|
||||
*
|
||||
*/
|
||||
package ${api.package};
|
||||
|
||||
|
@ -54,4 +54,8 @@
|
||||
|
||||
<!-- Suppressions for yangutils generated code -->
|
||||
<suppress files="org.onosproject.yang.gen.v1.*" checks="Javadoc.*" />
|
||||
|
||||
<!-- Suppress checks for Maven-generated code -->
|
||||
<suppress files="[/\\]target[/\\]" checks=".*"/>
|
||||
|
||||
</suppressions>
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<groupId>org.onosproject</groupId>
|
||||
<artifactId>onos-maven-plugin</artifactId>
|
||||
<version>1.11-SNAPSHOT</version>
|
||||
<version>1.13.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<description>Maven plugin for packaging ONOS applications or generating
|
||||
|
@ -41,6 +41,7 @@ import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.time.Year;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
@ -477,7 +478,8 @@ public class OnosSwaggerMojo extends AbstractMojo {
|
||||
src = src.replace("${api.package}", apiPackage)
|
||||
.replace("${web.context}", webContext)
|
||||
.replace("${api.title}", apiTitle)
|
||||
.replace("${api.description}", apiTitle);
|
||||
.replace("${api.description}", apiTitle)
|
||||
.replace("${year}", Year.now().toString());
|
||||
Files.write(src.getBytes(), reg);
|
||||
} catch (IOException e) {
|
||||
getLog().warn("Unable to write " + reg);
|
||||
|
@ -1,7 +1,5 @@
|
||||
/*
|
||||
* Auto-generated by OnosSwaggerMojo.
|
||||
*
|
||||
* Copyright 2015-present Open Networking Foundation
|
||||
* Copyright ${year}-present Open Networking Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -14,6 +12,9 @@
|
||||
* 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.
|
||||
*
|
||||
* Auto-generated by OnosSwaggerMojo.
|
||||
*
|
||||
*/
|
||||
package ${api.package};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user