문제

Suppose I have created an empty Maven project in Eclipse. What is the shortest way to observe Maven's ability of automatic jar downloading and dependency checking? For example, I need to use Swing or log4j library. How can I add them without thinking where to download?

도움이 되었습니까?

해결책

Add a dependency, for example, Log4J 1.2.16; it will be downloaded automatically, along with its dependencies. Then check in your home directory's .m2/repository directory.

(You'll find mvnrepository.com helpful; bookmark it!)

다른 팁

Add this at the end of your pom :

    <repository>
        <id>jboss-nexus</id>
        <url>https://repository.jboss.org/nexus/</url>
    </repository>

Then go to this location and look for the artifacts you need. Once you've found them add them to your project dependencies (the site even shows the complete dependency). Run mvn install and then mvn eclipse:eclipse and voila, all done...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top