( -Dexec.mainClass=maven.MainClass becomes maven.MainClass. )
When executing Java class using maven from within Java (Eclipse plugin actualy)
-Dexec.mainClass=maven.MainClass becomes maven.MainClass
package maven;
public class MainClass {
public static void main(String[] args) {
System.out.println("app is running!");
}
}
from Eclipse using
Process p = DebugPlugin.exec(cmds, workingPath, envp);
RuntimeProcess process = (RuntimeProcess)DebugPlugin.newProcess(launch, p, MavenConstants.PROCESS_MESSAGE);
that p= Runtime.getRuntime().exec(cmdLine, envp); just calls Java
p= Runtime.getRuntime().exec(cmdLine, envp);
And array of strings that concatenated looks like string below, somehow looses -Dexec.mainClass= part.
D:\Code\springsource\3.0\apache-maven-3.0.3\bin\mvn.bat compile exec:java -Dexec.mainClass=maven.MainClass
output
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building org.example.maven 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.672s
[INFO] Finished at: Fri Jan 24 23:59:50 CST 2014
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "maven.MainClass". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [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/LifecyclePhaseNotFoundException
but from cmd shell using mvn or full filename is OK
D:\Progs\Enide-Monster-08-kepler-win32\runtime-EclipseApplication\org.example.maven>mvn compile exec:java -Dexec.mainClass=maven.MainClass
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building org.example.maven 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) # org.example.maven ---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # org.example.maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) # org.example.maven >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) # org.example.maven <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) # org.example.maven ---
app is running!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.342s
[INFO] Finished at: Fri Jan 24 23:56:41 CST 2014
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
D:\Progs\Enide-Monster-08-kepler-win32\runtime-EclipseApplication\org.example.maven>D:\Code\springsource\3.0\apache-maven-3.0.3\bin\mvn.bat compile exec:java -Dexec.mainClass=maven
.MainClass
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building org.example.maven 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) # org.example.maven ---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # org.example.maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) # org.example.maven >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) # org.example.maven <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) # org.example.maven ---
app is running!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.435s
[INFO] Finished at: Fri Jan 24 23:57:46 CST 2014
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
Found that cmdLine.add("-Dmaven.test.skip=true"); also becomes just true with similar error.
I notices no mention in JavaDoc of this behavior for Runtime.getRuntime().exec(
Solved by putting all option in one string.
cmdLine.add(mavenPath);
cmdLine.add(mavenOptions+" compile exec:java -Dexec.mainClass="+packageClass);
Related
I have a Java application which should be run with mvn spring-boot:run -Dspring.profiles.active=dev -Djasypt.encryptor.password=<DJASYPT_ENCRYPTOR_PASSWORD>.
If I just run that command I get this:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 # ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, 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] Reactor Build Order:
[INFO]
[INFO] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml
Downloading: https://binaries.avisagroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml (10 kB at 1.2 kB/s)
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml (20 kB at 299 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SKIPPED
[INFO] accapiapp ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min
[INFO] Finished at: 2022-01-11T19:10:33Z
[INFO] Final Memory: 13M/209M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\A183540\.m2\repository), avis-nexus (https://binaries.avisagroup.com:443/artifactory/public-maven/)] -> [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/NoPluginFoundForPrefixException
I don't think I should need to add this to the accapi pom:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.12.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
and this to plugins
If I do and run the mvn command I get this:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
I get this:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 # ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, 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] Reactor Build Order:
[INFO]
[INFO] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapi 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile # accapi >>>
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile # accapi <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) # accapi ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapiapp 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile # accapiapp >>>
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (2) # accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO] Storing buildNumber: b9bd8c84473a4d0f5ab3f0e0f9a24a92620850d8 at timestamp: 1641928952817
[INFO] Storing buildScmBranch: develop
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-metadata (1) # accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 20 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) # accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile # accapiapp <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) # accapiapp ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SUCCESS [ 0.997 s]
[INFO] accapiapp ...................................... SUCCESS [ 4.948 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.137 s
[INFO] Finished at: 2022-01-11T19:22:35Z
[INFO] Final Memory: 33M/258M
[INFO] ------------------------------------------------------------------------
Even if I was correct to do this I'd expect the application to remain running. Is there anything obvious that I'm doing wrong?
I had to cd accapiapp then run my mvn command.
Overall description
I have a simple Maven project with a parameterized TestNG test. The parameter is specified through a suite XML file. When I run tests for the whole project, the suite XML file is read, parameter is used and the parameterized test is executed. However, when I attempt to test a single package only, then the suite XML file is not used apparently and the test is skipped with a complaint such as "Parameter '...' is required by #Test on method ... but has not been marked #Optional or defined". The question is how to run individual tests and test packages with parameters.
For more details see below.
Testing the whole project
This works as expected. Two test methods are executed. One test method is parameterless, other is parameterized and the parameter value is taken from the suite XML file. This is a equivalent of Run\Test project in NetBeans.
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>"c:\Program Files\NetBeans 8.2\java\maven\bin\mvn" test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestNGDemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # TestNGDemo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
testGetChangedString
getTrue
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.844 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.702s
[INFO] Finished at: Wed Jun 06 23:42:20 ACST 2018
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>
Testing a single package
In this case only one test method runs, the parameterless one. The parameterized test method is skipped. This is a equivalent of right-clicking a package in NetBeans and selecting "Test package".
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>"c:\Program Files\NetBeans 8.2\java\maven\bin\mvn" test -Dtest=com.endersoft.testngdemo.**.*
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestNGDemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # TestNGDemo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.endersoft.testngdemo.SimpleClassNGTest
getTrue
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 2.422 s - in com.endersoft.testngdemo.SimpleClassNGTest
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.268s
[INFO] Finished at: Wed Jun 06 23:47:28 ACST 2018
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
Project source
The zipped project source can be downloaded from here (very small)
You need separate XML files for separate package. When running TestNG with package as parameter, TestNG is not automatically aware about the XML file, like it doesn't exist.
So you have multiple options, specify the parameters in properties file, or hardcode them, or create separate XML files for every package that you can then pass as parameter.
Compilation error on using Maven Install command
Hi , When I use the Maven clean command it runs successfully but when I run the install command , I have been getting compilation errors . Follwing is the error I have been getting.Thanks
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TigerFinal 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # TigerFinal ---
[INFO] Deleting C:\Users\Shashank_bisht\workspace\TigerFinal\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.517 s
[INFO] Finished at: 2016-01-04T22:53:12+05:30
[INFO] Final Memory: 6M/105M
[INFO] ------------------------------------------------------------------------
C:\Users\Shashank_bisht\workspace\TigerFinal>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TigerFinal 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # TigerFinal ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Shashank_bisht\workspace\TigerFinal\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # TigerFinal ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to C:\Users\Shashank_bisht\workspace\TigerFinal\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/MyHomepage/Home.java:[11,27] packa
MyHomepageTestCases does not exist
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/Utils/AppUtils.java:[14,27] packag
yHomepageTestCases does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.733 s
[INFO] Finished at: 2016-01-04T22:53:26+05:30
[INFO] Final Memory: 17M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
project TigerFinal: Compilation failure: Compilation failure:
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/MyHomepage/Home.java:[11,27] packa
MyHomepageTestCases does not exist
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/Utils/AppUtils.java:[14,27] packag
yHomepageTestCases 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
From the comments:
You need a full JDK (Java Development Kit), not a JRE (Java Runtime Environment)
Download a JDK from OpenJDK or Oracle, then set the environment variable JAVA_HOME to the root folder of your JDK.
Then re-try your Maven command
I am trying to build the Californium repository https://github.com/eclipse/californium using maven. Typing "mvn clean install" gives the following output:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.eclipse.californium:californium-core:jar:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. # line 29, column 18
[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] Californium (Cf) Root
[INFO] Californium (Cf) Core
[INFO] Californium (Cf) Proxy
[INFO] Californium (Cf) OSGi Bundle
[INFO] Cf-PlugtestClient
[INFO] Cf-PlugtestChecker
[INFO] Cf-PlugtestServer
[INFO] Cf-HelloWorldClient
[INFO] Cf-HelloWorldServer
[INFO] Cf-SecureServer
[INFO] Cf-ExampleCrossProxy
[INFO] Cf Benchmark Server
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Californium (Cf) Root 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.eclipse.californium:element-connector:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Californium (Cf) Root ............................. FAILURE [0.097s]
[INFO] Californium (Cf) Core ............................. SKIPPED
[INFO] Californium (Cf) Proxy ............................ SKIPPED
[INFO] Californium (Cf) OSGi Bundle ...................... SKIPPED
[INFO] Cf-PlugtestClient ................................. SKIPPED
[INFO] Cf-PlugtestChecker ................................ SKIPPED
[INFO] Cf-PlugtestServer ................................. SKIPPED
[INFO] Cf-HelloWorldClient ............................... SKIPPED
[INFO] Cf-HelloWorldServer ............................... SKIPPED
[INFO] Cf-SecureServer ................................... SKIPPED
[INFO] Cf-ExampleCrossProxy .............................. SKIPPED
[INFO] Cf Benchmark Server ............................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.894s
[INFO] Finished at: Thu Jun 26 18:29:52 CEST 2014
[INFO] Final Memory: 6M/109M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project root: Could not resolve dependencies for project org.eclipse.californium:root:pom:1.0.0-SNAPSHOT: Could not find artifact org.eclipse.californium:element-connector:jar:1.0-SNAPSHOT -> [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/DependencyResolutionException
I tried different things but still Idon't know how to fix this errors and go on with my work. Can anyone help me?
MORE INFO:
Downloding and installing (mvn clean install) Californium Element Connector https://github.com/eclipse/californium.element-connector.git brings the build of Californium a little farther, but there are still some dependencies missing. I think that one of these is californium Scandium, but after I downloaded it, I found out that it also has some building problems...
Actually, all I want to use is the repo caled californium.tools (https://github.com/eclipse/californium.tools), which is based on Californium. I checked the pom.xml of californium.tools, and it already includes the required dependencies. However,when I build, I get the following errors:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Californium (Cf) Tools
[INFO] Cf-ConsoleClient
[INFO] Cf-GUIClient
[INFO] Cf-CoAPBench
[INFO] Cf-ExampleServer
[INFO] Cf-ResourceDirectory
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Californium (Cf) Tools 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) # tools ---
[INFO] Deleting file set: /home/ceccog/californium.tools/target (included: [**], excluded: [])
[INFO]
[INFO] --- maven-jar-plugin:2.4:test-jar (default) # tools ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /home/ceccog/californium.tools/target/tools-1.0.0-SNAPSHOT-tests.jar
[INFO]
[INFO] >>> maven-source-plugin:2.2.1:jar (attach-sources) # tools >>>
[INFO]
[INFO] <<< maven-source-plugin:2.2.1:jar (attach-sources) # tools <<<
[INFO]
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) # tools ---
[INFO]
[INFO] --- maven-install-plugin:2.3:install (default-install) # tools ---
[INFO] Installing /home/ceccog/californium.tools/pom.xml to /home/ceccog/.m2/repository/org/eclipse/californium/tools/1.0.0-SNAPSHOT/tools-1.0.0-SNAPSHOT.pom
[INFO] Installing /home/ceccog/californium.tools/target/tools-1.0.0-SNAPSHOT-tests.jar to /home/ceccog/.m2/repository/org/eclipse/californium/tools/1.0.0-SNAPSHOT/tools-1.0.0-SNAPSHOT-tests.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Cf-ConsoleClient 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.eclipse.californium:scandium:jar:1.0.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Californium (Cf) Tools ............................ SUCCESS [0.886s]
[INFO] Cf-ConsoleClient .................................. FAILURE [0.078s]
[INFO] Cf-GUIClient ...................................... SKIPPED
[INFO] Cf-CoAPBench ...................................... SKIPPED
[INFO] Cf-ExampleServer .................................. SKIPPED
[INFO] Cf-ResourceDirectory .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.161s
[INFO] Finished at: Wed Jul 02 11:42:57 CEST 2014
[INFO] Final Memory: 7M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project cf-client: Could not resolve dependencies for project org.eclipse.californium:cf-client:jar:1.0.0-SNAPSHOT: Could not find artifact org.eclipse.californium:scandium:jar:1.0.0-SNAPSHOT -> [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/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cf-client
EDIT: it looks like the maven repositories are online now and the bug in cf-secure has been fixed. So only step 4 is required to install the californium tools.
The repositories mentioned in README.md do not seem to be online yet. Therefore maven can not resolve the dependencies automatically. The trick is to build and install the maven artifacts directly from source in the appropriate order.
So in order to get californium.tools working:
install org.eclipse.californium:element-connector
git clone https://github.com/eclipse/californium.element-connector.git
cd californium.element-connector
mvn clean install
install org.eclipse.californium:scandium
git clone https://github.com/eclipse/californium.scandium.git
cd californium.scandium
mvn clean install
install org.eclipse.californium:californium-core
git clone https://github.com/eclipse/californium.git
cd californium
mvn -pl :californium-core -am clean install
Note that we are only building the californium-core submodule (with the -pl :californium-core -am flag), since there is a bug in cf-secure which causes the build to fail.
build the Californium tools
git clone https://github.com/eclipse/californium.tools.git
cd californium.tools
mvn -pl :cf-browser,:cf-coapbench,:cf-rd,:cf-server -am clean install
We need to exclude cf-client since it has a bug which makes the build fail.
To run any of the tools, just cd californium.tools/run and java -jar ... the appropriate jar.
Sorry, the project was recently created at eclipse.
Hudson is populating the maven repository now.
I'm trying to deploy a simple JSF app onto a Tomcat 8 server on my local machine. When I run mvn tomcat:deploy, I get the following feedback:
C:\_workspace\portfolio>mvn tomcat:deploy
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.italic:portfolio:war:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:tomcat-maven-plugin is missing. # line 38, column 12
[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 Portfolio 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat-maven-plugin:1.1:deploy (default-cli) # portfolio >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # portfolio ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # portfolio ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # portfolio ---
[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.1:testCompile (default-testCompile) # portfolio ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # portfolio ---
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # portfolio ---
[INFO] Packaging webapp
[INFO] Assembling webapp [portfolio] in [C:\_workspace\portfolio\target\portfolio-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\_workspace\portfolio\src\main\webapp]
[INFO] Webapp assembled in [184 msecs]
[INFO] Building war: C:\_workspace\portfolio\target\portfolio-0.0.1-SNAPSHOT.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] <<< tomcat-maven-plugin:1.1:deploy (default-cli) # portfolio <<<
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:deploy (default-cli) # portfolio ---
[INFO] Deploying war to http://localhost:8080/portfolio
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.499s
[INFO] Finished at: Sat Feb 08 19:10:27 PST 2014
[INFO] Final Memory: 21M/180M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project portfolio: Cannot invoke Tomcat manager: Server returne
d HTTP response code: 405 for URL: http://localhost:8080/manager/text/deploy?path=%2Fportfolio&war= -> [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
C:\_workspace\portfolio>
Apparently Maven is finding the server, but is unable to deploy onto it. I looked around the interwebs and found that this could be due to maven trying to use a "PUT" command. However, after looking at the following answer, I added this code to my tomcat web.xml in the default servlet:
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
However, it doesn't appear to have had any effect. Do you have any further advice on what I can do to get this working?
I'm using Maven 3.1.1 and Tomcat 8.0.1.
It turns out that this was a silly mistake- the user that I had maven using had "manager-gui" privileges instead of "manager-script." Resolving this issue fixed my problem.