[
https://issues.apache.org/jira/browse/CAMEL-10905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16444715#comment-16444715
]
ASF GitHub Bot commented on CAMEL-10905:
----------------------------------------
PascalSchumacher closed pull request #2284: CAMEL-10905: Make camel-grape work
on java 9 by replacing Groovy Ecli…
URL: https://github.com/apache/camel/pull/2284
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/components/camel-grape/pom.xml b/components/camel-grape/pom.xml
index 38bbb8d776d..078b8a4b687 100644
--- a/components/camel-grape/pom.xml
+++ b/components/camel-grape/pom.xml
@@ -32,9 +32,6 @@
<description>The grape component allows you to fetch, load and manage
additional jars when CamelContext is running</description>
<properties>
- <groovy-eclipse-batch.version>2.4.3-01</groovy-eclipse-batch.version>
- <groovy-eclipse-compiler.version>2.9.2-01</groovy-eclipse-compiler.version>
- <plexus-compiler-api.version>2.8.3</plexus-compiler-api.version>
<camel.osgi.export.pkg />
</properties>
@@ -89,35 +86,44 @@
<build>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>addSources</goal>
+ <goal>addTestSources</goal>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ <goal>generateTestStubs</goal>
+ <goal>compileTests</goal>
+ <goal>removeStubs</goal>
+ <goal>removeTestStubs</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-eclipse-batch</artifactId>
- <version>${groovy-eclipse-batch.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-eclipse-compiler</artifactId>
- <version>${groovy-eclipse-compiler.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-api</artifactId>
- <version>${plexus-compiler-api.version}</version>
- </dependency>
- </dependencies>
- <configuration>
- <compilerId>groovy-eclipse-compiler</compilerId>
- </configuration>
</plugin>
<plugin>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-eclipse-compiler</artifactId>
- <version>${groovy-eclipse-compiler.version}</version>
- <extensions>true</extensions>
+ <!-- if including source jars, use the no-fork goals
+ otherwise both the Groovy sources and Java stub sources
+ will get included in your jar -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ <goal>test-jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
@@ -143,32 +149,4 @@
</plugin>
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>jdk9-build</id>
- <activation>
- <jdk>9</jdk>
- </activation>
- <build>
- <plugins>
- <plugin>
- <!--Skip compile on Java 9
https://issues.apache.org/jira/browse/CAMEL-10905 -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <id>default-compile</id>
- <phase>none</phase>
- </execution>
- <execution>
- <id>default-testCompile</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git
a/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeProducer.groovy
b/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeProducer.groovy
index a3031493cf2..0b8d1563ba5 100644
---
a/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeProducer.groovy
+++
b/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeProducer.groovy
@@ -23,7 +23,6 @@ import org.apache.camel.impl.DefaultProducer
import static GrapeCommand.clearPatches
import static GrapeCommand.grab
import static GrapeCommand.listPatches
-import static GrapeConstants.GRAPE_COMMAND
class GrapeProducer extends DefaultProducer {
@@ -33,7 +32,7 @@ class GrapeProducer extends DefaultProducer {
@Override
void process(Exchange exchange) {
- def command = exchange.in.getHeader(GRAPE_COMMAND, grab,
GrapeCommand.class)
+ def command = exchange.in.getHeader(GrapeConstants.GRAPE_COMMAND,
grab, GrapeCommand.class)
switch(command) {
case grab:
def classLoader =
exchange.context.applicationContextClassLoader
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> camel-groovy fails on JAVA 9
> -----------------------------
>
> Key: CAMEL-10905
> URL: https://issues.apache.org/jira/browse/CAMEL-10905
> Project: Camel
> Issue Type: Sub-task
> Components: camel-groovy
> Reporter: John Poth
> Priority: Minor
> Attachments: out.txt
>
>
> I think the underlying problem comes from the
> [groovy-eclipse-compiler|https://github.com/groovy/groovy-eclipse/issues/265]
> and how (if possible) to pass JAVA 9 compiler args (full logs attached).
> Affected modules are camel-grape, camel-groovy and camel-example-groovy.
> {code}
> 240. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/dataformat/XmlParserDataFormat.java
> (at line 52)
> private XmlParser newParser() throws Exception {
> ^^^^^^^^^
> Exception cannot be resolved to a type
> ----------
> 241. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/dataformat/XmlParserDataFormat.java
> (at line 53)
> XmlParser xmlParser = new XmlParser(newSaxParser());
> ^^^^^^^^^^^^
> The method newSaxParser() from the type AbstractXmlDataFormat refers to the
> missing type SAXParser
> ----------
> 242. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/dataformat/XmlParserDataFormat.java
> (at line 54)
> xmlParser.setErrorHandler(getErrorHandler());
> ^^^^^^^^^^^^^^^
> The method getErrorHandler() from the type AbstractXmlDataFormat refers to
> the missing type ErrorHandler
> ----------
> 243. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/dataformat/XmlParserDataFormat.java
> (at line 59)
> private XmlNodePrinter newPrinter(OutputStream stream) {
> ^^^^^^^^^^^^
> OutputStream cannot be resolved to a type
> ----------
> 244. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/dataformat/XmlParserDataFormat.java
> (at line 60)
> XmlNodePrinter xmlNodePrinter = new XmlNodePrinter(new
> PrintWriter(stream));
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> The constructor XmlNodePrinter(PrintWriter) is undefined
> ----------
> 245. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/dataformat/XmlParserDataFormat.java
> (at line 60)
> XmlNodePrinter xmlNodePrinter = new XmlNodePrinter(new
> PrintWriter(stream));
> ^^^^^^^^^^^
> PrintWriter cannot be resolved to a type
> ----------
> ----------
> 246. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 1)
> /**
> ^
> The type javax.xml.transform.Source cannot be resolved. It is indirectly
> referenced from required .class files
> ----------
> 247. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 1)
> /**
> ^
> The type javax.xml.transform.TransformerException cannot be resolved. It is
> indirectly referenced from required .class files
> ----------
> 248. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 1)
> /**
> ^
> The type org.w3c.dom.Node cannot be resolved. It is indirectly referenced
> from required .class files
> ----------
> 249. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 19)
> import java.io.IOException;
> ^^^^^^^^^^^^^^^^^^^
> The import java.io.IOException cannot be resolved
> ----------
> 250. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 20)
> import javax.xml.parsers.ParserConfigurationException;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> The import javax.xml.parsers.ParserConfigurationException cannot be resolved
> ----------
> 251. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 21)
> import javax.xml.transform.TransformerException;
> ^^^^^^^^^^^^^^^^^^^
> The import javax.xml.transform cannot be resolved
> ----------
> 252. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 23)
> import org.w3c.dom.Node;
> ^^^^^^^
> The import org.w3c cannot be resolved
> ----------
> 253. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 24)
> import org.xml.sax.SAXException;
> ^^^^^^^^^^^^^^^^^^^^^^^^
> The import org.xml.sax.SAXException cannot be resolved
> ----------
> 254. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 34)
> public class GPathResultConverter {
> ^^^^^^^^^^^^^^^^^^^^
> Implicit super constructor Object() is undefined for default constructor.
> Must define an explicit constructor
> ----------
> 255. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 39)
> public GPathResult fromString(String input) throws
> ParserConfigurationException, SAXException, IOException {
> ^^^^^^
> String cannot be resolved to a type
> ----------
> 256. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 39)
> public GPathResult fromString(String input) throws
> ParserConfigurationException, SAXException, IOException {
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ParserConfigurationException cannot be resolved to a type
> ----------
> 257. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 39)
> public GPathResult fromString(String input) throws
> ParserConfigurationException, SAXException, IOException {
>
> ^^^^^^^^^^^^
> SAXException cannot be resolved to a type
> ----------
> 258. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 39)
> public GPathResult fromString(String input) throws
> ParserConfigurationException, SAXException, IOException {
>
> ^^^^^^^^^^^
> IOException cannot be resolved to a type
> ----------
> 259. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 40)
> return new XmlSlurper().parseText(input);
> ^^^^^^^^^^^^^^^^
> The constructor XmlSlurper() refers to the missing type
> ParserConfigurationException
> ----------
> 260. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 44)
> public GPathResult fromStringSource(StringSource input) throws
> IOException, SAXException, ParserConfigurationException {
>
> ^^^^^^^^^^^
> IOException cannot be resolved to a type
> ----------
> 261. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 44)
> public GPathResult fromStringSource(StringSource input) throws
> IOException, SAXException, ParserConfigurationException {
>
> ^^^^^^^^^^^^
> SAXException cannot be resolved to a type
> ----------
> 262. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 44)
> public GPathResult fromStringSource(StringSource input) throws
> IOException, SAXException, ParserConfigurationException {
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ParserConfigurationException cannot be resolved to a type
> ----------
> 263. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 45)
> return fromString(input.getText());
> ^^^^^^^
> The method getText() from the type StringSource refers to the missing type
> String
> ----------
> 264. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 49)
> public GPathResult fromNode(Node input, Exchange exchange) throws
> IOException, SAXException, ParserConfigurationException, TransformerException
> {
> ^^^^
> Node cannot be resolved to a type
> ----------
> 265. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 49)
> public GPathResult fromNode(Node input, Exchange exchange) throws
> IOException, SAXException, ParserConfigurationException, TransformerException
> {
>
> ^^^^^^^^^^^
> IOException cannot be resolved to a type
> ----------
> 266. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 49)
> public GPathResult fromNode(Node input, Exchange exchange) throws
> IOException, SAXException, ParserConfigurationException, TransformerException
> {
>
> ^^^^^^^^^^^^
> SAXException cannot be resolved to a type
> ----------
> 267. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 49)
> public GPathResult fromNode(Node input, Exchange exchange) throws
> IOException, SAXException, ParserConfigurationException, TransformerException
> {
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ParserConfigurationException cannot be resolved to a type
> ----------
> 268. ERROR in
> /home/jpoth/dev/git/apache/camel/components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java
> (at line 49)
> public GPathResult fromNode(Node input, Exchange exchange) throws
> IOException, SAXException, ParserConfigurationException, TransformerException
> {
>
> ^^^^^^^^^^^^^^^^^^^^
> TransformerException cannot be resolved to a type
> ----------
> 268 problems (268 errors)
> at
> org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1029)
> at
> org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:137)
> at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
> ... 20 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)