edit this page - page history - about editing

Maven

Maven is a build/release tool mostly for Java, but I don't like it very much.

Commands


Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one.

This means there is no "pom.xml" in the current directory. Perhaps you are not in the root directory of your project?


[INFO] Cannot find matching toolchain definitions for the following toolchain types:
jdk [ vendor='sun' version='1.5' ]
Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file.

Maven is complaining that it can't find a Sun JDK 1.5. If you create a toolchains.xml in your .m2 directory with the following:

<toolchains>
  <toolchain>
     <type>jdk</type>
     <provides>
         <version>1.6</version>
         <vendor>sun</vendor>
         <id>i_hate_maven</id>
     </provides>
     <configuration>
        <jdkHome>C:program filesjavajdk1.6.0_02</jdkHome>
     </configuration>
  </toolchain>
</toolchains>

This will still not work, because Maven is insisting on a 1.5 JVM, and supplying a 1.6 JVM is not appropriate. However, you can just copy and paste toolchain as follows. As far as I know, JVM 1.6 is backwards compatible.

<!-- I hate maven -->
<toolchains>
  <toolchain>
     <type>jdk</type>
     <provides>
         <version>1.6</version>
         <vendor>sun</vendor>
         <id>i_hate_maven</id>
     </provides>
     <configuration>
        <jdkHome>C:program filesjavajdk1.6.0_02</jdkHome>
     </configuration>
  </toolchain>
  <toolchain>
     <type>jdk</type>
     <provides>
         <version>1.5</version>
         <vendor>sun</vendor>
         <id>i_hate_maven_2</id>
     </provides>
     <configuration>
        <jdkHome>C:program filesjavajdk1.6.0_02</jdkHome>
     </configuration>
  </toolchain>
</toolchains>

Invalid task 'clean package', you must specify a valid lifecycle phase.

You are trying to run a single task called "clean package". Try instead running Maven twice using "clean" and "package" as two separate tasks.
Categories: Building | Releasing | Tools
edit this page - what links to here? - page history - top
Last edited by jevon jevon 42 months ago