IntelliJ不吸引Grails 3的私有依赖 [英] IntelliJ not pulling in Grails 3 private dependencies
问题描述
我正努力让IntelliJ 15 Ultimate Edition与Grails 3专用依赖关系一起工作。基本上我有一个仓库(artifactory),我的私人插件发布。我的应用程序正确地编译/运行/拉入所有插件,但IntelliJ只是不提取依赖关系。正如你可以想象这是代码自动完成等恶梦。
这里是build.gradle中插件的配置 - 这些环境变量是绝对的设置 - 我也尝试将凭据包含在〜/ .m2 / settings.xml中,但仍然无效。
存储库{
maven {
urlhttp://maven.hidden.co/plugins-release-local
凭证{
username System.getenv('REPO_USERNAME')
密码System.getenv('REPO_PASSWORD')
}
}
}
请帮忙。我疯了。 这完全是我的错。我依赖于由.profile和.bash_profile设置的OS X环境变量在IntelliJ中存在时,它们不存在。我必须使用另一种机制将这些环境变量转换为IntelliJ。
我创建了一个文件Library / LaunchAgents / environment.plist
<?xml version =1.0encoding =UTF-8?>
<!DOCTYPE plist PUBLIC - // Apple // DTD PLIST 1.0 // ENhttp://www.apple.com/DTDs/PropertyList-1.0.dtd\">
< plist version =1.0>
< dict>
< key>标签< / key>
< string> my.startup< / string>
< key> ProgramArguments< / key>
< array>
< string> sh< / string>
< string> -c< / string>
< string>
launchctl setenv REPO_USERNAME xxx
launchctl setenv REPO_PASSWORD xxx
< / string>
< / array>
< key> RunAtLoad< / key>
< true />
< / dict>
< / plist>
这为系统范围设置了环境字段,我能够正确加载我的项目。 p>
I'm struggling to get IntelliJ 15 Ultimate Edition to work with Grails 3 private dependencies. Basically I have a repository (artifactory) where my private plugins are published. My application compiles/runs/pulls in all the plugins correctly but IntelliJ just doesn't pick up the dependencies. As you can imagine this is a nightmare for code autocompletion etc.
Here's output from the gradle overview in IntelliJ
And here is the config for the plugins in build.gradle - these environment variables are definitely set - I've also tried to include the credentials in ~/.m2/settings.xml but still not working.
repositories {
maven {
url "http://maven.hidden.co/plugins-release-local"
credentials {
username System.getenv('REPO_USERNAME')
password System.getenv('REPO_PASSWORD')
}
}
}
Please help. I'm going insane.
This was entirely my fault. I was relying on OS X environment variables set by .profile and .bash_profile to be present in IntelliJ when they are not. I had to use another mechanism to get these environment variables into IntelliJ.
I created a file Library/LaunchAgents/environment.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv REPO_USERNAME xxx
launchctl setenv REPO_PASSWORD xxx
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
This set the environment fields for me system wide and I was able to load my projects correctly.
这篇关于IntelliJ不吸引Grails 3的私有依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!