我在linux上有一个maven项目。 直到上周才建成。 今天我收到以下错误
[ERROR] Failed to execute goal on project my-integration-service: Could not resolve
dependencies for project com.mycompany.myproj:my-integration-service:jar:0.0.1-SNAPSHOT:
Failed to collect dependencies for [org.springframework:spring-core:jar:4.0.4.RELEASE
(compile), org.springframework:spring-tx:jar:4.0.4.RELEASE (compile), ...]: No versions
available for joda-time:joda-time:jar:[2.2,) within specified range -> [Help 1]
我检查了我的settings.xml,在本地存储库中,我可以看到这个的很多版本...库2.2,2.4 ... 2.9.1
我还看到了文件M2_REPO / joda-time / joda-time / resolver-status.properties
maven-metadata-codehaus.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to codehaus (http\://repository.codehaus.org/org/codehaus)\: Error transferring file\: repository.codehaus.org
...
maven-metadata-spring-milestone.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to spring-milestone (http\://maven.springframework.org/milestone)\: Error transferring file\: Connection reset
....
maven-metadata-com.springsource.repository.maven.releases.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to com.springsource.repository.maven.releases (http\://maven.springframework.org/release)\: Error transferring file\: Connection reset
...
maven-metadata-just-testing.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to just-testing (http\://repo1.maven.org/maven2)\: Access denied to\: http\://repo1.maven.org/maven2/joda-time/joda-time/maven-metadata.xml
...
maven-metadata-apache.snapshots.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to apache.snapshots (http\://repository.apache.org/snapshots/)\: Error transferring file\: Connection reset
...
maven-metadata-maven-restlet.xml.error=Could not transfer metadata joda-time\:joda-time/maven-metadata.xml from/to maven-restlet (http\://maven.restlet.org)\: Error transferring file\: Connection reset
我还运行了命令mvn -X archetype:按建议生成What could be causing 'error transferring file' in maven?
[WARNING] Error reading archetype catalog http://repo1.maven.org/maven2
org.apache.maven.wagon.TransferFailedException: Error transferring file: Connection reset
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:143)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
....
....
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:658)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115)
... 31 more
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[DEBUG] Using catalog /wmchome/hfundadm/.m2/archetype-catalog.xml
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype
不太确定可能导致此错误的原因是什么?
使用Apache Maven 3.0.3(r1075438; 2011-02-28 12:31:09-0500)
<profile>
<id>defaultProfile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>http://my-mvn-repo/repo</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://my-mvn-repo/repo</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
但我没有看到任何以<id>
为中心的服务器,有很多服务器......不确定使用哪一台
<server>
<id>abccommon_id</id>
<username>abccommon_adm</username>
<password>****</password>
</server>
答案 0 :(得分:0)
您无权访问您的存储库。
Access denied to\: http\://repo1.maven.org/maven2/joda-time/joda-time/maven-metadata.xml
...
这里最有可能的问题是您的凭据。你可能没有正确地提供它们。
答案 1 :(得分:0)
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int N;
cin>>N;
int edges[N][N];
for(int i=0;i<N;i++)
{
for(int j=0;j<N;j++)
{
cin>>edges[i][j];
}
}
int ans=0;
for(int i=0;i<N;i++)
{
path.push_back(i);
for(int j=0;j<N;j++)
{
if(edges[i][j]==1)
{
for(int k=0;k<N;k++)
{
if(k!=i && edges[j][k]==1)
{
for(int l=0;l<N;l++)
{
if(l!=k && edges[l][k]==1 && edges[l][i]==1)
{ans++;}
}
}
}
}
}
}
`cout<<ans/16; `// i did this becoz i think that every quadrilateral will be counted 16 times by this code
更新V:\ Ecomm \ apache-maven-3.6.1 \ conf \ settings.xml
I had proxy issue
答案 2 :(得分:0)
我使用了以下标志,它成功下载了所有内容。
System.out.println(Arrays.toString(priorityQueue.toArray()));