remove unknown license
Signed-off-by: kakulisen <18813972746@163.com>
diff --git a/README-ZH.md b/README-ZH.md
index c48f5f1..4dce64c 100755
--- a/README-ZH.md
+++ b/README-ZH.md
@@ -123,7 +123,7 @@
例:-i http://petstore.swagger.io/v2/swagger.json
* -o, --output : 文档输出路径
例:-o ./document
-* -f, --format : 指定输出文档风格,现支持swagger-ui和asciidoc-html
+* -f, --format : 指定输出文档风格,现支持swagger-ui
例:-f swagger-ui
### 3.3 使用toolkit-maven-plugin插件
diff --git a/README.md b/README.md
index 12ad334..bc449cd 100755
--- a/README.md
+++ b/README.md
@@ -122,7 +122,7 @@
例:-i http://petstore.swagger.io/v2/swagger.json
* -o, --output. Document output path.
例:-o ./document
-* -f, --format. Specifies the output document format, now supports swagger-ui and asciidoc-html
+* -f, --format. Specifies the output document format, now supports swagger-ui
例:-f swagger-ui
### 3.3 Use the toolkit-maven-plugin plugin
diff --git a/cli/src/main/java/org/apache/servicecomb/toolkit/cli/DocGenerate.java b/cli/src/main/java/org/apache/servicecomb/toolkit/cli/DocGenerate.java
index 290feea..889cd6c 100755
--- a/cli/src/main/java/org/apache/servicecomb/toolkit/cli/DocGenerate.java
+++ b/cli/src/main/java/org/apache/servicecomb/toolkit/cli/DocGenerate.java
@@ -75,7 +75,8 @@
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
docGeneratorConfig.put("contractContent", SwaggerUtils.parseSwagger(file.toUri().toURL()));
- docGeneratorConfig.put("outputPath", output + File.separator + file.toFile().getName().substring(0, file.toFile().getName().indexOf(".")));
+ docGeneratorConfig.put("outputPath",
+ output + File.separator + file.toFile().getName().substring(0, file.toFile().getName().indexOf(".")));
docGenerator.configure(docGeneratorConfig);
retValues[0] = docGenerator.generate();
if (retValues[0]) {
@@ -94,18 +95,17 @@
.substring(0, new File(specFile).getName().indexOf(".")));
docGenerator.configure(docGeneratorConfig);
retValues[0] = docGenerator.generate();
-
} else {
fileName[0] = specFile;
docGeneratorConfig.put("contractContent", SwaggerUtils.parseSwagger(URI.create(specFile).toURL()));
- docGeneratorConfig.put("outputPath",output + File.separator + new File(specFile).getName()
+ docGeneratorConfig.put("outputPath", output + File.separator + new File(specFile).getName()
.substring(0, new File(specFile).getName().indexOf(".")));
docGenerator.configure(docGeneratorConfig);
retValues[0] = docGenerator.generate();
}
- if (retValues[0]) {
+ if (!retValues[0]) {
LOGGER.error("Failed to generate document base on file {}", fileName[0]);
return;
}
diff --git a/common/pom.xml b/common/pom.xml
index 87a7655..5e24240 100755
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -39,6 +39,20 @@
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.3.0.201903130848-r</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk15on</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpg-jdk15on</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk15on</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
diff --git a/docgen/pom.xml b/docgen/pom.xml
index d5fda74..d606103 100755
--- a/docgen/pom.xml
+++ b/docgen/pom.xml
@@ -47,30 +47,6 @@
</dependency>
<dependency>
- <groupId>org.asciidoctor</groupId>
- <artifactId>asciidoctorj</artifactId>
- <version>1.6.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.asciidoctor</groupId>
- <artifactId>asciidoctorj-pdf</artifactId>
- <version>1.5.0-alpha.15</version>
- <exclusions>
- <exclusion>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>9.2.6.0</version>
- </dependency>
-
- <dependency>
<groupId>org.apache.servicecomb</groupId>
<artifactId>swagger-generator-core</artifactId>
<version>1.2.0</version>
@@ -87,12 +63,6 @@
</dependency>
<dependency>
- <groupId>io.github.swagger2markup</groupId>
- <artifactId>swagger2markup</artifactId>
- <version>1.3.2</version>
- </dependency>
-
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
@@ -105,11 +75,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.eclipse.jgit</groupId>
- <artifactId>org.eclipse.jgit</artifactId>
- <version>5.3.0.201903130848-r</version>
- </dependency>
</dependencies>
<build>
<plugins>
diff --git a/docgen/src/main/java/org/apache/servicecomb/toolkit/docgen/ContractsAsciidocGenerator.java b/docgen/src/main/java/org/apache/servicecomb/toolkit/docgen/ContractsAsciidocGenerator.java
deleted file mode 100755
index a082d98..0000000
--- a/docgen/src/main/java/org/apache/servicecomb/toolkit/docgen/ContractsAsciidocGenerator.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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 org.apache.servicecomb.toolkit.docgen;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.Map;
-
-import org.apache.servicecomb.toolkit.DocGenerator;
-import org.asciidoctor.Asciidoctor;
-import org.asciidoctor.Attributes;
-import org.asciidoctor.AttributesBuilder;
-import org.asciidoctor.OptionsBuilder;
-import org.asciidoctor.SafeMode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.Ordering;
-
-import io.github.swagger2markup.Swagger2MarkupConverter;
-import io.github.swagger2markup.builder.Swagger2MarkupConfigBuilder;
-import io.swagger.models.Swagger;
-import io.swagger.models.parameters.Parameter;
-
-
-public class ContractsAsciidocGenerator implements DocGenerator {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ContractsAsciidocGenerator.class);
-
- private final static String DOC_FORMAT = "asciidoc-html";
-
- private final static String DOC_SUFFIX = ".html";
-
- private Swagger contractContent;
-
- private String outputPath = ".";
-
- @Override
- public boolean canProcess(String type) {
- return type != null && DOC_FORMAT.equals(type.toLowerCase());
- }
-
- @Override
- public void configure(Map<String, Object> config) {
-
- this.contractContent = (Swagger) config.get("contractContent");
- this.outputPath = (String) config.get("outputPath");
- }
-
- private boolean checkConfig() {
- if (contractContent == null) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean generate() {
-
- if (!checkConfig()) {
- return false;
- }
-
- Asciidoctor asciidoctor = Asciidoctor.Factory.create();
- Swagger2MarkupConverter.Builder markupBuilder = Swagger2MarkupConverter.from(contractContent);
- Swagger2MarkupConfigBuilder swagger2MarkupConfigBuilder = new Swagger2MarkupConfigBuilder()
- .withParameterOrdering(Ordering
- .explicit("path", "query", "header", "cookie", "formData", "body")
- .onResultOf(Parameter::getIn));
- String markup = markupBuilder.withConfig(swagger2MarkupConfigBuilder.build()).build().toString();
-
- final Map<String, Object> optionsMap = OptionsBuilder.options()
- .docType("book")
- .backend("html5")
- .headerFooter(true)
- .safe(SafeMode.UNSAFE)
- .attributes(AttributesBuilder.attributes()
- .attribute("toclevels", 3)
- .attribute(Attributes.TOC_2, true)
- .attribute(Attributes.TOC_POSITION, "left")
- .attribute(Attributes.SECTION_NUMBERS, true)
- .attribute(Attributes.SECT_NUM_LEVELS, 4))
- .asMap();
- String asciidocResult = asciidoctor.convert(markup, optionsMap);
- try {
- outputPath = correctPath(outputPath);
- Files.write(Paths.get(outputPath), asciidocResult.getBytes());
- } catch (IOException e) {
- LOGGER.error(e.getMessage());
- return false;
- }
-
- return true;
- }
-
- private String correctPath(String filepath) {
-
- if (!filepath.endsWith(DOC_SUFFIX)) {
- return filepath + "-" + DOC_FORMAT + DOC_SUFFIX;
- }
-
- return filepath;
- }
-}
diff --git a/docgen/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.DocGenerator b/docgen/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.DocGenerator
index 5b1bb73..ea46222 100755
--- a/docgen/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.DocGenerator
+++ b/docgen/src/main/resources/META-INF/services/org.apache.servicecomb.toolkit.DocGenerator
@@ -15,5 +15,4 @@
# limitations under the License.
#
-org.apache.servicecomb.toolkit.docgen.ContractsAsciidocGenerator
org.apache.servicecomb.toolkit.docgen.ContractsSwaggerUIGenerator
\ No newline at end of file
diff --git a/docgen/src/test/java/docgen/DocGeneratorTest.java b/docgen/src/test/java/docgen/DocGeneratorTest.java
index 278766c..ff21cf3 100755
--- a/docgen/src/test/java/docgen/DocGeneratorTest.java
+++ b/docgen/src/test/java/docgen/DocGeneratorTest.java
@@ -37,36 +37,6 @@
public class DocGeneratorTest {
-
- @Test
- public void contractToAsciidoc() throws IOException {
-
- Swagger20Parser swagger20Parser = new Swagger20Parser();
- InputStream in = DocGeneratorTest.class.getClassLoader().getResourceAsStream("HelloEndPoint.yaml");
-
- StringBuilder sb = new StringBuilder();
- byte[] bytes = new byte[1024];
- int len = -1;
- while ((len = in.read(bytes)) != -1) {
- sb.append(new String(bytes, 0, len));
- }
-
- Swagger swagger = swagger20Parser.parse(sb.toString());
- Path tempDir = Files.createTempDirectory(null);
- Path outputPath = Paths.get(tempDir.toFile().getAbsolutePath()
- + File.separator + "asciidoc.html");
-
- DocGenerator docGenerator = GeneratorFactory.getGenerator(DocGenerator.class, "asciidoc-html");
- Map<String, Object> docGeneratorConfig = new HashMap<>();
- docGeneratorConfig.put("contractContent", swagger);
- docGeneratorConfig.put("outputPath", outputPath.toFile().getCanonicalPath());
- docGenerator.configure(docGeneratorConfig);
- docGenerator.generate();
-
- Assert.assertTrue(Files.exists(outputPath));
- FileUtils.deleteDirectory(tempDir.toFile());
- }
-
@Test
public void contractTransferToSwaggerUI() throws IOException {
diff --git a/pom.xml b/pom.xml
index a93f31c..70e7aee 100755
--- a/pom.xml
+++ b/pom.xml
@@ -27,11 +27,20 @@
<packaging>pom</packaging>
<name>Microservice development toolkit</name>
+ <url>https://github.com/apache/servicecomb-toolkit</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
<modules>
<module>codegen</module>
<module>cli</module>
@@ -44,6 +53,37 @@
<build>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <version>1.19</version>
+ <executions>
+ <execution>
+ <id>default-cli</id>
+ <configuration>
+ <!-- Accept the pom module -->
+ <acceptPomPackaging>true</acceptPomPackaging>
+ <!-- Using the template which is grouped by License file -->
+ <fileTemplate>/org/codehaus/mojo/license/third-party-file-groupByMultiLicense.ftl</fileTemplate>
+ <licenseMerges>
+ <licenseMerge>The Apache Software License, Version 2.0|The Apache License, Version 2.0</licenseMerge>
+ <licenseMerge>The Apache Software License, Version 2.0|Apache License, Version 2.0</licenseMerge>
+ <licenseMerge>The Apache Software License, Version 2.0|Apache Public License 2.0</licenseMerge>
+ <licenseMerge>The Apache Software License, Version 2.0|Apache 2</licenseMerge>
+ <licenseMerge>The Apache Software License, Version 2.0|Apache 2.0</licenseMerge>
+ <licenseMerge>The Apache Software License, Version 2.0|Apache-2.0</licenseMerge>
+ <licenseMerge>The Apache Software License, Version 2.0|Apache License 2.0</licenseMerge>
+ <licenseMerge>The Apache Software License, Version 2.0|Apache License, version 2.0</licenseMerge>
+ <licenseMerge>3-Clause BSD License|BSD 3-clause</licenseMerge>
+ <licenseMerge>3-Clause BSD License|BSD 3-Clause</licenseMerge>
+ <licenseMerge>Eclipse Public License v1.0|Eclipse Public License 1.0</licenseMerge>
+ <licenseMerge>Eclipse Public License v1.0|Eclipse Public License - v 1.0</licenseMerge>
+ <licenseMerge>The MIT License|MIT License</licenseMerge>
+ </licenseMerges>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.13</version>
diff --git a/toolkit-distribution/release/LICENSE b/toolkit-distribution/release/LICENSE
index 6e2cb2b..653bf27 100755
--- a/toolkit-distribution/release/LICENSE
+++ b/toolkit-distribution/release/LICENSE
@@ -426,7 +426,6 @@
* Apache Commons Configuration (commons-configuration:commons-configuration:1.10 - http://commons.apache.org/configuration/)
* Vavr (io.vavr:vavr:0.9.1 - http://vavr.io)
* Vavr Match (io.vavr:vavr-match:0.9.1 - http://vavr.io)
-* paleo-core (ch.netzwerg:paleo-core:0.11.0 - no url defined)
* Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.9.8 - http://github.com/FasterXML/jackson)
* jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.9.8 - http://github.com/FasterXML/jackson)
* Jackson-core (com.fasterxml.jackson.core:jackson-core:2.9.8 - https://github.com/FasterXML/jackson-core)
@@ -492,11 +491,9 @@
* Google Guice - Core Library (com.google.inject:guice:4.1.0 - https://github.com/google/guice/guice)
* javax.inject (javax.inject:javax.inject:1 - http://code.google.com/p/atinject/)
* markup-document-builder (io.github.swagger2markup:markup-document-builder:1.1.2 - https://github.com/Swagger2Markup/markup-document-builder)
-* markdown_to_asciidoc (nl.jworks.markdown_to_asciidoc:markdown_to_asciidoc:1.0 - no url defined)
* pegdown (org.pegdown:pegdown:1.4.2 - http://pegdown.org)
* parboiled-core (org.parboiled:parboiled-core:1.1.6 - http://parboiled.org)
* parboiled-java (org.parboiled:parboiled-java:1.1.6 - http://parboiled.org)
-* swagger2markup (org.mockito:swagger2markup:1.3.2 - https://github.com/Swagger2Markup/swagger2markup)
* maven-plugin-api (org.apache.maven:maven-plugin-api:3.6.0 - https://github.com/apache/maven/tree/master/maven-plugin-api)
* maven-plugin-annotations (org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.0 - https://github.com/apache/maven-plugin-tools/tree/master/maven-plugin-annotations)
* maven-core (org.apache.maven:maven-core:3.6.0 - https://github.com/apache/maven/tree/master/maven-core)