将grails插件部署到Nexus的问题
我有一个grails项目,配置为一个插件,我想做的是将其推送到本地Nexus存储库中 我已经能够使用grails发布插件来实现这一点,但是当我使用依赖项时,我的项目使用依赖项找不到类 所以我查看了一下jar以了解原因,它看起来没有编译任何Groovy代码,看起来所有Groovy文件都打包在一起了,而不是先编译代码 你知道我做错了什么吗 关于我正在做什么的信息: Grails:2.4.3 BuildConfig.groovy将grails插件部署到Nexus的问题,grails,groovy,nexus,Grails,Groovy,Nexus,我有一个grails项目,配置为一个插件,我想做的是将其推送到本地Nexus存储库中 我已经能够使用grails发布插件来实现这一点,但是当我使用依赖项时,我的项目使用依赖项找不到类 所以我查看了一下jar以了解原因,它看起来没有编译任何Groovy代码,看起来所有Groovy文件都打包在一起了,而不是先编译代码 你知道我做错了什么吗 关于我正在做什么的信息: Grails:2.4.3 BuildConfig.groovy grails.project.class.dir = "target/c
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.repos.nexus.url = "http://xxxxx:8081/repository/maven-snapshots/"
grails.project.repos.default = "nexus"
grails.project.repos.nexus.username = "xxxx"
grails.project.repos.nexus.password = "xxxxx"
grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
// compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the test-app JVM, uses the daemon by default
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the run-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the Console UI JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]
grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsCentral()
mavenLocal()
mavenCentral()
}
dependencies {
compile 'com.xxx:lsi-client:1.0-SNAPSHOT'
}
plugins {
build ':release:3.0.1', {
export = false
}
}
}
要创建工件,我运行以下命令
grails maven-deploy
grails publish-plugin --repository=nexus
grails maven-install --binary
我还尝试了以下命令
grails maven-deploy
grails publish-plugin --repository=nexus
grails maven-install --binary
我有一个grails项目的标准目录结构。不确定要提供什么其他信息。在这一点上把我的头发拔出来
当我运行一个grails编译程序,按照预期执行正确的操作时,groovy类被编译到target/classes目录中。对于那些对这里的答案感兴趣的人,我最终加入了grails Slack社区,那里有人很友好地回答了我的问题: Grails2插件只是打包了源代码,不管是zip还是jar,这些类都不会被编译。它们由使用插件的应用程序编译 Grails3+与我所理解的不同,插件都是JAR,都是编译的 很高兴知道,但这只是从Grails2升级的另一个原因 编辑: 如果您需要在您的Grails2插件中编译并打包为maven local repo中的jar的域类,那么您可以通过以下命令实现这一点
grails maven-deploy
grails publish-plugin --repository=nexus
grails maven-install --binary
还要确保pom.xml中的工件类型也设置为jar(或者省略,因为我认为默认工件类型是jar)
4.0.0
com公司
工件名
罐子
0.1
希望这能帮助其他人