Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5969253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:12:13+00:00 2026-05-22T20:12:13+00:00

I have maven 2 installed. When I use mvn clean or mvn install in

  • 0

I have maven 2 installed. When I use mvn clean or mvn install in the app root it works fine.

But when I am trying to use maven install inside a bash script, I got the above exception:

This is my script:

#!/bin/sh
#dirname='/home/myuser/workspace/myapp'
DIRECTORY=$(cd `dirname $0` && pwd)
cd  $DIRECTORY
mvn install -s resources/settings.xml $1

it was working fine with maven 3, but after I installed maven 2 and configured it, it stopped working and gave me above exception. I don’t know what is the problem, since the regular build, mvn install works, but building from the script doesn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:12:14+00:00Added an answer on May 22, 2026 at 8:12 pm

    Couple of possibilities…

    • One, as posted here, you have both M2_REPO and M3_REPO variables defined.
    • Or you are facing this issue related to maven3 and M2_HOME
    • The other is that somehow the JRE is getting used instead of JDK when run from the batch file!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Fedora 11 (x86 64) installed with Eclipse. I need a Maven plugin,
I am importing a maven project into Eclipse. I have the m2e plugin installed
I have a maven project with the following packages (for illustration only): Root: src/main/java
I have just started to use Apache Maven. Now I would like to make
I want to use Maven 2 for buliding Web App using Spring 3.05 and
i have created a multi-module maven project and i am trying to write and
I have a maven project where I want to use the Cargo-Maven-Plugin (1.1.1) to
I am a newbie to maven. I have installed apache archiva in my machine
I have installed nexus, and configured my settings.xml to use my local nexus as
I have my JAVA_HOME set to: C:\Program Files (x86)\Java\jdk1.6.0_18 After I run maven install

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.