Hi,
Tamas asked me to take a look at this bug report:
https://github.com/apache/maven-resolver-ant-tasks/issues/138
It highlights an issue I hope to get some advice on.
The essence of the issue is whether we should enforce a "global pom" or
not. Today we allow overriding it in the deploy task e.g:
<target name="testDeployOverrideGlobalPom" depends="setUp"> <repo:pom file="${project.dir}/dummy-pom.xml"/> <repo:deploy
remotereporef="distrepo"> <pom file="${project.dir}/other-pom.xml"/> </repo:deploy> </target>
But if the user ONLY specifies the pom as a nested element inside the
deploy e.g:
<target name="testDeployNoGlobalPom" depends="setUp">
<repo:deploy> <repo:artifact file="${artifact.file}"> <repo:pom
file="${project.dir}/dummy-pom.xml"/> </repo:artifact> </repo:deploy> </target>
Then we throw an NPE on line 133 of the AbstractDistTask (because there
is no global pom).
I have reproduced the error in a test here:
https://github.com/apache/maven-resolver-ant-tasks/pull/139
The question is if we should
1. Allow this usage (fix the NPE issue)
2. Not allow this and throw a BuildException stating that a global pom
must be registered before an override is specified.
What do you think?
Regards,
Per