Re: Looking for an actively maintained (and working) docker maven plugin

2023-12-27 Thread Steinar Bang
> Nils Breunese :

> Fabric8’s docker-maven-plugin works for my projects on macOS with Rancher 
> Desktop providing Docker.
> The GitHub issue you reported seems to be specifically related to the docker 
> command being run by docker-maven-plugin not being supported by the docker 
> binary on your system. (docker-maven-plugin calls the docker CLI client, it 
> doesn’t contain a Java implementation of the Docker client.)

Yes, I thought it must be something like that.

Only, I had hoped to make do with the docker version native to debian
stable (which is the docker version I'm currently running).

I see there has been a bit of discussion on the github issue?


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



Re: Looking for an actively maintained (and working) docker maven plugin

2023-12-27 Thread Steinar Bang
> Tomaž Majerhold :

> Maybe look at  https://github.com/GoogleContainerTools/jib

Thanks for responding, but... not sure if this one does what I want?

Unless I'm mistaken this one is for packaging up a jar inside a docker
image?

And that's not what I'm looking for. I'm looking for a maven plugin that
can apply a Docker file (and some replacement files used by the Docker
file) and slightly modify an existing docker image (the official apache
karaf image).



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



Looking for an actively maintained (and working) docker maven plugin

2023-12-27 Thread Steinar Bang
I recently discovered that the docker-maven-plugin I had been using was
archived on March 21 2022 and had the last code update on Januar 15 2020:
 https://github.com/spotify/docker-maven-plugin

The first thing I did was google and this one came up first, and seems
actively maintained:
 https://github.com/fabric8io/docker-maven-plugin

However that plugin didn't work for me:
 https://github.com/fabric8io/docker-maven-plugin/issues/1739

Does anyone know of a maintained and working for them (preferrably on an
amd64 debian/ubuntu computer) docker maven plugin?

What I'm looking for is something that
 1. Reads a Docker file and performs the operations in that docker file,
which for me, are:
a. Fetch an image from docker hub
b. Replace one file in the image
c. Add one file to the image

(My images are based around the apache karaf official image and operate
with maven provisioning of their applications. I let karaf pull the
LATEST of whatever is deployed to maven central and whatever so I don't
have to update the images when the application updates. But now I've run
into the image I built with being incompatible with the OSGi version
currently used (and probably also the java version, though it doesn't
fail on that) so I need a new image buit 
https://github.com/steinarb/sonar-collector/issues/5 )

Thanks!

- Steinar


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



Adding nexus-staging-maven-plugin config broke "mvn deploy" of snapshots

2020-08-24 Thread Steinar Bang
Versions: debian 10.5 "buster", amd64
  openjdk 11
  maven 3.6.0 (debian) and 3.6.3 (apache binary) (same issue on both 
versions of maven)

When I introduced a nexus-staging-maven-plugin config into my project's
top pom, "mvn deploy" of snapshots stopped working.

Does anyone know what might cause this?

Is there a way to fix this, short of yanking the
nexus-staging-maven-plugin config from the pom?

Thanks!

Details follows below:

I have this project:
 https://github.com/steinarb/oldalbum

Before releasing to OSSRH I deployed snapshots to my own snapshot
repositories, using "mvn deploy".

However after doing a release of version 1.1.0 the project to OSSRH, I
tried doing "mvn deploy" again, and that failed:
 ...
 [INFO] Jacoco aggregate XML test coverage report .. FAILURE [  0.785 s]
 [INFO] 
 [INFO] BUILD FAILURE
 [INFO] 
 [INFO] Total time:  46.994 s
 [INFO] Finished at: 2020-08-24T21:00:38+02:00
 [INFO] 
 [ERROR] Failed to execute goal 
org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy 
(injected-nexus-deploy) on project jacoco-coverage-report: Failed to deploy 
artifacts/metadata: Cannot access sftp://maven.bang.priv.no/repository with 
type default using the available connector factories: 
BasicRepositoryConnectorFactory: Cannot access 
sftp://maven.bang.priv.no/repository using the registered transporter 
factories: WagonTransporterFactory: java.util.NoSuchElementException
 [ERROR]   role: org.apache.maven.wagon.Wagon
 [ERROR]   roleHint: sftp
 [ERROR] -> [Help 1]

I noticed that the nexus-staging-maven-plugin was involved, so I tried
"mvn deploy:deploy" instead, to explicitly use maven-deploy-plugin, but
that failed in a different way:
 ...
 [INFO] Oldalbum picture archive wrapper ... SUCCESS [ 17.215 s]
 [INFO] Oldalbum OSGi service definitions .. FAILURE [  0.048 s]
 [INFO] Oldalbum shiro role adder for test . SKIPPED
 [INFO] Oldalbum database schema ... SKIPPED
 [INFO] Oldalbum database with dummy data .. SKIPPED
 [INFO] Oldalbum OSGi service implementations .. SKIPPED
 [INFO] Oldalbum web whiteboard web context  SKIPPED
 [INFO] Oldalbum web whiteboard web API  SKIPPED
 [INFO] Oldalbum web frontend .. SKIPPED
 [INFO] Oldalbum database for production use ... SKIPPED
 [INFO] Jacoco aggregate XML test coverage report .. SKIPPED
 [INFO] 
 [INFO] BUILD FAILURE
 [INFO] 
 [INFO] Total time:  18.776 s
 [INFO] Finished at: 2020-08-24T21:12:19+02:00
 [INFO] 
 [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-cli) on 
project oldalbum.services: The packaging for this project did not assign a file 
to the build artifact -> [Help 1]

If I create a branch from the last commit before I introduced the
nexus-staging-maven-plugin config, "mvn deploy" works as before:
 
https://github.com/steinarb/oldalbum/commit/dcb906a40911e7f36bdbdc7d36d77261dc0a50de

Note: The project that fails in "mvn deploy" isn't a "real" maven
module.

Its sole purpose is to aggregate jacoco code coverage for use by sonar
and coveralls.


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



Re: How to avoid forking in a maven build?

2020-01-01 Thread Steinar Bang
Thanks to Thomas Broyer and Karl Heinz Marbaise!

Replacing aggregate-jar in the parent POM with aggregate-no-fork (and an
extra jar:jar) cut down the build time from around 2:50 min to around
50s on a 3.30GHz i5 with openjdk11.

The maven output contained much less clutter avoided re-running npm and
the resource plugin a lot of times.
 
https://github.com/steinarb/authservice/commit/22e3314d084d108ce27a27addf0ae404756eb67f


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



Re: How to avoid forking in a maven build?

2019-12-31 Thread Steinar Bang
> Thomas Broyer :

> In this specific case, what causes the forking is the javadoc:aggregate
> goal. That one is meant to be used on the command line. If you want to bind
> it to a build phase, you should use javadoc:aggregate-no-fork.

Thanks! I will switch goal here!

> Also, javadoc:aggregate forks a "mvn compile", which will trigger the
> frontend:webpack (et al.) because they're bound by default to the
> generate-resources phase

Right! That's where the rebuilds comes from. Thanks for the explanation.

>(which is odd if you ask me). You may want to bind the frontend
>plugin's goals to another phase, such as prepare-package.

Thanks! I will try!


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



Re: How to avoid forking in a maven build?

2019-12-31 Thread Steinar Bang
> Karl Heinz Marbaise :

> based on what I can identify in your pom files/output is that in your
> currenty configuration the maven-javadoc-plugin is configured to use the
> goal: aggregate[1] which is a goal which forkes the lifecycle. There is
> an equivalent "aggregate-no-fork"[2] which could be used instead...

Thanks! I will try that.

(The purpose of the javadoc aggregate is to get a javadoc jar
attached to the parent pom artifact, that I can link to with a javadoc
banner in the README.)

> The question is also why running javadoc everytime?

Hm... I don't understand...? Could you clarify?

> Apart from that you have configured the maven-source-plugin with the
> goal "jar" which also forkes the lifecycle[3] this could be replaced by
> using the "jar-no-fork" goal[4].

Ok, Thanks! Will try.

> Furthermore your configuration can be simplyfied by using the junit-bom
> instead of each dependency separately to import the dependencies for
> junit-jupiter ...

Thanks! I didn't know that. I will try this as well! (lots of
improvements here)

> The question is: Why have you bound the maven-resources-plugin to
> validate life cycle phase?

I guess because I needed the stuff copied in early in the build.  I
probably arrived there by experimentation. What phase should I use?

> One thing: Why do you have configured wagon-ftp as extension?

Copy/paste leftover from an earlier project. I wanted travis-ci to
deploy to my own snapshot repo and there I initially used ftp, but have
now transitioned to ssh, so this can be deleted (and well... this
particular project is released to maven central so it doesn't need to
put snapshots in a repo).

I will remove it. Thanks again!


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



How to avoid forking in a maven build?

2019-12-31 Thread Steinar Bang
This project https://github.com/steinarb/authservice has a lot of
messages like this in the build output:

[INFO] 
[INFO] Forking Authentication webapp 1.8.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (filter-resources) @ 
authservice ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] 
[INFO] Forking Authentication webapp definitions bundle 1.8.0-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (filter-resources) @ 
authservice.definitions ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/home/sb/workspaces/ws03/authservice/authservice.definitions/src/main/filtered-resources
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ 
authservice.definitions ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/home/sb/workspaces/ws03/authservice/authservice.definitions/src/main/resources
...

A lot of the forking messages to be repeated, so I worry that it does
some operations (e.g. the npm build of the frontend) way more times than
it has to (ie. only once).

Is the forking something that makes the build take longer than it has
to?  Or is it harmless and nothing worth spending time to fix?

I have tried to figure out who the culprit is. Maybe there are more than
one culprit...?

I thought maybe my use of the maven-resources-plugin in the parent was
the cause of the forking.  So I moved the build of a master karaf
feature repository out of the parent POM and into a module.  But that
only got rid of the first forking in the quoted text abote.

The full output from "mvn clean install" can be seen at:
 https://gist.github.com/steinarb/169d179abec47f50d3aa5574ad8d7585

Thanks!


- Steinar


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



Re: Problems making maven-bundle-plugin pick up resources from target/classes

2018-02-25 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>:

> Versions: Java 1.8
> maven 3.5.0
>   frontend-maven-plugin 1.6
>   maven-bundle-plugin 2.5.3

> I'm using frontend-maven-plugin to get webpack to put a webpack'd
> version of a react.js frontend into target/classes/bundle.js

> However, maven-bundle-plugin by default doesn't pick up stuff from
> target/classes but only from src/main/resources.

> Is there a way to make maven-bundle-plugin pick up resources from
> target/classes instead? (like the maven-jar-plugin does)

Clicking through the google matched I found this[1] (from November
2016).

Both of the following works:
 {maven-resources},/=target/classes/
 /=target/classes/

Ie. they both include the bundle.js that webpack has put into
target/classes.

I'm going for the last version, ie.
 /=target/classes/
(target/classes includes all of the stuff in src/main/resources anyway)

References:
[1] <https://stackoverflow.com/a/40720033>


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



Problems making maven-bundle-plugin pick up resources from target/classes

2018-02-25 Thread Steinar Bang
Versions: Java 1.8
  maven 3.5.0
  frontend-maven-plugin 1.6
  maven-bundle-plugin 2.5.3

I'm using frontend-maven-plugin to get webpack to put a webpack'd
version of a react.js frontend into target/classes/bundle.js

However, maven-bundle-plugin by default doesn't pick up stuff from
target/classes but only from src/main/resources.

Is there a way to make maven-bundle-plugin pick up resources from
target/classes instead? (like the maven-jar-plugin does)

I've googled and found this, but it didn't seem to have any effect (one
google match was a stackoverflow post from 2012)[1]:
   {maven-resources}

I've tried this as well, as a shot in the dark, didn't have any effect
either:
   {maven-resources}

Explicitly including stuff from target/classes both with destination
name and source name[2] doesn't look like something I would like to do.
It doesn't scale, especially if I get a lot of static resources, such as
images. 

A hack would be to have webpack drop the bundle.js into
src/main/resources/ and then .gitignore the generated files... but
that's not something I would like to do (but at least I wouldn't have to
specify the resources individually).

Thanks!


- Steinar

References:
 [1] 

 [2] 



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



Re: How to create a repository snapshot pruner mojo?

2017-09-24 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>:

> I'm deploying maven snapshots from travis CI-builds, to a "low-cost" (in
> terms of server resources) repository, consisting of an ftp server, and
> served out with nginx.

> I would like to clean up the snapshots, so that only the most recent
> snapshot of each artifact is kept.  

> I'm thinking that the best way would be if a plugin could clean up after
> the deploy in the maven build, preferably when everything about the
> remote repository (ie. the maven-metadata.xml files) already is parsed,
> and in memory, and accessible through some API.

> I have googled for such a plugin, but I haven't found any.  The closest
> I've got, is this stack overflow thread:
>  
> https://stackoverflow.com/questions/12572037/purge-maven-local-repository-and-keep-latest

It looks like the wagon API doesn't have any functionality for deleting
artifacts, so a maven mojo to do the cleanup isn't possible.

So I created a java application that can be run as a cronjob once a day,
and that deletes all snapshot files not listed as snapshot versions in
maven-metadata.xml files.  Caveat emptor!
  https://github.com/steinarb/maven-repository-snapshot-pruner


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



Re: Is there a way to make a mojo run after "deploy" completion?

2017-09-03 Thread Steinar Bang
> Karl Heinz Marbaise :

>> Ie. there is no "post-deploy" lifecycle phase to run my mojo in.

> We are thinking already of such things and which might be part of
> Maven 4+...[1]

> [1]:https://issues.apache.org/jira/browse/MNG-5666

Great news! :-)

>> Is there a way to order mojos bound to the same lifecycle, so that my
>> mojo will only run after maven-deploy-plugin has done its thing?

