Error occurred running Grails CLI: No profile found for name [web]. (Use --stacktrace to see the full trace)
Asked Answered
S

7

18

I am getting this error while trying to import a grails 3.3.2 project into intellij. I have searched online solutions and not found anything helpful.

Siftings answered 18/1, 2018 at 2:32 Comment(0)
S
38

I found a solution to this question on this thread. Solution is just to delete the build folder and rebuild the project

Siftings answered 18/1, 2018 at 6:13 Comment(0)
C
7

for me just delete the build folder and rebuild the project and it worked

Capsule answered 22/11, 2021 at 8:28 Comment(0)
F
5

As per below thread, I deleted the "build/.dependencies" file and it worked after resolving the dependencies again.

https://github.com/grails/grails-core/issues/10898

Favorable answered 14/1, 2022 at 0:43 Comment(0)
P
5

Just delete the build folder and rebuild the project.

enter image description here

Pygmy answered 2/2, 2022 at 6:9 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Hero
B
0
export GRAILS_OPTS="-XX:-UseSplitVerifier -Xverify:none"
Buke answered 18/8, 2020 at 14:25 Comment(2)
Can you add some context?Dunbar
Code-only answers are discouraged on Stack Overflow because they don't explain how it solves the problem. Please edit your answer to explain what this code does and how it answers the question, so that it is useful to the OP as well as other users with similar issues.Anarchism
B
0

One potential cause is a mismatch of your defined profiles:

build.groovy: profile "org.grails.profiles:angular"

application.yml: grails.profile: web

Make sure these agree with each other.

Bluegrass answered 22/3, 2023 at 13:59 Comment(0)
S
0

Deleting build directory may work in most cases, but using the Gradle clean task is the recommended and best practice approach for cleaning the build in a Grails application. It ensures consistency, safety, and compatibility with the Gradle build system.

You can call it either from command line:

gradlew clean

or from your IDE:

enter image description here

Here are some arguments why it's a better approach:

  1. Standardization: Using the gradle clean command ensures a standardized and consistent way of cleaning the build. It's a well-defined task that is widely used in the Gradle ecosystem.

  2. Dependency Management: The gradle clean command is aware of project dependencies, and it can clean the build artifacts and caches accordingly. Manually deleting the build directory might leave behind some cached files, leading to potential issues or outdated build results.

  3. Task Safety: Gradle's clean task is designed to be safe and reliable. It only deletes files related to the build process, preserving other essential project files and directories.

  4. Automation: By using gradle clean, users can integrate it into their build automation process, making it part of the regular development workflow. This ensures that the project starts from a clean state before every build.

  5. Ease of Use: The gradle clean command is simple and easy to remember. It eliminates the risk of accidentally deleting important files from the project.

  6. Team Collaboration: Using the standard gradle clean command makes it easier for other team members to understand and contribute to the project. It reduces confusion and prevents potential issues caused by manual build deletions.

  7. Future Compatibility: Gradle may evolve, and new features or improvements might be introduced in the clean task. By using the official Gradle command, users can benefit from these updates without any extra effort.

Sulfide answered 2/8, 2023 at 0:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.