Intellij maven dependency prefer local code

前端 未结 6 2328
野趣味
野趣味 2020-12-30 09:28

i\'m working on a project in which i have an android application project which has pom dependencies on other projects something like this:



        
6条回答
  •  不知归路
    2020-12-30 10:00

    This works for Maven projects in the following way:

    • Add the dependencies that you want to work with to the Maven Projects tab.
    • Navigate to the implementation of the class for which you are looking.
    • Once you are in the implementation, you can navigate back to the Super Method for the declaration.

    That's either Navigate -> Implementation(s) or ALT+COMMAND+B (on the Mac map). Intellij will then present you with the option of decompiling the class from the JAR in the dependency list or the source code in the attached Maven project.

    For example, I am in project bank of the Rooskie Bank, and I want to view the code for the Account class in bank-domain. I click on an Account object declaration and press ALT+COMMAND+B. From the popup menu, I choose the definition from the list of sources that does not have "(Maven: com.rooskiebank.bank-domain.jar)" in the choice.

    IMO this is an awkward way of doing things. As much as I like it, I find Intellij is difficult to use in enterprise-sized systems with multiple in-house libraries, and I still use Eclipse a lot for them. Intellij works better with Git and is great for stand-alone microservices.

    I imagine Gradle works in a similar way.

提交回复
热议问题