Menu

Apache Maven on RedHat, Scientific Linux, Fedora, CentOS


Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

If you think that Maven could help your project, you can find out more information about in the "About Maven" section of the navigation. This includes an in-depth description of what Maven is, a list of some of its main features, and a set of frequently asked questions about what Maven is


Install the repo in /etc/yum.repos.d/ like below example. The repo can be any trusted Apache Maven repository specifically for your RedHat version.
[root@hackthesec /]# cd /etc/yum.repos.d/

[root@hackthesec /]# vi maven.repo
  And add this lines bellow

[epel-apache-maven]
name=maven from apache foundation.
baseurl=http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-6Server/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0
[epel-apache-maven-source]
name=maven from apache foundation. - Source
baseurl=http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-6Server/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0
Save the edited maven.repo file [ESC] then : then x.

Let's install Maven
[root@hackthesec /]# yum -y install apache-maven
We have maven-3.2.5-1 Installed now.
I had to install this on multiple machines at the same time. Here's how I did it..

[root@hackthesec /]# for i in {2..2300}; do scp /etc/yum.repos.d/maven.repo n$i:/etc/yum.repos.d/;done <-- Copy repo to all SUTs
[root@hackthesec /]# for i in {2..2300}; do ssh n$i yum -y install apache-maven;done
Then I was ready to use Maven:
[root@hackthesec /]# cd hadoop-maven-plugins
[root@hackthesec /]# mvn install
If you have a proxy server you'll need to setup a proxy:
[root@hackthesec /]# vi /USERNAME/.m2/settings.xml
Maven needs to download files, so let's add the following information and change to your specifications:
<settings>
  .
  .
  <proxies>
   <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.example.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
      <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
    </proxy>
  </proxies>
  .
  .
</settings>
If you are compiling java applications then you'll also need java proxy setup:
Java Proxy setting below:
[root@hackthesec /]# export _JAVA_OPTIONS='-Dhttp.proxyHost=proxy-name.com -Dhttp.proxyPort=3660'
You can insert it in your environment now:
[root@hackthesec /]# vi /etc/environment
or
[root@hackthesec /]# vi /user/.bashrc
or
[root@hackthesec /]# vi /etc/profile
or
[root@hackthesec /]# vi /{user}/bash_profile
Log back in or simply do:
# Example
#
# .  /{environmentfile from above}
#
# source /{environmentfile from above}

About Author:


I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Next
Newer Post
Previous
Older Post

0 comments:

Post a Comment

 
Top