Navigation Menu

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

Maven site integration does not work with Maven Site Plugin 3.4 #125

Closed
mosabua opened this issue Sep 15, 2014 · 23 comments
Closed

Maven site integration does not work with Maven Site Plugin 3.4 #125

mosabua opened this issue Sep 15, 2014 · 23 comments
Milestone

Comments

@mosabua
Copy link

mosabua commented Sep 15, 2014

To reproduce just upgrade the version of the Maven Site Plugin in https://github.com/asciidoctor/asciidoctor-maven-examples/blob/master/asciidoc-site-example/pom.xml
and you will no longer get the html versions of your asciidoc generated..

@mojavelinux
Copy link
Member

I believe that @grdryn discovered that the .ad file extension is no longer getting picked up. (See #121). It's only catching the .adoc file extension. I thought I had both working, but apparently the hack doesn't work. Can you confirm it still matches files with the .adoc extension.

Also, do you know how to register more than one file extension for a site module? I couldn't figure it out.

@mojavelinux
Copy link
Member

On a closer read, I see that you are saying that the Asciidoctor site module might not be compatible with the newest Maven Site Plugin release. Are there any release notes that document what changed in this release?

@mosabua
Copy link
Author

mosabua commented Sep 15, 2014

I just figured out that it doesnt work with 3.4 by debugging my setups. I am not sure what changed in 3.4 but from all I know a bunch of internal things like doxia got changed.

I will ask on the Maven developer hangout this week about multiple extensions since I dont know myself. We could also ask on the dev list.

@mojavelinux
Copy link
Member

I will ask on the Maven developer hangout this week about multiple extensions since I dont know myself. We could also ask on the dev list.

Great!

@mosabua
Copy link
Author

mosabua commented Sep 15, 2014

Btw. in terms of the file extension.. I think it would be better to make it a config option for the plugin .. rather than supporting multiple. That should be easy to implement.

@mosabua
Copy link
Author

mosabua commented Sep 15, 2014

Forget what I said.. its already there.

@mosabua
Copy link
Author

mosabua commented Sep 16, 2014

I take it back again... it seems like the site integration does not use the parameter to set the extension into account.

@mosabua
Copy link
Author

mosabua commented Sep 19, 2014

Seems like multiple extensions is not supported at the moment but could be added.

We discussed it a bit more here https://www.youtube.com/watch?v=yfY-kbHj4VU

@mojavelinux
Copy link
Member

Thanks @mosabua. The time offset for that discussion seems to be around 9:10.

@hboutemy
Copy link
Contributor

PR #130 created with a fix for m-site-p 3.4 (Doxia 1.6)

I don't know what is the multiple file extension question

LightGuard added a commit that referenced this issue Oct 1, 2014
#125 added ParserModule implementation needed by Doxia 1.6/m-site-p 3.4
@mosabua
Copy link
Author

mosabua commented Oct 1, 2014

@hboutemy it would be good if filenames with the extensions .adoc as well as .asciidoc are picked up automatically when locating them in src/site/asciidoc

@ptahchiev
Copy link
Contributor

My file extensions are .adoc and they are not picked up by maven-site-plugin 3.4

@mojavelinux
Copy link
Member

I don't understand how to register multiple file extensions for a site module. If someone knows how to do it, please feel free to file a pull request. It will be most appreciated :)

@ptahchiev
Copy link
Contributor

You need to wait for the next release of the doxia plugin. Once that is done you will be able to simply do:

    /**
     * The extension for AsciiDoc files.
     */
    public static final String[] FILE_EXTENSION = { "adoc", "asciidoc" };

    /**
     * Build a new instance of {@link AsciidoctorParserModule}.
     */
    public AsciidoctorParserModule()
    {
        super( SOURCE_DIRECTORY, FILE_EXTENSION, AsciidoctorParser.ROLE_HINT );
    }

@mojavelinux
Copy link
Member

Great news!!

@mosabua
Copy link
Author

mosabua commented Mar 30, 2015

@paranoiabla what version of doxia? I might be able to push for a release on the Maven dev list. If its not already in progress..

@ptahchiev
Copy link
Contributor

The 2 pullrequests I have linked above (for maven-doxia and maven-doxiasitetools) need to be merged, a new release of doxia need to be issued. I believe @hboutemy is taking care of that :)

@mdlinville
Copy link

I'm not sure if my problem is relating to this one. Using Maven site plugin 3.4, I can get .adoc files in src/site/asciidoc to build into standalone themed HTML files. However, if a file includes other files, the included files do not get resolved. For instance, in src/site/asciidoc/ I have book.adoc, which includes chapters/installation.adoc, chapters/administration.adoc, etc. If I build book.adoc using an execution of the asciidoctor plugin, it works. However, if I try to build it using mvn site, the includes do not get resolved. Presumably there is a step where everything gets concatenated into one big .adoc before building, and that is not happening with the 'mvn site' target.

I am happy to file this as a separate issue, but it seems that it might be related here so I thought I would post here first.

@mojavelinux
Copy link
Member

@mstanleyjones The problem here is that the configuration of Asciidoctor within the Maven Site plugin is extremely limited. Likely what is happening is that the includes are not being found because Asciidoctor is being invoked without the proper base directory, and a custom base directory cannot be set. We really need to figure out how we can configure Asciidoctor when it is invoked via the Maven Site plugin. In essence, we need a configuration block like the regular plugin has.

A first step here is to get includes working in the example project so that we know it at least works (and can explore the problem in depth). See https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoc-maven-site-example

@mojavelinux
Copy link
Member

@mstanleyjones As I suspected, the baseDir is not being set and is therefore defaulting to the root of the project. Thus, to resolve an include, it has to begin with src/site/asciidoc. That needs to be fixed because it should match the behavior of the main plugin.

@mojavelinux
Copy link
Member

See #180

@mojavelinux
Copy link
Member

I believe this issue was resolved in 1.5.2. We're addressing some of the other points raised in this thread as part of 1.5.3.

@mojavelinux mojavelinux added this to the 1.5.2 milestone Dec 14, 2015
@mosabua
Copy link
Author

mosabua commented Dec 16, 2015

Awesome news. Looking forward to the new release!

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

No branches or pull requests

5 participants