So what I'm trying to do is to deploy my Spring Boot App to Heroku (using Git and Heroku CLI).
But every time I push my repo to Heroku, these errors appear after I used "$git push heroku master" in my terminal.
remote: [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.6.2:repackage (repackage) on project UserEditor: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.6.2:repackage failed: Unable to find main class -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
remote:
remote: ! ERROR: Failed to build app with Maven
remote: We're sorry this build is failing! If you can't find the issue in application code,
remote: please submit a ticket so we can help: https://help.heroku.com/
remote:
remote: ! Push rejected, failed to compile Java app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 33efb1c07b67aebd548c83b47099d3a66a2efed2
remote: !
remote: ! We have detected that you have triggered a build from source code with version 33efb1c07b67aebd548c83b47099d3a66a2efed2
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to myhome-app-1.
remote:
To https://git.heroku.com/myhome-app-1.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myhome-app-1.git' ```
The error would be because you are using Java version above 8 and for free deployment Heroku only allows Java version-8. so in pom.xml change the java version to 8 and rebuild maven. After that, run the project in your local system just to verify there are no errors because Java-8 doesn't contain all the functions that you would have used in your project.
Related
Getting this error: Error: Command failed: git push heroku main:refs/heads/main --force
.yml file for GitHub Actions
name: Java CI
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v3
- name: Set up JDK 17
uses: actions/setup-java#v3
with:
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action#e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action#0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: build
- uses: akhileshns/heroku-deploy#v3.12.12 # This is the action
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: "all-books-store" #Must be unique in Heroku
heroku_email: "mail-id-here"
branch: "main"
At first GitHub branch was set to master. I thought there could be a issue with it so renamed it to main and changed the branch. But still the issue was same. Before deployment everything goes good in GitHub actions build but during build it gets rejected and shows the error.
Procfile
web: java -Dserver.port=$PORT $JAVA_OPTS -jar build/libs/demo-0.0.1-SNAPSHOT.jar
Code run while it is deploying using github actions
Run akhileshns/heroku-deploy#v3.12.12
Created and wrote to ~/.netrc
Successfully logged into heroku
› Warning: Our terms of service have changed:
Added git remote heroku
› https://dashboard.heroku.com/terms-of-service
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Gradle app detected
remote: -----> Spring Boot detected
remote: -----> Installing OpenJDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew build -x check
remote: Downloading https://services.gradle.org/distributions/gradle-7.4.1-bin.zip
remote: ...........10%...........20%...........30%...........40%...........50%...........60%...........70%...........80%...........90%...........100%
remote: To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.4.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
remote: Daemon will be stopped at the end of the build
remote: > Task :compileJava FAILED
remote:
remote: FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: Execution failed for task ':compileJava'.
remote: > invalid source release: 17
remote:
remote: * Try:
remote: > Run with --stacktrace option to get the stack trace.
remote: > Run with --info or --debug option to get more log output.
remote: > Run with --scan to get full insights.
remote:
remote: * Get more help at https://help.gradle.org
remote:
remote: BUILD FAILED in 24s
remote: 1 actionable task: 1 executed
remote:
remote: ! ERROR: Failed to run Gradle!
remote: We're sorry this build is failing. If you can't find the issue in application
remote: code, please submit a ticket so we can help: https://help.heroku.com
remote: You can also try reverting to the previous version of the buildpack by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Gradle app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to all-books-store.
remote:
To https://git.heroku.com/all-books-store.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/all-books-store.git'
Unable to push branch because the branch is behind the deployed branch. Using --force to deploy branch.
(If you want to avoid this, set dontuseforce to 1 in with: of .github/workflows/action.yml.
Specifically, the error was: Error: Command failed: git push heroku main:refs/heads/main
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Gradle app detected
remote: -----> Spring Boot detected
remote: -----> Installing OpenJDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew build -x check
remote: Downloading https://services.gradle.org/distributions/gradle-7.4.1-bin.zip
remote: ...........10%...........20%...........30%...........40%...........50%...........60%...........70%...........80%...........90%...........100%
remote: To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.4.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
remote: Daemon will be stopped at the end of the build
remote: > Task :compileJava FAILED
remote:
remote: FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: Execution failed for task ':compileJava'.
remote: > invalid source release: 17
remote:
remote: * Try:
remote: > Run with --stacktrace option to get the stack trace.
remote: > Run with --info or --debug option to get more log output.
remote: > Run with --scan to get full insights.
remote:
remote: * Get more help at https://help.gradle.org
remote:
remote: BUILD FAILED in 24s
remote: 1 actionable task: 1 executed
remote:
remote: ! ERROR: Failed to run Gradle!
remote: We're sorry this build is failing. If you can't find the issue in application
remote: code, please submit a ticket so we can help: https://help.heroku.com
remote: You can also try reverting to the previous version of the buildpack by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Gradle app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to all-books-store.
remote:
To https://git.heroku.com/all-books-store.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/all-books-store.git'
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Gradle app detected
remote: -----> Spring Boot detected
remote: -----> Installing OpenJDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew build -x check
remote: Downloading https://services.gradle.org/distributions/gradle-7.4.1-bin.zip
remote: ...........10%...........20%...........30%...........40%...........50%...........60%...........70%...........80%...........90%...........100%
remote: To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.4.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
remote: Daemon will be stopped at the end of the build
remote: > Task :compileJava FAILED
remote:
remote: FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: Execution failed for task ':compileJava'.
remote: > invalid source release: 17
remote:
remote: * Try:
remote: > Run with --stacktrace option to get the stack trace.
remote: > Run with --info or --debug option to get more log output.
remote: > Run with --scan to get full insights.
remote:
remote: * Get more help at https://help.gradle.org
remote:
remote: BUILD FAILED in 23s
remote: 1 actionable task: 1 executed
remote:
remote: ! ERROR: Failed to run Gradle!
remote: We're sorry this build is failing. If you can't find the issue in application
remote: code, please submit a ticket so we can help: https://help.heroku.com
remote: You can also try reverting to the previous version of the buildpack by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Gradle app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 04b91247a117524163405aa40742f4bd84afb3fc
remote: !
remote: ! We have detected that you have triggered a build from source code with version 04b91247a117524163405aa40742f4bd84afb3fc
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
Error: Error: Command failed: git push heroku main:refs/heads/main --force
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Gradle app detected
remote: -----> Spring Boot detected
remote: -----> Installing OpenJDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew build -x check
remote: Downloading https://services.gradle.org/distributions/gradle-7.4.1-bin.zip
remote: ...........10%...........20%...........30%...........40%...........50%...........60%...........70%...........80%...........90%...........100%
remote: To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.4.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
remote: Daemon will be stopped at the end of the build
remote: > Task :compileJava FAILED
remote:
remote: FAILURE: Build failed with an exception.
remote:
remote: * What went wrong:
remote: Execution failed for task ':compileJava'.
remote: > invalid source release: 17
remote:
remote: * Try:
remote: > Run with --stacktrace option to get the stack trace.
remote: > Run with --info or --debug option to get more log output.
remote: > Run with --scan to get full insights.
remote:
remote: * Get more help at https://help.gradle.org
remote:
remote: BUILD FAILED in 23s
remote: 1 actionable task: 1 executed
remote:
remote: ! ERROR: Failed to run Gradle!
remote: We're sorry this build is failing. If you can't find the issue in application
remote: code, please submit a ticket so we can help: https://help.heroku.com
remote: You can also try reverting to the previous version of the buildpack by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Gradle app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 04b91247a117524163405aa40742f4bd84afb3fc
remote: !
remote: ! We have detected that you have triggered a build from source code with version 04b91247a117524163405aa40742f4bd84afb3fc
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to all-books-store.
remote:
To https://git.heroku.com/all-books-store.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/all-books-store.git'
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to all-books-store.
remote:
To https://git.heroku.com/all-books-store.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/all-books-store.git'
Screenshot for build using GitHub actions.
enter image description here
This has nothing to do with anything except your requirements. Here is the actual error, right in the output you quoted:
remote: * What went wrong:
remote: Execution failed for task ':compileJava'.
remote: > invalid source release: 17
(Why Java 17 is invalid here is a different question that you can ask, but see, e.g., Execution failed for task ':compileJava'. > invalid source release: 1.7 first.)
Error im getting is below, this happens when i do "git push heroku master"
Enumerating objects: 262, done.
Counting objects: 100% (262/262), done.
Delta compression using up to 4 threads
Compressing objects: 100% (232/232), done.
Writing objects: 100% (262/262), 316.61 KiB | 4.34 MiB/s, done.
Total 262 (delta 34), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Gradle app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew stage
remote: Downloading https://services.gradle.org/distributions/gradle-6.0-all.zip
remote: ......................................................................................................................................
remote: Unzipping /app/tmp/cache/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0-all.zip to /app/tmp/cache/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd
remote: Set executable permissions for: /app/tmp/cache/.gradle/wrapper/dists/gradle-6.0-all/cra2s42cvogxluqqpvbc5e9xd/gradle-6.0/bin/gradle
remote:
remote: > Configure project :
remote: fatal: not a git repository (or any parent up to mount point /)
remote: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
remote:
remote: FAILURE: Build failed with an exception.
remote:
remote: * Where:
remote: Build file '/tmp/build_24a75868b111767bf7a04169c852fe43/build.gradle' line: 102
remote:
remote: * What went wrong:
remote: A problem occurred evaluating root project 'XXX-bot'.
remote: > Process 'command 'git'' finished with non-zero exit value 128
remote:
remote: * Try:
remote: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
remote:
remote: * Get more help at https://help.gradle.org
remote:
remote: Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
remote: Use '--warning-mode all' to show the individual deprecation warnings.
remote: See https://docs.gradle.org/6.0/userguide/command_line_interface.html#sec:command_line_warnings
remote:
remote: BUILD FAILED in 51s
remote:
remote: ! ERROR: Failed to run Gradle!
remote: We're sorry this build is failing. If you can't find the issue in application
remote: code, please submit a ticket so we can help: https://help.heroku.com
remote: You can also try reverting to the previous version of the buildpack by running:
remote: $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
remote:
remote: Thanks,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Gradle app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to be-anmusicnew.
remote:
To https://git.heroku.com/XXX
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXX.git'
while executing "git ls-files gradle" the following files are listed
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
and my Procfile looks like this
"worker: java -jar target/Bot.jar"
Under the configure project there is an error:
fatal: not a git repository (or any parent up to mount point /)
so he can't push to that.
Try to modify the urlwhere you want to push
I'm using window OS
I'm doing like this (using google api in java)
https://github.com/aliciatang/CalendarSync
when I writing mvn appengine:devserver, It got error
[INFO] Retrieving Google App Engine Java SDK from Maven
Downloading: https://repo.maven.apache.org/maven2/com/google/appengine/appengine-java-sdk/1.9.21/appengine-java-sdk-1.9.21.zip
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34:22 min
[INFO] Finished at: 2017-08-04T18:52:58+09:00
[INFO] Final Memory: 19M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.21:devserver (default-cli) on project gcal: Could not resolve SDK artifact in Maven.: Could not transfer artifact com.google.appengine:appengine-java-sdk:zip:1.9.21 from/to central (https://repo.maven.apache.org/maven2): GET request of: com/google/appengine/appengine-java-sdk/1.9.21/appengine-java-sdk-1.9.21.zip from central failed: Connection reset -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I can't solve this problem!!
This works for me:
gcloud components update //Update gcloud
mvn clean package //Rebuild app
mvn appengine:run //Run on local server (Jetty) (This replace: mvn appengine:devserver)
Go to the browser: http://localhost:8080/
Happy coding !!!
I'm trying to deploy the following app to Heroku:
https://github.com/raeffu/ch.bfh.bti7081.s2015.Blue/
I'm using the Ant Buildpack.
After executing
$ git push heroku master
the build is successful and then this error message appears at the end of the log:
remote: BUILD SUCCESSFUL
[.....]
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing... done, 236.4MB
remote: -----> Launching... failed
remote:
remote: ! Push rejected, failure creating release
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to healvis.
remote:
To https://git.heroku.com/healvis.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/healvis.git'
The Procfile looks like this:
web: java -jar lib/webapp-runner-8.0.18.0-M1.jar --expand-war --port $PORT target/healvis.war
The log does not reveal any helpful information.
How can I find out more what's going wrong or, even better, how can I fix it?
The problem was the addon shared-database required by the buildpack.
I forked the repository and removed the addon, now it works.
I'm trying to test maven using
mvn archetype:generate -DgroupId=org.sonatype.mavenbook -DartifactId=quickstart -Dversion=1.0-SNAPSHOT -DpackageName=org.sonatype.mavenbook -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.0 -DinteractiveMode=false
After several minutes, the system shows me this:
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.2/archetype-catalog-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.2/archetype-catalog-2.2.pom (2 KB at 4.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.2/archetype-models-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.2/archetype-models-2.2.pom (3 KB at 5.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom (8 KB at 17.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.8.1/ant-parent-1.8.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30:36.874s
[INFO] Finished at: Tue Feb 07 15:59:39 BRST 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate failed: Plugin org.apache.maven.plugins:maven-archetype-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-archetype-plugin:jar:2.2 (): Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:1.5.8: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.2 from/to central (http://repo.maven.apache.org/maven2): Read timed out -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
How can I fix this? Thanks in advance!
I too encountered the same problem when I created a project using Idea IDE. Using the below method you can create a stand alone application or a web application without getting any error.
Go to the Terminal. Type below mentioned commands and execute.
For a web application:
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
For a stand alone application:
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
This will create the project structure by downloading relevant jars etc. When this is done the project structure has been created. Open up an IDE and direct it to created Project`s Pom.xml file.
The error is:
Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:1.5.8: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.2 from/to central (http://repo.maven.apache.org/maven2): Read timed out
Try again when your network works better (internet connection is better).
Check with ping if you can connect to the http://repo.maven.apache.org/maven2.
may be you should try in the root mode : try with sudo + command
I have encountered this problem when my machine is behind a firewall (corporate network) and I have not set up a proxy in ~/.m2/settings.xml.
The opposite could also be true, a proxy has been defined, but you're no longer connected to that network.
Details about Maven's settings.xml can be found here.
I had the same problem. Maven can't seem to view the plugins, in this case the archetype. This is a network problem. Are you behind a proxy or firewall? If so, follow the instructions given here. Otherwise, set your firewall permissions and you can try using sudo too.