3

Im creating an index.htm file with the asciidoctor-maven-plugin:2.2.2 and I get a build error, because the created file has no read permissions. mvn clean install

build failure stacktrace

file permissions

pom.xml

mvn clean install works on other machines. I am on a M1 Macbook Pro. I have tried to change Java version (currently using 17 Zulu) and Maven version (3.8.6), but no luck.

Harold L. Brown
  • 8,423
  • 11
  • 57
  • 109
Glup3
  • 144
  • 5

2 Answers2

2

asciidoctor internally uses JRuby, which in turn had related issue when running on M1: Wrong file mode/permission when opening/creating a new file [Apple Silicon, arm64, aarch64]

according to Update JNR for Apple Silicon varargs support #6985 you need to move on JRuby 9.2.21.0:

<plugin>
    <groupId>org.asciidoctor</groupId>
    <artifactId>asciidoctor-maven-plugin</artifactId>
    <dependencies>
        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby</artifactId>
            <!-- <artifactId>jruby-complete</artifactId> -->
            <version>9.2.21.0</version>
        </dependency>
....
Andrey B. Panfilov
  • 4,324
  • 2
  • 12
  • 18
0

you are not including your generated files directory to the classpath. try to add this ,

<build>
    <resources>
        <resource>
            <directory>${basedir}/src/main/resources</directory>
        </resource>
        <resource>
            <directory>${project.build.directory}/classes/generated-docs/api-gateway</directory>
        </resource>
    </resources>
    ...
</build>

${basedir}/src/main/resources ==> chage it with the right directory

Bacem W.
  • 92
  • 4