Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven on Linux

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I would like to know what additional thing that I have to do other than getting Maven installed on my machine that runs Linux in order for me to execute my project artifacts?

Suggestions needed.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a properly-configured Maven project, once Maven is installed, you should be able to run the build and it should work. But I can think of two things that might go wrong (other than networking issues):

1) The project relies on a repository other than the default one, in which case you must declare the alternate repository in your m2_home/conf/settings.xml file

2) The project relies on artifacts that were manually loaded in a local repository by the person who put together the pom.xml. In such a case, the provider of the project should provide documentation on which artifacts must be manually installed.

If this does not help you, then I will state that you can usually get better responses to questions if you state up front what error you are seeing.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to create a new project in Maven on Linux. I just wanted to know that I could use mvn install or similiar commands without a sudo permission?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For your own project, the Maven install is all you need. Be aware that the first time couple of times that you run Maven it will take extra time because it will have to download various JAR files from the remote repository. But after those first few times, the builds should go much faster, at least until you try something different or want to access other libraries, in which case more JARs will be downloaded.

You might want to get "Better Builds With Maven", or "Maven The Definitive Guide", both free downloads and helpful to get you started.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I just wanted to know that I could use mvn install or similiar commands without a sudo permission?


You don't need to use sudo to run any mvn commands.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18214
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"mvn install" doesn't mean what you think it does. It means "build the artifact and install it into the Maven Repository.

If you want to make an OS-installable application, you need to set up your own installation process. That means figuring out what directories you want the installed app to live in, setting up its config files (if any), creating and copying the scripts needed to run it (if any) and so forth.

For the most part, you'll be on your own. But for Red Hat/Fedora systems there's a Maven plug-in that can create RPM install packages and it works very nicely. You will need a good understanding of how RPMS are constructed, however.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic