You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien CARSIQUE <jc...@nuxeo.com> on 2008/08/25 11:50:07 UTC

artifact built from maven-nuxeo-plugin being installed before execution of following plugins

Hi,

I need to build resources artifacts (I use maven-assembly-plugin) and 
use them (with our maven-nuxeo-plugin) from the same pom.xml
The built resources artifacts do not need to be in the project 
dependency but have to be installed before the execution of the second 
plugin.

Is it possible to make artifacts built from maven-assembly-plugin being 
installed before the execution of the following maven-nuxeo-plugin ?

I have this error when running "mvn install":
[INFO] 
------------------------------------------------------------------------
[INFO] Building Nuxeo EP EAR
[INFO]    task-segment: [clean, install]
[INFO] 
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory 
/Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target
...
[INFO] [assembly:attached {execution: make-resources}]
[INFO] Reading assembly descriptor: src/main/assemble/resources/mono.xml
...
[INFO] Building zip: 
/Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target/nuxeo-platform-ear-5.1.6-SNAPSHOT-resources-mono.zip
...
[INFO] [nuxeo:assembly {execution: assemble-ear}]
[INFO] Loading assembly descriptor: 
/Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/src/main/assemble/nuxeo.xml
...
org.apache.maven.plugin.MojoExecutionException: Unable to find artifact.
...
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: 
Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=org.nuxeo.ecm.platform 
-DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT 
-Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file 
there:
    mvn deploy:deploy-file -DgroupId=org.nuxeo.ecm.platform 
-DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT 
-Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file 
-Durl=[url] -DrepositoryId=[id]
...

[INFO] 
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] 
------------------------------------------------------------------------
[INFO] Failed to run assembly


Here's an extract of my pom.xml:

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/main/assemble/resources/mono.xml</descriptor>
                ...
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make-resources</id>
            <phase>package</phase>
            <goals>
              <goal>attached</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-nuxeo-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>assemble-ear</id>
            <phase>package</phase>
            <goals>
              <goal>assembly</goal>
            </goals>
            <configuration>
                ...
           </configuration>
          </execution>
        </executions>
      </plugin>


Thanks,

-- 
Julien CARSIQUE, Nuxeo (Paris, France)
www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform 
jcarsique@nuxeo.com | Tel: +33 1 40 33 79 87 



Re: artifact built from maven-nuxeo-plugin being installed before execution of following plugins

Posted by Brett Porter <br...@gmail.com>.
2008/8/27 Julien CARSIQUE <jc...@nuxeo.com>:
> Our implementation rely on
> org.apache.maven.artifact.resolver.ArtifactResolver.resolve()
> Is there a reason why default implementation do not look up to from attached
> artifacts on project ?

The artifact code doesn't have any awareness of the Maven project. It
might be a useful enhancement in the future to have a helper to do
what you are proposing though.
>> BTW, the group ID for your nuxeo plugin should probably be something
>> other than o.a.m.plugins to avoid confusion.
>>
>
> Sure, it will.
> Reason is historical, because of an old maven bug (solved I guess?) and the
> need to be able running simple commands like "mvn nuxeo:anything ...".

That's still the case - it will work as long as the plugin is declared
in the POM, or if the group it uses is in the user's settings, but
otherwise there is no way for Maven to know how to resolve it.

Cheers,
Brett

-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

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


Re: artifact built from maven-nuxeo-plugin being installed before execution of following plugins

Posted by Julien CARSIQUE <jc...@nuxeo.com>.
Thanks,
> You have 3 alternatives:
> - put the nuxeo plugin in the install phase (though I assume since
> it's also producing an installable artifact you don't want that)
>   
Of course not, I often need to call only the package phase.
> - change the nuxeo plugin to look up the artifact from the already
> attached artifacts on the project first before falling back to the
> local repository
>   
I'll try in this way.
Our implementation rely on 
org.apache.maven.artifact.resolver.ArtifactResolver.resolve()
Is there a reason why default implementation do not look up to from 
attached artifacts on project ?

