I just updated the embedder guide so it's accurate now. Note that the embedder is only for the code in trunk which is slated for 2.1.
On 31 May 07, at 9:07 PM 31 May 07, 張旭 wrote:

Thanks to Jiaqi Guo. But I also found maybe maven-embedder can give me some
help (http://maven.apache.org/guides/mini/guide-embedding-m2.html).

On 5/30/07, Jiaqi Guo <[EMAIL PROTECTED]> wrote:

Check $M2_HOME/bin/mvn please.

......
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "${M2_HOME}"/boot/classworlds-*.jar \
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
"-Dmaven.home=${M2_HOME}" \
${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS

So in a typical case, "mvn compile package" will be

java -cp $M2_HOME/boot/classworlds-*.jar
-Dclassworlds.conf=$M2_HOME/bin/m2.conf -Dmaven.home=$M2_HOME
org.codehaus.classworlds.Launcher "compile package"

It's an application loaded by classworlds. By digging into m2.conf, you can find out that the actual main class is org.apache.maven.cli.MavenCli.


Regards
-Jiaqi

張旭 wrote:
> Hi, everyone. Is there a way to invoking maven from java code? Thanks in
> advance.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to