I'm currently trying to build and export an Eclipe plugin with Maven (Tycho extension) but it throws a buch of API restriction errors
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:09 min
[INFO] Finished at: 2015-03-02T13:57:35+03:00
[INFO] Final Memory: 78M/187M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project GDBFifoBlocks: Compilation failure: Compilation failure:
[ERROR] /home/siarshai/Programming/Workspaces/eclipse-rcp-workspace/GDBFifoBlocksBackbone/src/neuromatrixplugin/fifoblocks/backbone/viewmodel/fifo/FIFOBlockBitFieldVMNode.java:[240]
[ERROR] update.setLabel(getMessageFormat().format(
[ERROR] messageAttrs, new StringBuffer(), null).toString(), columnIndex);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The method 'MessageFormat.format(Object[], StringBuffer, FieldPosition)' is not API (restriction on classpath entry '/home/siarshai/.m2/repository/p2/osgi/bundle/com.ibm.icu/52.1.1.v201501240615/com.ibm.icu-52.1.1.v201501240615.jar')
[ERROR] /home/siarshai/Programming/Workspaces/eclipse-rcp-workspace/GDBFifoBlocksBackbone/src/neuromatrixplugin/fifoblocks/backbone/viewmodel/fifo/FIFOBlockBitFieldVMNode.java:[345]
[ERROR] update.setLabel(getMessageFormat().format(combinedAttrs, new StringBuffer(), null).toString(), columnIndex);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The method 'MessageFormat.format(Object[], StringBuffer, FieldPosition)' is not API (restriction on classpath entry '/home/siarshai/.m2/repository/p2/osgi/bundle/com.ibm.icu/52.1.1.v201501240615/com.ibm.icu-52.1.1.v201501240615.jar')
[ERROR] /home/siarshai/Programming/Workspaces/eclipse-rcp-workspace/GDBFifoBlocksBackbone/src/neuromatrixplugin/fifoblocks/backbone/viewmodel/fifo/FIFOBlockBitFieldVMNode.java:[395]
[ERROR] update.setLabel(getMessageFormat().format(combinedAttrs, new StringBuffer(), null).toString(), columnIndex);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The method 'MessageFormat.format(Object[], StringBuffer, FieldPosition)' is not API (restriction on classpath entry '/home/siarshai/.m2/repository/p2/osgi/bundle/com.ibm.icu/52.1.1.v201501240615/com.ibm.icu-52.1.1.v201501240615.jar')
[ERROR] /home/siarshai/Programming/Workspaces/eclipse-rcp-workspace/GDBFifoBlocksBackbone/src/neuromatrixplugin/fifoblocks/backbone/viewmodel/fifo/FIFOBlockElementVMNode.java:[290]
[ERROR] update.setLabel(getMessageFormat().format(messageAttrs, new StringBuffer(), null).toString(), columnIndex);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The method 'MessageFormat.format(Object[], StringBuffer, FieldPosition)' is not API (restriction on classpath entry '/home/siarshai/.m2/repository/p2/osgi/bundle/com.ibm.icu/52.1.1.v201501240615/com.ibm.icu-52.1.1.v201501240615.jar')
[ERROR] /home/siarshai/Programming/Workspaces/eclipse-rcp-workspace/GDBFifoBlocksBackbone/src/neuromatrixplugin/fifoblocks/backbone/viewmodel/fifo/FIFOBlockElementVMNode.java:[366]
[ERROR] update.setLabel(getMessageFormat().format(combinedAttrs, new StringBuffer(), null).toString(), columnIndex);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The method 'MessageFormat.format(Object[], StringBuffer, FieldPosition)' is not API (restriction on classpath entry '/home/siarshai/.m2/repository/p2/osgi/bundle/com.ibm.icu/52.1.1.v201501240615/com.ibm.icu-52.1.1.v201501240615.jar')
My pom.xml files: (see this question for more details)
Parent project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>NMGDBPluginFeature</groupId>
<artifactId>NMGDBPluginFeature.parent</artifactId>
<version>1.0.0.gdbfifoblocks</version>
<packaging>pom</packaging>
<properties>
<tycho-version>0.22.0</tycho-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>eclipse-luna</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/luna</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.22.0</version>
<extensions>true</extensions>
<configuration>
<compilerArgument>-warn:none</compilerArgument>
<compilerArgument>-err:none</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
<modules>
<module>../GDBFifoBlocksBackbone</module>
<module>../NMGDBPluginFeature</module>
</modules>
</project>
Feature project:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>NMGDBPluginFeature</groupId>
<artifactId>NMGDBPluginFeature.parent</artifactId>
<version>1.0.0.gdbfifoblocks</version>
<relativePath>./../GeneralExportingProject</relativePath>
</parent>
<artifactId>NMGDBPluginFeature</artifactId>
<packaging>eclipse-feature</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.22.0</version>
<extensions>true</extensions>
<configuration>
<compilerArgument>-warn:none</compilerArgument>
<compilerArgument>-err:none</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
</project>
Plugin project:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>NMGDBPluginFeature</groupId>
<artifactId>NMGDBPluginFeature.parent</artifactId>
<version>1.0.0.gdbfifoblocks</version>
<relativePath>./../GeneralExportingProject</relativePath>
</parent>
<artifactId>GDBFifoBlocks</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.22.0</version>
<extensions>true</extensions>
<configuration>
<compilerArgument>-warn:none</compilerArgument>
<compilerArgument>-err:none</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
</project>
I'm sure that plugin and exporting feature configurations (i.e. MANIFEST and feature.xml) are written well. I've already tried:
- Set all API violations to "Ignore" in Eclipse > Window > Preferences > Java > Compiler > Error/Warning
- Deleted JRE from project's Build Path and added it again (as suggested in several bug topics)
- Added -warn:none to the pom.xml (can be seen in configurations presented above)
I found no additional recommendations in Google. Should I report this as a bug or is it my mistake?
MessageFormat
from 'com.ibm.icu'? Or were you trying to use the normaljava.text.MessageFormat
? – MindimindlesscompilerArgument
is not a parameter on thetycho-maven-plugin
, so this configuration has no effect. – Dandify