Hi,

I looked into this issue and committed a fix for it. The core problem was that the 'attachartifact' task launched from the external Ant build was working from a clone of the Maven project, instead of the project itself. Can you try the latest 3.0.0-SNAPSHOT and report back?


Le 31/05/2017 à 19:14, Jürgen Weber a écrit :
Hi,

I found a solution, not pretty, but it actually works:

in an pom-inline antrun task call a Javascript function with the
project as parameter, in Javascript one can do all interesting things
(loop over properties from an ant property file) and call the
attachartifact task.

Cheers,
Juergen

<target name="javascript">
<script language="javascript"> <![CDATA[
load("script.js");
runtaskf(self.getProject());
]]>
</script>
</target>

script.js:

var runtaskf = function(project) {
aa = project.createTask("attachartifact");
f = new java.io.File("my.jar");
aa.setFile(f);
aa.setType("jar");
aa.setClassifier("test");
aa.perform();
}

2017-05-31 18:32 GMT+02:00 Karl Heinz Marbaise <[email protected]>:
Hi,

if i correctly understand you have a property file for each environment and
maybe some other files and a base artifact (jar/war?) now it sounds you have
to build for each environment a different jar/war ?

Maybe something like this could help here:

https://github.com/khmarbaise/multienv-maven-plugin/

or:

https://github.com/khmarbaise/iterator-maven-plugin/


Kind regards
Karl Heinz Marbaise


On 31/05/17 11:42, Jürgen Weber wrote:
Hi Jörg,
problem is, I have to build message driven beans, some 20, only difference
is the queue name in the deployment descriptor. Queue names are listed in
a
property file.
   I know that Maven wants no environment specific properties in artifacts,
but Sun defined the activation spec for MDBs. And the activation spec is
in
code or in ejb-jar.xml, both in the mdb jar. So I have to build a
different
MDB for each queue. And I have to iterate over the queues (which is
possible in ant + JavaScript. Yuck).
So I'd need to attach n artefacts, wherea in a Maven pom I have to list
each artefact individually.
Greetings, Jürgen

Am 30.05.2017 08:45 schrieb "Jörg Schaible"
<[email protected]
:

Hi Jürgen,

Jürgen Weber wrote:

What is the recommended work-around for attaching artifacts created by
antrun?

* forward target directory as variable to ant ?

That helps if the created files should be removed in a normal "clean"
phase.

* build-helper-maven-plugin attach-artifact ?

Definitely the proper action.

http://technotes.khitrenovich.com/attach-maven-artifact-
external-build-xml-file/
https://issues.apache.org/jira/browse/MANTRUN-181

Thx,
Juergen

Cheers,
Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to