You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mirko Friedenhagen <mf...@gmail.com> on 2011/10/25 20:51:52 UTC

maven-repository-plugin: Automatically create bundle and deploy it to repository as well

Hello,

I want to create and deploy the bundle for my artifacts. Right now I
have this in my pom:

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-repository-plugin</artifactId>
            </plugin>
        </plugins>

All plugins are attached to the package phase. However I have
encountered two problems:
1) The repository plugin keeps asking me which jars to bundle and I
have to enter 0 (I may avoid this by running Maven in batch mode, so
this seems to be no biggy).
2) However the bundle.jar is not uploaded to my repository. I tried putting:
    <pluginManagement>
        <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.7</version>
                    <executions>
                        <execution>
                            <id>deploy-bundle</id>
                            <phase>deploy</phase>
                            <configuration>
                                <files>
                                    <file>bundle</file>
                                </files>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
        </plugins>
    </pluginManagement>

but the bundle is not deployed.

Regards Mirko
-- 
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven-repository-plugin: Automatically create bundle and deploy it to repository as well

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hello,

I now got a solution via the build-helper-plugin:

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-repository-plugin</artifactId>
                    <version>2.3.1</version>
                    <executions>
                        <execution>
                            <id>attach-bundle</id>
                            <phase>package</phase>
                            <goals>
                                <goal>bundle-create</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.7</version>
                    <executions>
                        <execution>
                            <id>attach-artifacts-bundle</id>
                            <phase>package</phase>
                            <goals>
                                <goal>attach-artifact</goal>
                            </goals>
                            <configuration>
                                <artifacts>
                                    <artifact>

<file>${project.build.directory}/${project.artifactId}-${project.version}-bundle.jar</file>
                                        <type>jar</type>
                                        <classifier>bundle</classifier>
                                    </artifact>
                                </artifacts>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

Regards Mirko
-- 
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/



On Tue, Oct 25, 2011 at 20:51, Mirko Friedenhagen
<mf...@gmail.com> wrote:
> Hello,
>
> I want to create and deploy the bundle for my artifacts. Right now I
> have this in my pom:
>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-javadoc-plugin</artifactId>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-source-plugin</artifactId>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-repository-plugin</artifactId>
>            </plugin>
>        </plugins>
>
> All plugins are attached to the package phase. However I have
> encountered two problems:
> 1) The repository plugin keeps asking me which jars to bundle and I
> have to enter 0 (I may avoid this by running Maven in batch mode, so
> this seems to be no biggy).
> 2) However the bundle.jar is not uploaded to my repository. I tried putting:
>    <pluginManagement>
>        <plugins>
>                <plugin>
>                    <groupId>org.apache.maven.plugins</groupId>
>                    <artifactId>maven-deploy-plugin</artifactId>
>                    <version>2.7</version>
>                    <executions>
>                        <execution>
>                            <id>deploy-bundle</id>
>                            <phase>deploy</phase>
>                            <configuration>
>                                <files>
>                                    <file>bundle</file>
>                                </files>
>                            </configuration>
>                        </execution>
>                    </executions>
>                </plugin>
>        </plugins>
>    </pluginManagement>
>
> but the bundle is not deployed.
>
> Regards Mirko
> --
> http://illegalstateexception.blogspot.com/
> https://github.com/mfriedenhagen/
> https://bitbucket.org/mfriedenhagen/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org