I would also add the following:
1) Make sure that you have a repo. Maven without a repo is much less
intuitive.
2) Make sure that your IDE is set up to support Maven so you do not have
to switch back and forth between your IDE and Maven. We use Eclipse STS
from Springframework. It comes with Maven fully supported out of the box.
3) RTFM and the Maven books.
Ron
On 23/05/2012 6:24 AM, Graham Leggett wrote:
On 23 May 2012, at 1:59 AM, hujirong wrote:
After working with Maven for a month, I am still not quite understand how
Maven works. Maybe just like Microsoft technologies, encapsulate too much.
One key issue is to understand the plugin.
The way to think of maven is:
"maven knows how to do stuff".
Most specifically, each bit of "stuff" that maven knows how to do is implemented by a
plugin. For example, maven knows how to compile Java code using the
"maven-compiler-plugin". There are a host of other plugins that kick in when you build,
each one doing one thing, that runs one after the other as part of a maven lifecycle.
When you come to maven, don't ask the question "how do I...", instead ask the question
"how does maven...". The reason the distinction is important is because maven already
knows how to do something, you don't need to tell maven what to do, you just need to let maven get
on with it.
The vast majority of maven plugins don't need any configuration at all, they
just know what to do.
For example, the following example, how can I see this thing allows JDK 5.0
source. There is nowhere it says "allow". How do I know if it's not asking
the compiler to use JDK 5.0?!
The mistake you're making is you're asking the question "how do I allow JDK source", so
you're looking for an "allow" option and not finding one.
What you should ask instead is "how does maven control the JDK source", the
answer is by the maven-compiler-plugin the minimum levels by setting the following
configuration option in the configuration for the maven-compiler-plugin:
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
Regards,
Graham
--
--
Ron Wheeler President Artifact Software Inc email:
[email protected] skype: ronaldmwheeler phone:
866-970-2435, ext 102
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]