You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure that default value for snippets attribute is an absolute path
Previously, the snippets attribute was absolute when using Gradle and
relative to the docdir when using Maven. The relative path that was
used with Maven only worked as long as the working directory when
invoking Asciidoctor was the same as the docdir. This was the case
until 3.1.0 of the Asciidoctor Maven Plugin when the working
directory and docdir diverged at which point the snippets could no
longer be found.
This commit updates the snippets directory resolver to return an
absolute file when using Maven, just has it already does when using
Gradle. The resolution for Gradle has also been updated to explicity
make the File absolute rather than relying on the gradle-projectdir
or projectdir attributes having an absolute value.
Fixesgh-950
Copy file name to clipboardexpand all lines: spring-restdocs-asciidoctor/src/main/java/org/springframework/restdocs/asciidoctor/SnippetsDirectoryResolver.java
+4-4
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,7 @@
25
25
26
26
/**
27
27
* Resolves the directory from which snippets can be read for inclusion in an Asciidoctor
28
-
* document. The resolved directory is relative to the {@code docdir} of the Asciidoctor
29
-
* document that it being rendered.
28
+
* document. The resolved directory is absolute.
30
29
*
31
30
* @author Andy Wilkinson
32
31
*/
@@ -46,7 +45,7 @@ public File getSnippetsDirectory(Map<String, Object> attributes) {
Copy file name to clipboardexpand all lines: spring-restdocs-asciidoctor/src/test/java/org/springframework/restdocs/asciidoctor/SnippetsDirectoryResolverTests.java
+10-7
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2014-2023 the original author or authors.
2
+
* Copyright 2014-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -39,13 +39,13 @@ public class SnippetsDirectoryResolverTests {
0 commit comments