Home > database >  JAVA deploy first maven project failed
JAVA deploy first maven project failed

Time:02-21

Please tell me what i do wrong. I download maven project from springboot.io and import to IDE(intelliJ). Start to deploy I get error

> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
> (default-deploy) on project securing-web-initial: Deployment failed:
> repository element was not specified in the POM inside
> distributionManagement element or in
> -DaltDeploymentRepository=id::layout::url parameter -> [Help 1] [ERROR]

I read like this Problem with deploying spring boot application and add to POM.xml

<distributionManagement>
        <repository>
            <id>internal.repo</id>
            <name>Internal repo</name>
            <url>E:\!Distrib\repo</url>
        </repository>
    </distributionManagement>
    <repositories>
        <repository>
            <id>example-repo</id>
            <name>Example Repository</name>
            <url>
                E:\!Distrib\repo
            </url>
        </repository>
    </repositories>

Nothing changed.

CodePudding user response:

If I use a URL C:\!Users\tgdavies\testrepo I get the error message: Failed to deploy artifacts/metadata: Cannot access C:\!Users\tgdavies\testrepo with type default using the available connector factories: BasicRepositoryConnectorFactory

If I use file:C:\Users\tgdavies\testrepo deploy succeeds.

But your issue is that you do not need to run mvn deploy. Read the tutorial you linked to -- it does not suggest running mvn deploy. To test your code

If you use Maven, you can run the application by using ./mvnw spring-boot:run. Alternatively, you can build the JAR file with ./mvnw clean package and then run the JAR file, as follows: java -jar target/gs-rest-service-0.1.0.jar

CodePudding user response:

Import I made correctly. It is very easy. I suggested it need a lot of task after import maven project because Run button was not active. As additional automatically was open maven window with deploy and install items)). intelliJ did not make configuration for run. As a result run button was not active.

  • Related