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

Fails building with Javadoc #13

Closed
DJViking opened this issue Oct 22, 2018 · 11 comments
Closed

Fails building with Javadoc #13

DJViking opened this issue Oct 22, 2018 · 11 comments

Comments

@DJViking
Copy link
Contributor

This plugin does not work when building with Javadoc

> Task :javadoc FAILED
/home/sverre/workspace/movies/src/main/java/module-info.java:6: error: module not found: 
javafx.controls
    requires javafx.controls;
               ^
/home/sverre/workspace/movies/src/main/java/module-info.java:7: error: module not found: javafx.fxml
    requires javafx.fxml;
               ^
/home/sverre/workspace/movies/src/main/java/module-info.java:8: error: module not found: javafx.web
    requires javafx.web;
               ^
/home/sverre/workspace/movies/src/main/java/module-info.java:9: error: module not found: 
javafx.graphics
    requires javafx.graphics;
                   ^
/home/sverre/workspace/movies/src/main/java/module-info.java:10: error: module not found: 
javafx.media
    requires javafx.media;
                   ^
/home/sverre/workspace/movies/src/main/java/module-info.java:12: error: module not found: 
org.apache.logging.log4j
    requires org.apache.logging.log4j;

build.gradle

task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives jar
    archives sourcesJar
    archives javadocJar
}

Without this plugin I have a modules.gradle with the following Javadoc configuration:

javadoc {
    inputs.property("moduleName", moduleName)
    doFirst {
        exclude "**/module-info.java"
        options.addStringOption('-module-path', classpath.asPath)
        options.addStringOption('-add-modules', 'javafx.controls')
        options.addStringOption('-add-modules', 'javafx.fxml')
        options.addStringOption('-add-modules', 'javafx.web')
        options.addStringOption('-add-modules', 'javafx.graphics')
        options.addStringOption('-add-modules', 'javafx.media')
        options.addStringOption('-class-path', "")
        options.addBooleanOption('html5', true)
    }
}
@aalmiray
Copy link
Contributor

Encountered this problem too when testing out this plugin with the aalmiray/ikonli build. Resorted to the following

suprojects { subproj ->
    afterEvaluate {
        javadoc {
            inputs.property('moduleName', subproj.moduleName)
            doFirst {
                options.addStringOption('-module-path', classpath.asPath)
                classpath = files()
            }
        }
    }
}

@paulbakker
Copy link
Collaborator

First part of a fix in this PR: #20.
Still wouldn't fix the problem for @DJViking, because we need a way to specify extra modules. I'm considering adding dsl syntax for this, such as:

   addModules: [
      'module1', 'module2'
  ]
}

@paulbakker
Copy link
Collaborator

Fixed with #20 and #21

@DJViking
Copy link
Contributor Author

DJViking commented Nov 2, 2018

I have now tried to run with 1.1.1 of the plugin
Getting this error. The other errors are gone.

> Task :javadoc FAILED
/home/sverre/workspace/movies/src/main/java/module-info.java:12: error: module not found: 
org.apache.logging.log4j
    requires org.apache.logging.log4j;

@paulbakker
Copy link
Collaborator

Is the org.apache.logging.log4j module configured as a dependency?

@DJViking
Copy link
Contributor Author

DJViking commented Nov 3, 2018

Yes,

build.gradle

apply from: rootProject.file('dependencies.gradle')

dependencies.gradle

final def log4jGroup = 'org.apache.logging.log4j'
final def log4jVersion = '2.11.1'

dependencies {
    compile group: log4jGroup, name: 'log4j-api', version: log4jVersion
    compile group: log4jGroup, name: 'log4j-core', version: log4jVersion
    compile group: 'com.lmax', name: 'disruptor', version:'3.3.7'
}

module-info.java

requires org.apache.logging.log4j;

@DJViking
Copy link
Contributor Author

Will #34 fix this last remaining problem?

@paulbakker
Copy link
Collaborator

That's already merged in the last release, so if you're using that and it still doesn't work, there's another problem. If so, feel free to reopen this.

@DJViking
Copy link
Contributor Author

I am using v1.1.1. The #34 was merged in after and there is no v1.1.2 available.

@DJViking
Copy link
Contributor Author

DJViking commented Nov 21, 2018

Tried now with the latest v1.2.0, but getting same problem

Task :javadoc FAILED
/home/sverre/workspace/movies/src/main/java/module-info.java:12: error: module not found: org.apache.logging.log4j
requires org.apache.logging.log4j;

The Log4j is a multi version JAR with the module-info.class within META-INF/versions/9

@mpe85
Copy link

mpe85 commented Mar 11, 2019

I'm facing a very similar problem:

[...]\src\main\java\module-info.java:3: error: module not found: net.bytebuddy
requires net.bytebuddy;

ByteBuddy is also a multi release jar with the module-info.class inside META-INF/versions/9

Could you please re-open this issue and have another look at it?

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