Grails interprets zip in my repo as a plugin, although it's not really a plugin

The dependency of my grails project (the module I'm creating) displays the zip file as part of the build process (for use by the flex application) using the maven-assembly-plugin module. This zip is output to my local mvn repo in the same directory as the jar, which crashes the ie module

.m2/repository/com/mypackage/domain/1.0.0-SNAPSHOT/domain-1.0.0-SNAPSHOT.jar .m2/repository/com/mypackage/domain/1.0.0-SNAPSHOT/domain-1.0.0-SNAPSHOT-generated-tos.zip 

Since the module is a (transitive) dependency in my grails project, jar and zip are both cached in ivy cache

Now when I try to run the grails application, Grails seems to detect this ZIP file from the ivy cache and tries to install it as a plugin that does not work for obvious reasons ...

 | Loading Grails 2.0.0 | Configuring classpath. | Environment set to development..... | Error Zip ~/.grails/ivy-cache/com.mypackage/domain/zips/domain-1.0.0-SNAPSHOT-generated-tos.zip is not a valid plugin 

The zip must be created for the repo, since another module uses the mvn-dependency plugin to unpack it as part of the build process. Thus, I need to find a way to tell Grails to ignore it, since it is not a zip plugin. Is it possible?

+6
source share
2 answers

This is because in grails the default plugin packaging is zip, and any archive that depends on this format will be considered a plugin.

Try making the exception transitive by default:

 def excludes = { transitive = false } 
0
source

Without testing, I would assume that this is all related to the configuration of BuildConfig.groovy.

Things that you put inside the dependency block should be included as is, while things in the plugin block are considered a zip plugin.

I came across a problem as soon as I misconfigured the project. The following example is not verified :)

 dependencies { compile "my.project:artifact:0.1.0:zip" } plugins { compile "my.project:artifact:0.1.0" // Automatic found as a zip project 

}

0
source

Source: https://habr.com/ru/post/907511/


All Articles