Maven-install-plugin: can I define my own type of packaging, but get an artifact installed as a jar in a repo?

I am trying to find a plugin to detect and process Java EE application applications.

I created a new type of packaging called "car" through META-INF / plexus / components.xml ( http://maven-car-plugin.googlecode.com/svn/trunk/maven-car-plugin/src/main/resources /META-INF/plexus/components.xml ) and the corresponding mojo for Java EE application clients. I almost completely followed the same steps as the maven-ejb-plugin.

The behavior I want is the same as maven-ejb-plugin: It determines the type of ejb package, but the artifact is installed in the repo as .jar and inserted into the ear like .jar too.

I believe that you need to configure it in some way, because the ejb packaging type is set to .jar, but the packaging type for war creates .war.

The problem in my case is that the .car file is installed in the repo and the .car file gets into my ear.

Does anyone know how to make sure it is installed in the repo as a .jar file?

+3
source share
3 answers

I came across the same question that you have, except that I am creating a .war file and wanted the .jar file to be installed in my local repo. What I did was use the maven-jar-plugin to create a jar file in addition to the war file that was generated in my / target directory. I also used the maven-install-plugin to install the output jar to my local repo.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
            <execution>
                <id>make-jar</id>
                <phase>compile</phase>
                <goals>
                        <goal>jar</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <executions>
            <execution>
                <id>install-jar</id>
                <phase>install</phase>
                <goals>
                    <goal>install-file</goal>
                </goals>
                <configuration>
                    <packaging>jar</packaging>
                    <artifactId>${project.artifactId}</artifactId>
                    <groupId>${project.groupId}</groupId>
                    <version>${project.version}</version>
                    <file>${project.build.directory}/${project.artifactId}.jar</file>
                </configuration>
            </execution>
        </executions>
    </plugin>
+2
source

, packaging maven install plugin, , ?

0

I would suggest that you would need to specify

<packaging>jar</packaging>

as well as in the component descriptor. Otherwise, it looks right to me.

0
source

All Articles