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

disable javadoc for modules which don’t have a public or protected clases #17

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

sdelamo
Copy link
Collaborator

@sdelamo sdelamo commented Oct 8, 2024

javadoc fails with:

error: No public or protected classes found to document.

…asses

javadoc fails with:
> error: No public or protected classes found to document.
@sdelamo sdelamo requested a review from graemerocher October 8, 2024 13:34
@sdelamo
Copy link
Collaborator Author

sdelamo commented Oct 8, 2024

Even javadoc is disabled for micronaut-langchain-jlama modules, a module compatible only with 21 and with no public or protected classes, running global javadoc fails with:

./gradlew javadoc
Type-safe project accessors is an incubating feature.
Project accessors enabled, but root project name not explicitly set for 'buildSrc'. Checking out the project in different folders will impact the generated code and implicitly the buildscript classpath, breaking caching.

> Task :javadoc FAILED
/Users/sdelamo/github/micronaut-projects/micronaut-langchain4j/micronaut-langchain4j-jlama/build/aggregation/javadoc/io/micronaut/langchain4j/jlama/JlamaModule.java:21: error: cannot access JlamaChatModel
import dev.langchain4j.model.jlama.JlamaChatModel;
                                  ^
  bad class file: /Users/sdelamo/.gradle/caches/modules-2/files-2.1/dev.langchain4j/langchain4j-jlama/0.35.0/81c627ec5dfca426264627c3b9b04167b20688ee/langchain4j-jlama-0.35.0.jar(/dev/langchain4j/model/jlama/JlamaChatModel.class)
    class file has wrong version 65.0, should be 61.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/sdelamo/github/micronaut-projects/micronaut-langchain4j/micronaut-langchain4j-jlama/build/aggregation/javadoc/io/micronaut/langchain4j/jlama/JlamaModule.java:22: error: cannot access JlamaEmbeddingModel
import dev.langchain4j.model.jlama.JlamaEmbeddingModel;
                                  ^
  bad class file: /Users/sdelamo/.gradle/caches/modules-2/files-2.1/dev.langchain4j/langchain4j-jlama/0.35.0/81c627ec5dfca426264627c3b9b04167b20688ee/langchain4j-jlama-0.35.0.jar(/dev/langchain4j/model/jlama/JlamaEmbeddingModel.class)
    class file has wrong version 65.0, should be 61.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/sdelamo/github/micronaut-projects/micronaut-langchain4j/micronaut-langchain4j-jlama/build/aggregation/javadoc/io/micronaut/langchain4j/jlama/JlamaModule.java:23: error: cannot access JlamaStreamingChatModel
import dev.langchain4j.model.jlama.JlamaStreamingChatModel;
                                  ^
  bad class file: /Users/sdelamo/.gradle/caches/modules-2/files-2.1/dev.langchain4j/langchain4j-jlama/0.35.0/81c627ec5dfca426264627c3b9b04167b20688ee/langchain4j-jlama-0.35.0.jar(/dev/langchain4j/model/jlama/JlamaStreamingChatModel.class)
    class file has wrong version 65.0, should be 61.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/sdelamo/github/micronaut-projects/micronaut-langchain4j/micronaut-langchain4j-jlama/build/aggregation/javadoc/io/micronaut/langchain4j/jlama/JlamaModule.java:35: error: cannot find symbol
            impl = JlamaChatModel.class)
                   ^
  symbol: class JlamaChatModel
/Users/sdelamo/github/micronaut-projects/micronaut-langchain4j/micronaut-langchain4j-jlama/build/aggregation/javadoc/io/micronaut/langchain4j/jlama/JlamaModule.java:39: error: cannot find symbol
            impl = JlamaStreamingChatModel.class
                   ^
  symbol: class JlamaStreamingChatModel
/Users/sdelamo/github/micronaut-projects/micronaut-langchain4j/micronaut-langchain4j-jlama/build/aggregation/javadoc/io/micronaut/langchain4j/jlama/JlamaModule.java:43: error: cannot find symbol
            impl = JlamaEmbeddingModel.class
                   ^
  symbol: class JlamaEmbeddingModel
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/Users/sdelamo/github/micronaut-projects/micronaut-langchain4j/build/tmp/javadoc/javadoc.options'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1s

@melix any idea what we could do to workaround this?

@sdelamo sdelamo changed the title disable javadoc for modules which don’t have a public or protected cl… disable javadoc for modules which don’t have a public or protected clases Oct 8, 2024
@melix
Copy link
Collaborator

melix commented Oct 8, 2024

Let me take a look at the Java 21 issue, but I think the initial problem, which is disabling javadoc for some modules, will not work when publishing to Maven Central, because javadocs are mandatory.

@melix melix force-pushed the disable-javadoc-modules-with-no-public branch from 5f13043 to c4f7e14 Compare October 8, 2024 13:56
Copy link

sonarqubecloud bot commented Oct 8, 2024

@melix
Copy link
Collaborator

melix commented Oct 8, 2024

Issue should be fixed now. The empty javadocs are not a problem. Should they be, a better solution than disabling the javadocs would be to create a package-info.java file.

@sdelamo sdelamo merged commit cf75798 into master Oct 8, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants