IntelliJ IDEA

Configure IntelliJ IDEA and other JetBrains IDEs to work with CloudRepo repositories.

Overview

IntelliJ IDEA provides excellent support for Maven and Gradle projects, making CloudRepo integration straightforward through standard build tool configurations.

Maven Integration

IntelliJ automatically reads Maven settings from ~/.m2/settings.xml.

Configure Maven Settings

  1. Open File → Settings (or IntelliJ IDEA → Preferences on macOS)

  2. Navigate to Build, Execution, Deployment → Build Tools → Maven

  3. Ensure “User settings file” points to your settings.xml with CloudRepo configuration

settings.xml Configuration

<settings>
  <servers>
    <server>
      <id>cloudrepo</id>
      <username>your-username</username>
      <password>your-password</password>
    </server>
  </servers>

  <profiles>
    <profile>
      <id>cloudrepo</id>
      <repositories>
        <repository>
          <id>cloudrepo</id>
          <url>https://[org-id].cloudrepo.io/repository/maven-releases</url>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>cloudrepo</activeProfile>
  </activeProfiles>
</settings>

Gradle Integration

For Gradle projects, configure repositories in your build.gradle or build.gradle.kts.

Gradle Configuration

  1. Open your Gradle build file

  2. Add CloudRepo to repositories block:

repositories {
    maven {
        url "https://[org-id].cloudrepo.io/repository/maven-releases"
        credentials {
            username = project.findProperty("cloudrepoUsername") ?: System.getenv("CLOUDREPO_USERNAME")
            password = project.findProperty("cloudrepoPassword") ?: System.getenv("CLOUDREPO_PASSWORD")
        }
    }
}
  1. Add credentials to ~/.gradle/gradle.properties:

cloudrepoUsername=your-username
cloudrepoPassword=your-password

Repository Browser

Browse CloudRepo artifacts directly in IntelliJ:

  1. Open View → Tool Windows → Maven (or Gradle)

  2. Click the Repositories node

  3. Your CloudRepo repositories appear with configured artifacts

Publishing Artifacts

Deploy artifacts to CloudRepo from IntelliJ:

Using Maven

  1. Open Maven tool window

  2. Navigate to Lifecycle

  3. Double-click deploy

Using Gradle

  1. Open Gradle tool window

  2. Navigate to Tasks → publishing

  3. Double-click publish

Troubleshooting

Dependency Resolution Issues

  1. Refresh Dependencies: * Maven: Click refresh button in Maven tool window * Gradle: Click refresh button in Gradle tool window

  2. Clear Cache: * File → Invalidate Caches and Restart

  3. Check Settings: * Verify repository URL in build configuration * Confirm credentials are correct

Authentication Problems

  1. Store credentials securely: * Use IntelliJ’s password safe * Configure in system environment variables * Never commit credentials to version control

  2. Test connection: * Try accessing repository URL in browser * Verify credentials with mvn deploy or gradle publish from terminal

SSL Certificate Issues

If you encounter SSL errors:

  1. Import Certificate: * File → Settings → Tools → Server Certificates * Add CloudRepo certificate if using self-signed certs

  2. Update JDK: * Ensure JDK has latest CA certificates * Use JDK 11+ for better TLS support

Performance Optimization

Speed up dependency resolution:

  1. Enable Offline Mode when possible: * Maven: Check “Work offline” in Maven settings * Gradle: Use –offline flag

  2. Configure Parallel Downloads: * Maven: Set maven.artifact.threads in settings * Gradle: Enable parallel execution in gradle.properties

  3. Use CloudRepo Proxy Repositories: * Cache external dependencies * Reduce download times

Advanced Features

Code Completion

IntelliJ provides code completion for CloudRepo artifacts:

  1. Start typing dependency coordinates

  2. Press Ctrl+Space for suggestions

  3. Select from CloudRepo artifacts

Quick Documentation

View artifact documentation:

  1. Place cursor on dependency

  2. Press Ctrl+Q (or F1 on macOS)

  3. View artifact details and documentation

Dependency Analyzer

Analyze CloudRepo dependencies:

  1. Right-click on project

  2. Select Analyze → Analyze Dependencies

  3. Review dependency tree and conflicts

Integration with Other JetBrains IDEs

The same configuration works with:

  • Android Studio - For Android projects

  • PyCharm - For Python projects with Maven/Gradle

  • WebStorm - For JavaScript projects with Maven/Gradle

  • CLion - For C++ projects with build tool integration

Tips and Best Practices

  1. Use IDE Settings Sync to share CloudRepo configuration across machines

  2. Configure Project Templates with CloudRepo repositories pre-configured

  3. Set Up Live Templates for common CloudRepo configurations

  4. Use Version Control Ignore for credential files

  5. Enable Auto-Import for smoother dependency management

Additional Resources