Search This Blog

Showing posts with label maven. Show all posts
Showing posts with label maven. Show all posts

Monday, October 5, 2020

Ubuntu - Maven - SSL Error while doing mvn clean install

sudo dpkg --purge --force-depends ca-certificates-java sudo apt-get install ca-certificates-java sudo update-ca-certificates -f

Monday, June 15, 2020

Maven Manual Install to latest Version - Linux Ubuntu 16 14 18 20


cd /home/
 
wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
 

sudo tar -xvzf apache-maven-3.3.9-bin.tar.gz

sudo tar -xvzf apache-maven-3.3.9-bin.tar.gz
sudo tar -xvzf apache-maven-3.6.3-bin.tar.gz

sudo mv apache-maven-3.6.3 /opt/
cd /opt/
cd apache-maven-3.6.3/
ls


cd ..
sudo nano /etc/profile.d/mavenenv.sh




          export M2_HOME=/opt/apache-maven-3.6.3
          export MAVEN_HOME=${M2_HOME}
          export PATH=${M2_HOME}/bin:${PATH}

sudo chmod +x /etc/profile.d/mavenenv.sh


source /etc/profile.d/mavenenv.sh
 

mvn --version

Wednesday, March 25, 2020

Sunday, March 1, 2020

Eclipse Maven - Change Default version

1. Add your external maven
2. Change that version while run -> install configurations

enter image description here




enter image description here



enter image description here




enter image description here

Maven - Alternate location for the .m2 folder or local Folder settings.xml [ Error code 401, Unauthorized ]

1. settings.xml
     Contains id,username,password
2. pom.xml
      Contains repository->private url for metadata access


use the below command
--global-settings

mvn -X clean install -gs "settings.xml"
or
mvn -X clean install -gs "D:/works/settings.xml"
or
mvn -X clean install -global-settings "D:/folderpath/settings.xml"


Tuesday, September 11, 2018

Jacoco Sonar Report - Maven

COMPILE
mvn -X clean install -Dwtpversion=2.0 eclipse:eclipse

OR Ignore Test Cases
mvn -X clean install -Dwtpversion=2.0 -Dmaven.test.skip=true eclipse:eclipse

generate report  
**************
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent -Dmaven.test.skip=true install

Thursday, March 8, 2018

How to take from Custom/Local Lib - Maven

1. create a folder
2. in maven tag specify the local path
3.  what ever the jar you kept inside the folder. just add those jar in like how u r specifying normally.
4. Maven will pick in local repo, while compile or build [ whenever it perform ]





Wednesday, June 14, 2017

Dynamic Web Module 3.0 requires Java 1.6 or newer” in Maven Projects

Open your project’s pom.xml and add this plugin tag
<build>
    <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
        </configuration>
    </plugin>
    </plugins>
</build>
Finally, right click on your project > Maven > Update Project

Sunday, February 26, 2017

M2_REPO classpath Issues In Eclipse IDE

1. Add M2_REPO Manually

Define and add M2_REPO classpath variable manually into Eclipse IDE. Follow below steps :
  1. Eclipse IDE, menu bar
  2. Select Window > Preferences
  3. Select Java > Build Path > Classpath Variables
  4. Click on the new button > defined a new M2_REPO variable and point it to your local Maven repository
  5. Done.


2. SIMPLY DELETE AND RECREATE UR WORKSPACE


1. Delete your workspace
2. Import your projects with "Existing Maven Project"

NOTE: this will create M2_repo in your classpath. no worries. 


Wednesday, February 3, 2016

linux Ubuntu Maven Setup Installation


Maven
*****

Type the below commands.

    sudo apt-get install maven
    sudo update-alternatives --config mvn

Wednesday, January 6, 2016

Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinit ionParsingException: Configuration problem: Unable to locate SpringNamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx] Offending resource: class path resource [spring.xml]

When you get this error: please use maven-shade-plugin instead of maven-assembly-plugin

<!--
            #if you use this maven assembly plugin with spring-tx, you may get unable to locate exception while running as single jar. so use shade plugin
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>package</phase> bind to the packaging phase
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>yourpackage.YourMainClass</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            -->
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>1.4</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <transformers>
                            <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>yourpackage.YourMainClass</mainClass>
                            </transformer>
                            <transformer
                                implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                <resource>META-INF/spring.handlers</resource>
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>
       

Thursday, December 10, 2015

Maven Install in linux

Maven
******

 
    sudo apt-get install maven

    sudo update-alternatives --config mvn

Hit Counter


View My Stats