Push to github rejected with maven-release-plugin - java

I've spent hours trying to release a project to github with Maven. This is usually not a problem but for some reason it is for this project and I don't understand why. I'm using Maven 3.8.5 with Java 1.8.0_312 and git 2.36.1. Here's the pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<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>se.company.myproject</groupId>
<artifactId>myproject</artifactId>
<version>4.0.0</version>
<packaging>pom</packaging>
<name>myproject-base</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<slf4j.version>1.7.36</slf4j.version>
</properties>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
</modules>
<scm>
<connection>scm:git:ssh://git#github.com/mycompany/myproject.git</connection>
<developerConnection>scm:git:ssh://git#github.com/mycompany/myproject.git</developerConnection>
<url>https://github.com/mycompany/myproject.git</url>
<tag>4.0.0</tag>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>se.company.myproject</groupId>
<artifactId>some-internal-dependency</artifactId>
<version>5.0.1</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.9.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<tagNameFormat>#{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>company-releases</id>
<name>Internal Releases</name>
<url>https://company.se/company-maven-releases/</url>
</repository>
<snapshotRepository>
<id>company-snapshots</id>
<name>Internal Snapshots</name>
<url>https://company.se/company-maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>company-releases</id>
<url>https://company.se/company-maven-releases/</url>
</repository>
</repositories>
</project>
When I run maven release:prepare I get this:
[INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) # myproject-module3 ---
[INFO] [INFO] Building jar: /Users/me/code/module3/target/myproject-module3-4.0.0.jar
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Reactor Summary for myproject-base 4.0.0:
[INFO] [INFO]
[INFO] [INFO] myproject-base ..................................... SUCCESS [ 0.059 s]
[INFO] [INFO] module1............................................. SUCCESS [ 1.097 s]
[INFO] [INFO] module2 ............................................ SUCCESS [ 0.603 s]
[INFO] [INFO] module3 ............................................ SUCCESS [ 0.046 s]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 1.878 s
[INFO] [INFO] Finished at: 2022-05-20T14:29:16+02:00
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [prepare] 11/17 scm-commit-release
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd '/Users/me/code/myproject' && 'git' 'add' '--' 'pom.xml' 'module1/pom.xml' 'module2/pom.xml' 'module3/pom.xml'
[INFO] Working directory: /Users/me/code/myproject
[INFO] Executing: /bin/sh -c cd '/Users/me/code/myproject' && 'git' 'rev-parse' '--show-prefix'
[INFO] Working directory: /Users/me/code/myproject
[INFO] Executing: /bin/sh -c cd '/Users/me/code/myproject' && 'git' 'status' '--porcelain' '.'
[INFO] Working directory: /Users/me/code/myproject
[WARNING] Ignoring unrecognized line: ?? module1/pom.xml.releaseBackup
[WARNING] Ignoring unrecognized line: ?? module2/pom.xml.releaseBackup
[WARNING] Ignoring unrecognized line: ?? pom.xml.releaseBackup
[WARNING] Ignoring unrecognized line: ?? release.properties
[WARNING] Ignoring unrecognized line: ?? module3/pom.xml.releaseBackup
[INFO] Executing: /bin/sh -c cd '/Users/me/code/myproject' && 'git' 'commit' '--verbose' '-F' '/var/folders/xb/pl4xth9n5qbgksbyy2fy5lm80000gn/T/maven-scm-1737591658.commit'
[INFO] Working directory: /Users/me/code/myproject
[INFO] Executing: /bin/sh -c cd '/Users/me/code/myproject' && 'git' 'symbolic-ref' 'HEAD'
[INFO] Working directory: /Users/me/code/myproject
[INFO] Executing: /bin/sh -c cd '/Users/me/code/myproject' && 'git' 'push' 'ssh:********#github.com/company/myproject.git' 'refs/heads/main:refs/heads/main'
[INFO] Working directory: /Users/me/code/myproject
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for myproject-base 3.0.1-SNAPSHOT:
[INFO]
[INFO] myproject-base ........................................ FAILURE [ 8.100 s]
[INFO] module1 ............................................... SKIPPED
[INFO] module2 ............................................... SKIPPED
[INFO] module3 ............................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.207 s
[INFO] Finished at: 2022-05-20T14:29:18+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M5:prepare (default-cli) on project myproject: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] To ssh://github.com/company/myproject.git
[ERROR] ! [rejected] main -> main (non-fast-forward)
[ERROR] error: failed to push some refs to 'ssh://github.com/company/myproject.git'
[ERROR] hint: Updates were rejected because the tip of your current branch is behind
[ERROR] hint: its remote counterpart. Integrate the remote changes (e.g.
[ERROR] hint: 'git pull ...') before pushing again.
[ERROR] hint: See the 'Note about fast-forwards' in 'git push --help' for details.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I can push (and pull) just fine from the command line by using the git command. I've tried different versions of the maven-release-plugin to no avail. I've even deleted the entire GitHub repository and pushed it again from my local machine but still, I get the same error. What could be causing this?

