This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Maven Logging Custom output to a file

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi rancher,
I am a newbie here and to Maven. I am trying to figure how i can log execution details into a log file. Also, If I want to out some values like version, release number, execution status and details incase of failure. How can I do this? Any guidance will help.

I dont want to use mvn clean install > file.log

Is there a maven way of doing this.

Thanks in advance.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried running "mvn -?" to see what all of the options are. Do that and take a look at the -l option, perhaps that will do what you want.

Other than that, the only options you have are levels of detail on the output, with the current set of output being one option, and the -X being the other. If you really want to get only those items mentioned, you will have to parse the log output.
 
bhuvan emmandi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Peter,
Thanks for the quick reply. As I told you, I am new to Maven, going through the documentation as well. I will try your suggestions and see if that helps.
 
bhuvan emmandi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,
This helps me to output the execution log but does not give me handle to echo my own message during execution. I want to echo some message like

"date projectxyz {status:true, msg:"success or fail message"}"

is this possible in maven?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing like that built into Maven, but I did find a plugin that will do that:
http://code.google.com/p/maven-echo-plugin/

If you need anything more specific you might have to write your own plugin.
 
Dinner will be steamed monkey heads with a side of tiny ads.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic