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

[ci] Building docs for release fails #1328

Closed
adangel opened this Issue Sep 2, 2018 · 3 comments

Comments

Projects
None yet
1 participant
@adangel
Copy link
Member

adangel commented Sep 2, 2018

We now have an error message:

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
	at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
	at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:55)
Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Strings
	at org.sonatype.nexus.maven.staging.deploy.DeployLifecycleParticipant.getPluginByGAFromContainer(DeployLifecycleParticipant.java:238)
	at org.sonatype.nexus.maven.staging.deploy.DeployLifecycleParticipant.getNexusMavenPluginFromContainer(DeployLifecycleParticipant.java:182)
	at org.sonatype.nexus.maven.staging.deploy.DeployLifecycleParticipant.getBuildPluginsNexusMavenPlugin(DeployLifecycleParticipant.java:163)
	at org.sonatype.nexus.maven.staging.deploy.DeployLifecycleParticipant.afterProjectsRead(DeployLifecycleParticipant.java:95)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:264)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
	... 7 more
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Strings
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
	... 25 more

This happens, while trying to determine the version of PMD:

VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec|tail -1)

(Edit: I've removed on master already "tail -1" - it was once needed, when mvnw returned its version even with -quiet)

The result is, that the VERSION is determined as "---------------------------------------------------".

We build the documentation, but the resulting zip file is called pmd-doc----------------------------------------------------.zip.

This happens in .travis/build-doc.sh.

Later on, in .travis/release.sh, the same happens with the version. So it's at least consistent...
However, we still don't commit and push:
https://travis-ci.org/pmd/pmd/jobs/423595900#L818

On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
	pmd----------------------------------------------------/
nothing added to commit but untracked files present (use "git add" to track)
[INFO] Generating sitemap.xml
On branch master
nothing to commit, working tree clean

It seems like, that the command git add pmd-${RELEASE_VERSION} does nothing...

Any ideas?

@adangel adangel added this to the 6.8.0 milestone Sep 2, 2018

@adangel

This comment has been minimized.

Copy link
Member

adangel commented Sep 2, 2018

I cleared the cache on travis and ran the job again - it worked.

The same (or a similar error) was happening on master even before the release, this resulted in https://pmd.github.io/pmd/ not being updated since August 12th (see commits to branch gh-pages).

We should somehow detect this situation an fail the build...

@adangel adangel removed this from the 6.8.0 milestone Sep 29, 2018

@adangel

This comment has been minimized.

Copy link
Member

adangel commented Nov 25, 2018

From the last release log (6.9.0):

https://travis-ci.org/pmd/pmd/jobs/447430723#L808

It looks like that the sitemap generation didn't change the sitemap.xml file, and thus the commit was empty and the command "git commit..." ended with a failure, which stopped the release script at this position.
Since it's after the install step in travis, this doesn't mark the whole build fail, that's why it's still green.

I'm investigating....

@adangel adangel added this to the 6.10.0 milestone Nov 25, 2018

@adangel

This comment has been minimized.

Copy link
Member

adangel commented Nov 25, 2018

The problem seems to be the sparse checkout - I'm only checking out the folder latest, since that is being replaced. And adding a new folder (e.g. for the new release pmd-doc-x.y.z), seems to fine as well. But files in the base directory cannot be changed obviously with sparse checkout...

@adangel adangel self-assigned this Nov 25, 2018

@adangel adangel closed this in 1f76eb0 Nov 25, 2018

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