Eclipse IDE

Configure Eclipse IDE to work with CloudRepo for Java and other JVM language projects.

Overview

Eclipse provides excellent support for Maven and Gradle projects through plugins, making CloudRepo integration straightforward.

Prerequisites

Ensure you have the following Eclipse plugins installed:

  • m2e - Maven Integration for Eclipse (usually pre-installed)

  • Buildship - Gradle Integration (usually pre-installed)

  • EGit - Git Integration (optional but recommended)

Maven Integration (m2e)

Eclipse’s m2e plugin automatically reads Maven settings.

Configure Maven Settings

  1. Open Window → Preferences (Eclipse → Preferences on macOS)

  2. Navigate to Maven → User Settings

  3. Set User Settings to your settings.xml file location

  4. Click Update Settings

settings.xml Configuration

Create or edit ~/.m2/settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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>
      <pluginRepositories>
        <pluginRepository>
          <id>cloudrepo</id>
          <url>https://[org-id].cloudrepo.io/repository/maven-releases</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

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

Project Configuration

In your project’s pom.xml:

<distributionManagement>
  <repository>
    <id>cloudrepo</id>
    <url>https://[org-id].cloudrepo.io/repository/maven-releases</url>
  </repository>
  <snapshotRepository>
    <id>cloudrepo</id>
    <url>https://[org-id].cloudrepo.io/repository/maven-snapshots</url>
  </snapshotRepository>
</distributionManagement>

Gradle Integration (Buildship)

Buildship provides Gradle support in Eclipse.

Configure Gradle Settings

  1. Open Window → Preferences

  2. Navigate to Gradle

  3. Configure Gradle User Home if needed

  4. Set JVM arguments for credentials

Project Configuration

In your build.gradle:

repositories {
    maven {
        url "https://[org-id].cloudrepo.io/repository/maven-releases"
        credentials {
            username = System.getenv("CLOUDREPO_USERNAME")
            password = System.getenv("CLOUDREPO_PASSWORD")
        }
    }
}

publishing {
    repositories {
        maven {
            url = "https://[org-id].cloudrepo.io/repository/maven-releases"
            credentials {
                username = System.getenv("CLOUDREPO_USERNAME")
                password = System.getenv("CLOUDREPO_PASSWORD")
            }
        }
    }
}

gradle.properties

Store credentials in ~/.gradle/gradle.properties:

cloudrepoUsername=your-username
cloudrepoPassword=your-password

Dependency Management

Viewing Dependencies

Maven Projects:

  1. Right-click project → Maven → Show Dependency Hierarchy

  2. View tree of CloudRepo dependencies

  3. Search for specific artifacts

Gradle Projects:

  1. Open Gradle Tasks view

  2. Run dependencies task

  3. View dependency report

Updating Dependencies

Maven:

  1. Right-click project → Maven → Update Project

  2. Check Force Update of Snapshots/Releases

  3. Click OK

Gradle:

  1. Right-click project → Gradle → Refresh Gradle Project

  2. Dependencies update automatically

Publishing Artifacts

Deploy to CloudRepo

Maven Projects:

  1. Right-click project → Run As → Maven build…

  2. Set Goals: clean deploy

  3. Click Run

Gradle Projects:

  1. Open Gradle Tasks view

  2. Navigate to publishing → publish

  3. Double-click to execute

Using Run Configurations

Create reusable configurations:

  1. Run → Run Configurations…

  2. Create new Maven/Gradle configuration

  3. Set goals/tasks for deployment

  4. Save and reuse

Repository Browser

Maven Repositories View

  1. Window → Show View → Other…

  2. Select Maven → Maven Repositories

  3. Expand Global Repositories

  4. Browse CloudRepo artifacts

Search for Artifacts

  1. Open pom.xml

  2. In <dependencies> section

  3. Press Ctrl+Space for content assist

  4. Search CloudRepo artifacts

Eclipse Marketplace

Additional useful plugins from Eclipse Marketplace:

  • Spring Tools - For Spring Boot projects

  • Wild Web Developer - For web development

  • Docker Tooling - For container management

  • YAML Editor - For configuration files

Security Configuration

Secure Credentials

Use Eclipse Secure Storage:

  1. Window → Preferences → General → Security → Secure Storage

  2. Configure master password

  3. Store CloudRepo credentials securely

Environment Variables

Set in Eclipse:

  1. Run → Run Configurations…

  2. Select your configuration

  3. Environment tab

  4. Add CloudRepo variables:

CLOUDREPO_USERNAME=your-username
CLOUDREPO_PASSWORD=your-password
CLOUDREPO_ORG=your-org-id

Team Collaboration

Sharing Configuration

  1. Create .mvn/maven.config in project root:

-DrepositoryId=cloudrepo
-DrepositoryUrl=https://[org-id].cloudrepo.io/repository/maven-releases
  1. Commit to version control

  2. Team members get configuration automatically

Project Settings

Store Eclipse-specific settings:

  1. Enable Project-specific settings in preferences

  2. Commit .settings folder (selectively)

  3. Share common configurations

Troubleshooting

Common Issues

Dependencies Not Resolving:

  1. Check Maven/Gradle settings

  2. Verify repository URLs

  3. Update project configuration

  4. Clear local repository cache

Authentication Failures:

  1. Verify credentials in settings.xml

  2. Check environment variables

  3. Try command-line authentication

  4. Review CloudRepo user permissions

SSL Certificate Errors:

  1. Window → Preferences → General → Network Connections

  2. Configure proxy if needed

  3. Import certificates if required

Build Failures:

  1. Check Error Log view

  2. Review Console output

  3. Run with debug flag: -X for Maven, –debug for Gradle

  4. Verify artifact coordinates

Performance Optimization

Speed Up Builds

  1. Enable parallel builds: * Maven: -T 4 (use 4 threads) * Gradle: –parallel

  2. Configure offline mode when possible: * Maven: -o flag * Gradle: –offline

  3. Use CloudRepo proxy repositories to cache dependencies

Memory Settings

Increase heap size for large projects:

  1. Edit eclipse.ini

  2. Adjust -Xms and -Xmx values

  3. Restart Eclipse

Build Automation

Continuous Build

Enable automatic project building:

  1. Project → Build Automatically

  2. Configure build triggers

  3. Set up incremental compilation

Maven Profiles

Use profiles for different environments:

<profiles>
  <profile>
    <id>development</id>
    <repositories>
      <repository>
        <id>cloudrepo-dev</id>
        <url>https://[org-id].cloudrepo.io/repository/maven-dev</url>
      </repository>
    </repositories>
  </profile>
  <profile>
    <id>production</id>
    <repositories>
      <repository>
        <id>cloudrepo-prod</id>
        <url>https://[org-id].cloudrepo.io/repository/maven-prod</url>
      </repository>
    </repositories>
  </profile>
</profiles>

Tips and Best Practices

  1. Use Eclipse Working Sets to organize CloudRepo projects

  2. Configure Code Templates for CloudRepo configurations

  3. Set Up Format on Save for consistent code style

  4. Enable Validation for pom.xml and build.gradle

  5. Use Quick Fixes for dependency issues

  6. Configure Markers for CloudRepo-related TODOs

  7. Create Custom Perspectives for CloudRepo development

Integration with Other Tools

  • Jenkins Plugin - Trigger builds from Eclipse

  • Docker Tooling - Manage CloudRepo Docker images

  • Remote Systems Explorer - Access remote CloudRepo servers

  • Mylyn - Integrate with issue tracking

Additional Resources