Apache Maven Source Plugin/ generated-source:jar

2023-08-14 Thread Jürgen Weber
Looks like source:jar does not include generated sources.

Does it?

Yes, in theorie there is no need to save generated sources, but
sometimes you want to look at generated sources without having to set
up the generation environment. Also, people saw it occasionally happen
that generation environments decayed to dust ..

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



Re: Maven plugin to replace text in file

2020-11-08 Thread Jürgen Weber
Ant to the rescue: ReplaceRegExp task

David Hoffer  schrieb am So., 8. Nov. 2020, 18:01:

> Hi,
>
> I need to process a file during the build to replace constructs like this:
>
> "allOf": [
>   {
> "$ref": "#/definitions/Eligibility"
>   }
> ],
>
> to be:
>
> "$ref": "#/definitions/Eligibility",
>
> Where the $ref can point to anything.  How can I do this sort of writing
> custom code?
>
> -Dave
>


Re: Using Apache Maven, what is the simplest way to include /lib/ directory in the classpath in the pom.xml

2020-10-17 Thread Jürgen Weber
you could add the whole tomcat.zip to nexus, unpack it before compile
and install-file to local repository.

I had a similar problem, I needed to have the jars of an resource
adapter rar on the classpath:

> I was thinking of adapting maven-warpath-plugin, but in the end I built an 
> uber jar in a sub module with maven-ant-run (unzip, zip and zipgroupfileset) 
> and did an install-file to local repository.

