Spring boot SpringBootGuide创作:使用我的指南运行Sagan

Spring boot SpringBootGuide创作:使用我的指南运行Sagan,spring-boot,Spring Boot,为了呈现我自己的spring boot入门指南,我遵循以下两页: 我能跑萨根,但没有我自己的向导。特别是,第一个维基页面说: Example 1. sagan-site/src/main/resources/application.yml ... guides: owner: name: ${GITHUB_GUIDES_OWNER_NAME:/*your githubusername*/} type: ${GITHUB_GUIDES_OWNER_TY

为了呈现我自己的spring boot入门指南,我遵循以下两页:

我能跑萨根,但没有我自己的向导。特别是,第一个维基页面说:

Example 1. sagan-site/src/main/resources/application.yml

...
  guides:
    owner:
      name: ${GITHUB_GUIDES_OWNER_NAME:/*your githubusername*/}
      type: ${GITHUB_GUIDES_OWNER_TYPE:users}
...
但在萨根的代码中,它没有使用
GITHUB\u GUIDES\u OWNER\u NAME
。 我确实找到了定义组织属性的
sagan/sagan renderer/src/main/resources/application.yml
,但这样编辑并没有让sagan渲染:


我让萨根通过破解萨根代码来呈现我的指南(见下文)。基本上,从spring指南中获取指南列表,但从存储库中获取指南(在我的例子中,
ge0ffrey

对于它的价值(不多),这里是我的本地黑客补丁的区别:

Index: sagan-renderer/src/main/java/sagan/renderer/guides/GuideRenderer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sagan-renderer/src/main/java/sagan/renderer/guides/GuideRenderer.java   (revision 68d9ced83d8ee97c7972a0d603a9077299c0435f)
+++ sagan-renderer/src/main/java/sagan/renderer/guides/GuideRenderer.java   (date 1578485243882)
@@ -41,7 +41,7 @@
        GuideContentResource guideContent = new GuideContentResource();
        guideContent.setName(guideName);
        String repositoryName = type.getPrefix() + guideName;
-       String org = this.properties.getGuides().getOrganization();
+       String org = "ge0ffrey";
        String tempFilePrefix = org + "-" + repositoryName;

        File unzippedRoot = null;
Index: sagan-renderer/src/main/java/sagan/renderer/guides/GuidesController.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sagan-renderer/src/main/java/sagan/renderer/guides/GuidesController.java    (revision 68d9ced83d8ee97c7972a0d603a9077299c0435f)
+++ sagan-renderer/src/main/java/sagan/renderer/guides/GuidesController.java    (date 1578484725643)
@@ -53,6 +53,13 @@
                .toResources(this.githubClient.fetchOrgRepositories(properties.getGuides().getOrganization()))
                .stream().filter(guide -> !guide.getType().equals(GuideType.UNKNOWN))
                .collect(Collectors.toList());
+       Repository optaplannerGuide = new Repository(15L, "gs-constraint-solving-ai-optaplanner",
+               "spring-guides/gs-constraint-solving-ai-optaplanner", "OptaPlanner Guide description",
+               "https://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner/",
+               "git@github.com:ge0ffrey/gs-constraint-solving-ai-optaplanner.git",
+               "https://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner.git",
+               "git://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner.git", null);
+       guideResources.add(new GuideResource(optaplannerGuide));
        Resources<GuideResource> resources = new Resources<>(guideResources);

        for (GuideType type : GuideType.values()) {
@@ -70,7 +77,7 @@
        if (GuideType.UNKNOWN.equals(guideType)) {
            return ResponseEntity.notFound().build();
        }
-       Repository repository = this.githubClient.fetchOrgRepository(properties.getGuides().getOrganization(),
+       Repository repository = this.githubClient.fetchOrgRepository("ge0ffrey",
                guideType.getPrefix() + guide);
        GuideResource guideResource = this.guideAssembler.toResource(repository);
        if (guideResource.getType().equals(GuideType.UNKNOWN)) {
Index:sagan renderer/src/main/java/sagan/renderer/guides/guidesrenderer.java
创意附加信息:
子系统:com.intellij.openapi.diff.impl.patch.CharsetEP
UTF-8
===================================================================
---sagan renderer/src/main/java/sagan/renderer/guides/guides renderer.java(版本68d9ced83d8ee97c7972a0d603a9077299c0435f)
+++sagan renderer/src/main/java/sagan/renderer/guides/GuideRenderer.java(日期157848584243882)
@@ -41,7 +41,7 @@
GuideContentResource guideContent=新GuideContentResource();
guideContent.setName(guideName);
String repositoryName=type.getPrefix()+guideName;
-字符串org=this.properties.getGuides().getOrganization();
+字符串org=“ge0ffrey”;
字符串tempFilePrefix=org+“-”+repositoryName;
文件unzippedRoot=null;
索引:sagan renderer/src/main/java/sagan/renderer/guides/GuidesController.java
创意附加信息:
子系统:com.intellij.openapi.diff.impl.patch.CharsetEP
UTF-8
===================================================================
---sagan renderer/src/main/java/sagan/renderer/guides/guides controller.java(版本68d9ced83d8ee97c7972a0d603a9077299c0435f)
+++sagan renderer/src/main/java/sagan/renderer/guides/guides.java(日期1578484725643)
@@ -53,6 +53,13 @@
.toResources(此.githubClient.fetchOrgRepositories(properties.getGuides().getOrganization()))
.stream().filter(guide->!guide.getType().equals(GuideType.UNKNOWN))
.collect(Collectors.toList());
+Repository optaplannerGuide=新存储库(15L,“gs约束解决ai optaplanner”,
+“spring指南/gs约束解决ai optaplanner”,“optaplanner指南说明”,
+               "https://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner/",
+               "git@github.com:ge0ffrey/gs约束求解ai optaplanner.git“,
+               "https://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner.git",
+               "git://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner.git“,空);
+添加(新指南资源(optaplannerGuide));
资源=新资源(指南资源);
对于(GuideType类型:GuideType.values()){
@@ -70,7 +77,7 @@
if(GuideType.UNKNOWN.equals(GuideType)){
返回ResponseEntity.notFound().build();
}
-Repository Repository=this.githubClient.fetchOrgRepository(properties.getGuides().getOrganization(),
+Repository Repository=this.githubClient.fetchOrgRepository(“ge0ffrey”,
guideType.getPrefix()+guide);
GuideResource GuideResource=this.guideAssembler.toResource(存储库);
if(guideResource.getType().equals(GuideType.UNKNOWN)){
请注意,仅覆盖
应用程序.properties
中的
组织
是不起作用的,因为它需要首先获得所有指南的完整列表。如果您克隆其他存储库(不知道是哪些存储库),则可能会起作用

Index: sagan-renderer/src/main/java/sagan/renderer/guides/GuideRenderer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sagan-renderer/src/main/java/sagan/renderer/guides/GuideRenderer.java   (revision 68d9ced83d8ee97c7972a0d603a9077299c0435f)
+++ sagan-renderer/src/main/java/sagan/renderer/guides/GuideRenderer.java   (date 1578485243882)
@@ -41,7 +41,7 @@
        GuideContentResource guideContent = new GuideContentResource();
        guideContent.setName(guideName);
        String repositoryName = type.getPrefix() + guideName;
-       String org = this.properties.getGuides().getOrganization();
+       String org = "ge0ffrey";
        String tempFilePrefix = org + "-" + repositoryName;

        File unzippedRoot = null;
Index: sagan-renderer/src/main/java/sagan/renderer/guides/GuidesController.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sagan-renderer/src/main/java/sagan/renderer/guides/GuidesController.java    (revision 68d9ced83d8ee97c7972a0d603a9077299c0435f)
+++ sagan-renderer/src/main/java/sagan/renderer/guides/GuidesController.java    (date 1578484725643)
@@ -53,6 +53,13 @@
                .toResources(this.githubClient.fetchOrgRepositories(properties.getGuides().getOrganization()))
                .stream().filter(guide -> !guide.getType().equals(GuideType.UNKNOWN))
                .collect(Collectors.toList());
+       Repository optaplannerGuide = new Repository(15L, "gs-constraint-solving-ai-optaplanner",
+               "spring-guides/gs-constraint-solving-ai-optaplanner", "OptaPlanner Guide description",
+               "https://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner/",
+               "git@github.com:ge0ffrey/gs-constraint-solving-ai-optaplanner.git",
+               "https://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner.git",
+               "git://github.com/ge0ffrey/gs-constraint-solving-ai-optaplanner.git", null);
+       guideResources.add(new GuideResource(optaplannerGuide));
        Resources<GuideResource> resources = new Resources<>(guideResources);

        for (GuideType type : GuideType.values()) {
@@ -70,7 +77,7 @@
        if (GuideType.UNKNOWN.equals(guideType)) {
            return ResponseEntity.notFound().build();
        }
-       Repository repository = this.githubClient.fetchOrgRepository(properties.getGuides().getOrganization(),
+       Repository repository = this.githubClient.fetchOrgRepository("ge0ffrey",
                guideType.getPrefix() + guide);
        GuideResource guideResource = this.guideAssembler.toResource(repository);
        if (guideResource.getType().equals(GuideType.UNKNOWN)) {