1

When I run mvn javadoc:javadoc locally, it gives me a bunch of warnings—empty @return tags, unknown tags etc.—but eventually builds the Javadoc tree.

On GitLab CI, I have the following in .gitlab-ci-yml:

    variables:
      MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
    
    # [...]
    
    deploy:jdk8:
      stage: deploy
      script:
        - if [ ! -f ci_settings.xml ];
            then echo "CI settings missing\! If deploying to GitLab Maven Repository, please see https://docs.gitlab.com/ee/user/project/packages/maven_repository.html#creating-maven-packages-with-gitlab-cicd for instructions.";
          fi
        - 'mvn $MAVEN_CLI_OPTS deploy -s ci_settings.xml'
        - 'mvn javadoc:javadoc'
        - 'cp -r target/site/apidocs public/javadoc/dev'
      artifacts:
        paths:
        - public
      only:
        - master
        - dev

Here, Javadoc generation fails, with the previously mentioned warnings being reported as errors.

I am ultimately going to fix these things, but in the meantime, I would like Javadoc on CI to behave like its local counterpart. Where is the setting to accomplish that?

DV82XL
  • 5,350
  • 5
  • 30
  • 59
user149408
  • 5,385
  • 4
  • 33
  • 69
  • @DV82XL what is the point of your edit suggestion, apart from adding an extra 4 spaces at the beginning of each line? `variables` and `deploy` are top-level elements in my `.yml`, no indentation. Looking at the diff, a minimum of 4 spaces indentation per line (marking the `.yml` as code) was already there… – user149408 Aug 20 '20 at 18:39

1 Answers1

1

Changing the mvn javadoc:javadoc line as follows did the trick for me:

    - 'mvn javadoc:javadoc -DadditionalJOption=-Xdoclint:none'

Still not sure why this sems to be the default behavior on my local Maven installation but not on GitLab, but at least this solves my issue for now.

user149408
  • 5,385
  • 4
  • 33
  • 69