Maven package error using geospark library - eclipse

Currently, I am working on geospatial analytics use case and I am using spark 2.4.0 along with geospark library.When I am trying to create the application jar file using eclipse it is giving me the below error.Could you please help me to resolve the below maven dependency error?
Maven File:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.12</artifactId>
<version>2.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.scala-lang/scala-library -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-sql -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.12</artifactId>
<version>2.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.datasyslab/geospark -->
<dependency>
<groupId>org.datasyslab</groupId>
<artifactId>geospark</artifactId>
<version>1.2.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.datasyslab/geospark-sql -->
<dependency>
<groupId>org.datasyslab</groupId>
<artifactId>geospark-sql_2.3</artifactId>
<version>1.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.datasyslab/geospark-viz -->
<dependency>
<groupId>org.datasyslab</groupId>
<artifactId>geospark-viz_2.3</artifactId>
<version>1.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.kudu/kudu-client -->
<dependency>
<groupId>org.apache.kudu</groupId>
<artifactId>kudu-client</artifactId>
<version>1.6.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.kudu/kudu-spark2 -->
<dependency>
<groupId>org.apache.kudu</groupId>
<artifactId>kudu-spark2_2.11</artifactId>
<version>1.6.0</version>
<scope>test</scope>
</dependency>
Error:
geospark-sql_2.3-1.2.0.jar of GFence build path is cross-compiled with an incompatible version of Scala (2.3.0). In case this report is mistaken, this check can be disabled in the compiler preference page.
Description Resource Path Location Type
geospark-viz_2.3-1.2.0.jar of GFence build path is cross-compiled with an incompatible version of Scala (2.3.0). In case this report is mistaken, this check can be disabled in the compiler preference page.
kudu-spark2_2.11-1.6.0.jar of GFence build path is cross-compiled with an incompatible version of Scala (2.11.0). In case this report is mistaken, this check can be disabled in the compiler preference page.
GeoSpark version = 1.2.0
Apache Spark version = 2.4.0
JRE version = 1.8.0
API type = Scala
Thanks,
Sumit

Go to Windows -> Preferences
Expand Scala preferences & select Compiler.
In Compiler preferences tab go to Build manager & uncheck withVersionClasspathValidator check box.
Screenshot of the same::

Related

I can't create the Spark Maven-Scala project with IntelliJ 2022.2.2 on Ubuntu

I'm following a course on Udemy and this course is about the Scala-Maven with Spark.
Our instructor is writing codes on IntelliJ. The problem is that my instructor has IntelliJ (2018) and spark(2.2) but these versions are so old. First, I tried with the old IntelliJ version and it worked but then I decided to use the current Spark and IntelliJ because we are in 2022.
So, I downloaded the İntellij 2022 version but I couldn't open the Scala-Maven project on IntelliJ. (Also, I downloaded the current Spark version)
I watched some YouTube videos on the internet about how we can create a Scala-Maven project on İntellij and the problem is when they create a new project on the IntelliJ they are not choosing the archetypes which are in the picture https://i.stack.imgur.com/smRhs.png instead they are creating their archetype.
IntelliJ gives me an error when I try this method and tells me the Desired archetype does not exist.
So, why I'm facing this error? or how can I create a Spark-Scala project with Maven on IntelliJ 2022?
I selected the archetypes on İntelliJ but it's not working because I need to add some dependencies to my pom.xml. When I add my dependencies on pom.xml, I face a lot of mistakes.
I have been dealing with this problem for 5 days and I couldn't open the Scala-Maven project with Spark.
Also, I read a lot of articles about this and those methods didn't work too.
Also, you can check the dependencies which are I want to add to pom.xml
<!-- https://mvnrepository.com/artifact/org.scala-lang/scala-library -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.13.8</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-core -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.13</artifactId>
<version>3.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-sql -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.13</artifactId>
<version>3.3.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-mllib -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.13</artifactId>
<version>3.3.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.scalatest/scalatest -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<version>3.3.0-SNAP3</version>
<scope>test</scope>
</dependency>
`src/main/main.scala`
`src/main/test.scala`
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.7.1</version>
</plugin>
</plugins>

Error running cucumber in eclipse- Could not find or load main class cucumber.api.cli.Main

