mimil / docbkx-tools

The official docbkx-tools maven plugin (previously on code.google.com/p/docbkx-tools)
15 stars 6 forks source link

AbstractTransformerMojo.setUseStandardOutput is package scope, and therefore can't be implemented by a class in a different package #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the DocBkx Builder Maven Plugin with a POM exactly as for DocBkx Plugin 
except for the extra setting:
<packageName>example.docbook.maven</packageName>

2. Try to run mvn install

What is the expected output? What do you see instead?

The package should be built. Instead, it fails with the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
5.1:compile (default-compile) on project resources: Compilation failure
[ERROR] 
C:\Users\User\git\DocBook\plugin\target\generated-sources\example\docbook\maven\
DocbkxPdfMojo.java:[24,7] error: DocbkxPdfMojo is not abstract and does not 
override abstract method setUseStandardOutput(boolean) in 
AbstractTransformerMojo

What version of the product are you using? On what operating system?

DocBkx 2.0.15

Please provide any additional information below.

The cause of this is that this method is declared as follows in 
AbstractTransformerMojo:

  abstract void setUseStandardOutput(boolean useStandardOutput);

It should be:

  abstract protected void setUseStandardOutput(boolean useStandardOutput);

Because the method is currently declared in the "default" scope, and can only 
be overridden or accessed by subclasses in the same package. As I have declared 
my implementation to be generated in a different package, it cannot override 
the method (see 
http://stackoverflow.com/questions/3200174/javac-claims-that-im-not-overriding-a
-method-in-an-abstract-class-implementatio).

The obvious workaround is to have 
<packageName>com.agilejava.docbkx.maven</packageName>, which is what the 
ordinary implementation uses (and why you haven't seen this issue before).

Original issue reported on code.google.com by paul.mea...@gmail.com on 2 Aug 2014 at 2:09

GoogleCodeExporter commented 9 years ago
Hi,

sorry for the long delay (I run out of time for now), committed in r308 and 
deployed in snapshot.

Regards,
Cedric,

Original comment by MimilO...@gmail.com on 13 Aug 2014 at 9:34

GoogleCodeExporter commented 9 years ago

Original comment by MimilO...@gmail.com on 9 Jan 2015 at 9:29