English 中文(简体)
Maven项目界定的存放处不是工程
原标题:Maven project defined repository not works

RESOLVED P.S.Because I don t have enough reputation to answer my own question right now so I put the solution in the question.

我刚刚开始使用马文和我的roid子项目。 我使用的游戏发动机称为微调器,它不是在中央波里,因此我不得不自行安装。

After check the instruction, I use this method.https://stackoverflow.com/q/2230464/531223. I add below defined xml code in root pom.xml

<repositories>
<repository>
  <id>my-local-repo</id>
  <url>file://${basedir}/common/repo</url>
</repository>
</repositories>

And install the jar files I needed successfully with the method in that answer. However, when I execute command mvn install or mvn -o install, it still tell me can t find the jar file. I m not sure the repository I added in root pom.xml is working.
Can anyone tell me where I made the mistake and how to check whether the project defined repository is working? Thank you.

Thank you Death, I figured it out, it s my silly fault.

我的项目有3个单元。 普通和roid。 我把共同/亲爱的 d子作为我的存放处。 因此,我开始使用Maven。 除2个错误外,我所做的一切都是正确的。

1. 导言 Put the sediment Code in fundamental pom.xml not in pom.xml in the android dir which I . 我只是认为它会奏效,但却是 t。

2. 如果我把该守则放在右 d中,我就应当修改该 ,则该 based子已经改变。

这笔费用为3小时左右

最佳回答
  1. Run 帮助:

  2. 查阅<repositories> section, 查找my- local-repo, 并查看real 途径(不包括文件http:// prefix)

  3. run this command (from the link you found yourself) mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file -Dfile=/path/to/your.jar -DgroupId=yourGroup -DartifactId=yourArtifactId -Dversion=1.0 -Dpackaging=jar -DlocalRepositoryPath=the_path_you_looked_up_excluding_file://

  4. 如果出现错误的话,可以确保: 载有带子结构的<代码>grp/your ArtifactId/1.0/,your.jar,载于此处。

  5. 在您的项目must之后,即可找到对这一定义的依赖。

    <dependency>
        <groupId>grp</groupId>
        <artifactId>yourArtifactId</artifactId>
        <version>1.0</version>
    </dependency>
    
问题回答

I agree with Oleg s answer but if the problem persists after all his steps, check your global settings.xml file for possible usage of the tag.

镜像环境总是指向同一背书,忽略了你在项目中所可能定义的任何东西。

e. 您的om。

<repositories>
    <repository>
        <id>project.local</id>
        <name>project</name>
        <url>file://${project.basedir}/repo</url>
    </repository>
</repositories>

• 确保<代码>和t;USER_HOME>m2dings.xml 忽视

<mirrors>
    <mirror>
        <id>central</id>
        <name>Central</name>
        <url>http://my.nexus.ip/nexus/content/repositories/central/</url>
        <mirrorOf>!project.local,*</mirrorOf>
    </mirror>
</mirrors>




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签