gradle-archetype-plugin
gradle-archetype-plugin copied to clipboard
Nontemplates Not Working?
Items in my .nontemplates file seem to be ignored, as the plugin attempts to interpret files, including files in the gradle directory as templates. Details are below.
environment:
$ gradle --version
------------------------------------------------------------
Gradle 5.6.3
------------------------------------------------------------
Build time: 2019-10-18 00:28:36 UTC
Revision: bd168bbf5d152c479186a897f2cea494b7875d13
Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 11.0.2 (Oracle Corporation 11.0.2+9)
OS: Linux 5.2.11-100.fc29.x86_64 amd64
templates directory
$ ls -altr src/main/resources/templates/
total 16
drwxrwxr-x. 3 cgardner cgardner 4096 Nov 6 23:20 ..
drwxrwxr-x. 8 cgardner cgardner 4096 Nov 7 21:24 __projectName__
-rw-rw-r--. 1 cgardner cgardner 116 Nov 7 21:44 .nontemplates
drwxrwxr-x. 3 cgardner cgardner 4096 Nov 7 21:44 .
.nontemplates file
$ cat src/main/resources/templates/.nontemplates
# comments
**/*.jar
**/*.bat
**/*.sh
**/*.zip
**/*.gz
**/*.xz
**/*.tar
**/*.7z
gradle/
.gradle/
gradlew
gradlew.bat
Output
<======-------> 50% EXECUTING [46s]
Variables:
group ='group'
groupId ='group'
name ='project'
projectName ='project'
artifactId ='project'
version ='1.0-SNAPSHOT'
project.version ='1.0-SNAPSHOT'
namePackage ='project'
namePath ='project'
groupPath ='group'
packagePath ='group/project'
packageName ='group.project'
Using template in: /home/cgardner/git/gradle-clean-arch/src/main/resources/templates
Using non-template list in file: /home/cgardner/git/gradle-clean-arch/src/main/resources/templates/.nontemplates
Failed to resolve variables in: '/home/cgardner/git/gradle-clean-arch/src/main/resources/templates/__projectName__/.gradle/5.6.4/javaCompile/classAnalysis.bin]
Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
GStringTemplateScript792.groovy: 4: unexpected char: 0x1E @ line 4, column 53.
���ZE���K������������${���I
If I get rid of the intermediate __projectName__
directory I don't have this problem. Is there a way to use a templates/__projectName__
directory to make this work?