> Usually if you bind a another plugin to the life cycle all plugins
> from the default life cycle will run firstif your plugin is bound
> to an life cycle like "deploy"

Right.  I think I will try, and see what happens.

Thanks for the info!


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



Is there a way to make a mojo run after "deploy" completion?

2017-09-03 Thread Steinar Bang
I would like to run a mojo to run after deploy has completed
successfully, to notify some OSGi bundles running in karaf, that they
should update themselves with new deployed snapshots in a maven
repository.

The problem is that the deploy lifecycle phase is the last lifecycle
phase of the default lifecycle
 http://maven.apache.org/ref/3.5.0/maven-core/lifecycles.html

Ie. there is no "post-deploy" lifecycle phase to run my mojo in.

Is there a way to order mojos bound to the same lifecycle, so that my
mojo will only run after maven-deploy-plugin has done its thing?
(Preferrably only run my mojo if deployment has been successful, though
I could live with running it every time)


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



How to create a repository snapshot pruner mojo?

2017-08-26 Thread Steinar Bang
I'm deploying maven snapshots from travis CI-builds, to a "low-cost" (in
terms of server resources) repository, consisting of an ftp server, and
served out with nginx.

I would like to clean up the snapshots, so that only the most recent
snapshot of each artifact is kept.  

I'm thinking that the best way would be if a plugin could clean up after
the deploy in the maven build, preferably when everything about the
remote repository (ie. the maven-metadata.xml files) already is parsed,
and in memory, and accessible through some API.

I have googled for such a plugin, but I haven't found any.  The closest
I've got, is this stack overflow thread:
 
https://stackoverflow.com/questions/12572037/purge-maven-local-repository-and-keep-latest

But the solutions mentioned in the stack overflow are all for the local
maven repository. I haven't found any plugins that can do cleanup on a
remote repository accessible through the wagon API.

So I've toyed with the idea of writing a mojo to do snapshot pruning
myself.

However, it's hard to find code examples and pointers to the relevant
APIs.  At least just using google.

What I'm looking for initially, is this:
 - What API classes and methods to use to get at the information from
   maven-metadata.xml files for the current project artifact?
 - What API classes and methods to use to list remote files for a
   deployed artifact
 - What API classes and methods to use to delete remote files for a
   deployed artifact

All pointers and suggestions are appreciated!

Thanks!


- Steinar


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



Re: Is there a way to download and unzip the latest version of an artifact?

2016-03-19 Thread Steinar Bang
>>>>> Steinar Bang <s...@dod.no>:
>>>>> Anders Hammar <and...@hammar.net>:

>> Possibly you could use a range with no upper limit for a dependency and
>> then bind dependency:unpack.

> Ah, ok, so that is possible...?

> Definitely something to try!

That worked, but not for dependency:unpack (because the artifactItems'
version numbers can't handle ranges).

However, it worked with using dependency:unpack-dependencies and having
the izpack installer as a dependency.

I released version 0.0.2 into a locally installed nexus OSS, and did
"mvn clean install" on the POM below, and the 0.0.2 installer zip was
downloaded and unpacked.

Yay! :-)

But note the setting:
 true

Without this setting the POM downloads and unpacks waaay too much...:-)


Here's the working download-and-unpack POM:

http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 4.0.0

 no.priv.bang.fuseki
 download-service-installer
 0.0.1-SNAPSHOT
 pom

 download-service-installer
 http://maven.apache.org

 
  
   no.priv.bang.fuseki
   fusekiservice
   [0.0.1,)
   zip
   installer
  
 

 
  
   
org.apache.maven.plugins
maven-dependency-plugin
2.10

 
  unpack-service-installer
  initialize
  
   unpack-dependencies
  
  
   true
   ${project.build.directory}
  
 

   
  
 



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



Re: Is there a way to download and unzip the latest version of an artifact?

2016-02-28 Thread Steinar Bang
> Anders Hammar :

> Possibly you could use a range with no upper limit for a dependency and
> then bind dependency:unpack.

Ah, ok, so that is possible...?

Definitely something to try!

Thanks for the tip!


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



Is there a way to download and unzip the latest version of an artifact?

2016-02-28 Thread Steinar Bang
Is there a way to find what the latest version of an artifact, and then
download and unzip the artifact?

My usecase is that I would like a simple way to download and unzip the
newest version of an izpack installer from a local Nexus repository.

I've googled a bit, and a possible solution would be to use this to set
the correct version in a property
 http://www.mojohaus.org/versions-maven-plugin/examples/update-properties.html
and then I could to a new mvn invocation to dependency:unpack the zip
file.

But it would be neat if I could bind some executions to a couple of
lifecycle phases,and then just do
 mvn clean install
and after that invocation have a fresh target directory filled with a
ready to go unpacked zip file containing an izpack installer.

Thanks!


- Steinar


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



Re: Why not a forum

2016-02-28 Thread Steinar Bang
> "Preston, Dale" :

> I was just wondering why this group uses an email list rather than a
> forum.  It seems forum software is more searchable and filterable than
> email lists.

If you want to, you can read this list in a forum-like, searchable form here:
 http://blog.gmane.org/gmane.comp.jakarta.turbine.maven.user

You can even post from there (after you jump through a couple of hoops).



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



Adding Atlassian repos but keeping maven central?

2014-06-06 Thread Steinar Bang
If I add the atlassian repos (the SDK local disk repo and the
https://maven.atlassian.com/repository/public repo to the settings.xml,
will maven still fetch dependencies from maven central?

I have tried googling for the behaviour here, and I have tried running 
 mvn help:active-profiles
without becoming any wiser:
 - With atlassian-profile in activeProfiles atlassian-profile is
   listed as the only active profile
 - With an empty activeProfiles element, no active profiles are listed
 - With no activeProfiles element, no active profiles are listed 

Below is my ~/.m2/settings.xml file.

Should I make the atlassian-profile activeByDefault, instead of listing
it in activeProfiles? (the theory being that all activeByDefault
profiles will be enabled which would include both the one with maven
central, and atlassian-profile)

Or shouldn't I worry about it, because maven central will always be
used?

Thanks!


- Steinar

My ~/.m2/settings.xml file:

settings
 profiles
  profile
   idatlassian-profile/id
   repositories
repository
 idatlassian-public/id
 urlhttps://maven.atlassian.com/repository/public/url
 snapshots
  enabledtrue/enabled
  updatePolicynever/updatePolicy
  checksumPolicywarn/checksumPolicy
 /snapshots
 releases
  enabledtrue/enabled
  checksumPolicywarn/checksumPolicy
 /releases
/repository
repository
 idatlassian-plugin-sdk/id
 urlfile://${env.ATLAS_HOME}/repository/url
 snapshots
  enabledtrue/enabled
 /snapshots
 releases
  enabledtrue/enabled
  checksumPolicywarn/checksumPolicy
 /releases
/repository
   /repositories
   pluginRepositories
pluginRepository
 idatlassian-public/id
 urlhttps://maven.atlassian.com/repository/public/url
 snapshots
  enabledtrue/enabled
  updatePolicynever/updatePolicy
  checksumPolicywarn/checksumPolicy
 /snapshots
 releases
  enabledtrue/enabled
  checksumPolicywarn/checksumPolicy
 /releases
/pluginRepository
pluginRepository
 idatlassian-plugin-sdk/id
 urlfile://${env.ATLAS_HOME}/repository/url
 snapshots
  enabledtrue/enabled
 /snapshots
 releases
  enabledtrue/enabled
  checksumPolicywarn/checksumPolicy
 /releases
/pluginRepository
   /pluginRepositories
  /profile
 /profiles
 activeProfiles
  activeProfiledefault/activeProfile
  activeProfileatlassian-profile/activeProfile
 /activeProfiles
/settings


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



Re: What packaging for Jira excel reports with maven?

2014-05-19 Thread Steinar Bang
 Anders Hammar and...@hammar.net:

 I categorize different usage of Maven into two categories:
 A) As a build tool
 B) As a utility tool
[snip!]
 My point here is that if you're in category A then Maven is absolutely
 appropriate. At least if you're building everything else with
 Maven. But if you're in category B, then Maven is just one of many
 options you have. I would even go as far as saying that there are
 simpler solutions, one being a shell script (or Windows batch file)
 where you just have you Java command with the jar on the classpath and
 the options to have the excel file generated.

A solution like this, is what I would like to replace, actually. :-)

 Using Maven here would just add an additional dependency (to Maven)
 which could just complicate things.

What we have, is:
 - A jar that is built with maven, and installed in the local plexus
   archive, this Jar file creates an excel file from a template
 - Many jenkins projects that uses the jar together with two python
   scrips
 - The python scripts, are:
  - A script to delete existing XLS files in the working directory
  - A script to download the jar from plexus

What I would like to have, are maven projects that would:
 1. Have the jar project as a dependency
 2. Run the jar to create the XLS spreadsheet in the target directory
 3. Offer the the XLS spreadsheet in the target directory as a Jenkins
build artifact

Ie. since the python scripts does things that maven does by default
(clean the working directory, and download jar files from plexus),
replacing them with a maven project seemed like a good idea.
 


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



What packaging for Jira excel reports with maven?

2014-04-01 Thread Steinar Bang
I have access to a Jar-file that contains code that:
 - Reads an excel file containing a JQL query, the names of the fields
   from the JQL results to include in excel, as well as the sheets that
   are to be populated
 - Talks to Jira, using the Jira REST API, to do the query and extract
   the results
 - Exports a new excel file populated with the query results

The Jar-file resides in a plexus archive, so I thought that having a
small maven project, containing a pom.xml and the template excel
spreadshet in src/main/resources/ would be a good match.

The idea was that I could:
 - set the Jar-file containing the excel export code as a dependency
 - use exec-maven-plugin to run the Jar
 - have the output of exec-maven-plugin (an excel file) as the build
   artifact 

But the idea stopped on that I don't know what packaging should be used
for the pom: jar didn't seem appropriate, so I tried pom, but that
doesn't do anything (no target directory created).

Is maven appropriate for what I'm trying to do? Is there an appropriate
packaging to use?

Thanks!


- Steinar


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



Re: noob confusion about dependencies and repositories

2012-10-08 Thread Steinar Bang
 Steinar Bang s...@dod.no:

 On the recommended book list mentioned earlier, I will in particular
 mention Maven by example
  http://www.sonatype.com/Support/Books/Maven-By-Example

The download page lists PDF and HTML versions.  I was able to build
myself an ePub version for my Sony PRS-T1 ebook reader, with:
 git clone https://github.com/sonatype/maven-example-en.git
 cd maven-example-en
 git checkout production
 mvn install

The mvn install command failed for me, while creating the PDF file (a
403 when trying to load the Docbook DTD, with HTTP, I think).  But ePub
succeeded, and the result was in
 maven-example-en/mvnex-epub/target/epub/public-book.epub

I ran the ePub file through an epub-epub conversion in calibre to get a
more pleasing result in the Sony: I first added some missing metadata
(authors, and some tags), then did the conversion, picking the cover
from the existing epub files (otherwise the cover showed up as a blank
in the Sony reader), and told it not to split on page breaks.


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



Re: noob confusion about dependencies and repositories

2012-10-07 Thread Steinar Bang
 Rob Withers reefed...@gmail.com:

 I am guilty for being lazy.  I really hate all this build config
 stuff...
[snip!]

FWIW, in my experience embracing maven patterns allows you to reduce
build config to a minimum.

On the recommended book list mentioned earlier, I will in particular
mention Maven by example
 http://www.sonatype.com/Support/Books/Maven-By-Example


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



Re: noob confusion about dependencies and repositories

2012-10-06 Thread Steinar Bang
 Rob Withers reefed...@gmail.com:

 Here are my questions, I suppose:
   1.. How can I install murmur-events, even though pmd/findbugs is issuing 
 warnings?  The mvn install is failing.

What's the directory layout of your projects?  Where do you issue the
command?  What are the error messages you're getting.

   2.. Where is the local repository where these get installed?

On a linux/unix'ish machine, it is in $HOME/.m2/repository unless you've
configured it otherwise.

On a Windows XP machine it would typically be
 C:\Documents and Settings\yourusername\.m2\repository

On a Vista/Windows 7/Windows 2008 Server and newer, it would typically
be in
 C:\users\yourusername\.m2\repository

   3.. Do I need to have a parent pom with two modules, one for each
   project? 

That would be the maven way, yes, structured so:

 murmur-top/
   pom.xml
   murmur-events/
 pom.xml
   murmur/
 pom.xml

If you structure your project this with POMs like this, you will have
the minimum configuration needed:
 murmur-top/pom.xml:
  project
modelVersion4.0.0/modelVersion
groupIdorg.murmur/groupId
artifactIdmurmur-top/artifactId
version1.0-SNAPSHOT/version
packagingpom/packaging

namemurmur-top/name
modules
  modulemurmur-events/module
  modulemurmur/module
/modules
  /project

 murmur-top/murmur-events/pom.xml:
  project
modelVersion4.0.0/modelVersion
parent
  groupIdorg.murmur/groupId
  artifactIdmurmur-top/artifactId
  version1.0-SNAPSHOT/version
/parent
artifactIdmurmur-events/artifactId
namemurmur-events/name
  /project

 murmur-top/murmur/pom.xml:
  project
modelVersion4.0.0/modelVersion
parent
  groupIdorg.murmur/groupId
  artifactIdmurmur-top/artifactId
  version1.0-SNAPSHOT/version
/parent
artifactIdmurmur/artifactId
namemurmur/name
dependencies
  dependency
groupIdorg.murmur/groupId
artifactIdmurmur-events/artifactId
version1.0-SNAPSHOT/version
  /dependency
/dependencies
  /project