I'm trying to run a maven project using Oxygen.1 a release. I have the cucumber plugin installed. But when I run the default feature file, I'm getting an error Error: Could not find or load main class cucumber.api.cli.Main
Please help!
I've never used Cucumber, but I guess you need to add it as a dependency to your Maven pom.xml as described in the Cucumber JVM documentation.
The Eclipse plugin adds syntax highlighting, content assists and other IDE related convenience. But you still need to tell the JVM where to find the Cucumber classes and in a Maven project this is defined by the dependencies in pom.xml.
You may rise a feature request at the Cucumber-Eclipse issue tracker to extend the plugin to allow adding the dependency to Maven projects automatically.
Add these dependencies to the pom.xml and the issue gets resolved. I was trying with the latest versions so was facing this problem. When I changed the version then it worked for me.
<dependencies>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.14.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
</dependencies>

Adding rampart.mar to classpath via Maven

I have been trying to find a solution for this for several days, but with no avail.
I'm currently in the process of introducing Maven to some of my Java projects. One of them requires Axis2 and Rampart for WS Security.
I added all Axis2 and Rampart dependencies in pom.xml:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-core</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-policy</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-trust</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart</artifactId>
<version>1.5.2</version>
<type>mar</type>
</dependency>
When I import the project in Eclipse, rampart.mar is not there, and attempting to engage the rampart module on runtime causes a failure.
However, when I use maven-dependency-plugin to copy all dependencies to a specific repository, I see that the rampart mar file is there!
This makes me believe that this is a limitation in the Eclipse m2e plugin. Anyone stumbled upon this one before? I saw several similar questions on Stackoverflow that were left unanswered.

Really painful to run GWTP in Maven

I've been struggling all day to run GWTP with Maven, essentially I created a GWTP gwt application using the Eclipse plugin. And added a simple welcome presenter. Tried it without maven and it works well running from eclipse.
However when I convert it to a maven project (I'm using m2eclipse plugin) everything breaks. So I added the required dependencies and the gwtp dependency:
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<version>1.5.0</version>
</dependency>
<!-- MVP component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-all</artifactId>
<version>${gwtp.version}</version>
</dependency>
However when I try to run it I get this error:
Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.event.shared.EventBus' (did you forget to inherit a required module?)
Any ideas why its quite hard to make GWTP with maven.
I think you might be missing the gwt-user dependency. Here is my maven pom.xml for an GWTP project:
<properties>
<gwtVersion>2.4.0</gwtVersion>
<gwtp.version>0.7</gwtp.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-mvp-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope>
</dependency>
<!-- Dispatch component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-dispatch-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope> <!-- Remove for GWTP 0.5.1 and earlier -->
</dependency>
<!-- Tester component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-tester</artifactId>
<version>${gwtp.version}</version>
<scope>test</scope>
</dependency>
In case you use the newest gwtp 0.7 be aware that they switched from the depreciated classes in com.google.gwt.event.shared to com.google.web.bindery.event.shared.
See here for more details.

How to run a Ext GWT (GXT) application with Maven

I am trying to make a GXT 3.0 starting app with Maven support. I have successfully compiled and run the native GWT application with mvn gwt:compile gwt:run command
Howeven, when I added these dependecies:
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-uibinder</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-chart</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>uibinder-bridge</artifactId>
<version>2.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
and added this in the gwt.xml (module) file:
<inherits name="com.sencha.gxt.ui.GXT" />
I am getting this error (running the same mvn command as above):
GWT module com.sencha.gxt.ui.GXT not found
And looking from the Java build path of the project in the Maven Dependencies, I can see that the GXT jars have not been downloaded.
Full pom.xml here.
If you want the snapshot, make sure you have the repository tags for it as well, for wherever you are getting that build from. Otherwise use the latest release, 3.0.0-beta3.
If you are building your own local copies, or deploying to an internal repo, then 3.0.0-SNAPSHOT should work - make sure the jar can be found in your repo, and that you aren't running as offline.
Use these dependencies:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>
GXT does not require uibinder-bridge anymore according to Sencha forum.
All GXT uibinder features were incorporated into GWT 2.5.0 release.
GXT 3.0.1 is on maven central
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>