Problems with Maven package dependencies

Asked

Viewed 2,259 times

3

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

        <!-- 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>

inserir a descrição da imagem aqui

1 answer

4

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

Like simple-email is not in the repositories that are standards you should add a repository that solves such a dependency.

Apparently such library is not in a public repository, at least 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, one way 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:

  1. [You will need to use in this step] Clone the library repository: git clone https://github.com/codylerum/simple-email.git
  2. Walk to the folder where the clone was made: cd simple-email
  3. [You will need to have the configured correctly in your OS] Install the library to your local Maven repository: mvn install -DskipTests=true (the tests are failing, so we won’t run them)
  4. Once successfully installed, update the dependency on your pom.xml for the version 0.2.1, which is the current version of the project that has been cloned, thus:
<dependency>
    <groupId>com.outjected</groupId>
    <artifactId>simple-email</artifactId>
    <version>0.2.1</version>
</dependency>

P.S. 1: if your project does not already have dependency on simple-mail, you may 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 way of solving is to include the project of which simple-email is Fork, the Seam Mail, if it is convenient for your case.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.