Am Fr., 16. Okt. 2020 um 10:25 Uhr schrieb /dev /local/ca
:
>
> What is the simplest way to specify a directory (and all jars underneath
> this directory) to be in the maven classpath when it compiles .java classes
> and builds a .jar?
>
> The directory is not in my git repo or any directory under my IDE project
> files.
>
> I have a requirement to create a pom.xml that will reference the current
> project, and external jars in a /lib/ directory.
> --
>
> The requirement is to put together a pom.xml for a maven build that depends
> on jars in:
>
> $TOMCAT_HOME/webapps//WEB-INF/lib/
>
> I want to reference that location directly in the maven pom.xml file and
> not copy the /lib/*.jar files to another directory under my git repo.
>
> The .../WEB-INF/lib/ contains .jar files that contains classes that my
> project imports.
>
> The jar that is then built will be put into:
> $TOMCAT_HOME/webapps//WEB-INF/lib/ to extend the product as
> per the vendor instructions.
> --
>
> If anyone has had this exact issue, and has a reference pom.xml that can be
> pasted here, it would be extremely helpful and get me going quickly.
> --
>
> Irrespective of the deployment part where I copy the jar to
> /webapps//WEB-INF/lib/, I would be happy to just get files
> under /src/com/.../.java/ compiled and put into a jar in the /target/
> directory

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



Re: Resource adapter classes as compile time dependency

2020-08-26 Thread Jürgen Weber
Hi,

I was thinking of adapting maven-warpath-plugin, but in the end I
built an uber jar in a sub module with maven-ant-run (unzip, zip and
zipgroupfileset) and did an install-file to local repository.

Juergen



On 2020/08/21 08:04:44, Jürgen Weber wrote: > Hi,> > > some message driven
EJBs (MDB) have dependencies on classes from> > corresponding resource
adapter packages (.rar).> > > At runtime, application servers make the rar
classes available to the MDBs.> > > For compile time, the process goes like
this: unpack the needed jars> > from the rar, put them into Nexus and add
the dependencies to the MDB.> > Repeat for each new rar version.> > > Is
there a way (a Maven plugin?) to add the whole rar as compile time> >
dependency, as application servers do at runtime?> > > Regards,> > Juergen>
> > ->
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org> > For
additional commands, e-mail: users-h...@maven.apache.org> > >


Resource adapter classes as compile time dependency

2020-08-21 Thread Jürgen Weber
Hi,

some message driven EJBs (MDB) have dependencies on classes from
corresponding resource adapter packages (.rar).

At runtime, application servers make the rar classes available to the MDBs.

For compile time, the process goes like this: unpack the needed jars
from the rar, put them into Nexus and add the dependencies to the MDB.
Repeat for each new rar version.

Is there a way (a Maven plugin?) to add the whole rar as compile time
dependency, as application servers do at runtime?

Regards,
Juergen

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



Re: Work-around for antrun AttachArtifact not working in external Ant build file

2017-06-06 Thread Jürgen Weber
Hi Guillaume,

with inheritRefs attachartifact works perfectly for me.

Merci beaucoup,

Juergen

Am 03.06.2017 20:26 schrieb "Guillaume Boué" <gb...@apache.org>:

> That means you're missing inheritRefs=true in the  task. It is
> necessary for the references to be propagated to subprojects.
>
> I've also added an integration test in https://github.com/apache/mave
> n-plugins/tree/trunk/maven-antrun-plugin/src/it/attach-
> artifact-from-ant-task that you can maybe look at.
>
> Guillaume
>
>
> Le 02/06/2017 à 10:21, Jürgen Weber a écrit :
>
>> Hi,
>>
>> no, still does not work.
>>
>> Where is your changed source? I could run it in the debugger..
>>
>> Juergen
>>
>> Maven project reference not found: maven.project.ref
>>
>> at
>> org.apache.maven.ant.tasks.AttachArtifactTask.execute(Attach
>> ArtifactTask.java:80)
>>
>> Am 01.06.2017 19:17 schrieb "Guillaume Boué" <gb...@apache.org>:
>>
>> It's currently in Apache snapshot repository located at
>>> https://repository.apache.org/content/repositories/snapshots. You can
>>> add
>>> this repository as a plugin repository to your settings or POM for the
>>> test.
>>>
>>>  
>>>apache-snapshots-plugin
>>>https://repository.apache.org/content/repositories/
>>> snapshots/
>>> 
>>>
>>>  true
>>>
>>>  
>>>
>>>
>>> Le 01/06/2017 à 16:25, Jürgen Weber a écrit :
>>>
>>> There is no 3.0.0-SNAPSHOT of maven-antrun-plugin, is it?
>>>> org/apache/maven/ant/tasks/AttachArtifactTask.class is in
>>>> maven-antrun-plugin-1.8.jar
>>>>
>>>>
>>>> Am 31.05.2017 19:57 schrieb "Guillaume Boué" <gb...@apache.org>:
>>>>
>>>> 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
>>>>>
>>>>> 
>>>>>  <![CDATA[
>>>>> load("script.js");
>>>>> runtaskf(self.getProject());
>>>>> ]]>
>>>>> 
>>>>> 
>>>>>
>>>>> 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 <khmarba...@gmx.de>:
>>>>>
>>>>> 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:
>>

Re: Work-around for antrun AttachArtifact not working in external Ant build file

2017-06-02 Thread Jürgen Weber
Hi,

no, still does not work.

Where is your changed source? I could run it in the debugger..

Juergen

Maven project reference not found: maven.project.ref

at
org.apache.maven.ant.tasks.AttachArtifactTask.execute(AttachArtifactTask.java:80)

Am 01.06.2017 19:17 schrieb "Guillaume Boué" <gb...@apache.org>:

> It's currently in Apache snapshot repository located at
> https://repository.apache.org/content/repositories/snapshots. You can add
> this repository as a plugin repository to your settings or POM for the test.
>
> 
>   apache-snapshots-plugin
>   https://repository.apache.org/content/repositories/snapshots/
> 
>   
> true
>   
> 
>
>
> Le 01/06/2017 à 16:25, Jürgen Weber a écrit :
>
>> There is no 3.0.0-SNAPSHOT of maven-antrun-plugin, is it?
>> org/apache/maven/ant/tasks/AttachArtifactTask.class is in
>> maven-antrun-plugin-1.8.jar
>>
>>
>> Am 31.05.2017 19:57 schrieb "Guillaume Boué" <gb...@apache.org>:
>>
>> 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
>>>
>>> 
>>>  <![CDATA[
>>> load("script.js");
>>> runtaskf(self.getProject());
>>> ]]>
>>> 
>>> 
>>>
>>> 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 <khmarba...@gmx.de>:
>>>
>>> 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"
>>>>> <joerg.schai...@bpm-inspire.com
>>>>>
>>>>> :
>>>>>>
>>>>>> 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: users-unsubscr...@maven.apache.org
>>> For additional commands, e-mail: users-h...@maven.apache.org
>>>
>>>
>>> ---
>> 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: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>>
>>
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> https://www.avast.com/antivirus
>


Re: Work-around for antrun AttachArtifact not working in external Ant build file

2017-06-01 Thread Jürgen Weber
There is no 3.0.0-SNAPSHOT of maven-antrun-plugin, is it?
org/apache/maven/ant/tasks/AttachArtifactTask.class is in
maven-antrun-plugin-1.8.jar


Am 31.05.2017 19:57 schrieb "Guillaume Boué" <gb...@apache.org>:

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
>
> 
>  <![CDATA[
> load("script.js");
> runtaskf(self.getProject());
> ]]>
> 
> 
>
> 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 <khmarba...@gmx.de>:
>
>> 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"
>>> <joerg.schai...@bpm-inspire.com
>>>
>>>> :
>>>>
>>>
>>> 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: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

---
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: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


Re: Work-around for antrun AttachArtifact not working in external Ant build file

2017-05-31 Thread Jürgen Weber
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


 <![CDATA[
load("script.js");
runtaskf(self.getProject());
]]>



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 <khmarba...@gmx.de>:
> 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"
>> <joerg.schai...@bpm-inspire.com
>>>
>>> :
>>
>>
>> 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: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Work-around for antrun AttachArtifact not working in external Ant build file

2017-05-31 Thread Jürgen Weber
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" <joerg.schai...@bpm-inspire.com
>:

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: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org


Work-around for antrun AttachArtifact not working in external Ant build file

2017-05-28 Thread Jürgen Weber
What is the recommended work-around for attaching artifacts created by antrun?

* forward target directory as variable to ant ?
* build-helper-maven-plugin attach-artifact ?

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

Thx,
Juergen

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