Problems with Maven package dependencies

3

When I insert this package it generates an error, why will it?

        <!-- Abstração para envio de e-mails -->        
<dependency>
    <groupId>com.outjected</groupId>
    <artifactId>simple-email</artifactId>
    <version>0.1.2-SNAPSHOT</version>
    <scope>compile</scope>
</dependency>

    
asked by anonymous 12.06.2015 / 20:46

1 answer

3

You probably have only the default Maven repositories and none that can resolve this dependency.

As simple-email is not in repositories that are defaults you should add a repository that will resolve such dependency.

Apparently such a library is not in a public repository, at least I have not found, if you find such dependency in some public repository, you can include in your pom.xml something like this:

<repositories>
    <repository>
        <id>simple-email-repo</id>
        <url>http://urldorepositorio.com/repo</url>
    </repository>
</repositories>

Or include in your settings.xml , a form is this:

<profiles>
    <profile>
        <id>simple-email</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <id>simple-email-repo</id>
                <url>http://urldorepositorio.com/repo</url>
            </repository>
        </repositories>
    </profile>
</profiles>

So the simplest way to solve it is:

  • [ You'll need to use in this step ] Clone the library repository: git clone https://github.com/codylerum/simple-email.git
  • Walk to the folder where the clone was made: cd simple-email
  • [ You'll need to have configured correctly in your SO ] Install the library in your local maven repository: mvn install -DskipTests=true (tests are failing, so we will not run them)
  • After successfully installed, update the dependency on your pom.xml to the 0.2.1 version, which is the current version of the project that was cloned, thus:
  • <dependency>
        <groupId>com.outjected</groupId>
        <artifactId>simple-email</artifactId>
        <version>0.2.1</version>
    </dependency>
    

    P.S. 1 : If your project still does not depend on simple-mail , you can consider using some other library that is in the maven central repository, such as Simple Java Mail , Apache Common Email , etc.

    P.S. 2 : Another solution is to include the project of which simple-email is fork , the Seam Mail , if it is convenient for you.

        
    12.06.2015 / 23:19