(I've left out external dependencies such as eg. JUnit for brevity).

To build everything you would do mvn install or mvn clean install
from the murmur-top directory.

If you go to murmur-top/murmur/ and do mvn install from that directory
it will try to resolve the murmur-events dependency from the local
repository ($HOME/.m2/repository) and if the jar isn't there, it will
fail.

If you want to be sure that you are depending on the newest
murmur-events in murmur, you will need to do mvn install from the
murmur-top directory.

Note: you don't _have_ to structure your projects like above, but it is
easier that way.

 Does this impact where my local repository is?

Nope.

   4.. Should I specify the murmur-events-1.0.1-SNAPSHOT.jar, as a dependency 
 in the murmur project, by system file path?

No.  That is: you probably could, but you definitely should not.

   5.. If the jar is named ‘murmur-events-1.0.1-SNAPSHOT.jar’, will the above 
 dependency of the following find it?

Um... not sure I understood that...?

   6.. What about setting up an internal repository?  Would that be a better 
 solution?

What do you mean by an internal repository?  A repository for internal
to your project?  Or a repository local to your site?

   7.. If I have the dependency in maven, will eclipse pick it up?

Not eclipse by itself.  But you can either use the eclipse m2e plugin
that will make maven projects appear as eclipse projects, or you can use
the maven-eclipse-plugin to let maven generate the eclipse project
settings.  You can also use maven as an external build tool in eclipse.


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



Re: noob confusion about dependencies and repositories

2012-10-06 Thread Steinar Bang
 Rob Withers reefed...@gmail.com:

 What's the directory layout of your projects?  Where do you issue the
 command?  What are the error messages you're getting.
 
 workspace/
 murmur/
 pom.xml
 murmur-events/
 pom.xml

 I issue the command in the murmur-events dir and I have no parent
 pom.xml and the error is:

 [ERROR] Failed to execute goal 
 org.apache.maven.plugins:maven-pmd-plugin:2.7.1:check (default) on project 
 murmur-events: You have 17 PMD violations. For more de
 tails see:C:\rob\comp\workspace\murmur-events\target\pmd.xml - [Help 1]

Right... one fix would be to fix those 17 PMD violations...;-)

Alternatively you can remove maven-pmd-plugin from the plugins section
of the murmur-events/pom.xml.  Or you can use that same entry to
configure the maven-pmd-plugin to be less strict (not sure if that's
possible...?).

3.. Do I need to have a parent pom with two modules, one for each
project?
 
 That would be the maven way, yes, structured so:
 
 murmur-top/
   pom.xml
   murmur-events/
 pom.xml
   murmur/
 pom.xml

 Ok, I tried this and got an error in both the parent dir, when issuing
 the mvn command:

 C:\rob\comp\workspacemvn
 [INFO] Scanning for projects...
 [ERROR] The build could not read 3 projects - [Help 1]
 [ERROR]
 [ERROR]   The project org.murmur:murmur-events:1.0.1-SNAPSHOT 
 (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error
 [ERROR] Non-resolvable parent POM: Could not find artifact 
 org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at 
 wrong local POM @ line
  5, column 11 - [Help 2]

Hm... did I do something wrong in my example?  I don't think so...?
To try it out, I did rm -rf ~/.m2/repository/org/murmur and then mvn
install in the top dir again.  That worked fine.  The output is
attached.

I have also zipped together my banal test project so you can try it out
yourself.  I will email it to you.  Note: unix line endings.

 [ERROR]
 [ERROR]   The project org.murmur:murmur:0.0.1-SNAPSHOT 
 (C:\rob\comp\workspace\murmur\pom.xml) has 1 error
 [ERROR] Non-resolvable parent POM: Could not find artifact 
 org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at 
 wrong local POM @ line
  4, column 11 - [Help 2]

Same error... strange... could it be my fake groupId that makes the
problem.  What happens if you use the same groupId that your actual
pom.xml files use?

 and an error in the subdir, when issuing the mvn command:

 C:\rob\comp\workspace\murmur-eventsmvn
 [INFO] Scanning for projects...
 [ERROR] The build could not read 1 project - [Help 1]
 [ERROR]
 [ERROR]   The project org.murmur:murmur-events:1.0.1-SNAPSHOT 
 (C:\rob\comp\workspace\murmur-events\pom.xml) has 1 error
 [ERROR] Non-resolvable parent POM: Could not find artifact 
 org.murmur:murmur-top:pom:1.0-SNAPSHOT and 'parent.relativePath' points at 
 wrong local POM @ line
  5, column 11 - [Help 2]

 These are really the same error.

Yep.  And with the parent POM residing in the directory above the
projects, this is strange.

5.. If the jar is named ‘murmur-events-1.0.1-SNAPSHOT.jar’, will the
  above dependency of the following find it?
 
 Um... not sure I understood that...?

 This dependency section in the murmur pom:

 dependency
   groupIdorg.reefedjib/groupId
   artifactIdmurmur-events/artifactId
   version1.0.1-SNAPSHOT/version
 /dependency

If that is the groupId+artifactId+version your actual murmur-events
pom.xml has, and if murmur-events have been built and installed in your
local repository, then yes, that shoud be enough.
 
6.. What about setting up an internal repository?  Would that be a
  better solution?
 
 What do you mean by an internal repository?  A repository for internal to
 your project?  Or a repository local to your site?

 Instead of a local repository, have a public repository at
 http://callistosheart.org/maven or something.

If that is an option for you, then I'm sure it will be a good thing.
I have only ever been allowed to set up an intranet repository...:-)

You can add that repository in your top pom.

7.. If I have the dependency in maven, will eclipse pick it up?
 
 Not eclipse by itself.  But you can either use the eclipse m2e plugin that 
 will
 make maven projects appear as eclipse projects, or you can use the maven-
 eclipse-plugin to let maven generate the eclipse project settings.  You can
 also use maven as an external build tool in eclipse.

 Does Eclipse Juno include these plugins? 

m2e?  By default?  No idea.

 It does have some level of support, but I am finding I need to go to
 the command line to generate new projects.

That isn't m2e or eclipse.  That's the maven-eclipse-plugin.  If you do
mvn eclipse:eclipse on the workspace level this maven plugin will
generate the eclipse project files/directories in murmur-events and
murmur.

The dependency from murmur to murmur-events will be a project
dependency. 

Note that you also need to mvn 

Re: noob confusion about dependencies and repositories

2012-10-06 Thread Steinar Bang
 Rob Withers reefed...@gmail.com:

 Ok, I got around the issue with number 3 by removing the modules and
 building the top pom, then adding the modules. 

Ok.  What you did with that, was to add the top POM to your local
repository, and then the modules will find it there, rather than in
their parent directory.

Shouldn't be necessary... could it be the groupId mismatch...?

 I am now getting an error with murmur-events that is preventing
 installation and preventing murmur from building.  Here is the error
 with PMD:
[...]
 Why are PMD warnings failing the murmur-events install?

Without knowing the first thing about maven-pmd-plugin, my guess is that
it is because the reporting section of the murmur-events/pom.xml file
references the maven-pmd-plugin.

And: the source files contain 17 PMD violations.


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



maven-archetype-simple: JUnit 3.8 is really old.

2012-09-28 Thread Steinar Bang
I created a project with maven-archetype-simple, and it creates a
project with a dependey to JUnit 3.8.1.

JUnit 3.8.1 is really old.  In fact it's so old I've been unable to
google when it was released.  The oldest relase I find is the release of
JUnit 4.5 in 2008 http://www.junit.org/node/401

Ah... found something: Release date: 5 September 2002.
 http://grepcode.com/snapshot/repo1.maven.org/maven2/junit/junit/3.8.1

Really, really old!

I would have liked to report an issue for this, but I have been unable
to figure out what the newest version is, and what issues have been
reported and fixed.

The newest site for maven-archetype-plugin seems to be for version
1.0-alpha7, dated February 8 2008
 http://maven.apache.org/plugins/maven-archetype-plugin-1.0-alpha-7/

The issue site shows versions 2.3, 2.4, and 2.x, all listed under the
heading of Unreleased:
 http://jira.codehaus.org/browse/ARCHETYPE

I am confused...


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



Re: maven-archetype-simple: JUnit 3.8 is really old.

2012-09-28 Thread Steinar Bang
 Tim Pizey tim.pi...@gmail.com:

 Not everyone uses annotations, the surefire plugin requires the JUnit
 3.8.1 naming conventions,

That doesn't seem to be the case:
 http://maven.apache.org/plugins/maven-surefire-plugin/examples/junit.html

Quote:
  Surefire supports three different generations of JUnit: JUnit 3.8.x,
   JUnit 4.x (serial provider) and JUnit 4.7 (junit-core provider with
   parallel support).

 the Jenkins plugins assume the same conventions.

Hm... I haven't yet tried Jenkins, but I would surprised if Jenkins does
anything outside of what maven would do, for a maven build...?

 We have been bitten by People using JUnit4 and TestNG and hence
 skipping tests in Jenkins.

I found this on Stack Overflow, someone who had surefire not picking up
tests marked with annotations:
 
http://stackoverflow.com/questions/2021771/surefire-is-not-picking-up-junit-4-tests

It seems that in this case, this was a case of TestNG requiring JUnit
3.8.1 and shadowing a later dependance of JUnit 4.


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



maven-archetype-quickstart: JUnit 3.8 is really old. (Was: maven-archetype-simple: JUnit 3.8 is really old.)

2012-09-28 Thread Steinar Bang
 Olivier Lamy ol...@apache.org:

 Agree it's old :-)

 Jira project is here: http://jira.codehaus.org/browse/MARCHETYPES

Thanks!  And from the above URL I got to here:
 
http://maven.apache.org/archetype/maven-archetype-bundles/maven-archetype-quickstart/

quickstart, not simple.

Checking what I actually did, quickstart is what I used, not simple.
I must have stumbled over maven-quickstart-simple, when googling.

Anyway, maven-archetype-quickstart also uses JUnit 3.8.1.  At least the
version that appeared for me with mvn 3.0.4.

I haven't been able to list all Jira issues here yet.  I think I will
try to instantiate a quickstart archetype from 5-SNAPSHOT and see what
happens. 

If it's still 3.8.1, I'll file a bug.


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



Re: maven-archetype-quickstart: JUnit 3.8 is really old.

2012-09-28 Thread Steinar Bang
 Steinar Bang s...@dod.no:

 I haven't been able to list all Jira issues here yet.  I think I will
 try to instantiate a quickstart archetype from 5-SNAPSHOT and see what
 happens. 

 If it's still 3.8.1, I'll file a bug.

Hm... that didn't work...?

I tried the command example on this page:
 
http://maven.apache.org/archetype/maven-archetype-bundles/maven-archetype-quickstart/

Ie. the command line:
 mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes 
-DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=5-SNAPSHOT

But the command line failed, because it couldn't find version 5-SNAPSHOT
of the quickstart archetype plugin:

