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
Related
I've just barely started a java 8 project with spring boot and maven. I can't add the springframework dependancy...
When I go over it with the mouse and click on "Add dependancy" nothing changes, even after loading the maven changes.
Here's my 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>microservices.book</groupId>
<artifactId>social-multiplication</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>social-multiplication</name>
<description>Social Multiplication App</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.3.20</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
EDIT:
mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< microservices.book:social-multiplication >--------------
[INFO] Building social-multiplication 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) # social-multiplication ---
[INFO] Deleting C:\Users\username\Desktop\Programming\social-multiplication\target
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # social-multiplication ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) # social-multiplication ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Users\username\Desktop\Programming\social-multiplication\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # social-multiplication ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory C:\Users\username\Desktop\Programming\social-multiplication\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) # social-multiplication ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\username\Desktop\Programming\social-multiplication\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[3,17] package org.junit does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[4,24] package org.junit.runner does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[10,10] cannot find symbol
symbol: class Test
location: class test.java.microservices.book.multiplication.SocialMultiplicationApplicationTests
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.838 s
[INFO] Finished at: 2022-09-12T21:36:28+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:testCompile (default-testCompile) on project socia
l-multiplication: Compilation failure: Compilation failure:
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[3,17] package org.junit does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[4,24] package org.junit.runner does not exist
[ERROR] /C:/Users/username/Desktop/Programming/social-multiplication/src/test/java/microservices/book/multiplication/SocialMultiplicatio
nApplicationTests.java:[10,10] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class test.java.microservices.book.multiplication.SocialMultiplicationApplicationTests
[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
.idea.log file contents:
2022-09-12 21:36:41,468 [ 502853] WARN - com.intellij.util.xmlb.Binding - no accessors for org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptInputsWatcher$Storage
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.
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.
I did everything according to this guide: https://documentation.magnolia-cms.com/display/DOCS/Getting+started+with+Blossom
I get these errors when I'm trying follow last step, mvn install (mvn clean works fine). Here is output after mvn clean install
tests-imac:acme test$ mvn clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.acme:acme-webapp:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. # com.acme:acme-webapp:[unknown-version], /Users/staz/blossomproj/acme/acme-webapp/pom.xml, line 35, column 15
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.acme:acme-module:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: javax.servlet:servlet-api:jar -> version 2.4 vs 2.5 # line 77, column 17
[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] acme (parent pom)
[INFO] acmeModule Magnolia Module
[INFO] acme: webapp
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building acme (parent pom) 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # acme ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # acme ---
[INFO] Installing /Users/staz/blossomproj/acme/pom.xml to /Users/test/.m2/repository/com/acme/acme/1.0-SNAPSHOT/acme-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building acmeModule Magnolia Module 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # acme-module ---
[INFO] Deleting /Users/staz/blossomproj/acme/acme-module/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # acme-module ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # acme-module ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 4 source files to /Users/staz/blossomproj/acme/acme-module/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/AcmeModule.java:[17,17] error: no suitable method found for initRootWebApplicationContext(Class<AcmeModuleConfiguration>)
[ERROR] method BlossomModuleSupport.initRootWebApplicationContext(ContextLoader) is not applicable
(actual argument Class<AcmeModuleConfiguration> cannot be converted to ContextLoader by method invocation conversion)
method BlossomModuleSupport.initRootWebApplicationContext(String) is not applicable
(actual argument Class<AcmeModuleConfiguration> cannot be converted to String by method invocation conversion)
/Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/AcmeModule.java:[18,17] error: method initBlossomDispatcherServlet in class BlossomModuleSupport cannot be applied to given types;
[ERROR] actual argument Class<BlossomServletConfiguration> cannot be converted to String by method invocation conversion
/Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/BlossomServletConfiguration.java:[88,22] error: cannot find symbol
[ERROR] variable handlerMapping of type BlossomHandlerMapping
/Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/BlossomServletConfiguration.java:[140,20] error: method addContextAttribute in class AbstractRenderer cannot be applied to given types;
[ERROR] actual argument Class<Directives> cannot be converted to ContextAttributeConfiguration by method invocation conversion
/Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/BlossomServletConfiguration.java:[141,20] error: method addContextAttribute in class AbstractRenderer cannot be applied to given types;
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] acme (parent pom) .................................. SUCCESS [ 0.869 s]
[INFO] acmeModule Magnolia Module ......................... FAILURE [ 5.262 s]
[INFO] acme: webapp ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.003 s
[INFO] Finished at: 2015-03-06T12:01:46+01:00
[INFO] Final Memory: 23M/183M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project acme-module: Compilation failure: Compilation failure:
[ERROR] /Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/AcmeModule.java:[17,17] error: no suitable method found for initRootWebApplicationContext(Class<AcmeModuleConfiguration>)
[ERROR] method BlossomModuleSupport.initRootWebApplicationContext(ContextLoader) is not applicable
[ERROR] (actual argument Class<AcmeModuleConfiguration> cannot be converted to ContextLoader by method invocation conversion)
[ERROR] method BlossomModuleSupport.initRootWebApplicationContext(String) is not applicable
[ERROR] (actual argument Class<AcmeModuleConfiguration> cannot be converted to String by method invocation conversion)
[ERROR] /Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/AcmeModule.java:[18,17] error: method initBlossomDispatcherServlet in class BlossomModuleSupport cannot be applied to given types;
[ERROR] actual argument Class<BlossomServletConfiguration> cannot be converted to String by method invocation conversion
[ERROR] /Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/BlossomServletConfiguration.java:[88,22] error: cannot find symbol
[ERROR] variable handlerMapping of type BlossomHandlerMapping
[ERROR] /Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/BlossomServletConfiguration.java:[140,20] error: method addContextAttribute in class AbstractRenderer cannot be applied to given types;
[ERROR] actual argument Class<Directives> cannot be converted to ContextAttributeConfiguration by method invocation conversion
[ERROR] /Users/staz/blossomproj/acme/acme-module/src/main/java/com/acme/BlossomServletConfiguration.java:[141,20] error: method addContextAttribute in class AbstractRenderer cannot be applied to given types;
[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 :acme-module
Magnolia version - 5.3.7 EE
Blossom module version - 3.0.5
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>acme</artifactId>
<groupId>com.acme</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.acme</groupId>
<artifactId>acme-module</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>acmeModule Magnolia Module</name>
<!--
<description>Please uncomment and fill in ...</description>
-->
<properties>
<magnoliaVersion>5.3.7</magnoliaVersion>
<javaVersion>1.6</javaVersion>
<blossomVersion>3.0.5</blossomVersion>
<springVersion>4.1.4.RELEASE</springVersion>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-core</artifactId>
<version>${magnoliaVersion}</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-rendering</artifactId>
<version>${magnoliaVersion}</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-templating</artifactId>
<version>${magnoliaVersion}</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-templating-jsp</artifactId>
<version>${magnoliaVersion}</version>
</dependency>
<dependency>
<groupId>info.magnolia.blossom</groupId>
<artifactId>magnolia-module-blossom</artifactId>
<version>${blossomVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springVersion}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${springVersion}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<!-- For #Valid - JSR-303 Bean Validation API -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.1.Final</version>
</dependency>
<!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
</configuration>
</plugin>
</plugins>
<!-- default resources configuration which will filter the module descriptor -->
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>META-INF/magnolia/*</include>
</includes>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>magnolia.public</id>
<url>https://nexus.magnolia-cms.com/content/groups/public</url>
<snapshots>
</snapshots>
</repository>
<repository>
<id>magnolia.enterprise.releases</id>
<url>https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-addons</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
</project>
regarding the warning
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: javax.servlet:servlet-api:jar -> version 2.4 vs 2.5 # line 77, column 17
You probably have a transient dependency that requires javax.servlet:servlet-api:2.5, but you have defined javax.servlet:servlet-api:2.4
You can either switch from javax.servlet:servlet-api:2.4 to javax.servlet:servlet-api:2.5 or add another exclusion for the javax.servlet:servlet-api:2.5 dependency. Use mvn dependency:list to find out which dependency provides the transient dependency.
Then there's another warning
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. # com.acme:acme-webapp:[unknown-version], /Users/staz/blossomproj/acme/acme-webapp/pom.xml, line 35, column 15
add
[...]
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
...
to you pom.xml
Blossom 3.0.6 was released yesterday to make it easier to use Spring java config. With that BlossomModuleSupport got new methods to initialize the application context and servlets using configuration classes. These are the methods that can't be found which breaks compilation.
With that the archetype snapshot version you're using was updated to generate a project that uses Spring java config, and hence these new methods.
So, you need to use 3.0.6 with the archetype and all should be fine.
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