Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin not working with Maven on Mac #26

Closed
Damounet opened this issue Sep 2, 2019 · 7 comments
Closed

Plugin not working with Maven on Mac #26

Damounet opened this issue Sep 2, 2019 · 7 comments

Comments

@Damounet
Copy link

Damounet commented Sep 2, 2019

Hello,

We are recently started using markdown to write doc and wanted to automate the production of pdf with our assembly plugin.

We tried this plugin and it's working like a charm on windows.
But I am running the project on my MacbookPro and the plugin is not working.

This is the configuration of the plugin we are using:

<plugin>
	<groupId>se.natusoft.tools.doc.markdowndoc</groupId>
	<artifactId>markdowndoc-maven-plugin</artifactId>
	<version>2.1.2</version>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>doc</goal>
			</goals>
			<configuration>
				<generatorOptions>
					<generator>pdf</generator>
					<inputPaths>CHANGELOG.md</inputPaths>
				</generatorOptions>
				<pdfGeneratorOptions>
					<resultFile>CHANGELOG.pdf</resultFile>
				</pdfGeneratorOptions>
			</configuration>
		</execution>
	</executions>
</plugin>

I ran maven in debug mode so that you have all the info:

[INFO] --- markdowndoc-maven-plugin:2.1.2:doc (default) @ PROXY ---
[DEBUG] Could not find metadata org.apache.pdfbox:pdfbox/maven-metadata.xml in local (/Users/user_adm/.m2/repository)
[DEBUG] Skipped remote request for org.apache.pdfbox:pdfbox/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Skipped remote request for org.apache.pdfbox:pdfbox/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=158110, ConflictMarker.markTime=34092, ConflictMarker.nodeCount=26, ConflictIdSorter.graphTime=80373, ConflictIdSorter.topsortTime=34329, ConflictIdSorter.conflictIdCount=18, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=595733, ConflictResolver.conflictItemCount=23, DefaultDependencyCollector.collectTime=76888497, DefaultDependencyCollector.transformTime=942732}
[DEBUG] se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:jar:2.1.2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0.5:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.0.5:compile
[DEBUG]          org.codehaus.plexus:plexus-utils:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.0.5:compile
[DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
[DEBUG]          org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.4:compile
[DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
[DEBUG]             org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[DEBUG]                org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
[DEBUG]    se.natusoft.tools.doc.markdowndoc:markdown-doc-lib:jar:2.1.2:compile
[DEBUG]       org.apache.pdfbox:pdfbox:jar:2.0.16:compile
[DEBUG]          org.apache.pdfbox:fontbox:jar:2.0.16:compile
[DEBUG]          commons-logging:commons-logging:jar:1.2:compile
[DEBUG]       se.natusoft.json:basic-json-lib:jar:1.0:compile
[DEBUG]       org.codehaus.groovy:groovy-all:jar:indy:2.4.4:compile
[DEBUG]    se.natusoft.tools.optionsmgr:OptionsManager:jar:2.0.3:compile
[DEBUG] Created new class realm plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2
[DEBUG] Importing foreign packages into class realm plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2
[DEBUG]   Included: se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:jar:2.1.2
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.6
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.0
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0
[DEBUG]   Included: org.sonatype.sisu:sisu-guava:jar:0.9.9
[DEBUG]   Included: se.natusoft.tools.doc.markdowndoc:markdown-doc-lib:jar:2.1.2
[DEBUG]   Included: org.apache.pdfbox:pdfbox:jar:2.0.16
[DEBUG]   Included: org.apache.pdfbox:fontbox:jar:2.0.16
[DEBUG]   Included: commons-logging:commons-logging:jar:1.2
[DEBUG]   Included: se.natusoft.json:basic-json-lib:jar:1.0
[DEBUG]   Included: org.codehaus.groovy:groovy-all:jar:indy:2.4.4
[DEBUG]   Included: se.natusoft.tools.optionsmgr:OptionsManager:jar:2.0.3
[DEBUG] Configuring mojo se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2:doc from plugin realm ClassRealm[plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2, parent: sun.misc.Launcher$AppClassLoader@3d4eac69]
[DEBUG] Configuring mojo 'se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2:doc' with basic configurator -->
[DEBUG]   (f) baseDir = /Users/user_adm/Documents/work/proxy
[DEBUG]   (s) generator = pdf
[DEBUG]   (s) inputPaths = CHANGELOG.md
[DEBUG]   (f) generatorOptions = se.natusoft.doc.markdown.generator.options.GeneratorOptions@431e86b1
[DEBUG]   (s) resultFile = CHANGELOG.pdf
[DEBUG]   (f) pdfGeneratorOptions = se.natusoft.doc.markdown.generator.options.PDFGeneratorOptions(resultFile:CHANGELOG.pdf, rootDir:null, title:null, subject:null, titlePageImage:null, author:null, version:null, copyright:null, authorLabel:Author:, versionLabel:Version:, pageLabel:Page, tableOfContentsLabel:Table of Contents, hideLinks:false, unorderedListItemPrefix:•, mss:null, generateSectionNumbers:false, generateTOC:false, generateTitlePage:false, help:false)
[DEBUG] -- end configuration --
No document source files were specified, and thus nothing were generated!
[INFO] 

On the windows computer of my colleague it works perfectly

[DEBUG] Could not find metadata org.apache.pdfbox:pdfbox/maven-metadata.xml in local (E:\.m2\repository)
[DEBUG] Skipped remote request for org.apache.pdfbox:pdfbox/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Skipped remote request for org.apache.pdfbox:pdfbox/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=26, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=18, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=23, DefaultDependencyCollector.collectTime=197, DefaultDependencyCollector.transformTime=2}
[DEBUG] se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:jar:2.1.2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0.5:compile
[DEBUG]       org.apache.maven:maven-model:jar:3.0.5:compile
[DEBUG]          org.codehaus.plexus:plexus-utils:jar:2.0.6:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.0.5:compile
[DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
[DEBUG]          org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.4:compile
[DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
[DEBUG]             org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[DEBUG]                org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
[DEBUG]    se.natusoft.tools.doc.markdowndoc:markdown-doc-lib:jar:2.1.2:compile
[DEBUG]       org.apache.pdfbox:pdfbox:jar:2.0.16:compile
[DEBUG]          org.apache.pdfbox:fontbox:jar:2.0.16:compile
[DEBUG]          commons-logging:commons-logging:jar:1.2:compile
[DEBUG]       se.natusoft.json:basic-json-lib:jar:1.0:compile
[DEBUG]       org.codehaus.groovy:groovy-all:jar:indy:2.4.4:compile
[DEBUG]    se.natusoft.tools.optionsmgr:OptionsManager:jar:2.0.3:compile
[DEBUG] Created new class realm plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2
[DEBUG] Importing foreign packages into class realm plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2
[DEBUG]   Included: se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:jar:2.1.2
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:2.0.6
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.0
[DEBUG]   Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0
[DEBUG]   Included: org.sonatype.sisu:sisu-guava:jar:0.9.9
[DEBUG]   Included: se.natusoft.tools.doc.markdowndoc:markdown-doc-lib:jar:2.1.2
[DEBUG]   Included: org.apache.pdfbox:pdfbox:jar:2.0.16
[DEBUG]   Included: org.apache.pdfbox:fontbox:jar:2.0.16
[DEBUG]   Included: commons-logging:commons-logging:jar:1.2
[DEBUG]   Included: se.natusoft.json:basic-json-lib:jar:1.0
[DEBUG]   Included: org.codehaus.groovy:groovy-all:jar:indy:2.4.4
[DEBUG]   Included: se.natusoft.tools.optionsmgr:OptionsManager:jar:2.0.3
[DEBUG] Configuring mojo se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2:doc from plugin realm ClassRealm[plugin>se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2, parent: sun.misc.Launcher$AppClassLoader@55f96302]
[DEBUG] Configuring mojo 'se.natusoft.tools.doc.markdowndoc:markdowndoc-maven-plugin:2.1.2:doc' with basic configurator -->
[DEBUG]   (f) baseDir = E:\nextIbis\ibis
[DEBUG]   (s) generator = pdf
[DEBUG]   (s) inputPaths = CHANGELOG.md
[DEBUG]   (f) generatorOptions = se.natusoft.doc.markdown.generator.options.GeneratorOptions@7ee548be
[DEBUG]   (s) resultFile = CHANGELOG.pdf
[DEBUG]   (f) pdfGeneratorOptions = se.natusoft.doc.markdown.generator.options.PDFGeneratorOptions(resultFile:CHANGELOG.pdf, rootDir:null, title:null, subject:null, titlePageImage:null, author:null, version:null, copyright:null, authorLabel:Author:, versionLabel:Version:, pageLabel:Page, tableOfContentsLabel:Table of Contents, hideLinks:false, unorderedListItemPrefix:?, mss:null, generateSectionNumbers:false, generateTOC:false, generateTitlePage:false, help:false)
[DEBUG] -- end configuration --
[INFO] Parsing the following files:
    E:\nextIbis\ibis\CHANGELOG.md
[INFO] All parsed!
Generating: E:\nextIbis\ibis\CHANGELOG.pdf
Using default MSS!
sept. 02, 2019 2:38:34 PM org.apache.pdfbox.pdmodel.PDPageContentStream close
AVERTISSEMENT: You did not call endText(), some viewers won't display your text
[INFO]

The file is present on my computer but not recognised by the plugin

➜  proxy git:(sprint6) ✗ pwd 
/Users/user_adm/Documents/work/proxy
➜  proxy git:(sprint6) ✗ ls CHANGELOG.md
CHANGELOG.md

I tried changing the inputPaths parameter and try ./CHANGELOG.MD ./.md ./..md and this does not work at all.
Any help would be appreciated.

@Arkinator
Copy link

Arkinator commented Sep 12, 2019

Thanks for reporting that bug! Same problem for me, was about to loose my sanity or report that bug for myself.
My pom looks like that:

<build>
        <plugins>
            <plugin>
                <groupId>se.natusoft.tools.doc.markdowndoc</groupId>
                <artifactId>markdowndoc-maven-plugin</artifactId>
                <version>2.1.2</version>

                <executions>
                    <execution>
                        <id>generate-docs</id>
                        <goals>
                            <goal>doc</goal>
                        </goals>
                        <phase>install</phase>
                        <configuration>

                            <generatorOptions>
                                <generator>pdf</generator>
                                <inputPaths>README.md</inputPaths>
                            </generatorOptions>

                            <pdfGeneratorOptions>
                                <resultFile>blub.pdf</resultFile>
                            </pdfGeneratorOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

I tried various placeholders and different paths, to no avail.

@tombensve
Copy link
Owner

Github is telling me that I'm supposed to get notifications, but I'm not!! I haven't seen this until now!

I will look at this ASAP!

@tombensve
Copy link
Owner

OK, I have read this over and over and fail to understand exactly what is it that is not working ? What is the problem ? I can see a lot of debug output, but not failures or error messages.

There is one thing I'm seeing:

No document source files were specified, and thus nothing were generated!

This means that none of the source files specified were found! And yes, there could be a better error message for that case :-).

In the 2 cases above I see:

<inputPaths>CHANGELOG.md</inputPaths>

and

<inputPaths>README.md</inputPaths>

Are these files at the root of the project ? Or are those in the root of a maven sub module ? Input files should always be specified relative to top level (root) POM! If specified relative to its own module then it will work when the module is built alone, but fail when the whole project is built.

For example from MarkdownDocs own submodule Docs:

Docs/src/MarkdownDocUserGuideStart.md

That is a full path from top root. Docs is a submodule.

That it works on Windows but not on Mac is however strange. I'm using MarkdownDoc on both Windows (10) and Mac and have never seen any behavior difference.


It would also be interesting to know what JDK version you are using ? I've run MarkdownDoc upp to JDK 11 without problems. As of JDK 12 there will be problems and it will be impossible to support both pre 12 and post 12 without 2 different versions. Personally I think that the JDK people have lost their minds.

@Damounet
Copy link
Author

Hello,

Haven't got any notification on your answer too, will check that too ! :D

So yes both the pom.xml, CHANGELOG.md and README.md are under the same root folder of the application.
The maven app does not have any module, it's a simple maven application.

My Java version is

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

I can't provide you access to the source code of the application, but if you want anything else, don't hesitate to contact me.

@r4fterman
Copy link

Just wanted to add my 2ct.
Plugin in Version 2.1.4 is working fine on my Mac and Maven:

          <plugin>
                <groupId>se.natusoft.tools.doc.markdowndoc</groupId>
                <artifactId>markdowndoc-maven-plugin</artifactId>
                <version>2.1.4</version>
                <executions>
                    <execution>
                        <id>generate-docs</id>
                        <goals>
                            <goal>doc</goal>
                        </goals>
                        <phase>install</phase>
                        <configuration>

                            <generatorOptions>
                                <generator>pdf</generator>
                                <inputPaths>${project.basedir}/README.md</inputPaths>
                            </generatorOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Mac Version: 11.2.3 (Big Sur)
Maven Version: Apache Maven 3.6.3

@Damounet
Copy link
Author

Thanks @r4fterman for the update.

Tested again on my mac and it seems to work fine with version 2.1.4

I close the issue as it resolved itself by magic :D

@tombensve
Copy link
Owner

Hmm ... I have not been receiving mail notification on activity in issues!

I found "Comments on Issues and Pull Requests [ ]" for email in setting unchecked! If that is default value then that is rather bad. It is now checked!

As I understand it the issue is now resolved.

There is now also a 2.1.5 but only contains build fixes due to Bintray shutting down.

<repositories>
    <repository>
        <id>natusoft-repo</id>
        <name>NS GitHub stuff repo</name>
        <url>https://download.natusoft.se/maven</url>
    </repository>
</repositories>

is now needed to get binaries. I've been looking at maven central again, but it is still rather complicated, still working against easy open sharing of open source binaries. I'm doing this on my free time, and I'm not about to let a company like sonatype waste my time. With Bintray it was trivial.

There is also a 3.0.0 coming that does not provide new functionality either, but bumps Groovy to version 3 and does some code cleanup, like missed @CompileStatic on some classes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants