0

when I build a project in linux environment, it says:

[ERROR] Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-enforcer-plugin:jar:1.0-beta-1: Could not transfer artifact org.apache.maven.plugins:maven-enforcer-plugin:pom:1.0-beta-1 from/to Main Maven Repo (http://repo1.maven.org/maven2/): repo1.maven.org: Unknown host repo1.maven.org -> [Help 1]

I'm using my company internal mirror repository.

Any one help me?

Update: I copied the .m2 folder to the linux home/user_name , resolved this issue

Systematix Infotech
  • 2,345
  • 1
  • 14
  • 31
user3231931
  • 331
  • 1
  • 2
  • 8
  • Are you behind the proxy? – Jk1 Jun 04 '14 at 07:41
  • 1
    Are you sure you are using your internal mirror? `Unknown host repo1.maven.org` – tom Jun 04 '14 at 07:41
  • How is your internal mirror configured? And are you able to download other artifacts without problems? Try for instance to change version on one of the plugins you are using and see if you can download that particular version. – Joakim Z Jun 04 '14 at 07:44
  • I reset the setting.xml using the internal repository, the maven should search under it, I also don't understand why it search under the repo1.maven.org – user3231931 Jun 04 '14 at 07:48

1 Answers1

0

If you want to use only your company's repo and not the public ones, such as maven central, take a look here Disable Maven central repository.

Otherwise you need your station/network configured to allow access to the public repos and resolve their IPs from the hostnames.

Community
  • 1
  • 1
Morfic
  • 15,178
  • 3
  • 51
  • 61
  • My linux cannot access the network so I config the internal repository, the repository can access the network. – user3231931 Jun 04 '14 at 07:50
  • Then you need to set up your internal repo to mirror the central, as it is described in the accepted answer for the linked question. – Morfic Jun 04 '14 at 07:52
  • 1
    you can check your config by doing `mvn help:effective-pom`. Looking at the result you can tell if you configured your maven project correctly to use the internal repo. – tom Jun 04 '14 at 07:54