Announcement Announcement Module
Collapse
No announcement yet.
How can I open spring social source code using IntelliJ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I open spring social source code using IntelliJ?

    I downloaded the latest gradle and setup gradle in INtelliJ.

    When I try and open the build.gradle file using intelliJ it doesn't work.

    What are the steps to open the source code in intellij?

  • #2
    You can run "mvn idea:idea" to generate an IntelliJ project. Or you can simply open the pom.xml file with IntelliJ.

    Comment


    • #3
      There is no pom.xml file?

      https://github.com/SpringSource/spring-social

      Comment


      • #4
        I'm not an IntelliJ user, so I'm probably not going to be able to help much directly...if you get really stuck, I'll try to get a copy of IntelliJ and try it out for you, but before I go to the much effort, let me give a few clues as to what might be going on...

        The project (from a Git perspective) has a submodule that includes some of the build code. Therefore, when you clone the project, you either need to clone it with the --recursive flag or (if you failed to do that when you first cloned), you need to do "git submodule init; git submodule update" to pull the submodule. If the submodule hasn't been pulled down, the build will fail...and I suspect that IntelliJ won't be able to import it.

        (Note that I intend to change the build soon so that the submodule isn't required. For now, however, it is still required.)

        Could that possibly be the problem? Can you build the project from the command line with "gradlew clean build"? If you can do that and still cannot import into IntelliJ, then there must be something else. What errors do you get from IntelliJ when you import?

        Another thing you might try is to not import the project as a Gradle project and instead do "gradlew idea" to generate the InteliiJ .iml files. Then just import it into IntelliJ as any other existing IntelliJ project.

        Comment


        • #5
          So I deleted the folder and re-cloned using the recursive flag.

          Just as a background as I have never used gradle before, I downloaded the latest version of gradle, created a GRADLE_HOME environment variable pointing to the /bin directory. Reloaded my bash script in my terminal so gradle -v works etc.

          Using the gradlew command inside the spring-social folder doesn't work, but doing just:

          Code:
          gradle clean build
          worked, but the build failed with:

          Code:
          Dynamic properties have been deprecated (property "provided" on the object "DefaultExternalModuleDependency{group='javax.servlet.jsp', name='javax.servlet.jsp-api', version='2.2.1', configuration='default'}" with value "true" created).
          See: http://gradle.org/docs/current/dsl/o...Extension.html
          
          FAILURE: Build failed with an exception.
          
          * Where:
          Script '/Users/me/dev/sources/java/spring-social/buildSrc/docbook.gradle' line: 34
          
          * What went wrong:
          Could not compile script '/Users/me/dev/sources/java/spring-social/buildSrc/docbook.gradle'.
          > startup failed:
            script '/Users/me/dev/sources/java/spring-social/buildSrc/docbook.gradle': 34: unable to resolve class ch.qos.logback.classic.Level
             @ line 34, column 1.
               import ch.qos.logback.classic.Level;
               ^
            
            1 error
          
          
          * Try:
          Run with --info or --debug option to get more log output.
          
          * Exception is:
          org.gradle.groovy.scripts.ScriptCompilationException: Could not compile script '/Users/snad/dev/sources/java/spring-social/buildSrc/docbook.gradle'.
          	at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.wrapCompilationFailure(DefaultScriptCompilationHandler.java:154)
          	at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:120)
          	at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileToDir(DefaultScriptCompilationHandler.java:67)
          	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CacheInitializer.execute(FileCacheBackedScriptClassCompiler.java:76)
          	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CacheInitializer.execute(FileCacheBackedScriptClassCompiler.java:61)
          	at org.gradle.cache.internal.DefaultPersistentDirectoryCache.buildCacheDir(DefaultPersistentDirectoryCache.java:77)
          	at org.gradle.cache.internal.DefaultPersistentDirectoryCache.access$100(DefaultPersistentDirectoryCache.java:33)
          	at org.gradle.cache.internal.DefaultPersistentDirectoryCache$1.run(DefaultPersistentDirectoryCache.java:63)
          	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeToFile(DefaultFileLockManager.java:145)
          	at org.gradle.cache.internal.DefaultPersistentDirectoryCache.init(DefaultPersistentDirectoryCache.java:61)
          	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:47)
          	at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.doOpenDir(DefaultCacheFactory.java:62)
          	at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.open(DefaultCacheFactory.java:100)
          	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:170)
          	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:126)
          	at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:113)
          	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompiler.java:48)
          	at org.gradle.groovy.scripts.internal.ShortCircuitEmptyScriptCompiler.compile(ShortCircuitEmptyScriptCompiler.java:35)
          	at org.gradle.groovy.scripts.internal.CachingScriptClassCompiler.compile(CachingScriptClassCompiler.java:36)
          	at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactory.java:60)
          	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:121)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:82)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:32)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:54)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$execute.call(Unknown Source)
          	at org.gradle.groovy.scripts.DefaultScript.apply(DefaultScript.groovy:76)
          	at org.gradle.api.Script$apply.callCurrent(Unknown Source)
          	at docs_2nm22ci8d2udpc8djdivjupv4r.run(/Users/snad/dev/sources/java/spring-social/buildSrc/docs.gradle:18)
          	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
          	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:82)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:32)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:54)
          	at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
          	at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:840)
          	at build_5nsfbcjjdv9k0bof7h5uql9555$_run_closure6.doCall(/Users/snad/dev/sources/java/spring-social/build.gradle:177)
          	at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:141)
          	at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:90)
          	at org.gradle.api.internal.project.AbstractProject.project(AbstractProject.java:856)
          	at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196)
          	at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102)
          	at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:99)
          	at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source)
          	at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.groovy:73)
          	at build_5nsfbcjjdv9k0bof7h5uql9555.run(/Users/snad/dev/sources/java/spring-social/build.gradle:176)
          	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
          	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
          	at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
          	at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
          	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:462)
          	at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:74)
          	at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
          	at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
          	at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
          	at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
          	at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:438)
          	at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:433)
          	at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
          	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139)
          	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
          	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
          	at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
          	at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
          	at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
          	at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
          	at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:302)
          	at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:286)
          	at org.gradle.launcher.Main.doAction(Main.java:48)
          	at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
          	at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
          	at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
          	at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
          	at org.gradle.launcher.Main.main(Main.java:39)
          	at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)
          	at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
          	at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
          Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          script '/Users/me/dev/sources/java/spring-social/buildSrc/docbook.gradle': 34: unable to resolve class ch.qos.logback.classic.Level
           @ line 34, column 1.
             import ch.qos.logback.classic.Level;
             ^
          
          1 error
          
          	at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:118)
          	... 75 more
          
          
          BUILD FAILED
          
          Total time: 9.78 secs
          I'm on Mac lion if that matters.

          Comment


          • #6
            Ok please ignore what I said, I just read through the github readme and it worked as stated.

            Very sorry for not reading that in the first place!

            Comment


            • #7
              That's great! So, can we assume that you now have been able to import it into IntelliJ?

              Comment


              • #8
                Yes that is a safe assumption

                I just ran gradle to generate the idea files as per your readme.

                Comment

                Working...
                X