Using the Maven Exec Plugin from Codehaus is a rather convenient way to
execute UOMo Units Console Examples or similar examples to follow.
Go to the Units Console Examples project folder.
E.g.:
~\workspace\units\org.eclipse.uomo\examples\units\org.eclips e.uomo.examples.units.console
And run:
mvn exec:java -Dexec.mainClass="<Full Class Name>"
E.g.:
mvn
exec:java -Dexec.mainClass="org.eclipse.uomo.examples.units.console.HelloUnits "
Result:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------ ------------
[INFO] Building UOMo Units Console Examples 0.1.0.SNAPSHOT
[INFO] ------------------------------------------------------------ ------------
[INFO]
[INFO] --- exec-maven-plugin:1.2:java (default-cli) @
org.eclipse.uomo.examples.units.console ---
10 m
m
3.048
393.7007874015748 fuß
100.0 m²
[INFO] ------------------------------------------------------------ ------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------ ------------
[INFO] Total time: 1.990s
[INFO] Finished at: Sun Jan 23 21:37:13 IST 2011
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------ ------------
Note, the locale is German, otherwise you'll see "foot" or other localized
versions of corresponding units.
UOMo Documentation is going to be updated with a more detailed version of
this guideline.
Please feel free to comment or provide additional examples.
Note, under Windows Vista or below you may see Unicode issues like this in
the Windows Command Line:
10 m
m
3.048
393.7007874015748 fu▀
100.0 m▓
An issue has been raised against Maven Exec Plugin, but it almost seems like
a problem of Windows, since the same plugin works perfectly fine in Eclipse
with M2E.
Windows 7 provides additional Encoding options to adjust, which Vista (at
least the versions I know) doesn't.
Please share your experience if you came across similar problems or know,
how to easily address it also under Vista?
Or just use Eclipse instead of the Command Line ;-)