Fast and functional solution was to generate these "resources artifacts" 
in a sub-module but I had a lot of execution issues, depending on the 
module from which the command was launched (sub-module, this module, 
parent module, root module, ...) and because of inherited plugins' 
configurations that I didn't succeed to unactivate.
maven-nuxeo-plugin works like maven-assembly-plugin and need to be able 
accessing these resources as well locally since as downloaded artifacts 
from local or remote repository.
Or from already attached artifacts on the project, I like the idea :-)
> - manually install the first assembly in the package phase (which
> would seem a bit counterintuitive)
>
> The second is probably the best if it is an option.
>
> BTW, the group ID for your nuxeo plugin should probably be something
> other than o.a.m.plugins to avoid confusion.
>   
Sure, it will.
Reason is historical, because of an old maven bug (solved I guess?) and 
the need to be able running simple commands like "mvn nuxeo:anything ...".
> Cheers,
> Brett
>
> 2008/8/25 Julien CARSIQUE <jc...@nuxeo.com>:
>   
>> Hi,
>>
>> I need to build resources artifacts (I use maven-assembly-plugin) and use
>> them (with our maven-nuxeo-plugin) from the same pom.xml
>> The built resources artifacts do not need to be in the project dependency
>> but have to be installed before the execution of the second plugin.
>>
>> Is it possible to make artifacts built from maven-assembly-plugin being
>> installed before the execution of the following maven-nuxeo-plugin ?
>>
>> I have this error when running "mvn install":
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Nuxeo EP EAR
>> [INFO]    task-segment: [clean, install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [clean:clean]
>> [INFO] Deleting directory
>> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target
>> ...
>> [INFO] [assembly:attached {execution: make-resources}]
>> [INFO] Reading assembly descriptor: src/main/assemble/resources/mono.xml
>> ...
>> [INFO] Building zip:
>> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target/nuxeo-platform-ear-5.1.6-SNAPSHOT-resources-mono.zip
>> ...
>> [INFO] [nuxeo:assembly {execution: assemble-ear}]
>> [INFO] Loading assembly descriptor:
>> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/src/main/assemble/nuxeo.xml
>> ...
>> org.apache.maven.plugin.MojoExecutionException: Unable to find artifact.
>> ...
>> Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
>> Unable to download the artifact from any repository
>>
>> Try downloading the file manually from the project website.
>>
>> Then, install it using the command:
>>   mvn install:install-file -DgroupId=org.nuxeo.ecm.platform
>> -DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT
>> -Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file
>>
>> Alternatively, if you host your own repository you can deploy the file
>> there:
>>   mvn deploy:deploy-file -DgroupId=org.nuxeo.ecm.platform
>> -DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT
>> -Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file -Durl=[url]
>> -DrepositoryId=[id]
>> ...
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Failed to run assembly
>>
>>
>> Here's an extract of my pom.xml:
>>
>>     <plugin>
>>       <artifactId>maven-assembly-plugin</artifactId>
>>       <configuration>
>>         <descriptors>
>>           <descriptor>src/main/assemble/resources/mono.xml</descriptor>
>>               ...
>>         </descriptors>
>>       </configuration>
>>       <executions>
>>         <execution>
>>           <id>make-resources</id>
>>           <phase>package</phase>
>>           <goals>
>>             <goal>attached</goal>
>>           </goals>
>>         </execution>
>>       </executions>
>>     </plugin>
>>     <plugin>
>>       <groupId>org.apache.maven.plugins</groupId>
>>       <artifactId>maven-nuxeo-plugin</artifactId>
>>       <extensions>true</extensions>
>>       <executions>
>>         <execution>
>>           <id>assemble-ear</id>
>>           <phase>package</phase>
>>           <goals>
>>             <goal>assembly</goal>
>>           </goals>
>>           <configuration>
>>               ...
>>          </configuration>
>>         </execution>
>>       </executions>
>>     </plugin>
>>
>>
>> Thanks,
>>
>> --
>> Julien CARSIQUE, Nuxeo (Paris, France)
>> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
>> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
>> jcarsique@nuxeo.com | Tel: +33 1 40 33 79 87
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>     
>
>
>
>   



Re: artifact built from maven-nuxeo-plugin being installed before execution of following plugins

Posted by Brett Porter <br...@gmail.com>.
You have 3 alternatives:
- put the nuxeo plugin in the install phase (though I assume since
it's also producing an installable artifact you don't want that)
- change the nuxeo plugin to look up the artifact from the already
attached artifacts on the project first before falling back to the
local repository
- manually install the first assembly in the package phase (which
would seem a bit counterintuitive)

The second is probably the best if it is an option.

BTW, the group ID for your nuxeo plugin should probably be something
other than o.a.m.plugins to avoid confusion.

Cheers,
Brett

2008/8/25 Julien CARSIQUE <jc...@nuxeo.com>:
> Hi,
>
> I need to build resources artifacts (I use maven-assembly-plugin) and use
> them (with our maven-nuxeo-plugin) from the same pom.xml
> The built resources artifacts do not need to be in the project dependency
> but have to be installed before the execution of the second plugin.
>
> Is it possible to make artifacts built from maven-assembly-plugin being
> installed before the execution of the following maven-nuxeo-plugin ?
>
> I have this error when running "mvn install":
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Nuxeo EP EAR
> [INFO]    task-segment: [clean, install]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [clean:clean]
> [INFO] Deleting directory
> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target
> ...
> [INFO] [assembly:attached {execution: make-resources}]
> [INFO] Reading assembly descriptor: src/main/assemble/resources/mono.xml
> ...
> [INFO] Building zip:
> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target/nuxeo-platform-ear-5.1.6-SNAPSHOT-resources-mono.zip
> ...
> [INFO] [nuxeo:assembly {execution: assemble-ear}]
> [INFO] Loading assembly descriptor:
> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/src/main/assemble/nuxeo.xml
> ...
> org.apache.maven.plugin.MojoExecutionException: Unable to find artifact.
> ...
> Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
> Unable to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
>   mvn install:install-file -DgroupId=org.nuxeo.ecm.platform
> -DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT
> -Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file
>
> Alternatively, if you host your own repository you can deploy the file
> there:
>   mvn deploy:deploy-file -DgroupId=org.nuxeo.ecm.platform
> -DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT
> -Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file -Durl=[url]
> -DrepositoryId=[id]
> ...
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to run assembly
>
>
> Here's an extract of my pom.xml:
>
>     <plugin>
>       <artifactId>maven-assembly-plugin</artifactId>
>       <configuration>
>         <descriptors>
>           <descriptor>src/main/assemble/resources/mono.xml</descriptor>
>               ...
>         </descriptors>
>       </configuration>
>       <executions>
>         <execution>
>           <id>make-resources</id>
>           <phase>package</phase>
>           <goals>
>             <goal>attached</goal>
>           </goals>
>         </execution>
>       </executions>
>     </plugin>
>     <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-nuxeo-plugin</artifactId>
>       <extensions>true</extensions>
>       <executions>
>         <execution>
>           <id>assemble-ear</id>
>           <phase>package</phase>
>           <goals>
>             <goal>assembly</goal>
>           </goals>
>           <configuration>
>               ...
>          </configuration>
>         </execution>
>       </executions>
>     </plugin>
>
>
> Thanks,
>
> --
> Julien CARSIQUE, Nuxeo (Paris, France)
> www.nuxeo.com - The Open Source ECM Platform - www.nuxeo.org
> Nuxeo ECM Stack - The Java EE, scalable, standard-based ECM Platform
> jcarsique@nuxeo.com | Tel: +33 1 40 33 79 87
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

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


maven-assembly-plugin / artifact built from maven-assembly-plugin being installed before execution of following plugins in same pom.xml

Posted by Julien CARSIQUE <jc...@nuxeo.com>.
Changed subject (maven-assembly-plugin)

Julien CARSIQUE a �crit :
> Hi,
>
> I need to build resources artifacts (I use maven-assembly-plugin) and 
> use them (with our maven-nuxeo-plugin) from the same pom.xml
> The built resources artifacts do not need to be in the project 
> dependency but have to be installed before the execution of the second 
> plugin.
>
> Is it possible to make artifacts built from maven-assembly-plugin 
> being installed before the execution of the following 
> maven-nuxeo-plugin ?
>
> I have this error when running "mvn install":
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Building Nuxeo EP EAR
> [INFO]    task-segment: [clean, install]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] [clean:clean]
> [INFO] Deleting directory 
> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target 
>
> ...
> [INFO] [assembly:attached {execution: make-resources}]
> [INFO] Reading assembly descriptor: src/main/assemble/resources/mono.xml
> ...
> [INFO] Building zip: 
> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/target/nuxeo-platform-ear-5.1.6-SNAPSHOT-resources-mono.zip 
>
> ...
> [INFO] [nuxeo:assembly {execution: assemble-ear}]
> [INFO] Loading assembly descriptor: 
> /Users/julien/Documents/workspace/nuxeo/nuxeo-platform/nuxeo-platform-ear/src/main/assemble/nuxeo.xml 
>
> ...
> org.apache.maven.plugin.MojoExecutionException: Unable to find artifact.
> ...
> Caused by: 
> org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable 
> to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
>    mvn install:install-file -DgroupId=org.nuxeo.ecm.platform 
> -DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT 
> -Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file
>
> Alternatively, if you host your own repository you can deploy the file 
> there:
>    mvn deploy:deploy-file -DgroupId=org.nuxeo.ecm.platform 
> -DartifactId=nuxeo-platform-ear -Dversion=5.1.6-SNAPSHOT 
> -Dclassifier=resources-mono -Dpackaging=zip -Dfile=/path/to/file 
> -Durl=[url] -DrepositoryId=[id]
> ...
>
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Failed to run assembly
>
>
> Here's an extract of my pom.xml:
>
>      <plugin>
>        <artifactId>maven-assembly-plugin</artifactId>
>        <configuration>
>          <descriptors>
>            <descriptor>src/main/assemble/resources/mono.xml</descriptor>
>                ...
>          </descriptors>
>        </configuration>
>        <executions>
>          <execution>
>            <id>make-resources</id>
>            <phase>package</phase>
>            <goals>
>              <goal>attached</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-nuxeo-plugin</artifactId>
>        <extensions>true</extensions>
>        <executions>
>          <execution>
>            <id>assemble-ear</id>
>            <phase>package</phase>
>            <goals>
>              <goal>assembly</goal>
>            </goals>
>            <configuration>
>                ...
>           </configuration>
>          </execution>
>        </executions>
>      </plugin>
>
>
> Thanks,
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org