I'm using Grails 3.3.6 (via sdkman) and when I try to use the dbmigration plugin to generate chagelog files it just doesn't do anything and can't figure out how to get more informative output out of the plugin. This is what's on my build.gradle:
buildscript {
...
dependencies {
...
classpath 'org.grails.plugins:database-migration:3.0.0'
...
runtime "mysql:mysql-connector-java:5.1.46"
}
}
This isn't a new project, I cloned it from a git repo and it is successfully running locally on my machine and several db migrations have been performed before (not on my machine, but the migrations folder has dozens of previous migrations, some generated with the plugin it seems). For some reason though, using the db migration plugin from the CLI isn't really working for me even though the project is successfully running locally. This is the output I get after modifying a model class:
[user#machine project-root]$ grails dbm-gorm-diff add-field-to-model.groovy --add
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/user/.sdkman/candidates/grails/3.3.6/lib/org.codehaus.groovy/groovy/jars/groovy-2.4.15.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Usage:
create-app [NAME] --profile=web
create-plugin [NAME] --profile=web-plugin
| Available Profiles
--------------------
* angular - A profile for creating Grails applications with Angular 5+
* rest-api - Profile for REST API applications
* base - The base profile extended by other profiles
* angularjs - A profile for creating applications using AngularJS
* plugin - Profile for plugins designed to work across all profiles
* profile - A profile for creating new Grails profiles
* react - A profile for creating Grails applications with a React frontend
* react-webpack - A profile for creating Grails applications with a React frontend using Webpack
* webpack - A profile for creating applications with node-based frontends using webpack 2
* web - Profile for Web applications
* rest-api-plugin - Profile for REST API plugins
* vue - A profile for creating Grails applications with a Vue.js frontend
* web-jboss7 - A Profile for Creating a JBoss 7.1 EAP Project
* web-plugin - Profile for Plugins designed for Web applications
Type 'grails help' or 'grails -h' for more information.
From what I've read online that warning is normal for certain versions of grails and/or groovy depending on your jdk version. The point is that the migration groovy script isn't generated as expected. I used variations grails envname dbm-gorm-diff --add add-field-to-model.groovy
Related
I installed Grails 3.3.1 using SDKMAN!. Now I tried to list the available profiles using
grails list-profiles
and got the following error:
| Error Error occurred running Grails CLI: Could not find artifact org.grails.profiles:angular:jar:4.0.1 in grailsCentral (https://repo.grails.org/grails/core) (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.grails.profiles:angular:jar:4.0.1 in grailsCentral (https://repo.grails.org/grails/core)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:39)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:319)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.grab(AetherGrapeEngine.java:129)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.grab(AetherGrapeEngine.java:121)
at org.grails.cli.profile.repository.MavenProfileRepository.getAllProfiles(MavenProfileRepository.groovy:134)
at org.grails.cli.profile.commands.ListProfilesCommand.handle(ListProfilesCommand.groovy:43)
at org.grails.cli.GrailsCli.executeCommandWithArgumentValidation(GrailsCli.groovy:287)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:263)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Error occurred running Grails CLI: Could not find artifact org.grails.profiles:angular:jar:4.0.1 in grailsCentral (https://repo.grails.org/grails/core)
Do I have to change the repo?
Turns out the grails repo https://repo.grails.org/grails/core was down. When up, it returns list of the available artifacts and the above command should return a list of all available profiles as follows:
grails list-profiles Resolving dependencies.. | Available Profiles
angular - A profile for creating Grails applications with Angular 2
rest-api - Profile for REST API applications
base - The base profile extended by other profiles
angularjs - A profile for creating applications using AngularJS
plugin - Profile for plugins designed to work across all profiles
profile - A profile for creating new Grails profiles
react - A profile for creating Grails applications with a React frontend
rest-api-plugin - Profile for REST API plugins
web - Profile for Web applications
web-jboss7 - A Profile for Creating a JBoss 7.1 EAP Project
web-plugin - Profile for Plugins designed for Web applications
webpack - A profile for creating applications with node-based frontends using webpack 2
I have installed Grails 3 by downloading and unloading the zip on CentOS 6.2.
grails --version shows
| Grails Version: 3.1.10
| Groovy Version: 2.4.7
| JVM Version: 1.7.0_111
grails list-plugins shows
Usage:
create-app [NAME] --profile=web
create-plugin [NAME] --profile=web-plugin
| Available Profiles
--------------------
* angular - A profile for creating applications using AngularJS
* rest-api - Profile for REST API applications
* base - The base profile extended by other profiles
* plugin - Profile for plugins designed to work across all profiles
* web - Profile for Web applications
* web-plugin - Profile for Plugins designed for Web applications
Type 'grails help' or 'grails -h' for more information.
Which mostly the same as grails list-profiles.
I thought list-plugins listed all of the plugins that were available for Grails in a central repository.
Is this a bug in Grails 3.1.10? (Which is the latest version for download and the version that sdkman tries to install as well).
Most Grails commands have to be run inside an existing application or plugin, with create-app and create-plugin being exceptions, so that's what the usage message is telling you. Since list-plugins doesn't work outside of an existing app/plugin (I'm not sure why tbh) you're seeing this low-information response.
You can see all of the available Grails 3 plugins here.
I am trying to setup aNimble on Windows following this article.
I have setup the Java and MySQL (xampp) on Windows and both are working properly.
Now, as the final step I need to execute
grails prod execute-database-scripts-all
but I am getting cannot find the specified path. Even when I type grails only I get the same error. I have zero experience in Grails, but it seems that I need to install Grails first on the PC. Until I do this, I want to know is there anything else that I need to do this to successfully execute this command.
What are the three portions of this command grails, prod and execute-database-scripts-all
This error means that Windows is unable to find grails executable anywhere it looks (in any paths specified in PATH system property) when you typing grails command. You may have to follow this guide in order to install grails application framework properly in your system (also, make sure you are installing a correct version of grails compatible with your distribution of aNimble) and then retry.
Grails is a web application framework and which provides a set of tools to develop, build and run web applications like aNimble, prod is a command line option for grails telling it to run in a production mode and execute-database-scripts-all is aNimble-specific command to initialize it's database.
I'm writing a Grails plugin for internal Grails apps to use. I need the plugin to install a truststore (and inside of it, an added SSL cert) and make it available to whatever Grails app includes it as a compile-time plugin.
Hence, if my truststore is called cacerts.jks, and the name of the SSL cert stored therein is called myssl.cer, when the user adds the following to their Grails app's BuildConfig.groovy:
plugins {
compile ":myplugin:VERSION"
}
...then the Grails app will trust the myssl.cer that is stored in its JKS.
Any ideas as to how to accomplish this?
Anyone knows how to fix this ?
It works fine on my env (Me being the developer) and doesn't work on my colleagues machine who unzips the whole
Welcome to Grails null - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\abc\products\grails-1.1
Base Directory: C:\abc\products\foo\bar
Running script C:\abc\products\grails-1.1\scripts\RunApp.groovy
Environment set to development
Application expects grails version [1.1], but GRAILS_HOME is version [null] - us
e the correct Grails version or run 'grails upgrade' if this Grails version is n
ewer than the version your application expects.
Some clarifications
1) There has been no Grails version change , either on my machine or my colleagues machine. In fact some of them are installing for the first time
2) Under C:\Documents and Settings\myfriend.grails I can see a folder called 'null'
I tried removing this folder - but it gets created he runs my application
3) The way I am giving him the release is- I unzip the whole folder and he unzips it
SO there are three steps
A_ grails create-app to create the APp
B_ Unzip my folder to replace the generated folder
C_ Grails run-app
Things are fine after the step A- but degenerate after Step C
It appears that his Grails installation is corrupted or not set up correctly. I would have him reinstall a fresh copy of Grails - http://www.grails.org/Installation and try again.
The error that you are getting is telling us that the application that you are trying to run is identified as version 1.1 and I assume that this is correct. The fact that Grails is not able to identify what version is installed makes me point to a corrupted or mis-configured Grails installation
If he types 'grails' at the command line what does he see?
I found the problem.
This was because I had added a file- build.properties
And since the file was there- it was expecting it to have certain properties defined in it
Once I renamed it to something else- it started to work