问题描述
我试图通过在pom中包含依赖项来访问一些jar文件。问题是我在公司关系仓库中找不到错误。如何告诉Maven不要仅在http://sl-quality.mycompany.com/nexus/content/groups/public/中查找依赖项?网址在哪里定义?
import pandas as pd
df = pd.read_csv('file.csv',index_col=0)
df.index = pd.to_datetime(df.index,format='%d/%m/%y')
dtr = pd.date_range('01.01.2020','31.03.2020',freq='W')
empty = pd.DataFrame(index=dtr)
df = pd.concat([df,empty[~empty.index.isin(df.index)]]).sort_index().fillna(0)
我不知道为什么它总是成为联系,因为这在我的pom文件中没有提到。我可以将其安装在本地存储库中,但不能确定需要拉出哪些应用jar文件才能正常工作,因为需要添加两个存储库。
解决方法
存储库通常是在Windows上C:/Users/Youruser/.m2/settings.xml
中的设置文件中配置的
例如检查镜像和相应的存储库标签-您的settings.xml可能看起来像这样
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://sl-quality.mycompany.com/nexus/content/groups/public/</url>
</mirror>
更改此URL以指向另一个存储库,可能是外部非公司存储库,例如http://repo.maven.apache.org/maven2
编辑: 我想这就是你想要的
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*,!ksqlDB</mirrorOf>
<url>http://sl-quality.mycompany.com/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<!-- Add repository for your other repo to filter on above -->
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>ksqlDB</id>
<url>https://ksqldb-maven.s3.amazonaws.com/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</profile>
<!-- add at bottom inside </settings> -->
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
根据需要添加更多存储库,并在必要时在上方进行过滤。我相信(未经测试)您可以将相同的排除项应用于镜像,而不是亲自使用存储库,我更喜欢使用存储库标签并进行配置文件设置。