A mvn -X prepare should show you which commit is checked out from your git:ssh://git#github.com/mycompany/myproject.git
Compare it with the latest commit on GitHub to understand the difference.
Trying to use an exec goal to do a git pull before mvn release is possible, but it is better to identify first why there is a remote commit that you do not have locally.

Related

Why doesn't Maven recognize file modifications? ("Nothing to compile - all classes are up to date" error)

I have a project in Java + Maven. I can compile and run the code with IntelliJ just fine: each modification I do in the code gets compiled in the program. However, when I try compiling from the command line (using mvn compile), Maven doesn't recognize the changes in the code, and simply says "Nothing to compile - all classes are up to date". I can force rebuilding using mvn clean, but that invalidates the purpose of having a build system. Why is it so, and how can it detect changes in the code?
For example, say I have a working code.
I do mvn compile. It works fine and I can run the program.
I change the code and introduce a syntax error. I save the file and do mvn compile. The output is Nothing to compile, together with a BUILD SUCCESS. However, when I try to run the program, I get a Exception in thread "main" java.lang.Error: Unresolved compilation problems, along with a series of error (due to the erroneous parsing)
If I change the code to a different code, but syntactically valid, I get the same behavior.
In fact, after this, even returning to my original code compiles, but then throws a java.lang.Error exception!
Why does it work like this, and why does it work in IntelliJ, but not in terminal?
EDIT:
IntelliJ is not open. However, Emacs does start the language server (jdtls).
My pom.xml:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it.polimi.middlewareB</groupId>
<artifactId>akka_actors</artifactId>
<packaging>jar</packaging>
<version>0.1 </version>
<properties>
<akka.version>2.6.19</akka.version>
<scala.binary.version>2.13</scala.binary.version>
</properties>
<name>akka_actors</name>
<url>http://maven.apache.org</url>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-bom_${scala.binary.version}</artifactId>
<version>2.6.19</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor-typed_2.13</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${scala.binary.version}</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor-testkit-typed_2.13</artifactId>
<version>${akka.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<!-- <plugin> -->
<!-- <groupId>org.codehaus.mojo</groupId> -->
<!-- <artifactId>exec-maven-plugin</artifactId> -->
<!-- <version>1.6.0</version> -->
<!-- <configuration> -->
<!-- <executable>java</executable> -->
<!-- <arguments> -->
<!-- <argument>-classpath</argument> -->
<!-- <classpath /> -->
<!-- <argument>com.example.AkkaQuickstart</argument> -->
<!-- </arguments> -->
<!-- </configuration> -->
<!-- </plugin> -->
<!-- <plugin> -->
<!-- <groupId>org.codehaus.mojo</groupId> -->
<!-- <artifactId>exec-maven-plugin</artifactId> -->
<!-- <version>1.6.0</version> -->
<!-- <executions> -->
<!-- <execution> -->
<!-- <id>default-cli</id> -->
<!-- <configuration> -->
<!-- <mainClass>com.example.AkkaQuickstart</mainClass> -->
<!-- </configuration> -->
<!-- </execution> -->
<!-- </executions> -->
<!-- </plugin> -->
</plugins>
</build>
</project>
After mvn clean, this is the output of mvn compile:
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< it.polimi.middlewareB:akka_actors >------------------
[INFO] Building akka_actors 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # akka_actors ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # akka_actors ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 15 source files to /home/alessandro/middleware/middleware_projectB/akka_actors/target/classes
[INFO] /home/alessandro/middleware/middleware_projectB/akka_actors/src/main/java/it/polimi/middlewareB/AlwaysSeekToBeginningListener.java: /home/alessandro/middleware/middleware_projectB/akka_actors/src/main/java/it/polimi/middlewareB/AlwaysSeekToBeginningListener.java uses unchecked or unsafe operations.
[INFO] /home/alessandro/middleware/middleware_projectB/akka_actors/src/main/java/it/polimi/middlewareB/AlwaysSeekToBeginningListener.java: Recompile with -Xlint:unchecked for details.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.471 s
[INFO] Finished at: 2022-07-13T10:36:08+02:00
[INFO] ------------------------------------------------------------------------
Adding in the main .java file a line like this
public class ClusterStarter {
private static final String kafkaDefaultArgument = "localhost:9092";
private static final int actorPoolDefaultDimension = 3;
apinaosncla aifasi; //NOTE HERE
public static void main(String[] args) {
/* ... */
}
}
launching mvn compile gives:
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< it.polimi.middlewareB:akka_actors >------------------
[INFO] Building akka_actors 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # akka_actors ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # akka_actors ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.970 s
[INFO] Finished at: 2022-07-13T10:43:07+02:00
[INFO] ------------------------------------------------------------------------
However, giving first mvn clean and then mvn compile:
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< it.polimi.middlewareB:akka_actors >------------------
[INFO] Building akka_actors 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # akka_actors ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # akka_actors ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 15 source files to /home/alessandro/middleware/middleware_projectB/akka_actors/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/alessandro/middleware/middleware_projectB/akka_actors/src/main/java/it/polimi/middlewareB/ClusterStarter.java:[36,5] cannot find symbol
symbol: class apinaosncla
location: class it.polimi.middlewareB.ClusterStarter
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.966 s
[INFO] Finished at: 2022-07-13T10:43:46+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project akka_actors: Compilation failure
[ERROR] /home/alessandro/middleware/middleware_projectB/akka_actors/src/main/java/it/polimi/middlewareB/ClusterStarter.java:[36,5] cannot find symbol
[ERROR] symbol: class apinaosncla
[ERROR] location: class it.polimi.middlewareB.ClusterStarter
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Now, returning to a working code, mvn compile still gives Nothing to compile, and launching the program gives:
/path/to/project $ /usr/lib/jvm/java-11-openjdk/bin/java -Dfile.encoding=UTF-8 -classpath /home/alessandro/middleware/middleware_projectB/akka_actors/target/classes:/home/alessandro/.m2/repository/com/typesafe/akka/akka-actor-typed_2.13/2.6.19/akka-actor-typed_2.13-2.6.19.jar:/home/alessandro/.m2/repository/org/scala-lang/scala-library/2.13.8/scala-library-2.13.8.jar:/home/alessandro/.m2/repository/com/typesafe/akka/akka-slf4j_2.13/2.6.19/akka-slf4j_2.13-2.6.19.jar:/home/alessandro/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:/home/alessandro/.m2/repository/com/typesafe/akka/akka-actor_2.13/2.6.19/akka-actor_2.13-2.6.19.jar:/home/alessandro/.m2/repository/com/typesafe/config/1.4.2/config-1.4.2.jar:/home/alessandro/.m2/repository/org/scala-lang/modules/scala-java8-compat_2.13/1.0.0/scala-java8-compat_2.13-1.0.0.jar:/home/alessandro/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/home/alessandro/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/home/alessandro/.m2/repository/com/typesafe/akka/akka-actor-testkit-typed_2.13/2.6.19/akka-actor-testkit-typed_2.13-2.6.19.jar:/home/alessandro/.m2/repository/com/typesafe/akka/akka-testkit_2.13/2.6.19/akka-testkit_2.13-2.6.19.jar:/home/alessandro/.m2/repository/org/apache/kafka/kafka-clients/3.2.0/kafka-clients-3.2.0.jar:/home/alessandro/.m2/repository/com/github/luben/zstd-jni/1.5.2-1/zstd-jni-1.5.2-1.jar:/home/alessandro/.m2/repository/org/lz4/lz4-java/1.8.0/lz4-java-1.8.0.jar:/home/alessandro/.m2/repository/org/xerial/snappy/snappy-java/1.1.8.4/snappy-java-1.1.8.4.jar:/home/alessandro/.m2/repository/org/apache/logging/log4j/log4j-api/2.17.2/log4j-api-2.17.2.jar:/home/alessandro/.m2/repository/org/apache/logging/log4j/log4j-core/2.17.2/log4j-core-2.17.2.jar:/home/alessandro/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.17.2/log4j-slf4j-impl-2.17.2.jar:/home/alessandro/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/home/alessandro/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.12.6.1/jackson-databind-2.12.6.1.jar:/home/alessandro/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.12.6/jackson-annotations-2.12.6.jar:/home/alessandro/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.12.6/jackson-core-2.12.6.jar it.polimi.middlewareB.ClusterStarter
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
RetriesAnalysisActor cannot be resolved
JobSupervisorActor cannot be resolved
CompletedAnalysisThread cannot be resolved to a type
PendingAnalysisThread cannot be resolved to a type
at it.polimi.middlewareB.ClusterStarter.main(ClusterStarter.java:55)
(those are classes of my project)

Maven returns Compilation failure: package com.mashape.unirest.http does not exist

I tried to use Maven to install the dependency Unirest. I downloaded the .jar file (unirest-java-1.4.9.jar) and added it to the POM like this:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
</dependencies>
</dependencyManagement>
In addition, I added the .jar in Eclipse:
Now Maven says that the package does not exist. Eclipse did not say that anything was wrong.
What did I do wrong?
Are the warnings in the beginning a problem?
My logs:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.sap.cloud.sdk.sensorLive:sensorLive-application:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # com.sap.cloud.sdk.sensorLive:sensorLive:1.0-SNAPSHOT, C:\Users\c5283284\Documents\Projekte\Transformation module\sensorLive\pom.xml, line 52, column 21
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.sap.cloud.sdk.sensorLive:sensorLive-unit-tests:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # com.sap.cloud.sdk.sensorLive:sensorLive:1.0-SNAPSHOT, C:\Users\c5283284\Documents\Projekte\Transformation module\sensorLive\pom.xml, line 52, column 21
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.sap.cloud.sdk.sensorLive:sensorLive-integration-tests:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # com.sap.cloud.sdk.sensorLive:sensorLive:1.0-SNAPSHOT, C:\Users\c5283284\Documents\Projekte\Transformation module\sensorLive\pom.xml, line 52, column 21
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.sap.cloud.sdk.sensorLive:sensorLive:pom:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # line 52, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] sensorLive - Root [pom]
[INFO] sensorLive - Application [war]
[INFO] sensorLive - Unit Tests [jar]
[INFO] sensorLive - Integration Tests [jar]
[INFO]
[INFO] --------------< com.sap.cloud.sdk.sensorLive:sensorLive >---------------
[INFO] Building sensorLive - Root 1.0-SNAPSHOT [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (SAP S/4HANA Cloud SDK Project Structure Checks) # sensorLive ---
[INFO]
[INFO] --------< com.sap.cloud.sdk.sensorLive:sensorLive-application >---------
[INFO] Building sensorLive - Application 1.0-SNAPSHOT [2/4]
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (SAP S/4HANA Cloud SDK Project Structure Checks) # sensorLive-application ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # sensorLive-application ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # sensorLive-application ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 9 source files to C:\Users\c5283284\Documents\Projekte\Transformation module\sensorLive\application\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/c5283284/Documents/Projekte/Transformation module/sensorLive/application/src/main/java/com/sap/cloud/sdk/sensorLive/Servlet.java:[16,1] package com.mashape.unirest.http does not exist
[ERROR] /C:/Users/c5283284/Documents/Projekte/Transformation module/sensorLive/application/src/main/java/com/sap/cloud/sdk/sensorLive/Servlet.java:[17,32] package com.mashape.unirest.http does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for sensorLive - Root 1.0-SNAPSHOT:
[INFO]
[INFO] sensorLive - Root .................................. SUCCESS [ 0.485 s]
[INFO] sensorLive - Application ........................... FAILURE [ 2.233 s]
[INFO] sensorLive - Unit Tests ............................ SKIPPED
[INFO] sensorLive - Integration Tests ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.079 s
[INFO] Finished at: 2019-01-31T10:22:32+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project sensorLive-application: Compilation failure: Compilation failure:
[ERROR] /C:/Users/c5283284/Documents/Projekte/Transformation module/sensorLive/application/src/main/java/com/sap/cloud/sdk/sensorLive/Servlet.java:[16,1] package com.mashape.unirest.http does not exist
[ERROR] /C:/Users/c5283284/Documents/Projekte/Transformation module/sensorLive/application/src/main/java/com/sap/cloud/sdk/sensorLive/Servlet.java:[17,32] package com.mashape.unirest.http does not exist
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :sensorLive-application
My POM:
<?xml version='1.0' encoding='utf-8'?>
<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>
<name>sensorLive - Root</name>
<description>sensorLive - Root</description>
<groupId>com.sap.cloud.sdk.sensorLive</groupId>
<artifactId>sensorLive</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.cloud.s4hana</groupId>
<artifactId>sdk-bom</artifactId>
<version>2.9.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.testSource>${java.version}</maven.compiler.testSource>
<maven.compiler.testTarget>${java.version}</maven.compiler.testTarget>
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<modules>
<module>application</module>
<module>unit-tests</module>
<module>integration-tests</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.maventest.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>1.7.1</version>
<configuration>
<tomeeVersion>1.7.1</tomeeVersion>
<tomeeClassifier>plus</tomeeClassifier>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>SAP S/4HANA Cloud SDK Project Structure Checks</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.3.9</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
<reactorModuleConvergence />
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This is how I import Unirest:
import com.mashape.unirest.http.*;
You added your dependency to the dependencyManagement section of your pom. This section is intended for multi-module projects where a dependency can be defined in the parent pom but used in child modules. Further reading.
To be able to use your dependency, you must open your child-module's pom (in this case the pom of application, unit-tests or integration-tests) and tell maven that you wish to use the dependency there like so:
<?xml version='1.0' encoding='utf-8'?>
<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">
...
<groupId>com.sap.cloud.sdk.sensorLive</groupId>
<artifactId>application</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
</dependency>
</dependencies>
...
</project>
Try removing unirest-java dependency from dependencyManagement tag and add in dependencies tag like below example
Sample example:
<dependencies>
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
</dependency>
</dependencies>
if your using Eclipse, just do a maven update and that should do the trick.

Running scala under maven project

i am running scala project .I woudld like to use maven project but , it seems doesn't recognize scala .Because before i used add scala nature now i would ike to add scala through maven , but i can't get it doesnt .i used scala 2.11.8
here is the pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>SynchData</groupId>
<artifactId>SynchData</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-catalyst_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.1.3</version>
</dependency>
<!-- <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId>
<version>9.2-1002-jdbc4</version> </dependency> -->
<!-- https://mvnrepository.com/artifact/oracle/ojdbc6 -->
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Once i make maven clean install i got this
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for SynchData:SynchData:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.spark:spark-sql_2.11:jar -> duplicate declaration of version 2.2.0 # line 31, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SynchData 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # SynchData ---
[INFO] Deleting C:\Users\MHT\eclipse-workspace\test.iptech\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # SynchData ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) # SynchData ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\MHT\eclipse-workspace\test.iptech\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/MHT/eclipse-workspace/test.iptech/src/main/java/LauncherPack/SynchronizeData.java:[2,1] package SynchronizePackage does not exist
[ERROR] /C:/Users/MHT/eclipse-workspace/test.iptech/src/main/java/LauncherPack/SynchronizeData.java:[10,17] cannot find symbol
symbol: variable MainFunction
location: class LauncherPack.SynchronizeData
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.277 s
[INFO] Finished at: 2017-09-26T14:29:59+01:00
[INFO] Final Memory: 36M/281M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project SynchData: Compilation failure: Compilation failure:
[ERROR] /C:/Users/MHT/eclipse-workspace/test.iptech/src/main/java/LauncherPack/SynchronizeData.java:[2,1] package SynchronizePackage does not exist
[ERROR] /C:/Users/MHT/eclipse-workspace/test.iptech/src/main/java/LauncherPack/SynchronizeData.java:[10,17] cannot find symbol
[ERROR] symbol: variable MainFunction
[ERROR] location: class LauncherPack.SynchronizeData
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Please any help to get it work without using add scala nature through eclipse .
Thanks a lot

Maven Plugin/Profile Issue

I am an automation qa engineer and I've been charged with setting up our Jenkins CI framework. The issue that I am having is that Maven is failing in the build phase. In looking at the log there a few things that are concerning to me but I am not sure if they are related or relevant. See the log below
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\dmohamed>mvn test -PCustomerFSNRegressionSuite
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
Envi_Test:Maven:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.qas.qtest.api:qtest-sdk-a
gent:jar should not point at files within the project directory, ${basedir}\src\
Libs\qtest-sdk-java-1.1.0.jar will be unresolvable by dependent projects # line
42, column 17
[WARNING] 'dependencies.dependency.systemPath' for com.qas.qtest.api:qtest-testn
g-agent:jar should not point at files within the project directory, ${basedir}\s
rc\Libs\qtest-testng-agent-1.0.0.jar will be unresolvable by dependent projects
# line 50, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Maven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dmohamed\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # Maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Ma
ven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dmohamed\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # Maven -
--
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) # Maven ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.190 s
[INFO] Finished at: 2016-08-02T08:25:01-04:00
[INFO] Final Memory: 11M/307M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "CustomerFSNRegressionSuite" could not be activa
ted because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
19.1:test (default-test) on project Maven: Unable to parse configuration of mojo
org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test for parameter proper
ties: Missing name in properties -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigur
ationException
C:\Users\dmohamed>
my concerns are specifically these lines
INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\dmohamed\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # Maven ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Ma
ven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
C:\Users\dmohamed\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # Maven -
--
[INFO] No sources to compile
WARNING] The requested profile "CustomerFSNRegressionSuite" could not be activa
ted because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
19.1:test (default-test) on project Maven: Unable to parse configuration of mojo
org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test for parameter proper
ties: Missing name in properties -> [Help 1]
It seems as though when I attempt to run the mvn commands it tries to reference srs folders that don't exist (not sure if this does any harm) it doesn't recognize my TestnNG profile specified in my POM file (I am assuming this will impact Jenkins) and there is some property/configuration error in my pom file (Per the ERROR message in my log) that I cannot resolve. See my POM file below
<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>Envi_Test</groupId>
<artifactId>Maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Maven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>CustomerFSNRegressionSuite</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>2.53.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-testng</artifactId>
<version>1.1.5</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Any help would be greatly appreciated, I am sorry if this is a repost, I looked but I did not see a question regarding a circumstance like this.

