I'm making a Java application. I want to generate and deploy the Javadoc after each commit on main. I'm using Maven to generate the files.
From the documentation:
When this
pagesjob completes successfully, a specialpages:deployjob appears in the pipeline view. It prepares the content of the website for the GitLab Pages daemon.
In the pipeline, the stage job runs successfully, but no stages:deploy in sight. There is no Deploy>Pages in the sidebar, and accessing group.domain.com/my_username/project-slug/pages is 404 (directly accessing a file supposed to be in public doesn't work either).
I also checked the job's artifact : the zip file just contains the public folder with the right files inside (including index.html).
Here is my .gitlab-ci.yml :
variables:
MAVEN_OPTS: -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
default:
image: maven:3.9.6-eclipse-temurin-21
before_script:
- mvn -version
- cd winform-tester/
stages:
- build
- test
- deploy
- publish
cache:
paths:
- .m2/repository
build_job:
stage: build
script:
- mvn $MAVEN_OPTS compile
test_job:
stage: test
script:
- mvn $MAVEN_OPTS test
artifacts:
when: always
paths:
- winform-tester/target/surefire-reports/TEST-*.xml
reports:
junit:
- winform-tester/target/surefire-reports/TEST-*.xml
pages:
stage: publish
script:
- mvn $MAVEN_OPTS javadoc:javadoc
after_script:
- mv winform-tester/target/site/apidocs public
artifacts:
paths:
- public
only:
- main
Of course the jobs build_job and test_job are working as intended. Please tell me if you also need the pages job shell or pom.xml.
Thanks for the help.