[INFO] Generating project in Interactive mode
[INFO] Archetype repository missing. Using the one from 
[org.apache.maven.archetypes:maven-archetype-quickstart:1.1] found in catalog 
remote
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time: 26.596s
[INFO] Finished at: Fri Sep 28 19:35:27 CEST 2012
[INFO] Final Memory: 9M/21M
[INFO] 
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on 
project standalone-pom: The desired archetype does not exist 
(org.apache.maven.archetypes:maven-archetype-quickstart:5-SNAPSHOT) - [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


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



Re: maven-archetype-quickstart: JUnit 3.8 is really old.

2012-09-28 Thread Steinar Bang
 Steinar Bang s...@dod.no:
 Steinar Bang s...@dod.no:

 If it's still 3.8.1, I'll file a bug.

 Hm... that didn't work...?

I have now filed a bug, in case anyone would like to vote on it:
 https://jira.codehaus.org/browse/MARCHETYPES-41

(Note: 3.8.1 is *really* old... 10 years is over half the lifetime of Java 
itself...)


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



Re: Flaky antrun:run behaviour with unzip and zip

2008-05-04 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 I have a plugin config to fix the version numbers of OSGi bundles for
 snapshot version.  Eg. change 1.1.0-SNAPSHOT to 1.1.0.SNAPSHOT.  The
 full plugin config is shown at the end of this message.

 It works by:
  - unzipping the bundle jar
  - fixing the META-INF/MANIFEST.MF
  - zipping up the jar again
[snip!]
 The problem is that the zip isn't always executed when running the
 bundle projects as part of a multi-project.  And when the zip target
 isn't run, the bundle doesn't have the correct version number (the
 bundles aren't proper bundles.  They are meant as scaffolding for
 thirdparty libraries.  That's why only the META-INF directory is
 packaged up).

 Which projects in the multi-project that fails, differs from run to run.
 I build with mvn clean install.

 Does anyone know why this might fail?  Is it some sort of timing issue?

Maybe timing related...?

As an experiment, inserting a
 sleep second=10 /
between the unzip and the replace worked for all of the projects
except for the two latest projects (which consistently failed).

But 
 1. I still don't know why the two last projects consistently fail
 2. adding an extra 10s to each project slows down the build

And introducing a wait to make things work is always a hack.

I tried doing this instead of the sleep:
  waitfor
   available file=${project.build.directory}/META-INF/MANIFEST.MF /
  /waitfor

But that didn't work.  It didn't stop and wait either.

But why should something like this be timing related?  Doesn't all tasks
inside a target execute sequentially, in the same thread?

What happens when [zip] is not listed in the maven output?  Doesn't zip
run, because there are no files to zip up?  Is there a way to make it
more verbose?

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Flaky antrun:run behaviour with unzip and zip

2008-05-04 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Maybe timing related...?

 As an experiment, inserting a
  sleep second=10 /
 between the unzip and the replace worked for all of the projects
 except for the two latest projects (which consistently failed).

 But 
  1. I still don't know why the two last projects consistently fail
  2. adding an extra 10s to each project slows down the build

 And introducing a wait to make things work is always a hack.

 I tried doing this instead of the sleep:
   waitfor
available file=${project.build.directory}/META-INF/MANIFEST.MF /
   /waitfor

 But that didn't work.  It didn't stop and wait either.

I tried something more:
 - splitting up the unzip from the replace and zip tasks in two separate
   executions in the verify phase, that didn't help
 - running the unzip execution in the integration-test phase.  That
   didn't help either, so that shoots holes in the timing theory 

Another possible culprit is the use of ${project.build.directory}.  Is
that always right when running a multi-project?  (it seems to be, from
the [unzip] output, and for the [zip] output where we get it.  But there
may be issues there...?)

I tried replacing it with ${basedir}/target, but that didn't make any
difference. 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Flaky antrun:run behaviour with unzip and zip

2008-05-04 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

[snip! Things that didn't work]

I added a delete of the original jar file, before the zip task, and
then it worked.  Ie.
 unzip
 replace
 delete
 zip

So it was probably something about zip and overwriting of the existing
file that caused the flaky behaviour.  Why it sometimes worked, and why
a sleep worked for some projects, is still a mystery.

The entire plugin config for each project, looks like this now:
   plugin
artifactIdmaven-antrun-plugin/artifactId
executions
 execution
  idfix-snapshot-bundle-version/id
  goals
   goalrun/goal
  /goals
  phaseverify/phase
  configuration
   tasks
unzip src=${project.build.directory}/${artifactId}_${version}.jar 
dest=${project.build.directory} /
replace file=${project.build.directory}/META-INF/MANIFEST.MF 
token=-SNAPSHOT value=.SNAPSHOT /
delete file=${project.build.directory}/${artifactId}_${version}.jar 
/
zip destfile=${project.build.directory}/${artifactId}_${version}.jar
 fileset dir=${project.build.directory} includes=META-INF/** /
/zip
   /tasks
  /configuration
 /execution
/executions
   /plugin


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Flaky antrun:run behaviour with unzip and zip

2008-05-04 Thread Steinar Bang
 Jason van Zyl [EMAIL PROTECTED]:

 Does it work in a simple ant script.

You mean to just do:
 unzip
 replace
 zip
?

I don't know.  I haven't tried (I don't know ant very well, outside of
googling for ant tasks, to be put inside a tasks configuration element
of antrun executions...).


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Flaky antrun:run behaviour with unzip and zip

2008-05-04 Thread Steinar Bang
 Jason van Zyl [EMAIL PROTECTED]:

 Just trying to determine if it's a Ant problem, or an Ant inside Maven
 problem.

If the behaviour wasn't so unpredictable, I would have tried to create a
simple test case to make it appear, and then reported the issue to
antrun, and if it was revealed to be an ant problem, let it trickle down
to ant.

But the way it is, I don't know how to report it.

I _suspect_ it's an issue with the ant zip target, when the zip target
file already exists.  But I don't know how to reproduce it in a
predictable manner.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Flaky antrun:run behaviour with unzip and zip

2008-05-03 Thread Steinar Bang
Platform: Ubuntu 8.04, Intel Pentium M,
  maven 2.0.8,
  maven-antrun-plugin 1.1

I have a plugin config to fix the version numbers of OSGi bundles for
snapshot version.  Eg. change 1.1.0-SNAPSHOT to 1.1.0.SNAPSHOT.  The
full plugin config is shown at the end of this message.

It works by:
 - unzipping the bundle jar
 - fixing the META-INF/MANIFEST.MF
 - zipping up the jar again

This is done in the verify phase, so that it should be performed after
the jar:jar goal, which is done in the package phase, and before the
install phase.

The problem is that the zip isn't always executed when running the
bundle projects as part of a multi-project.  And when the zip target
isn't run, the bundle doesn't have the correct version number (the
bundles aren't proper bundles.  They are meant as scaffolding for
thirdparty libraries.  That's why only the META-INF directory is
packaged up).

Which projects in the multi-project that fails, differs from run to run.
I build with mvn clean install.

Does anyone know why this might fail?  Is it some sort of timing issue?


When it works it looks like this
[unzip] Expanding: 
/home/sb/p4/depot/myproj/MAIN/com.mycompany.thirdparty.commons.codec/target/com.mycompany.thirdparty.commons.codec_1.1.0-SNAPSHOT.jar
 into 
/home/sb/p4/depot/myproj/MAIN/com.mycompany.thirdparty.commons.codec/target
  [zip] Building zip: 
/home/sb/p4/depot/myproj/MAIN/com.mycompany.thirdparty.commons.codec/target/com.mycompany.thirdparty.commons.codec_1.1.0-SNAPSHOT.jar

When it fails, there's just the [unzip] line.  And sometimes I see
something like this:
[unzip] Expanding: 
/home/sb/p4/depot/myproj/MAIN/com.mycompany.thirdparty.xercesimpl/target/com.mycompany.thirdparty.xercesimpl_1.1.0-SNAPSHOT.jar
 into /home/sb/p4/depot/myproj/MAIN/com.mycompany.thirdparty.xercesimpl/target
  [zip] Warning: META-INF/maven modified in the future.
  [zip] Warning: META-INF/maven/com.mycompany.thirdparty.xercesimpl 
modified in the future.
  [zip] Warning: 
META-INF/maven/com.mycompany.thirdparty.xercesimpl/com.mycompany.thirdparty.xercesimpl
 modified in the future.

(no NFS mounted drives to give modify time strangeness.  Everything is
taking place on the same ext3 filesystem, with a single-core Pentium-M)

I've followed this pattern in other places, to fix things in zip and jar
files, but I have never seen strangeness like this.


The full plugin config looks like this:
   plugin
artifactIdmaven-antrun-plugin/artifactId
executions
 execution
  idfix-snapshot-bundle-version/id
  goals
   goalrun/goal
  /goals
  phaseverify/phase
  configuration
   tasks
unzip src=${project.build.directory}/${artifactId}_${version}.jar 
dest=${project.build.directory} /
replace file=${project.build.directory}/META-INF/MANIFEST.MF 
token=-SNAPSHOT value=.SNAPSHOT /
zip destfile=${project.build.directory}/${artifactId}_${version}.jar
 fileset dir=${project.build.directory} includes=META-INF/** /
/zip
   /tasks
  /configuration
 /execution
/executions
   /plugin


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: maven pde rcp to build

2008-04-23 Thread Steinar Bang
 [EMAIL PROTECTED]:
   eclipseInstallC:\Program
 Files\JavaWorkEnv\eclipse/eclipseInstall

Is the line break here actual, or an artifact of your email program?  If
it is actual, it could be the problem.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Looking for pde:test example

2008-04-23 Thread Steinar Bang
Platform: Ubuntu 7.10, Intel pentium M,
  Sun Java 1.5.0_11
  eclipse 3.2.2 SDK,
  eclipse-Automated-Tests-3.2.2.zip,
  maven 2.0.7,
  pde-maven-plugin 1.0-alpha-1

I have been successful in building a feature based RCP product, using
the pde-maven-plugin.

Now I'm trying to get the UI plugin tests to run, and I've tried to make
the pde:test goal run:
http://mojo.codehaus.org/pde-maven-plugin/test-mojo.html

Does anyone know of an example of using this goal?  So far I've been
unsuccessful in googling up an example.

What I've tried, is:
 1. made a copy of the product build for linux
 2. modified the POM in the copy to have pde:test execution config,
instead of the pde:ext execution that build the product
 3. run a build with mvn clean install, which seemed to build the same
as the regular product 
 4. copy in the config parameters that is inherited from a parent POM
 5. tried to run mvn test, but it still seemed to do the regular build
 6. download the eclipse-Automates-Tests for 3.2.2 and extract the
test.xml file from there, and drop it into the test project's
${basedir} 
 7. do mvn clean install, mvn test, and mvn install, and they all
seemed to do the same thing (ie. build the product).  The output
from the build, didn't mention test.xml at all
 8. I tried mvn pde:test, and then I was at least able to provoke it
to output an error message from reading test.xml:
setup:

BUILD FAILED
/media/sda8/bangste/p4/depot/ccr/MAIN/ccr_eclipse_studio_export/content_studio_test/test.xml:508:
 The following error occurred while executing this line:
/media/sda8/bangste/p4/depot/ccr/MAIN/ccr_eclipse_studio_export/content_studio_test/test.xml:285:
 The following error occurred while executing this line:
/media/sda8/bangste/p4/depot/ccr/MAIN/ccr_eclipse_studio_export/content_studio_test/test.xml:182:
 The following error occurred while executing this line:
/media/sda8/bangste/p4/depot/ccr/MAIN/ccr_eclipse_studio_export/content_studio_test/test.xml:161:
 The following error occurred while executing this line:
/media/sda8/bangste/p4/depot/ccr/MAIN/ccr_eclipse_studio_export/content_studio_test/test.xml:112:
 The following error occurred while executing this line:
Target `${setupTarget}' does not exist in this project. 

My current sources for how PDE build tests are supposed to work, are:
 
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/launchers/junit_launcher.htm
 http://wiki.eclipse.org/index.php/PDEBuild
 http://www.eclipse.org/articles/Article-PDE-Automation/automation.html

Some of the information in the above URLs, seems to be a bit dated.

All hints, tips, pointers, etc. are welcome!  It doesn't have to be
related to pde-maven-plugin, even.  Any way of building eclipse RCP
applications, and do the JUnit tests on them, using maven, is of
interest (especially the stuff that can be made to work with eclipse
3.2.2...).


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [ANN] Maven Jar Plugin 2.2 for Maven 2 Released

2008-01-28 Thread Steinar Bang
 Olivier Lamy [EMAIL PROTECTED]:

 * [MJAR-90] - when maven.test.Skip is set, the test-jar artifact is empty

The fix is to make no test-jar on maven.test.skip.

This fix may have created a new bug, but I'm unsure of which plugin has
the bug (ie. what plugin to report it on).  Is it maven-surefire-plugin
or maven-dependency-plugin=

I cleaned up my repo today to build our project from scratch.  And then
it failed on mvn clean install -Dmaven.test.skip on dependencies with
  scopetest/scope
  typetest-jar/type

The reason they failed are because the test-jar files are no longer
present.  But since they have scopetest/scope they shouldn't be
resolved with -Dmaven.test.skip.  Or at least I think they shouldn't. 

(we have some test cross dependencies, that makes it neccessary to run
through with maven.test.skip before we run with tests)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [ANN] Maven Jar Plugin 2.2 for Maven 2 Released

2008-01-28 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Olivier Lamy [EMAIL PROTECTED]:
 In order to save your fingers :-), you can use -DskipTests (with
 surefire 2.4) This will compile test classes but not execute units.

 Thanx!  In addition to saving my fingers from typing, it seems to have
 the effect that I don't get the dependency failures.

Hmno... it seems to be stuck in the same sink hole it gets stuck in,
when I try using -Dmaven.test.failure.ignore.  It gets a lot of
compilation errors caused by missing symbols, and then the build just
hangs. 

 So... I won't have to try out any of the workarounds I pondered during
 lunch...:-)  (either removing the scopetest/scope dependencies, or
 locking maven-jar-plugin to version 2.1 in the top POM)

Locking maven-jar-plugin to version 2.1 seems to be the least intrusive
approach.  I'll try that first.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [ANN] Maven Jar Plugin 2.2 for Maven 2 Released

2008-01-28 Thread Steinar Bang
 Olivier Lamy [EMAIL PROTECTED]:

 In order to save your fingers :-), you can use -DskipTests (with
 surefire 2.4) This will compile test classes but not execute units.

Thanx!  In addition to saving my fingers from typing, it seems to have
the effect that I don't get the dependency failures.

So... I won't have to try out any of the workarounds I pondered during
lunch...:-)  (either removing the scopetest/scope dependencies, or
locking maven-jar-plugin to version 2.1 in the top POM)

Thanx again!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [ANN] Maven Jar Plugin 2.2 for Maven 2 Released

2008-01-28 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Locking maven-jar-plugin to version 2.1 seems to be the least
 intrusive approach.  I'll try that first.

But how do I do that.  Just putting
 plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-jar-plugin/artifactId
  version2.1/version
 /plugin
in the top pom, makes 2.1 be pulled into the local maven repo, but
that's in addition to 2.2, and I still get the missing test-jar issue.
So it probably still uses 2.2.

Do I have to introduce this setting into all POMs with
packagingjar/packaging? 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [ANN] Maven Jar Plugin 2.2 for Maven 2 Released

2008-01-28 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Steinar Bang [EMAIL PROTECTED]:
 Olivier Lamy [EMAIL PROTECTED]:
 In order to save your fingers :-), you can use -DskipTests (with
 surefire 2.4) This will compile test classes but not execute units.

 Thanx!  In addition to saving my fingers from typing, it seems to have
 the effect that I don't get the dependency failures.

 Hmno... it seems to be stuck in the same sink hole it gets stuck in,
 when I try using -Dmaven.test.failure.ignore.  It gets a lot of
 compilation errors caused by missing symbols, and then the build just
 hangs. 

The reason it got stuck was that many POMs had explicit
maven-surefire-plugin configs, locking to version2.3/version.

A residue from a workaround from some earlier problem if I recall
correctly.

Removing those settings makes
 maven clean install -DskipTests
run through without failing (because it builds the test jars, and the
dependencies are satisfied, presumably...?).


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Eclipse has a trouble with processing .classpath file generated by maven Eclipse plug-in

2008-01-14 Thread Steinar Bang
 Huang [EMAIL PROTECTED]:

 Has anyone encountered this issue when using maven2 Eclipse plug-in?
 Basically, after I use it to generate .classpath and .project file for
 a project, Eclipse IDE has a trouble with processing .classpath and
 complains:

  cannot next blah_blah_blah.../resources inside
 an_artifact_directory/src/java. To enable the nesting exlude
 resources/ from an_artifact_directory/src/java

Are your maven projects nested hierarchically in the file system?
Eclipse doesn't like nested projects (well, maybe now it does, but 3.2
didn't). 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Why do maven lifecycles fork?

2008-01-09 Thread Steinar Bang
Platform: maven-2.0.8, maven-dependency-plugin 2.0-alpha-4,
  maven-antrun-plugin 1.1, maven-jar-plugin 2.1

Why does maven lifecycles fork?  Ie. what makes them fork?

I have a setup where I use dependency:copy to pull in some files from
the maven repository, and put them under target/classes/.  I've put them
in phasegenerate-sources/phase.

Then I've created an antrun:run task in phaseprocess-sources/phase
that moves some files to a new name.

What happens is that the dependency:copy is run twice, and sometimes
thrice in a mvn install (thrice if its run as part of a
multi-project).  I have no idea what makes it do that.

After the first copying it does an [antrun:run] to fix the file names,
and then a [jar:jar] with presumably the correct content.

Before the second execution of dependency:copy it says:
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.

But it still does a [jar:jar] after the copying has been done again, and
creates a jar with both the copied in artifacts with their old name, and
their new names (since there is no [antrun:run] here, fixing the file
names before doing the jar, and the renamed artifacts from the previous
antrun:run are still present).

Before the third execution it says
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[WARNING] Removing: test-jar from forked lifecycle, to prevent recursive 
invocation.
and at the end of the copying it does another [jar:jar] but no
[antrun:run]

I have no idea what forks the lifecycles, and just a vague idea what it
means.  I have no idea why [jar:jar] is run, even though it says it's
not going to run it (actually it doesn't look like it's actually run
until after the last dependency:copy, but since the fixes have been
overwritten once or twice, that doesn't really matter).

I've tried putting the antrun:run in compile, process-test-sources, and
test, and still only one of the lifecycles use it.

I've put it in package, but then it's run after the jar:jar in the final
phase, which is too late (the jar has already been built).

I guess I could unzip the jar in the packaging phase, fix the contents
of the jar, and jar it up again in the antrun:run, but that really
sounds like a hack...?

Any other ideas are welcome...

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why do maven lifecycles fork?

2008-01-09 Thread Steinar Bang
 Brian E. Fox [EMAIL PROTECTED]:

 Any plugin that declares @execute [phase] will cause the build to
 fork.  The dependency plugin does not, but one of your other plugins
 must. I know that javadoc did, assembly does (depending on which
 goal), enforcer:enforce-once does. Take a look at the various plugins
 you have bound and see which one is forking the build. If it's in a
 parent pom, it will fork the entire multi-module build.

Ok, thanx for the tip!

I'll walk through the parent POMs, then.

Company SuperPOM, content of buildplugins//build :
 maven-source-plugin, execution of jar and test-jar with no phase
 binding

 maven-bundle-plugin, configuration but no execution

 maven-compiler-plugin, configuration but no execution

 maven-surefire-plugin, configuration but no execution

 maven-project-info-reports-plugin, no configuration, no execution

 maven-jxr-plugin, no configuration, no execution

 maven-surefire-report-plugin, no configuration, no execution

 maven-javadoc-plugin, configuration, no execution

Project parent POM, , content of buildplugins//build :
 maven-source-plugin, execution of jar and test-jar with no phase
 binding

 maven-compiler-plugin, configuration but no execution

 maven-bundle-plugin, configuration but no execution

 maven-surefire-plugin, configuration but no execution

 maven-clean-plugin, configuration but no execution

 maven-project-info-reports-plugin, no configuration, no execution

 maven-jxr-plugin, no configuration, no execution

 maven-surefire-report-plugin, no configuration, no execution

 maven-pmd, configuration but no execution

 emma-maven-plugin, no configuration, no execution

 maven-javadoc-plugin, configuration, no execution

 maven-project-info-reports-plugin, configuration, no execution


The maven-source-plugin looks like a likely culprit.  

At the very least there is no need for two of it, and what I originally
tried to accomplish (creating source jars for both the artifact and its
test jar).


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why do maven lifecycles fork?

2008-01-09 Thread Steinar Bang
First an update: removing this plugin from both the SuperPOM and the
Project parent POM, caused my forked lifecycle message to go away.

I tried doing like this page does
 http://maven.apache.org/plugins/maven-source-plugin/usage.html
ie. changing the original
 plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-source-plugin/artifactId
  executions
   execution
goals
 goaljar/goal
 goaltest-jar/goal
/goals
   /execution
  /executions
to
 plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-source-plugin/artifactId
  executions
   execution
idattach-sources/id
phaseverify/phase
goals
 goaljar/goal
 goaltest-jar/goal
/goals
   /execution
  /executions

And that slimmed down the forking for ordinary jar project, but my
problem project (which builds an Eclipse source plugin for a bunch of
Felix maven-bundle-plugin built OSGi plugins), still has a problem with
this. 

And I guess you have the explanation for that below:

 Brian E. Fox [EMAIL PROTECTED]:

[snip!]
 * Invokes the execution of the lifecycle phase generate-sources
 prior to executing itself.

 Notice the last statement. If you have anything bound to
 generate-sources (I think this is the default binding of the dependency
 plugin) then it will run multiple times.

Not only that: I've added a phase putting it there...:-)

So... if I move it to eg. generate-sources, I may get rid of the
problem?  I'll try, and post back the results.

Apparently I can't get rid of the forked lifecycle issue: 
 http://jira.codehaus.org/browse/MSOURCES-13

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why do maven lifecycles fork?

2008-01-09 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 So... if I move it to eg. generate-sources, I may get rid of the
 problem?  I'll try, and post back the results.

Moving the dependency:copy config from generate-sources to
generate-resources, and doing the antrun:run patch in process-resources
did the trick for me; only one run of the dependency:copy, and no
overwrites of the patches.

Thanx for your assistance, Brian!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is it possible to activate a profile from settings.xml?

2007-12-29 Thread Steinar Bang
 Tomasz Pik [EMAIL PROTECTED]:
 yes, add something like this:

 activeProfiles
activeProfileidOfProfile/activeProfile
activeProfileidOfOtherProfile/activeProfile
 /activeProfiles

 listing profiles that needs to be activated at the end of settings.xml
 file (before /settings).

So simple!  Thanx! :-)

I noted something strange on maven 2.0.4: I also needed a profiles
element in the settings.xml, containing a default profile (an empty
one), for the activeProfiles setting to take.

Is that a known bug?  Or is it expected behaviour?  Is it changed/fixed
in later maven versions?

Thanx again!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Is it possible to activate a profile from settings.xml?

2007-12-27 Thread Steinar Bang
Is it possible to activate a profile in the top POM from settings.xml?

What I want to do is to have a set of properties describing OS name, and
architecture of shared libraries (ie. redhat4 and x86, or win32 and
x86_64) for different build systems, and to have a single switch in
settings.xml, to set the right set of values for a configuration.

Is this possible to do?

Thanx!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to single step with debugger thru java spring-framework source code with Eclipse and maven?

2007-12-25 Thread Steinar Bang
 nicolas de loof [EMAIL PROTECTED]:

 You can also set this in you $HOME/.m2/settings.xml
  properties
 downloadSourcestrue/downloadSources
  /properties

 so that you don't have to set -D... everytime you launch eclipse:eclipse

I actually prefer to control it with the command line, since using this
flag can take a long time on a multi-project invocation, if it can't
find source jars for some jars in the classpath.

I usually run it with this flag once initially.  Then I run it again if
I see that I miss some source during debugging.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Don't kill the messenger

2007-12-24 Thread Steinar Bang
 Borut Bolčina [EMAIL PROTECTED]:

 Anybody saw this post?
 http://fishbowl.pastiche.org/

I came in four days later.  Presumably y'all are talking about this
article:
 http://fishbowl.pastiche.org/2007/12/20/maven_broken_by_design


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to single step with debugger thru java spring-framework source code with Eclipse and maven?

2007-12-24 Thread Steinar Bang
 Jeff MAURY [EMAIL PROTECTED]:

 I you use the maven eclipse plugin, there is an option in the
 preference that tells maven to download source artifact as well as
 binary artifact.  Once you've checked this flag, when Eclipse buids
 the classpath from you pom, the source artifact will automatically be
 attached to the referenced jar.

The invocation is
 mvn eclipse:eclipse -DdownloadSources=true

Here are the docs:
 http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html

What mvn eclipse:eclipse does is to create .project and .classpath
files (as well as some other eclipse stuff), in all projects with
packaging jar, and others it knows about that are eclipse relevant.

When invoked over a multi-project it, by default, creates project
dependencies between the projects it generates eclipse files for.  For
projects outside of the invocation, and jar dependencies, it creates
.classpath references into the local maven repo.

If it finds source-jars together with the jars in the local maven repo,
it will add them to its sources.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 + Classpath

2007-12-22 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

Here's my mistake:

   dependency
groupIdorg.eclipse.osgi/groupId
artifactIdorg.eclipse.osgi/artifactId
version3.2.1-R32x_v20060919/version
scopesystem/scope

 systemPath${basedir}/target/dependencies/someosgiapp/org.eclipse.osgi_3.2.1_R32x_v20060919.jar/systemPath
   /dependency

The value of systemPath is wrong.  It should be:

systemPath${basedir}/target/dependency/someosgiapp/org.eclipse.osgi_3.2.1_R32x_v20060919.jar/systemPath

Ie. target/dependency (the default outputDirectory of
dependency:unpack), instead of target/dependencies.

And you were also right about this:

 Stuart McCulloch [EMAIL PROTECTED]:

 also check which build phase you do the unpacking, as the dependency
 will be checked during [resources:resources] - so you probably need
 to bind the unpacking goal to the generate-resources phase...

I had the unpacking done in generate-test-resources.  And that worked on
an mvn install with the node already present (once I got the
systemPath right), but not when I did mvn clean install.

Moving the unpacking to generate-resources made mvn clean install
work.

Thanx for your help, Stuart!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 + Classpath

2007-12-21 Thread Steinar Bang
 Stuart McCulloch [EMAIL PROTECTED]:

 I did a quick test and using ${basedir} appeared to work for me

I'm stuck with maven 2.0.4.  Perhaps that's the cause of my problems?

 - note that the basedir is the directory with the pom, so if you
 unpack to target/someosgiapp then you need to use
 systemPath${basedir}/target/someosgiapp/...etc.../systemPath

Sorry about that.  I was overeager in my anonymizing.

It's actually
   
systemPath${basedir}/target/dependencies/someosgiapp/org.eclipse.osgi_3.2.1_R32x_v20060919.jar/systemPath

In any case, this gives no error message:

  dependency
   groupIdorg.eclipse.osgi/groupId
   artifactIdorg.eclipse.osgi/artifactId
   version3.2.1-R32x_v20060919/version
  /dependency

while this:

  dependency
   groupIdorg.eclipse.osgi/groupId
   artifactIdorg.eclipse.osgi/artifactId
   version3.2.1-R32x_v20060919/version
   scopesystem/scope
   
systemPath${basedir}/target/dependencies/someosgiapp/org.eclipse.osgi_3.2.1_R32x_v20060919.jar/systemPath
  /dependency

gives:

[WARNING] 
Artifact 
org.eclipse.osgi:org.eclipse.osgi:jar:3.2.1-R32x_v20060919:system retains local 
scope 'system' overriding broader scope 'compile'
given by a dependency. If this is not intended, modify or remove the 
local scope.

[INFO] 
[ERROR] BUILD ERROR
[INFO] 
[INFO] Failed to resolve artifact.

Missing:
--
1) org.eclipse.osgi:org.eclipse.osgi:jar:3.2.1-R32x_v20060919

  Try downloading the file manually from the project website.

  Then, install it using the command: 
  mvn install:install-file -DgroupId=org.eclipse.osgi 
-DartifactId=org.eclipse.osgi \
  -Dversion=3.2.1-R32x_v20060919 -Dpackaging=jar -Dfile=/path/to/file

  Path to dependency: 
1) com.somecompany.someapp.proxy:com.somecompany.someapp.proxy:jar:0.1.0
2) org.eclipse.osgi:org.eclipse.osgi:jar:3.2.1-R32x_v20060919

--
1 required artifact is missing.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 + Classpath

2007-12-18 Thread Steinar Bang
 Stuart McCulloch [EMAIL PROTECTED]:

 well, there are system scope dependencies that let you refer to
 library artifacts in a fixed location like /usr/share/lib/... but
 their use is discouraged, because it makes things less portable:

 http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

I tried doing this:
  dependency
   groupIdorg.eclipse.osgi/groupId
   artifactIdorg.eclipse.osgi/artifactId
   version3.2.1-R32x_v20060919/version
   scopesystem/scope
   
systemPath${basedir}/someosgiapp/org.eclipse.osgi_3.2.1_R32x_v20060919.jar/systemPath
  /dependency

(I first tried basing systemPath to be based on
${project.build.directory}, since the OSGi app is downloaded and
unpacked with dependency:unpack, but that didn't work, since systemPath
needs to be absolute.  However ${basedir} seems to be absolute, so using
it got me past that stage)

But maven didn't like it:
[INFO] 
[ERROR] BUILD ERROR
[INFO] 
[INFO] Failed to resolve artifact.

Missing:
--
1) org.eclipse.osgi:org.eclipse.osgi:jar:3.2.1-R32x_v20060919

  Try downloading the file manually from the project website.

  Then, install it using the command: 
  mvn install:install-file -DgroupId=org.eclipse.osgi 
-DartifactId=org.eclipse.osgi \
  -Dversion=3.2.1-R32x_v20060919 -Dpackaging=jar -Dfile=/path/to/file

  Path to dependency: 
1) com.somecompany.someapp:com.somecompany.someapp:jar:0.1.0
2) org.eclipse.osgi:org.eclipse.osgi:jar:3.2.1-R32x_v20060919

--
1 required artifact is missing.

for artifact: 
  com.somecompany.someapp:com.somecompany.someapp:jar:0.1.0

from the specified remote repositories:
 [snip!]

There is a version of the OSGi runtime with the given
groupId/artifactId/version already in my local maven repository.

Here's its POM:

?xml version=1.0 encoding=UTF-8?project
  modelVersion4.0.0/modelVersion
  groupIdorg.eclipse.osgi/groupId
  artifactIdorg.eclipse.osgi/artifactId
  version3.2.1-R32x_v20060919/version
  distributionManagement
statusdeployed/status
  /distributionManagement
/project


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 + Classpath

2007-12-18 Thread Steinar Bang
 Stuart McCulloch [EMAIL PROTECTED]:

 FYI, you might be interested in:

http://wiki.ops4j.org/confluence/x/A4A6Pax-Runner
http://wiki.ops4j.org/confluence/x/8QPax-Construct

 which aim to make OSGi development and deployment a breeze with Maven

Thanx for the tip!  I'll check them out.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Not run maven-antrun-plugin task with file present?

2007-12-17 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

[snip! On using a profile to detect file presence]
 It now works when I do mvn install (config is modified), and
 repeated installs (config is left alone).

 But when I do mvn clean install then config is not modified
 (probably because the marker is still there at the time of profile
 activation).

 Of course, since the marker is deleted, but not recreated, the next
 mvn install will modify the config, and repeated mvn install
 invocations will leave it alone.

 So the behaviour is less destructive than before (ie. the config is
 never modified beyond corruption), but it may be wrong the first time,
 and that behaviour is confusing.

 Not sure how to fix this.

To complete the thread: I ended up having to bite the bullet, and put
the stuff done by ant into a separate ant build file, and invoke it from
an ant task in maven-antrun-plugin.

This works, ie. both mvn clean install and mvn install gives the
expected results (patching of config the first time after a clean, and
no more patching after that).

It also allows me to use a property for the marker file name (a property
that is a function of other properties, and eventually based on
${project.build.directory}).

The drawbacks are:
 1. there is an extra file to keep track of and put changes in
 2. running an ant task seems to be a lot more costly in time, than
having the ant tasks inline in the POM
 3. it doesn't do property expansion in the replacevalue elements (that
was probably done by maven with the inlined maven-antrun-plugin
tasks) 


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom classpath for maven-surefire-plugin?

2007-12-17 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 I would like to limit the classpath for a maven-surefire-plugin to
 something other than what comes from the dependencies.

 Is that possible?  How does one do it?

It's in Subversion, but I can't tell from here when it'll be in the
plugin us mortals use:
http://jira.codehaus.org/browse/SUREFIRE-118


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 + Classpath

2007-12-17 Thread Steinar Bang
 Wayne Fay [EMAIL PROTECTED]:

 That's just not the way Maven works. What libraries in particular do
 you need -- many should be available in the Maven repo already, so its
 simply a matter of writing the proper pom.xml dependency entries.

That's not always sufficient.

Eg. if you want to start an OSGi application based on equinox, then you
have to use a jar for the OSGi runtime, that resides in a directory that
have a ./configuration/config.ini file, and in the same directory as the
OSGi bundles the config.ini tells the OSGi runtime to load and start.

(...says the experience of someone who tried using the version of the
very same file in the maven repo, and didn't understand why the app
didn't start, last Friday...)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Not run maven-antrun-plugin task with file present?

2007-12-16 Thread Steinar Bang
 Wendy Smoak [EMAIL PROTECTED]:

 On Dec 15, 2007 2:19 PM, Steinar Bang [EMAIL PROTECTED] wrote:
 Platform: Ubuntu 7.10, Intel Pentium M, maven 2.0.4
 
 How does one avoid doing a maven-antrun-task when a file is present?

 Try wrapping the execution in a profile, and activating that profile
 on the presence of the file.

The main problem with profiles is that exists doesn't take properties,
not even proprties like ${basedir} (at least not in maven 2.0.4 which
I'm stuck with for the duration).

So you can get the exists to run in a particular project, but not
neccessarily when run as a part of composite, unless... well I guess you
could activate on all different paths there could be to the file
(ie. from the parent, and from the project itself), but that could get
messy pretty quick.  Especially if you have to copy the
maven-antrun-plugin task to the different profiles.

The second problem with profiles is that they make the POMs hard to read
and understand.

One thing is if you can make do with setting properties in the profiles,
but that only works if you can do it in a parent (I think...?).  But if
you have to put plugins stuff in a profile, you get one part of a
plugins config living outside the profile and one inside.

It makes it easy to overlook stuff that's actually related.

 But actually it sounds like you may want to just activate the profile
 if one of the files that would be created is _missing_. 

Yes.  The marker file I create with touch in a maven-antrun-plugin
task. 

 There's an example of that on this page:
 http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Thanx!  I'll give it a look.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Not run maven-antrun-plugin task with file present?

2007-12-16 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Wendy Smoak [EMAIL PROTECTED]:

[snip!]
 But actually it sounds like you may want to just activate the profile
 if one of the files that would be created is _missing_.

 Yes.  The marker file I create with touch in a maven-antrun-plugin
 task.

 There's an example of that on this page:
 http://maven.apache.org/guides/introduction/introduction-to-profiles.html

 Thanx!  I'll give it a look.

Now I've moved the entire maven-antrun-plugin config for the config
modification, into a profile that's activated with
 file
  missingfull-path-to-the-marker-file/missing
 /file

and that works after a fashion (except that the full-path thingy is a
nuisance).

It now works when I do mvn install (config is modified), and repeated
installs (config is left alone).  

But when I do mvn clean install then config is not modified (probably
because the marker is still there at the time of profile activation).

Of course, since the marker is deleted, but not recreated, the next mvn
install will modify the config, and repeated mvn install invocations
will leave it alone.

So the behaviour is less destructive than before (ie. the config is
never modified beyond corruption), but it may be wrong the first time,
and that behaviour is confusing.

Not sure how to fix this.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Custom classpath for maven-surefire-plugin?

2007-12-16 Thread Steinar Bang
I would like to limit the classpath for a maven-surefire-plugin to
something other than what comes from the dependencies.

Is that possible?  How does one do it?

I would like the classpath to contain three things:
 - the target/classes/ directory
 - the target/test-classes/ directory
 - the JAR file 
target/unpacked-osgi-app/org.eclipse.osgi.services_3.1.100_v20060601.jar

(The jar file looks for a configuration/config.ini relative to where the
jar file is, and also finds the OSGi bundles it needs to start up, from
the same directory as the jar file.  In short it's an OSGi application
starting up)

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Not run maven-antrun-plugin task with file present?

2007-12-15 Thread Steinar Bang
Platform: Ubuntu 7.10, Intel Pentium M, maven 2.0.4

How does one avoid doing a maven-antrun-task when a file is present?

Here's what I do:
 - Unzip a zip file with dependency:unpack
 - Add a couple of jars into the unpacked zip file with dependency:copy
 - Modify the config in two XML files in the unpacked zip file, to tell
   it about the jars 
 - Rezip the zip file and install it in the local maven repo

This works, but I have to always do mvn clean install to avoid the
config being modified more than once, which messes it up, and mvn clean
install is a nuisance when I'm running this project as part of a
compound project.

What I have done is add an empty marker file with the touch task when I
do the config.

What I have tried to do, and been unsuccessful in, was to detect this
marker and not do the modification, inside the maven-antrun-plugin's
tasks element.

I've also tried (and not really expected to succeed), in using a
previous maven-antrun-plugin task to set a property if the marker file
is present, and use that property in an unless attribute on the tasks
element that does the config modification.

So... is there another plugin, or built-in maven stuff that can set a
maven property if a file is present?

(maven properties are visible inside maven-antrun-plugin tasks, but
properties set inside tasks are (probably... I haven't found any
documentation on this) not visible outside the task.  At least setting a
property in one task to determine if the next one should be run, doesn't
seem to work.)

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Disinheriting dependecies

2007-11-14 Thread Steinar Bang
Is there a way to make a child POM inherit the parent's property
settings, but not the parent's dependecies list?

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Disinheriting dependecies

2007-11-14 Thread Steinar Bang
 Wayne Fay [EMAIL PROTECTED]:

 Not that I'm aware of. You may want to use dependencyManagement
 instead of straight dependencies -- then you can control what deps are
 needed in your children.

I found a fairly clear description of dependencyManagement here:
 http://www.bhaskarvk.info/content/maven/dependency_management.html

Thanx for the heads up!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to specify the eclipse code formatter profile

2007-11-13 Thread Steinar Bang
 Barrie Treloar [EMAIL PROTECTED]:

 On 10/12/07, Dan Tran [EMAIL PROTECTED] wrote:
 plugin
 artifactIdmaven-eclipse-plugin/artifactId
 version2.5-SNAPSHOT/version
 [del]
 then run 'mvn eclipse:configure-workspace' at your root

 Note this is a SNAPSHOT version of the eclipse plugin, so you will
 need to wait until it is released, point to the SNAPSHOT repository,
 or build it yourself and deploy into your environment.

From the name of it, eclipse:configure-workspace looks very interesting
(looks like something we have been missing).

Are there online docs available for the SNAPSHOT of
maven-eclipse-plugin?

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why Maven is Hard?

2007-10-08 Thread Steinar Bang
 Dennis Lundberg [EMAIL PROTECTED]:

 Steinar Bang wrote:
 Two things have locked us to 2.0.4:

 - a bug in maven proper (I think) where maven will ungzip a tar.gz
 or tgz file it downloads, before dropping it in the local maven
 repo, still with the same name, which breaks when an attempt is
 made at using the file
[snip!]

 If you can't find issues for these problems in JIRA, please create new
 ones. Add the stack trace to the issue, by running 'mvn -e ...'

I unintentionally verified that the ungzip problem is present on 2.0.7
tonight (I used the wrong maven version on a build server, and now I
have to wait for the admin to clear up the build user's maven
repository...), and I couldn't find any maven bugs containing gzip,
uncompress, or tgz, so I reported it:
http://jira.codehaus.org/browse/MNG-3233


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why Maven is Hard?

2007-09-30 Thread Steinar Bang
 Dennis Lundberg [EMAIL PROTECTED]:

 Thanks for your input Steinar.

 But this isn't at all helpful. Because is to vague. In order for us
 (the Maven devs) to fix things we need you (the Maven users) to let us
 know *exactly* what is wrong. Please give us concrete examples, then
 we can fix them.

Two things have locked us to 2.0.4:
 - a bug in maven proper (I think) where maven will ungzip a tar.gz
   or tgz file it downloads, before dropping it in the local maven
   repo, still with the same name, which breaks when an attempt is
   made at using the file
 - our use of profile gave maven 2.0.5 a nullpointer exception, and
   still breaks with error messages I don't understand, and haven't
   had time to look closer at, on 2.0.7

The profile problem is the reason I haven't been able to verify that
we have the unpack issue on 2.0.7, which is why I haven't reported it
as a bug.

Trying to find out about the two above have been _major_ time
wasters.  We have spent days trying to track down what has been
happening with the first one, and have spent days trying to understand
profiles enought to fix the second one.

So I guess profiles should definitely be classified as _hard_.

 Of course this does not really apply when documentation is totally missing.

Well, the plugin that had documentation preceeding the currently
released plugin was maven-dependency-plugin a way back.  I was trying
to use the analysis goal, which the documentation showed but the
plugin didn't have.  And also there were some exclude* parameters in
copy-dependencies that were in the online docs, but not in the
released plugin.

This is hopefully outdated information, and has been fixed a long time
back.  However I avoid doing mvn -U, since I'm still on 2.0.4 (see
above). 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using a parent POM plugin config in only some child modules?

2007-09-27 Thread Steinar Bang
 Wayne Fay [EMAIL PROTECTED]:

 You just need multiple parents. One top parent, then another one
 below it that sets the dependency plugin configs, then have your
 bundles inherit from it, and the other modules inherit from the top
 parent.

That would require a project restructuring for us.

We have two levels of parents.  One top parent spanning all projects,
and then pairs of *def and *impl bundles (the *def bundles defining
the interfaces for OSGi services, and the data structures they use,
and *impl creating OSGi components exposing services) with a common
parent, handling common settings for the bundle pairs.

To use your idea, we would have to drop the common settings layer,
which would take some work.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using a parent POM plugin config in only some child modules?

2007-09-27 Thread Steinar Bang
 Tomasz Pik [EMAIL PROTECTED]:

 Configure plugins in profiles in parent pom and activate profiles in
 child poms?  This won't be automatic (I do not know if there's a way
 to activate profile using packaging, maybe there's?) - you'll need
 to add avtivation to child poms but should solve problem with
 storing configuration in one place.

Yes, I was wondering about if profiles could be triggered by
packaging, and if that was a way to go...?

But I dread going this way, because my last incursion into profiles in
2.0.4 broke when 2.0.5 was released, and also breaks on the current
2.0.7... and has (along with another bug introduced with 2.0.5) stuck
us on 2.0.4 (which is increasingly more of a problem).


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Skiping module during mvn eclipse:eclipse

2007-09-26 Thread Steinar Bang
 Nick Stolwijk [EMAIL PROTECTED]:

 At the eclipse plugin site [1] I don't see such an option. But I don't
 understand the problem you have with generating the .classpath en
 .project files. Just don't import the project into Eclipse and all is
 well, or not?

Actually, if the project you'd like to skip had been a jar project, if
you tried not importing it, you'd get errors, since eclipse:eclipse
will generate project dependencies between modules, rather than
dependencies against the jars in the local maven repo.

But since this was modules with packaging other than jar, this
doesn't apply.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Eclipse/Maven2 integration info

2007-09-26 Thread Steinar Bang
 Alexander Sack [EMAIL PROTECTED]:

 You know Eclipse/Maven2 integration at this point can be very
 confusing.  You have three plugins, two of which are ECLIPSE plugins
 that integrate Maven2 while the other is a Maven2 plugin that
 happens to auto-generate files for Eclipse.  I wrote this below and
 I figured I would share to see if it helps anyone else.

A fourth way of interacting with eclipse, when writing eclipse
applications, is to use the maven-bundle-plugin from the apache felix
project, to build OSGi bundles that are then added to the PDE target
platform. 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why Maven is Hard?

2007-09-26 Thread Steinar Bang
 Denis Bessmertniy [EMAIL PROTECTED]:

 It is interesting why maven is so hard to understand? Why it is not well
 documented? (It is all my own opinions)
 I haven't so much probmlems with Ant, for example. 

Here are the problems I have had:
 - unclear where maven ends and plugins take over
 - unclear what versions of the plugins are in use
 - unclear where the plugins come from, and who are responsible 
 - sparse documentation, where the docs on the web may be for a
   different version of the plugin than the one you're using (I've
   seen a case where the documentation on the web was for a version of
   the plugin that hadn't been relased yet)
 - bugs in the plugins that require workarounds (and different people
   deploying maven at different points in time, may end up with
   different versions of the plugins which require different
   workarounds) 
 - a bug in maven proper that has stuck us on version 2.0.4

These are from the top of my head.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Using a parent POM plugin config in only some child modules?

2007-09-26 Thread Steinar Bang
Is it possible to create a plugin configuration in a top level POM
with packagingpom/packaging, that will only be executed in child
modules with packagingbundle/packaging (modules using the apache
FELIX maven-bundle-plugin)?

The use case is where I have a dependency:copy config in the POM of
each bundle projects, that copies the installed bundle into an eclipse
PDE target platform.

I would like to move the config up to a common parent, but that causes
the projects with packagingpom/packaging to be copied to the PDE
target platform as well.  They aren't bundles, so they won't have any
effect on eclipse, but it's clutter I'd like to avoid...

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven, DLLs and repositories...how ?

2007-06-12 Thread Steinar Bang
 Arne Styve [EMAIL PROTECTED]:

 Thanks for your input. I'll give this a try. However, how do you
 then use the JAR containing all the DLLs and .so's ? As far as I've
 understood, you cannot access a DLL that is inside a JAR, and hence
 you have to extract the DLLs from the JAR in order to use the
 DLL. Is this correct ?

What I've done is to use dependency:unpack (see the maven-dependency-plugin 
http://maven.apache.org/plugins/maven-dependency-plugin/ ) to unpack
jar files containing DLLs into a directory in the PATH of the VM that
will use them from JNI.

Shared libs for linux and Solaris takes a bit more work.
dependency:unpack can unpack tar.gz files, but doesn't preserve the
symlinks between different versions of the shared libs.
See
http://jira.codehaus.org/browse/MDEP-68

So for these platforms I've used dependency:copy to download and place
the tar.gz files in a directory in the LD_LIBRARY_PATH of the VM that
will use them from JNI, and then use exec:exec from exec-maven-plugin
http://mojo.codehaus.org/exec-maven-plugin/plugin-info.html ) to
unpack the tar.gz files using native tar.

A bit clumsy, but it works.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What does Expression: mean?

2007-06-12 Thread Steinar Bang
 Brett Porter [EMAIL PROTECTED]:

 It needs to be set with the second form, the expression is used for:
 - reading from properties
 - reading from -Dmaven.compile.encoding on the command line,

Thanx for the info!

(I tried setting the first form, since it's so much shorter, but it
had no effect that I could see)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What does Expression: mean?

2007-06-11 Thread Steinar Bang
What does the Expression: entry in maven plugin goal argument lists
mean?  Eg. like here:
 
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#encoding

Does this mean that by setting
 properties
  maven.compile.encodingutf-8/maven.compile.encoding
 properties
the java compiler encoding will be set to UTF-8?

Or is it neccessary to set it like this?
 plugins
  plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-compiler-plugin/artifactId
configuration
 encodingutf-8/encoding
/configuration
  /plugin
 /plugins


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



maven-eclipse-plugin missing test jar sources

2007-04-28 Thread Steinar Bang
Does anyone know what's the current status on this bug?
http://jira.codehaus.org/browse/MECLIPSE-151

It has a patch, which the asignee says looks good, but is still listed
as open.  Will it be fixed for v2.4 of maven-eclipse-plugin?

Thanx!


- Steinar (bitten by this bug)


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: dependency:unpack unzipping .tgz files after HTTP downloads

2007-04-10 Thread Steinar Bang
 Brian E. Fox [EMAIL PROTECTED]:

 Putting explicit versions should force it. The only caveat is that
 it seems that once maven picks a version in a multi-module build, it
 uses that throughout the build, regardless of individual poms.

 Looking over the change log[1], I don't see anything that would
 affect this between the builds.

Neither did I.  Turns out the problem is with maven-2.0.5, that others
had been installing, since had become the default maven release.

If I build with maven-2.0.5 I see the issue, if I build with
maven-2.0.4 (without any local repo changes, except deleting the
offending ungzipped .tgz files), it goes away.

So my guess is that the issue is with the built-in HTTP support of
maven, rather than in any plugins.

Since 2.0.6 seems to be the current maven release, I tried it as
well.  But 2.0.6 got a null pointer exception trying to build our
maven project.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



dependency:unpack unzipping .tgz files after HTTP downloads

2007-03-31 Thread Steinar Bang
Platform: Win32, 
  maven-2.0.4,
  maven-dependency-plugin 2.0-alpha-3 and 2.0-alpha-4

People at work, following my development environment setup howtos,
have started complaining to me that dependency:unpack of .tgz files
fails. 

What seems to be happening is that responses with these headers
 Content-Type: application/x-tar
 Content-Encoding: gzip
causes the file to be ungzipped after download (what's in the users'
maven repos are files of 42MB instead of the expected 8MB, and that
are actually tar files, in spite of the .tgz extension).

I've had the people who've had the problem look at the contents of
their 
 
%HOMEDRIVE%%HOMEPATH%/.m2/repository/org/apache/maven/plugins/maven-dependency-plugin/
directories.

One reported 2.0-alpha-3, and one reported 2.0-alpha-4.  I seem to
have 2.0-alpha-1, and haven't seen the issue on neither Win32 nor
linux. 

I asked the person with 2.0-alpha-3 to put
version2.0-alpha-1/version in the plugin configs, but that
didn't help the issue for him.

I haven't reported this as a Jira issue, since I haven't seen it
myself (and am reluctant to break my setup to try to reproduce
it...:-) ).

Is there a way I can upgrade, and then safely downgrade?  Putting in
explicit version tags didn't seem to be enough.

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: surefire and target/tmpdir not being created?

2007-03-15 Thread Steinar Bang
This was our own error, and not something caused by
maven-surefire-plugin.

There was an override of java.io.tmpdir in the top POM of the
project.  A result of copy'n paste from a different project at a point
in time when we understood very little about the way maven operated.

Sorry for the noise!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Activating profile in child POM

2007-03-14 Thread Steinar Bang
 Brian E. Fox [EMAIL PROTECTED]:

 Yes. I looked into the plexus-archiver component and it doesn't
 appear to support symlinks. I filed a request and then linked the
 MDEP one to it. Your best bet at this point is to create a patch for
 the archiver support and then we can add it to maven-dependency once
 that is applied and released. I don't really have any other
 suggestions right now.

What I'm doing right now, is to just copy the tgz in the correct spot,
and let the native tar untar it before running.  That's in the script
that starts the Java program (and sets LD_LIBRARY_PATH before firing
up the VM).

But I'm not sure how I'll handle unpacking for surefire
tests... suggestions welcome.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



surefire and target/tmpdir not being created?

2007-03-14 Thread Steinar Bang
Platform: Intel Pentium M, Ubuntu Dapper
  maven 2.0.4
  maven-surefire-plugin 2.3

In a JUnit test, I use
 System.getProperty(java.io.tmpdir);
to find the system temp dir.

This works fine when running the test from eclipse as a JUnit test run
config.  But the test fails when running under surefire.

The test outputs a file and reads it back, writes it back out again,
and compares the results, to test the input and output of a storage
format. 

Under surefire, the test complains that it can't find the first test
file (the one that's first written out), from the target/tmpdir
directory of the maven module's directory.

However when I look at the contents of the target directory, after
running mvn install, there is no tmpdir subdirectory there.  Only
the subdirectories
 classes
 surefire-reports
 test-classes
and the -tests.jar and .jar resulting from the build.

So it looks like the target/tmpdir isn't created.  Is there some
setting I have to do to make it appear?

I don't see anything relevant to tmp or temp here:
http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html

Thanx!


- Steinar




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Activating profile in child POM

2007-03-13 Thread Steinar Bang
I've been reading

http://maven.apache.org/guides/introduction/introduction-to-profiles.html
and trying to understand how profiles should be used

What I'm trying to do, is:

 1. download, and install the appropriate shared lib/DLL for different
platforms, for use with JNI wrappers

 2. use dependency:copy for unixoid platforms, and dependency:unpack
for Win32 (the reason for using dependency:copy is that
dependency:unpack, is that the latter currently doesn't support
symlinks, and the symlinks between different versions of a shared
lib are lost.  The reason for using dependency:unpack for win32,
is that as a result of the build system, Win32 DLLs will be tgz'ed
instead of zipped, and tar and gzip won't be available on the
machines being unpacked on, and besides unpacking would be hard to
automate with what's available on the Win32 machines running the
goal 

What I've succeeded in, so far, is to set properties depending on the
os, in profile elements, in a profiles element in the top level
POM, and have a dependenc:unpack goal in a plugins execution in a
child pom, pick up these properties.

What I so far haven't succeded in, is to set a property in the top
pom, and use that property to activate a dependency:copy goal in the
child POM.

Is this the correct way to do actication in the child POM?

I guess I could use the os.family trigging directly in the child POM,
but I was aiming for single-point-of-change for the activation
criteria for that behaviour.

Here's what I've done in the top pom
  ...
  profiles
   profile
!-- This profile is used to differentiate between unixens, which has to 
use native tar,
 to preserve symlinks, when unpacking shared libs used for JNI, and 
windows systems where it's
 possible to use dependency:unpack to unpack the DLLs used for JNI.

 What's used from this profile is the id, in plugin activations --
idunix-generic/id
activation
 os
  familyunix/family
 /os
/activation
properties
 unix-generic-activatetrue/unix-generic-activate
/properties
   /profile
   ...
  /profiles
  ...

Here's what I've done in the child POM:
  ...
  profiles
   profile
activation
 property
  nameunix-generic-activate/name
 /property
/activation
idunix-generic-copy-mylib/id
build
 plugins
  plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-dependency-plugin/artifactId
   executions
execution
 idunpackmylib/id
 phaseinstall/phase
 goals
  goalcopy/goal
 /goals
 configuration
  artifactItems
   artifactItem
groupIdcom.somecompany.mylib/groupId
artifactIdmylib-${jni.os.name}-${jni.os.arch}/artifactId
version0.0/version
typetgz/type
   /artifactItem
  /artifactItems
  outputDirectory${target.platform.dir}/lib/outputDirectory
 /configuration
/execution
   /executions
  /plugin
 /plugins
/build
   /profile
  /profiles
  ...

When I run mvn help:active-profiles from the top POM or from this
POM directly, the profile doesn't show as activated.

When I run mvn help:active-profiles -Dunix-generic-activate in
either place, it shows up as activated.

So I guess perhaps the unix-generic-activate property isn't set when
the child pom's profile activation is done...?

I'm guessing the property values are seen, because jni.os.name and
jni.os.arch used in artifactId are set in a profile activated in the
top pom.  And they seem to work if I run with -Dunix-generic-activate.

So what's the proper approach?  Put the unix-generic profile into a
profiles.xml file in the top level directory (and having essential
build information outside of the POM, which appearently isn't
recommended)?  Or don't attempt single-point-of-change for this, and
just use os.family activation?

Thanx!


- Steinar



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Activating profile in child POM

2007-03-13 Thread Steinar Bang
 Brian E. Fox [EMAIL PROTECTED]:

 I don't think you can activate based on a property set in a parent.
 Normally this wouldn't make sense because it's always the same until
 ou change it right?

Yup.  That's what I figured.

 It should work using -D or even -P to specify the profile.

It did.

However, I ended up activating profiles based on os.family for chosing
between dependency:copy or dependency:unpack, and that works fine.

(btw you've probably guessed that this is a workaround for
dependency:unpack not preserving symlinks...?  However, I still would
like to see that JIRA feature request... removes kludges and
workarounds...;-) ) 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



dependency:unpack and symlinks in tar files?

2007-03-12 Thread Steinar Bang
Platform: maven-2.0.4
  maven-dependency-plugin 2.0-alpha-2-SNAPSHOT (the maven
  dependency report variant checked out from subversion)

I'm trying to use dependency:unpack to download and unpack a tgz file
containing shared libs and symlinks between different versions of the
shared libs.

However, using dependency:unpack on an artifactItem with
typetgz/type, doesn't seem to handle symlinks.  The symlinks turn
into files with size 0.

Is there a config parameter I'm missing (the plugin execution
attached to the end of this file)?  Is there a workaround I could try?

One thing that's possible is to have maven run an ant task for doing
an exec to do the untar operation.  Does that sound feasible?  Or
does it contain too many complicating steps?

Thanx!


- Steinar

execution follows:

execution
 idunpackmylib/id
 phaseinstall/phase
 goals
  goalunpack/goal
 /goals
 configuration
  artifactItems
   artifactItem
groupIdcom.somecompany.mylib/groupId
artifactIdmylib-${os.name}-${os.arch}/artifactId
version1.0/version
typetgz/type
   /artifactItem
  /artifactItems
  outputDirectory${target.platform.dir}/lib/outputDirectory
 /configuration
/execution



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: dependency:unpack and symlinks in tar files?

2007-03-12 Thread Steinar Bang
 Brian E. Fox [EMAIL PROTECTED]:

 There is currently no configuration for symlinks. Since the dependency
 plugin uses the plexus archiver/unarchiver, I'd have to see how symlinks
 are supported and was configuration might be needed. File a Jira for
 this and I'll take a look.

Great!  Thanx!

Filed as http://jira.codehaus.org/browse/MDEP-68


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Status of maven dependency analysis mojo?

2007-03-08 Thread Steinar Bang
 Brian E. Fox [EMAIL PROTECTED]:

 The merged plugin is sitting here:
 /maven/sandbox/trunk/plugins/maven-dependency-plugin/pom.xml 

 Once alpha-2 is released, this will be merged into the dependency plugin
 trunk.

Ok.  Thanx!

What goals do I run to generate the reports?  None of the regular
dependency plugin goals seems to fit...?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Status of maven dependency analysis mojo?

2007-03-08 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Brian E. Fox [EMAIL PROTECTED]:
 The merged plugin is sitting here:
 /maven/sandbox/trunk/plugins/maven-dependency-plugin/pom.xml 

 Once alpha-2 is released, this will be merged into the dependency plugin
 trunk.

 Ok.  Thanx!

 What goals do I run to generate the reports?  None of the regular
 dependency plugin goals seems to fit...?

mvn dependency:analyze seemed like a good guess.  And that goal
actually seems to be there.

Unfortunately I'm getting a FATAL ERROR (see stack trace below).
Could it be because we're using a flattened directory structure on our
hierarchical maven project?

(the flattened structure is more eclipse friendly.  That's why we're
using it)


/media/sda8/someuser/p4/depot/someproject/MAIN/com.somecompany.someproject$ mvn 
dependency:analyze
[INFO] Scanning for projects...
[INFO] Reactor build order:
[snip! ...]
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] 

[INFO] Building Somecompany Someproject
[INFO]task-segment: [dependency:analyze]
[INFO] 

[INFO] Preparing dependency:analyze
[INFO] No goals needed for project - skipping
[INFO] [dependency:analyze]
[INFO] 
[ERROR] FATAL ERROR
[INFO] 
[INFO] Cannot accept visitor on URL: 
file:/media/sda8/someuser/p4/depot/someproject/MAIN/com.somecompany.someproject/target
[INFO] 
[INFO] Trace
java.lang.IllegalArgumentException: Cannot accept visitor on URL: 
file:/media/sda8/someuser/p4/depot/someproject/MAIN/com.somecompany.someproject/target
at 
org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils.accept(ClassFileVisitorUtils.java:74)
at 
org.apache.maven.shared.dependency.analyzer.asm.ASMDependencyAnalyzer.analyze(ASMDependencyAnalyzer.java:49)
at 
org.apache.maven.shared.dependency.analyzer.DefaultProjectDependencyAnalyzer.buildDependencyClasses(DefaultProjectDependencyAnalyzer.java:141)
at 
org.apache.maven.shared.dependency.analyzer.DefaultProjectDependencyAnalyzer.analyze(DefaultProjectDependencyAnalyzer.java:72)
at 
org.apache.maven.plugin.dependency.AnalyzeMojo.execute(AnalyzeMojo.java:74)
at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] 
[INFO] Total time: 5 seconds
[INFO] Finished at: Thu Mar 08 09:53:35 CET 2007
[INFO] Final Memory: 12M/21M
[INFO] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Status of maven dependency analysis mojo?

2007-03-08 Thread Steinar Bang
 Mark Hobson [EMAIL PROTECTED]:

 That exception would occur if the build directory didn't exist or is
 not a directory - in your case:

 /media/sda8/someuser/p4/depot/someproject/MAIN/com.somecompany.someproject/target

 Does that directory exist? 

Yes.  It contains a file called mvn-eclipse-cache.properties
(presumably generated by mvn eclipse:eclipse...?).

com.somecompany.someproject/pom.xml is the top POM for the
hierarchical project, and has packagingpom/packaging.

 What's your environment?

Ubuntu Dapper Drake (on Intel arch)
maven 2.0.4
Sun Java 2 SDK 1.5.0_06-b05


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JNI shared libs: attachments or separate artifacts?

2007-03-08 Thread Steinar Bang
I'm trying to use maven to distribute .so/DLL files used by a JNI
class.  The plan was to use dependency:unpack to drop the .so files
and DLLs into a directory in LD_LIBRARY_PATH (or PATH on Win32).

The questions are:
 1. should the DLLs be separate artifacts, or can they be attachments
to the JNI jar artifact?  (if so, how are they referenced from an
artfactItem in the artifactItems list of dependency:unpack?  I
only know how to do sources here...)

 2. can dependency:unpack handle .tar or .tar.gz or .tgz files?

Thanx!


- Steinar

PS the plan was to use ${os.name} and ${os.arch} in the artifactId for
the case where each platform's DLL gets a separate artifact.  How to
do it if the DLLs becomes attachments I have no idea.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JNI shared libs: attachments or separate artifacts?

2007-03-08 Thread Steinar Bang

 On 3/8/07, Steinar Bang [EMAIL PROTECTED] wrote:

 The questions are:
 1. should the DLLs be separate artifacts, or can they be attachments
 to the JNI jar artifact?  (if so, how are they referenced from an
 artfactItem in the artifactItems list of dependency:unpack?  I
 only know how to do sources here...)


 I would have dll to depend on the jar, then use dependency:copy to place
 those artifact on your footprint/workspace

Good idea.  Thanx!

This implictly means that separate artifacts for the DLLs for each
platform, is the right way to go?

Is the attachment approach workable at all?  Google finds me very
little information on maven artifact attachments.

 2. can dependency:unpack handle .tar or .tar.gz or .tgz files?

Ok. Thanx for the info!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JNI shared libs: attachments or separate artifacts?

2007-03-08 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Dan Tran [EMAIL PROTECTED]:

 I would have dll to depend on the jar, then use dependency:copy to place
 those artifact on your footprint/workspace

 Good idea.  Thanx!

Note that I don't build the DLLs with maven.  They are built on build
servers for each artifacts, and deployed as maven artifacts from
there.

So to be able to make the DLLs depend on the jar, I would probably
have to make a maven module with packagingpom/packaging that
depends on the jar, and use dependency:unpack to dump the DLLs into
a directory into LD_LIBRARY_PATH/PATH.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Status of maven dependency analysis mojo?

2007-03-07 Thread Steinar Bang
Does anyone know the current status for the dependency analysis mojo?
Specifically: is there still work going on it, or is it dead?  Where
can I get it from?  How do I run it? (ie. what goals do I give on the
command line?)

I googled today for something to help me clean up the dependencies of
our hierarchical maven project, and I ran into the
maven-dependency-analyzer:
http://jira.codehaus.org/browse/MNG-2676
which seems to be exactly what I was looking for.

However, the SVN URLs in the above bug report don't work.  I was able
to check out the maven-dependency-analyzer by inserting a /trunk
after /shared.

But I wasn't able to find the maven-dependency-analyzer-plugin.

So any information about the status of this tool, or of alternative
tools, is welcome.

Thanx!


- Steinar



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Referring to an artifactItem's values inside the element

2007-03-07 Thread Steinar Bang
Platform: maven 2.0.4

Is it possible to refer to an artifactItem's own values inside the
artifactItem element?

Specifically I would like to do something like this:
artifactItem
 groupIdorg.somewhere.bundle/groupId
 artifactIdorg.somewhere.bundle/artifactId
 version1.0.0/version
 typejar/type
 classifiersources/classifier
 
outputDirectory${target.plugin.dir}/${source.plugin.name}-${source.plugin.version}/src/${artifactId}_${version}/outputDirectory
 destFileNamesrc.zip/destFileName
/artifactItem

Note the uses of ${artifactId} and ${version} in at the end of the
outputDirectory value.  That's where I would like to get the values
set earlier in the artifactItem.

(For those who think they recognize it... yep! This is a step towards
creating an eclipse source bundle for debugging into plugins that make
up the PDE target platform.  Specifically, this is pulling down jar
file source attachments from the maven repo and installing them into
an eclipse source bundle)

Thanx!


- Steinar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: giving -Dpde=true to eclipse:eclipse doesn't work

2007-02-10 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Steinar Bang [EMAIL PROTECTED]:
 Platform: Intel Pentium M, Ubuntu Dapper,
 Sun Java 2 SDK 1.6.0_06,
 maven 2.0.4,
 maven-eclipse-plugin 2.3

[snip!]
 Ie. there is no plugin nature in .project, and .classpath still refers
 to files directly in the local maven repository.

 After the parameter name correction the .project and .classpath looks
 correct.  But no jars are copied to a project local directory, like
 the documentation says it should be.
   http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html

What happened, was that there was no META-INF/MANIFEST.MF in the
project directories, and that I got the following warning
 [WARNING] The references manifest file doesn't exist, plugin dependencies will 
not be updated: 
/media/sda8/bangste/p4/depot/ccr/MAIN/com.fastsearch.ccr.repository.repositorydef/META-INF/MANIFEST.MF

I created the META-INF directories, containing empty MANIFEST.MF
files, and then had a bit more success.  Ie. the jars weren't copied,
but they were made linkedResources in the .project file (I'm not
sure what that means wrt. creating an RCP application containing these
plugin projects...?)

But, of course, I'm not all there yet.  Because right now, I have a
bunch of META-INF/MANIFEST.MF files containing nothing but
Bundle-Classpath.  And I need a bit more to make these projects play
as plug-ins.  At least:
 - Bundle-Symbolic-Name
 - Bundle-Version
Possibly:
 - Export-Package
 - Import-Package
 - Bundle-Activator

That information is currently residing in the POMs as
manifestEntries for maven-jar-plugin.  Duplicating it manually into
the MANIFEST.MF files, seems like a bad idea.

Any suggestions for automating this?

Thanx!


- Steinar



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: giving -Dpde=true to eclipse:eclipse doesn't work

2007-02-10 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Platform: Intel Pentium M, Ubuntu Dapper,
   Sun Java 2 SDK 1.6.0_06,
   maven 2.0.4,
   maven-eclipse-plugin 2.3

[snip!]
 But, of course, I'm not all there yet.  Because right now, I have a
 bunch of META-INF/MANIFEST.MF files containing nothing but
 Bundle-Classpath.  And I need a bit more to make these projects play
 as plug-ins.  At least:
  - Bundle-Symbolic-Name
  - Bundle-Version
 Possibly:
  - Export-Package
  - Import-Package
  - Bundle-Activator

 That information is currently residing in the POMs as
 manifestEntries for maven-jar-plugin.  Duplicating it manually
 into the MANIFEST.MF files, seems like a bad idea.

As an experiment I unpacked the META-INF/MANIFEST.MF files from the
projects' bundle incarnations.  And I still can't get it to work.  I
think it's a class-path issue.

The projects have, in their POMs, dependency elements referring
other OSGi bundles, that won't be practical to get into eclipse with
eclipse:eclipse and turn into PDE projects, in the workspace.

These bundles are put into the bundle-classpath by eclipse:eclipse
goal.  And the bundles in bundle-classpath doesn't seem to see bundles
in the PDE target platform.

The bundles also exists in the PDE target platform, but
eclipse:eclipse has no way of knowing that (no way of knowing the
bundle-symboliic-name/version-no tuple from the
groupId/artifactId/version-no tuple in the dependency... I don't know
if it tries, but if it did try, it would probably use
artifactId/version-no (that would be consistent with eg. the .project
file generated by eclipse:eclipse), and the bundles in question are
using groupId/version-no).

One error message of this kind I see, is
 The project was not built since its build path is incomplete. Cannot find the 
class file for org.osgi.framework.BundleActivator. Fix the build path then try 
building this project

So... I could probably get rid of the white-on-red-Xes, by using
eclipse:make-artifacts to put the eclipse runtime into my local maven
repository, and create dependencies to these bundles, and in that way
get them into the bundle-classpath.

But that seems like a serious hack, and defeating the use of OSGi
bundles in the first place.

So even if I could resolve the generation of MANIFEST.MF issues, I'm
guessing
mvn eclipse:eclipse -Declipse.pde=true
is a dead end for me...?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: giving -Dpde=true to eclipse:eclipse doesn't work

2007-02-09 Thread Steinar Bang
 Steinar Bang [EMAIL PROTECTED]:

 Platform: Intel Pentium M, Ubuntu Dapper,
 Sun Java 2 SDK 1.6.0_06,
 maven 2.0.4,
 maven-eclipse-plugin 2.3

 I'm trying to use -Dpde=true to give modules plugin nature, ie.
   mvn eclipse:eclipse -Dpde=true
 but that doesn't seem to work.

That's because it should have been
mvn eclipse:eclipse -Declipse.pde=true

 Ie. there is no plugin nature in .project, and .classpath still refers
 to files directly in the local maven repository.

After the parameter name correction the .project and .classpath looks
correct.  But no jars are copied to a project local directory, like
the documentation says it should be.
http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html

 I noticed this bug
   http://jira.codehaus.org/browse/MECLIPSE-195

On a side note: that's probably not my bug/problem, because with 2.3 I
do get requiredPlugins set in classpath.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >