How to generate project JAR and POM by following the layout of the Maven repository?

2

I have a project where I need to generate the jar and pom following the same method as the maven-install-plugin plugin generates inside the local repository, as in the feedback that is given when constructing the project :

--- maven-install-plugin:2.3.1:install (default-install) @ projeto-java ---
Installing C:\Users\matheus\Java\Projeto-Java\target\Projeto-java-1.2.3.jar to C:\Users\matheus\.m2\repository\br\com\xxx\java\projeto-java.2.3\projeto-java-1.2.3.jar
Installing C:\Users\matheus\Java\Projeto-Java\pom.xml to C:\Users\matheus\.m2\repository\br\com\xxx\java\projeto-java.2.3\projeto-java-1.2.3.pom

I need the project-java-1.2.3.pom and java-1.2.3.jar files to be placed in a specific directory, how can I change the directory where the plugin puts it or has another plugin that does this?

    
asked by anonymous 05.10.2016 / 16:17

1 answer

0

It can be done by defining a profile and its directory within pom.xml :

<profiles>
    <profile>
        <id>novoProfile</id>
        <build>
            <directory>${project.basedir}/diretorioDesejado</directory>
        </build>
    </profile>
</profiles>

And running the command using the new profile:

mvn install -PnovoProfile

Font

    
05.10.2016 / 20:39