Error while compiling apache sparkSql

I am trying to execute below sparkSQL example,
https://github.com/apache/spark/blob/master/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java
my pom.xml (i have added sql dependency as well, i am stuck please help)
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>edu.berkeley</groupId>
<artifactId>simple-project</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>Simple Project</name>
<repositories>
<repository>
<id>Akka repository</id>
<url>http://repo.akka.io/releases</url>
</repository>
</repositories>
<dependencies>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.0.2</version>
</dependency>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.10</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
</project>
i have just renamed the file as SimpleApp.java
I get this following error when compiling.. kindly advice
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple Project 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # simple-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Volumes/Official/spark-1.0.2-bin-hadoop2/try/simple-project/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # simple-project ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Volumes/Official/spark-1.0.2-bin-hadoop2/try/simple-project/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Volumes/Official/spark-1.0.2-bin-hadoop2/try/simple-project/src/main/java/SimpleApp.java:[61,16] error: cannot find symbol
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.801 s
[INFO] Finished at: 2014-08-19T10:30:31+05:30
[INFO] Final Memory: 21M/232M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project simple-project: Compilation failure
[ERROR] /Volumes/Official/spark-1.0.2-bin-hadoop2/try/simple-project/src/main/java/SimpleApp.java:[61,16] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
I found out the issue:
In the example
https://github.com/apache/spark/blob/master/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java
replace the line schemaPeople.registerTempTable("people");
with schemaPeople.registerAsTable("people");
compile and package with mvn compile and mvn package and run with
bin/spark-submit --class "org.apache.spark.examples.sql.SimpleApp" --master local[4] try/simple-project/target/simple-project-1.0.jar

Categories