[ 
https://issues.apache.org/jira/browse/BUILDR-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586112#action_12586112
 ] 

Victor Hugo Borja commented on BUILDR-59:
-----------------------------------------

EarTask assumes all non-lib components (war, ejb, jar)  are packages generated 
by projects on the same buildfile. 
When each of these non-lib components are added to the ear, EarTask modifies 
their Class-Path entry (actually modifying the jar's MANIFEST.MF) so that 
needed jars can be referenced at deployment time.

In your second example, you're trying to add an external artifact (say one 
downloaded from a remote repo) as an ejb, that's currently not supported, and 
IMHO that's a good-thing.  As explained above, EarTask would actually modify 
the MANIFEST.MF file on your  ~/.m2/log4j/log4j-1.2.14.jar possibly causing 
lots of problems for other projects using it. So, the way to go around this if 
you really want to add an external artifact as an EAR component is to create a 
clone that can be modified safely.

define 'modifies_log4j_clone' do 
   define 'clone' do # this project just holds the clone log4j
      package(:jar).merge(artifact('log4j:log4j:jar:1.2.14')).include('**/*') # 
copy all content from original jar
   end
   package(:ear).add :ejb => project(:clone).package(:jar) 
end



> EarTask: component type cannot be specified for Artifact
> --------------------------------------------------------
>
>                 Key: BUILDR-59
>                 URL: https://issues.apache.org/jira/browse/BUILDR-59
>             Project: Buildr
>          Issue Type: Bug
>          Components: Packaging
>    Affects Versions: 1.3
>         Environment: Windows XP SP2, JRuby 1.1, buildr trunk (rev 645177)
>            Reporter: Tomas Carlsson
>            Assignee: Victor Hugo Borja
>            Priority: Minor
>
> Trying to specify component type for Artifact when packaging ear:s fails with:
> undefined method `manifest' for #<Buildr::Artifact:0x1202d8a>
> Example buildfile:
> repositories.remote << "http://repo1.maven.org/maven2";
> define 'myproj' do
>   project.version=1
>   project.group = "foo"
>   define 'this_works' do
>     package(:ear).add "log4j:log4j:jar:1.2.14"
>   end
>   define 'does_not_work' do
>     package(:ear).add :ejb => "log4j:log4j:jar:1.2.14"
>   end
> end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to