Plugin fails when processing a git submodule folder
jackson-chris opened this issue · comments
The plugin (3.0 and 4.0.rc2) fails when processing a git submodule folder. The build will complete successfully but several errors are thrown and garbage is presented to the terminal. Documents are also attempted to be printed for some reason.
I cannot include a full stack trace but here is a partial one with some info redacted:
[INFO] Updating license headers...
[WARNING] failure occurred while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
[WARNING] faiure occurred while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
31m[WARNING] failure occurred while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
java.lang.RuntimeExceptionjav: [WARNING] failure occurred while calling class com.myc[1ila..lang.Runt;31mCould not compute the year of the last git commit for file REDACTEDmaven.plugin.license.git.CopyrightRangeProvider;31mjava.lang.RuntimeException
java.lang.RuntimeExceptionimeException: /cod[WARNINGm] Could not compute te/md: REDACTED/main.ymlhe year failure occurred while calling class com.mycila.maven.plugin.license.git.Cop: yrighCould not compute the year of the last git commit for file REDACTED/main.ymlof
[1;31 the lasattRangeProvider com.mycila.maven.plugin.license.git.CopyrightRangeProvider.getAdditionalPropertiest gmCould not compute the year of the last git commit for file /REDACTED/main.yml
(atit commit for fil
/REDACTED/main.yml com.mycila.maven.plugin.license.git.CopyrightRangeProvider.getAdditionalPropertiesCopyright RangeProvider.java:94)at com.mycila.maven.plugin.license.git.CopyrightRangeProvider.getAdditionalProperties
(CopyrightRan
WARN[1;31mjava.lang.RuntimeException: at com.mycila.maven.plugin.license.git.CopyrightRangeProvider.getAdditionalPropertiesING (CopyrightRangeProvider.java:94)
gePro (CopyrightRang eProvivider.java:94)
at[m] failure occurred while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
mC[WARNING] failure occurred while calling class com.mycila.maven.plugin.license.git.CopyrightRange der.java:94)
atom.mycila.maven.plugin.license.AbstractLicenseMojo$1.loadPro (java.ould not compute the year of tlang.RuntimeException: [Could not compute the year of the last git commit for file /REDACTED/main.ymlviderm com.mycila.maven.plugin.license.Abstractat com.mycila.maven.plugin.license.AbstractLicenseMojo$1.load[1mat c (AbstractLicenseMojo.java:473)
LicenseMojo$1.load
(AbstractLicenseMojo.java:473)
1mAbstra heat com.mycila.maven.plugin.license.git.CopyrightRangeProvider.getAdditionalPropertiesctLicenseMojo. (CopyrightRangeProvider.java:94atjava.lang.RuntimeExcep[atom.mycila.mav com.mycila.maven.plugin.licen1;33mWARNING] failure occurretion com.mycila.maven.plugin.license.document.Document.mergeProperties[m)java:473Document.java:97)
last git commit for file /REDACTED)
: at Could not compute the year of the last git commit for file /REDACTED/create_redis_configuration.sh
d while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
se[n.plugin.license.AbstractLicenseMojo$1.load31mjava (AbstractLicenseMojoWARNING] failure occurred wh.document.Document.mergeProperties at (Document.java:97)
at com.mycila.maven.plugin.license.header.Header.isMcom.mycila.maven.plugin.license.AbstractLicenseMojo$1.load (Abstraat com.mycila.maven.plugin.license.header.Header.isMatchForTextain/resource (Header.java:180) com.mycila.maven.plugin.license.document.Document.mergePropertiesctLicenseMojo.java:473)atchForText[m com.mycila.maven.plugin.li (Header.java:180)
il.ja.lang.RuntimeExva:473)
e calling class com. cense.git.Copyright
(Doc
s/ans uatRangeProvycila.mave cption: n.pCould not 1matider com.mycient[1mible/roleat.jla.maven.plugin.license.document.Document.mergeProperties.getAdditionalProperties (Docume (CopyrightRangeProvider.java:94)
at com.mycila.maven. ccomlugin.license.git.CopyrightRangeProvider
java.lang.RuntimeException: C[[1WARNING] failure ocould not compupute the year of the last git commit for fiom.mycila.maven.plugin.license.document.Document.hasHeaderplugin.license.AbstractLicenseMojo$1.loadnt.java:97)ava:97)
com.msREDACTED/main.ymlycila.
atle /REDACTED curmatred while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
the year of the last git commit for file REDACTED com.mycila.maven.plugin.license.header.Header.isMatchForText mat (
( (Document.java:85)
Header.java:180)
[at REDACTEDjava.lang.RuntimeException: [Co com.myuld not compute the year of the last git commit for filWARNING] failure occurred while calli/REDACTED/main.n.plugin.license.document.Document.hasHeaderm.mycila (Document.java:85)
com.my1mat com.mycila.maven.plugin.license.AbstractLicenseMojo$2.run (at com.mycila.maven.plugin.liceAbstractLicecila.maven.pluginat com.mycila.maven.plugin.lic.maven.plugin.license.header.Header.isMatchForTextymleREDACTED/main.ymlng class com.mycila.maven.plugin.license.git.CopyrightRangeProvidere jaccila.maven.plugin.license.document.Document.mergePropertiesREDACTED/main.yml
(Header.java:180 at com.mycila.maven.plugin.licensense.AbstractLicenseMojo$2.run.lin (AbstractLicenseMojo.java:511nse.git.CopyrightRangeProvider.getAdditionalProperties (CopyrightRangeProvider.java:94)
at[1mAbstractLicen com.mycila.maven.plugin.license.AbstractLicenseMojo$1.load (AbstractLicenseMojo.java:473)
at com.mycila.maven.plugin.license.)
seMojo.java:473)
cense.documee.git.CopyrightRangeProvider.getAdditionalProperties[m)
(CopyrightRangeProvider.java:94)
at [WADocument.java:97)
;31mjava.lang.RuntimeExceptionRNING] failure occurred while calling class com.mycila.maven.plugin.license.git.CopyrightRangeProvider
coat com.mycila.maven.plugin.license.AbstractLi
at com.mycila.mavent.Document.hasHeader dseMojo.java:511)cument.Docu[1m[1mat (. censeMojo$1.loadm.mycila. (AbstractLicejava.lang.RuntimeException:: Could not compute the year of the last git commit for file /REDACTEDmanifest.yaml
n maven.plugin.license.git.CopyrightRangeProvider.getAdditionalProperties (CopyrightRangeProvider.java:94)
plugin.license.document.Document.hasHeader1mDocument.java:85) com.mycila.maven.plugin.license.document.Document.mergePropertiesat java. (Document.java:97)ment.mergeProperties
at java
util
.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
at java.util.concurrent.FutureTask.run [ [1meMojmCould not compute the year of the last git commit for file REDACTED at com.mycila.maven.plugin.license.header.Header.isMatchForText (ato.java:473)
at com.mycila.maven.plugin.license.AbstractLicenseMojo$1.load(Fu tureTask.java:266)
1mat com.mycmDocu .tiat( cl.concurrent.Executors$RunnableAdapter.call[1mat ment.java:85)ila.maven.plugin.license.git.CopyrightRangeProvider.getAdditionalProperties (at java.util.concurrent.Executors$RunnableAdapter.call(AbstractLicenseMojo.java:473)
om.mycila.maven.plugin.license.git.CopyrightRangeProvider.getAdditionalPropertiesHeader.java:180)REDACTED/main.yml
at com.mycila.maven.plugin.license.document.Document.hasHeader (CopyrightRangeProvider.java:94)
[1mat com.mycila.maven.plugin.l
at com.mycila.maven.plugin.license.document.Document.mergeProperties (E (Document.java:97)1mCopyrightRangeProvider.java:94)
at com.mycila.maven.plugin.license.AbstractLicenseMojo$2.run(E (AbstractLicenseMojo.java:511)[m com.mycila.maven.plugin.license.AbstractLicenseMojo$2.runom.mycila.maven.plugin.license.header.Header.isMatchForTextDocument.java:97) (Header.java:180)
(AbstractLicenseMojo.java:
xecutors.java:511)
xecutors.java:511)
icense.document.Document.mergeProperties (at com.mycila.maven.plugin.license.AbstractLicenseMojo$1.load (Document.java:85)
at (AbstractLiceDocument.java:97)
at com.mycila.maven.plugin.license.header.Header.isMatchForText (Header.java:180)
[1mat)
at javat[1mat com.mycila.maven.plugin.license.AbstractLicenseMojo$1.load ([1mat atnseMojo. com.mycila.maven.plugin.license.AbstractLicenseMojo$2.run atjava:473)
com java.utiAbstractLicenseMojo.java:473 com.mya.util.concurrent.FutureTask.run java.ut (FutureTask.java:2at1mat com.mycila.maven.plugin.license.header.Header.isMatchForText[1mat java.util.concurrent.Executors$RunnableAdapter.call66)i l.concurrent.Executors$RunnableAdapter.callcila. [m)
lat com.mycila.maven.plugin.licen.mycila.maven.plugin.license.header.Header.isMatchForText co(AbstractLicenseMojo.java:511)m.mycila.maven.plugin.license.git.CopyrightRan (Heat com.mycila.maven.plugin.license.document.Document.mergePropertiesse.document.Document.mergeProperties.con current.FutureTask.run(E (FutureTask.java:266)
maven.plugin.license.document.Document.(
( com.mycila.maven.plugin.license.document.Document.hasHeader[1ma [1mExecutorshasHeaderat java.util.concurrent.ThreadPoolExecutor.runWorkerxecu tors.j(Doc (Documentader.java:180)geProvi
dat java.util.concurrent.Executors$RunnableAdapter.call
.java:97)
at com.mycila.maven.plugin.license.header.Header.isMatchForTextumentava:511 (Header.java:180)
(ThreadPoolE(Docume.java:511)
at(Document.java:85)
t java.util.concurrent.Executors$RunnableAdapter.callHeader.java:1 (Executors.java:511)at com.mycila.maven.plugin.license.AbstractLicenseMojo$2.run ja (AbstractLicenseMojo.java:511)
nt.java:85)xecutor.java )
.java:97)
at com.mycila.maven.plugin.license.headeat (Executors.java:511)
at java.util.concurrent.FutureTask.runer.getAd (d com.mycila.maven.plugin.license.document.Document.hasHeaderr.He (Document.java:85)atat:1149)
atata.util.concurrent.FutureTask.run
(FutureTask.java:266)
80)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511)
[m java.util.concurrent.Executors$RunnableAdapter.call com (.mycila. at java.util. java.util.concurrent.FutureTask.run
(ader.isMatitionalPFutureTask.java:266)ropertieschForText (Copy rigFutureTask.java:266)
concurrent.ThreadPoolExecutor$Worker.runcom.myci (ThreadPoolExecutor.java:624)
maveExecutors.java:511)atmatat com.my java.util.concurrent.FutureTask.runm java.util.c
n.plugin.license.AbstractLicenseMojo$2.runatAbstractLicenseMojo.java:511)
la.maven.plugin.license.document.Document.hasHeader (Document.javat java.util.concurrent.Executors$RunnableAhtRangeProvider.java:94)
(
Header.java:180) atdapter.calla:85Executors.java:511)
[1mat m java.lang.Thread.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutoncila.maven.plugin.licurrent.Futor.java:1149)
at java.util.concurrent.FutureTask.run (Thread.java:748)at java.util.concurrent.Executors$Ru com.mycila.maven.plugin.li m)
com.mycila
at j.maven.pla atcense.Absnnabl
(FutureTask.java:266at java.util.concurrent.ThreadPoolExeureTask.runcense.document.Document.hasHeader (Document.java:85)
cutor$Worker.run[m) (ThreadPoolExecuto[1meAdtractLicense java.util.concurrent.FutureTa va.util.concurrent.Executors$RunnableAdapter.callugin[1mat com.mycila.maven.plugi (Executors.java:511)
.license.atsk.runMojo$2.runapter.Caused by: java.lang.Runtir.ja
at (FutureTask.java:266) java.util.concurrent.Executors$RunnableAdap at com.mycila.maven.plugin.license.AbstractLicenseMojo$2.runva:624meException :(AbstractLicenseMojo.java:511)c
at java.util.concurrent.Executors$RunnableAdapter.call com.mycila.maven.plugin.license.AbstractLiAbstractL n.license.doatice java.util.concurrent.FutureTask.runcenseM ( (Executors.java:511)
(FutureTask.java:266)
all (Execut (AbstractLicenseMojo.java:511)
ter
.call (Executat[m)ors.java:5[1;31mCaatat java.util.concurrent.FutureTask.run[1mFutureTask.java:266)ojo$2.runnseMojo$1.loadc (AbstractLicenseMojo.java:473) (AbstractLicenseMojo.ja
(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorkernnot rel (ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run11
ators.java:511 [at java.util.concurrent.ThreadPoolExecutor.runWorker java.lang.Thread.runjava.util.concurrent.Executors$RunnableAdapter.call (ThreadPoolExecutor.java:624)
m)
ativize path ' java.util.concurrent.Executors$RunnableAdapter.callat java.util.concurrent.ThreadPoolExecutor.runWorkerva:511)
ument.Document.hasHeadera (Document.java:85)
atat (ThreadPoolExecutor.jav (Executors.java:511)REDACTED at (Executors.java:511) (Thread.java:748)
()
1mThreadPoolExecutor.java:1149)
Caused by: java.lang.R
java.lang.Thread.run k (
:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run java.util.concur (ThreadPoolExecutor.java:624)
tatcoreat1mThread.java:748)
/REDACTED java.util.concurrent.FutureTask.run uat m java.util.concurrent.FutureTask.runntimeExcREDACTED/main.yml' to directory 'REDACTED/'
the garbage that was printed to terminal:
62;4c62;4c62;4c62;4c62;4c62;4c62;4c62;4c62;4c62;4c
I updated the plugin configuration to skip directories that are git submodules and the issues goes away. Shouldn't git submodules be accounted for when the plugins configuration uses license-maven-plugin-git
dependency? Or the documentation at a minimum should state that git submodule directories should be excluded.
Hello @blindenvy ,
I would really love to go but this is really hard with such stack trace.
With the limited time everyone has supporting oss projects we rely a lot on people to make the bet efforts they can when reporting an issue.
Could you please give us more information like he output of mvn -version and please a readable stack trace ;-)
Also please describe your plugin configuration.
Thanks !
Duplicate of #206
readable stack trace ;-)
This is how maven and the plugin is printing the stack trace, I'm not sure what you're expecting on how to clean this up and make it more readable.
The version of maven that was used when this was experienced is:
○ mvn --version
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T11:06:16-04:00)
Maven home: /usr/local/Cellar/maven/3.6.2/libexec
Java version: 1.8.0_222, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"