I've a Play Framework 1.2.7 project which is managed by Maven. Now I am trying to upgrade to Play Framework version 1.3.0
What am I doing the way, how to properly upgrade from Play framework 1.2 to 1.3?
Maven play plugin in the current pom.xml
<parent>
<groupId>com.google.code.maven-play-plugin</groupId>
<artifactId>play-app-default-parent</artifactId>
<version>1.0.0-beta7</version>
</parent>
Changed play plugin to
<parent>
<groupId>com.google.code.maven-play-plugin</groupId>
<artifactId>play13-app-default-parent</artifactId>
<version>1.0.0-beta7</version>
</parent>
Maven --version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T02:58:10+06:00)
Maven home: /usr/local/Cellar/maven/3.2.3/libexec
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.1", arch: "x86_64", family: "mac"
mvn package clean and mvn install output
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) # gui ---
[INFO]
[INFO] --- play-maven-plugin:1.0.0-beta7:initialize (default-initialize) # gui ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # gui ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # gui ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 38 source files to /Users/sultan/project/gui/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/sultan/project/gui/app/models/Dataset.java:[7,36] package javax.validation.constraints does not exist
[ERROR] /Users/sultan/project/gui/app/models/AbstractInstance.java:[14,36] package javax.validation.constraints does not exist
[ERROR] /Users/sultan/project/gui/app/models/User.java:[10,36] package javax.validation.constraints does not exist
[ERROR] /Users/sultan/project/gui/app/models/Experiment.java:[19,36] package javax.validation.constraints does not exist
[ERROR] /Users/sultan/project/gui/app/models/AccessGroup.java:[7,36] package javax.validation.constraints does not exist
[INFO] 27 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:16 min
[INFO] Finished at: 2015-01-15T14:45:00+06:00
[INFO] Final Memory: 26M/119M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project gui: Compilation failure: Compilation failure:
[ERROR] /Users/sultan/project/gui/app/models/AbstractInstance.java:[29,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class models.AbstractInstance
[ERROR] /Users/sultan/project/gui/app/models/User.java:[40,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class models.User
[ERROR] /Users/sultan/project/gui/app/models/Experiment.java:[30,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class models.Experiment
[ERROR] /Users/sultan/project/gui/app/models/Experiment.java:[49,6] cannot find symbol
[ERROR] symbol: class NotNull
[ERROR] location: class models.Experiment
[ERROR] symbol: class ConstraintViolationException
[ERROR] location: class controllers.ExperimentController
[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 have tried to upgrade Hibernate but it didn't help
Check if you have marked any dependency as a runtime dependency. Try changing the scope to compile.
play13-app-default-parent:1.0.0-beta7 depends on play 1.3.0-RC1. This version of Play! does not contain validation-api in it's dependencies, it was added in 1.3.0-RC2 but neither 1.3.0-RC2 nor 1.3.0-RC3 were deployed to Maven central. 1.3.0 was deployed.
Next version of play13-app-default-parent will depend on 1.3.0.
For now you have to add one project property to switch to 1.3.0:
<properties>
...
<play.version>1.3.0</play.version>
</properties>
Related
I know this is ridiculous , but I have been struggling to move on from step 0 which is to create dependencies for the project!
I want to to make a simple speech to text app that can transcribe a file for me .
How the code will look like :
package com.ibm.watson.speech_to_text;
import com.ibm.cloud.sdk.core.http.HttpMediaType;
import com.ibm.cloud.sdk.core.security.Authenticator;
import com.ibm.cloud.sdk.core.security.IamAuthenticator;
import com.ibm.watson.speech_to_text.v1.SpeechToText;
import com.ibm.watson.speech_to_text.v1.model.RecognizeOptions;
import com.ibm.watson.speech_to_text.v1.model.SpeechRecognitionResults;
import java.io.File;
import java.io.FileNotFoundException;
/**
* Recognize a sample wav file and print the transcript into the console output.
* Make sure you are using UTF-8 to print messages; otherwise, you will see
* question marks.
*/
public class Main {
public static void main(String[] args) throws FileNotFoundException {
Authenticator authenticator = new IamAuthenticator("-key");
SpeechToText service = new SpeechToText(authenticator);
File audio = new File("C:\\Users\\User\\Desktop\\curl\\test.mp3");
RecognizeOptions options = new RecognizeOptions.Builder().audio(audio).contentType(HttpMediaType.AUDIO_MP3)
.build();
;
try {
options = new RecognizeOptions.Builder().audio(audio).contentType(HttpMediaType.AUDIO_MP3).build();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SpeechRecognitionResults transcript = service.recognize(options).execute().getResult();
System.out.println(transcript.toString());
}
}
According to github and IBM website You are supposed to create dependencies using maven or Gradle for your project and I have no idea how to do that !
I Don't understand how to create dependencies , Do I have to create a new file in the project and call it pom.xml and paste the text and run it as maven install (because that didn't work for me ) or what exactly should I do ? Please help as it's been almost 3 days and I'm struggling in like step 0!
Update:
I got these Errors when I click maven build with the goal as "clean install"
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/User/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Users/User/eclipse/java-2020-12/eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/User/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Users/User/eclipse/java-2020-12/eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.ibm.watson:my-app >------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # my-app ---
[INFO] Deleting C:\Users\User\Desktop\waaaaaaaaaats\my-app\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my-app ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\User\Desktop\waaaaaaaaaats\my-app\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # my-app ---
[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\User\Desktop\waaaaaaaaaats\my-app\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.740 s
[INFO] Finished at: 2021-08-18T18:45:47+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project my-app: Compilation failure: Compilation failure:
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
[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
The pom.xml File that I used :
<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>com.ibm.watson</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.ibm.watson</groupId>
<artifactId>speech-to-text</artifactId>
<version>9.2.1</version>
</dependency>
</dependencies>
</project>
new Error
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.ibm.watson:my-app >------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # my-app ---
[INFO] Deleting C:\Users\User\Desktop\my-app\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # my-app ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\User\Desktop\my-app\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # my-app ---
[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\User\Desktop\my-app\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[4,35] package com.ibm.cloud.sdk.core.http does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[5,39] package com.ibm.cloud.sdk.core.security does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[6,39] package com.ibm.cloud.sdk.core.security does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[7,40] package com.ibm.watson.speech_to_text.v1 does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[8,46] package com.ibm.watson.speech_to_text.v1.model does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[9,46] package com.ibm.watson.speech_to_text.v1.model does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[22,17] cannot find symbol
symbol: class Authenticator
location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[22,51] cannot find symbol
symbol: class IamAuthenticator
location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[23,17] cannot find symbol
symbol: class SpeechToText
location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[23,44] cannot find symbol
symbol: class SpeechToText
location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[27,17] cannot find symbol
symbol: class RecognizeOptions
location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[27,100] cannot find symbol
symbol: variable HttpMediaType
location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[27,64] package RecognizeOptions does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[31,91] cannot find symbol
symbol: variable HttpMediaType
location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[31,55] package RecognizeOptions does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[37,17] cannot find symbol
symbol: class SpeechRecognitionResults
location: class com.ibm.watson.speech_to_text.Main
[INFO] 16 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.107 s
[INFO] Finished at: 2021-08-18T19:48:34+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project my-app: Compilation failure: Compilation failure:
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[4,35] package com.ibm.cloud.sdk.core.http does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[5,39] package com.ibm.cloud.sdk.core.security does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[6,39] package com.ibm.cloud.sdk.core.security does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[7,40] package com.ibm.watson.speech_to_text.v1 does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[8,46] package com.ibm.watson.speech_to_text.v1.model does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[9,46] package com.ibm.watson.speech_to_text.v1.model does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[22,17] cannot find symbol
[ERROR] symbol: class Authenticator
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[22,51] cannot find symbol
[ERROR] symbol: class IamAuthenticator
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[23,17] cannot find symbol
[ERROR] symbol: class SpeechToText
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[23,44] cannot find symbol
[ERROR] symbol: class SpeechToText
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[27,17] cannot find symbol
[ERROR] symbol: class RecognizeOptions
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[27,100] cannot find symbol
[ERROR] symbol: variable HttpMediaType
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[27,64] package RecognizeOptions does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[31,91] cannot find symbol
[ERROR] symbol: variable HttpMediaType
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[31,55] package RecognizeOptions does not exist
[ERROR] /C:/Users/User/Desktop/my-app/src/main/java/com/ibm/watson/speech_to_text/Main.java:[37,17] cannot find symbol
[ERROR] symbol: class SpeechRecognitionResults
[ERROR] location: class com.ibm.watson.speech_to_text.Main
[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
You need to create a maven project for this where its structure might look like this
my-app
|-- pom.xml
`-- src
|-- main
| `-- java
| `-- com
| `-- ibm
| `-- watson
| `-- speech_to_text
| `-- Main.java
src, main, java, com, ibm, watson, speech_to_text are the directories.
The content of the pom.xml might look like
<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>com.ibm.watson</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.ibm.watson</groupId>
<artifactId>ibm-watson</artifactId>
<version>9.2.0</version>
</dependency>
</dependencies>
</project>
This includes your dependencies,
After this, you need to have maven installed in your machine to compile and run it. After installing maven you can run
mvn clean install OR mvn package
to compile/build the project. This will create a JAR file for you.
Finally, you can run the project with
java YOUR_JAR_NAME.jar
Suggestions:
Don't use the package com.ibm.watson.speech_to_text in your java file instead use your own e.g. com.mycompany.app so your directory structure will also change as per the package name i.e.
my-app
|-- pom.xml
`-- src
|-- main
| `-- java
| `-- com
| `-- mycompany
| `-- app
| `-- Main.java
pom.xml content will also change according to this
<groupId>com.mycompany.app</groupId>
When I use GraphChi-java benchmark to analysis network graph, I encounter an issue related to mvn.
Maven version and Java Version:
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T03:58:13-04:00)
Maven home: /usr/local/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-041500-lowlatency", arch: "amd64", family: "unix"
The build information is link
mvn assembly:assembly -DdescriptorId=jar-with-dependencies
However, I get errors about
error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
error: error while loading ConcurrentMap, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/util/concurrent/ConcurrentMap.class)' is broken
error: error while loading AnnotatedElement, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken
These errors are weird since I think there should be no problem with java-8-oracle. Why are some class broken? How to fix it?
wxf#wxf:/home/wxf/javaPrj/graphChi/graphchi-java$ mvn assembly:assembly -DdescriptorId=jar-with-dependencies
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.graphchi:graphchi-java_2.11:jar:0.2.2
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.commons:commons-math:jar -> version 2.0 vs 2.1 # line 81, 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] ------------------------------------------------------------------------
[INFO] Building graphchi-java_2.11 0.2.2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-assembly-plugin:2.2.2:assembly (default-cli) > package # graphchi-java_2.11 >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # graphchi-java_2.11 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/wxf/javaPrj/graphChi/graphchi-java/src/main/resources
[INFO]
[INFO] --- maven-scala-plugin:2.15.2:compile (default) # graphchi-java_2.11 ---
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] /home/wxf/javaPrj/graphChi/graphchi-java/src/main/java:-1: info: compiling
[INFO] /home/wxf/javaPrj/graphChi/graphchi-java/src/main/scala:-1: info: compiling
[INFO] Compiling 121 source files to /home/wxf/javaPrj/graphChi/graphchi-java/target/classes at 1518718593215
[ERROR] error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
[INFO] (bad constant pool tag 18 at byte 10)
[ERROR] error: error while loading ConcurrentMap, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/util/concurrent/ConcurrentMap.class)' is broken
[INFO] (bad constant pool tag 18 at byte 61)
[ERROR] error: error while loading AnnotatedElement, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken
[INFO] (bad constant pool tag 18 at byte 76)
[ERROR] three errors found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.874 s
[INFO] Finished at: 2018-02-15T13:16:38-05:00
[INFO] Final Memory: 26M/1928M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.scala-tools:maven-scala-plugin:2.15.2:compile (default) on project graphchi-java_2.11: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) -> [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/MojoExecutionException
Currently i am using maven(Apache Maven 3.3.9) & Java(Java version: 1.8.0_91) installed in my windows machine. I have a java application which was developed using Java Version 1.6.0_31.
Since Apache maven(3.3.9) is not directly compatible with the previous version of Java(Prior to 1.8) I have included toolchains plugin to compile and run the project with Java 1.6. I can do a successful build using command prompt.
But when I try to build the same project using eclipse with eclipse m2e plugin or by adding the external maven(3.3.9) using eclipse->Windows->Preferences->Maven->Installations, I am getting the below error.
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Expected root element 'settings' but found 'toolchains' (position: START_TAG seen ...OOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd">... #45:114) # U:\POC\Repo\.m2\toolchains.xml, line 45, column 114
[WARNING]
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Replenishment Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # Replenishment ---
[INFO] Deleting C:\Users\xagh9\workspace\Replenishment\target
[INFO]
[INFO] --- maven-toolchains-plugin:1.1:toolchain (default) # Replenishment ---
[INFO] Required toolchain: jdk [ vendor='sun' version='1.6' ]
[ERROR] No toolchain found for type jdk
[ERROR] Cannot find matching toolchain definitions for the following toolchain types:
jdk [ vendor='sun' version='1.6' ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.105 s
[INFO] Finished at: 2017-01-04T12:02:08+11:00
[INFO] Final Memory: 8M/116M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project Replenishment: Cannot find matching toolchain definitions for the following toolchain types:
[ERROR] jdk [ vendor='sun' version='1.6' ]
[ERROR] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file.
[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
Note: With Java_1.8 I can build the project successfully without toolchains plugin. But with toolchains plugin configured I am facing this issues. Can anyone help me to resolve this.
The required toolchains.xml is present in both maven config folder as well as in the .m2 folder of the repository
UPDATE:
Maven compiler plugin configuration:
The resolved after changing goals in eclipse run configuration as below.
The problem is eclipse is not automatically reading the toolchains.xml. We have to manually specify in the goals. I fixed this by referring the this Link
I have installed maven :
C:\Windows\System32>mvn --version
Apache Maven 3.3.3 (7994120775791599e405a7528ec3e0dke21dja06; 2015-04-22T13:57:3
7+02:00)
Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.3.3
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_51\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "windows"
I am trying to generate Jersey glassfish project with the aid of maven prompt but when I type the following:
D:\maven>mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archety
pes -DinteractiveMode=false \ -DarchetypeVersion=2.17
I am getting this error:
The goal you specified requires a project to execute but there is no POM
in this directory (D:\maven). Please verify you invoked Maven from the correct
directory. -> [Help 1]
I dont understand the error: Which project is required here since I am trying to generate one? And how should I create the pom.xml file? I thought it is created by the project generation.
I appreciate any help.
Edit when I type it without \
D:\maven>mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archety
pes -DinteractiveMode=false -DarchetypeVersion=2.17
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) > generate-sources
# standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) < generate-sources
# standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) # standalone-pom --
-
[INFO] Generating project in Batch mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.glassfish.jer
sey.archetypes:maven-archetype-quickstart:2.17)
Downloading: https://repo.maven.apache.org/maven2/org/glassfish/jersey/archetype
s/maven-archetype-quickstart/2.17/maven-archetype-quickstart-2.17.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.542 s
[INFO] Finished at: 2015-05-12T16:39:51+02:00
[INFO] Final Memory: 17M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.3:generate (default-cli) on project standalone-pom: The desired archetype does
not exist (org.glassfish.jersey.archetypes:maven-archetype-quickstart:2.17) -> [
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/MojoFailureExc
eption
D:\maven>
I'll go for an answer now.
So the first part of your problem was the caracter "\". See this thread
Then for your second problem : it is said The desired archetype does
not exist. This archetype maven-archetype-quickstart doesn't exist in maven repository. Please refer to this link to choose the archetype you are looking for and put it in your command.
At the end you command must have at least 2 argument -DarchetypeGroupId and -DarchetypeArtifactId. For example :
mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp
I am on Ubuntu 14.04 LTS, Java 7, have installed Rasperry Pi, have also setup the kura eclipse workspace. Now I want to use the Kura source code to start the sample application.
I followed the Eclipse Kura getting started guide here
but when i ran `mvn clean install` in the kura/target-platform directory,
it failed with the following message:
[INFO] Reactor Summary:
[INFO]
[INFO] target-platform .................................... SUCCESS [ 0.147 s]
[INFO] Java API for working with Human Interface USB Devices (HID) SUCCESS [ 1.832 s]
[INFO] javax.usb API from javax-usb ....................... SUCCESS [ 0.226 s]
[INFO] javax.usb Common from javax-usb .................... SUCCESS [ 0.239 s]
[INFO] javax.usb Linux implementation from javax-usb ...... SUCCESS [ 0.190 s]
[INFO] Serial Device based on SODA DK comm ................ SUCCESS [ 0.483 s]
[INFO] p2-repo-common ..................................... FAILURE [ 0.491 s]
[INFO] p2-repo-equinox_3.8.1 .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.008 s
[INFO] Finished at: 2015-05-14T18:05:23+08:00
[INFO] Final Memory: 31M/427M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.9:copy (copy-dio-bundle-for-publishing) on project p2-repo-common: Unable to find artifact. Could not find artifact jdk:jdk.dio:jar:1.0.1 in nexus-releases (http://192.168.0.119:8081/nexus/content/groups/public)
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=jdk -DartifactId=jdk.dio -Dversion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=jdk -DartifactId=jdk.dio -Dversion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] jdk:jdk.dio:jar:1.0.1
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus-releases (http://192.168.0.119:8081/nexus/content/groups/public, releases=true, snapshots=true)
[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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :p2-repo-common
It is complaining not finding artifact jdk:jdk.dio:jar:1.0.1 which is provided in Java ME as far as I know. Do I need to install anything first before building the Kura source code?
The jdk.dio artifact is available in the "Add-ons" repo provided by Eurotech at https://raw.github.com/eurotech/kura_addons/mvn-repo
It looks like you may have a custom Maven settings file that causes everything to be searched in your local Nexus? (http://192.168.0.119:8081)
HTH.