Skip to main content

JXLayer & Maven

41 replies [Last post]
tyken
Offline
Joined: 2006-03-08
Points: 0

Is there any plans to have JXLayer released to a maven repository? The reason I am asking is that everytime there is a new version of JXLayer I have to manually go install it to our internal repository.

I would be more than happy to help with this.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Hervea

Here you are:
http://repo2.maven.org/maven2/org/swinglabs/jxlayer/3.0.4/

Sorry for delay
(the vacation wasn't that long :-))

alexp

ringerc
Offline
Joined: 2008-06-08
Points: 0

Sorry to resurrect this elderly thread, but ... is the 3.0.4 release in the maven repos what's elsewhere referred to as "4.0"? I'm concerned that I'll be targeting an old API by sticking with 3.0.3, and 3.0.4 seems to be a completely compatible change (for my simple users) ... is it 4.0, or just a bugfix release of the 3.x line as the name would suggest?

Anyway, I'd like to take this chance to thank alexfromsun and everyone else involved in JXLayer (and the related LockableUI code from swingx) for such an incredibly handy too. Hopefully once the Oracle kerfuffle settles out it'll move toward mainline Java, as with the increasing use of "fancy" UIs (and the lack of any good built-in input blocker + feedback mechanism in Swing) it's getting really important.

BTW, http://download.java.net/maven/2/org/swinglabs/jxlayer/ doesn't contain the 3.0.4 or 4.0 release, only the 3.0.3 release. It seems like 3.0.4 only got pushed to master.

Message was edited by: ringerc

dingfelder
Offline
Joined: 2010-09-12
Points: 0

I agree, none of the latest versions have been pushed to the official maven repositories.

A bit sad, as making them readily available to the general public would increase the chance of new folks starting to use them.

Yes, you can manually download the jars, put them in your local repository, and hope you see new versions so you can down them too, and manually set up your POM files.
Or you can jump through hoops and add alternate custom repositories, making administration more complicated, and then depend on the (also out of date) sun repository.

Maybe one day...

ctof
Offline
Joined: 2004-02-03
Points: 0

Hi

I'm also interested by maven integration into JXLayer.
Please, note it's not a best practice to set the repository into the pom file.
It's better to set it into your settings.

Without widening me on the subject, know simply that it raises many problems when you are in an environment where you have no full access to the net (it is case in most of the big companies).

See upload rules on central repository (http://maven.apache.org/guides/mini/guide-central-repository-upload.html):

[i]FAQ and common mistakes

I have other repositories or pluginRepositories listed in my POM, is that a problem?
Yes, the central repository must be self contained, which means that all your dependencies must already be in the central repository. You need to remove the repositories and pluginRepositories entries and make sure your project still builds when your local repository cache is empty.[/i]

There is 2 solutions
1/ move repository section into your settigns
2/ move repository section into a profile section which is not enabled by default.
[i]
upload

false



maven2-repository.dev.java.net
Java.net Repository for Maven
http://download.java.net/maven/2/


[/i]

after you can deploy with this command:
[b]mvn -Dupload deploy[/b]

usefull command:
[b]mvn help:active-profiles[/b]

Regards
Christophe

Message was edited by: ctof

Message was edited by: ctof

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Christophe

Thanks for the information,
I'll let SwignLabs team know about that

alexp

dingfelder
Offline
Joined: 2010-09-12
Points: 0

Are there any plans to put version 4 into maven?

Until it gets released, I have had to change my pom and add a local system scope jar (which is less than ideal)

Cheers,

Ding

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Ding

Good point, I'll take care of it

Thanks
alexp

dingfelder
Offline
Joined: 2010-09-12
Points: 0

sorry to bug you but both:
http://download.java.net/maven/2/org/swinglabs/jxlayer/
and
http://repo2.maven.org/maven2/org/swinglabs/jxlayer/
are still out of date.

repo2.maven.org (which is what the vast majority of users will use as it is the default for Maven) shows:
3.0.3

download.java.net shows:
3.0
3.0.1
3.0.2
3.0.3

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Ding

Thanks for letting me know,
I'll ask to update it

With best regards
alexp

cedarsoft
Offline
Joined: 2008-09-13
Points: 0

Well, I made a small mistake (wrong packaging). I fixed that and modified the dependencies (removed the dependency to swingx and the filter). Those dependencies are added within the test scope now.

I think it is possible to deploy a jar not build by maven. But I don't know how - never tried it. And I think it is the easiest way to just let maven create the jar and deploy it.
Just call "mvn deploy" from your ant script and everything should work as expected.

I do not suggest to upload the demo jar. Just offer them to download.

Here the modified pom:
[code]

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

4.0.0

jar org.swinglabs
jxlayer
3.1-SNAPSHOT
jxlayer
The universal decorator for Swing components
https://jxlayer.dev.java.net/

BSD
http://www.opensource.org/licenses/bsd-license.php


scm:svn:https://jxlayer.dev.java.net/svn/jxlayer/trunk
scm:svn:https://jxlayer.dev.java.net/svn/jxlayer/trunk




org.swinglabs
swingx
0.9.3


com.jhlabs
filters
2.0.235




org.swinglabs
swingx
test


com.jhlabs
filters
test



java.net-m2-repository
java-net:/maven2-repository/trunk/www/repository/



maven
Maven Central Repository
http://repo1.maven.org/maven/


java.net-m2-repository
Java.net Repository for Maven
http://download.java.net/maven/2
default


src/java
src/demo



org.jvnet.wagon-svn
wagon-svn
RELEASE

org.apache.maven.plugins
maven-compiler-plugin

1.5
1.5

org.apache.maven.plugins
maven-source-plugin



jar



[/code]

dingfelder
Offline
Joined: 2010-09-12
Points: 0

ok, I added this to my pom and got errors at first while trying the maven repository but then eventually resolved from the 2ndary repository. Not sure why my old version did not, something must be different that I didn't see. I thought the repositories should be the settings.xml but this seems to work for now



maven
Maven Central Repository
http://repo1.maven.org/maven/


java.net-m2-repository
Java.net Repository for Maven
http://download.java.net/maven/2
default




org.swinglabs
swingx
0.9.3


com.jhlabs
filters
2.0.235


org.swinglabs
jxlayer
3.0

I still would prefer using just the main repository eventually but at least my code compiles now :)

cedarsoft
Offline
Joined: 2008-09-13
Points: 0

It is the better way to upload all artifacts to the central maven repository. I don't know why those java.net projects prefer their own repository.
But it is much better than nothing - so I accept it.

The failed downloads you have seen seem to be ok. Maven doesn't know in which repository the artifacts can be found. So it just tries all repositories...

rah003
Offline
Joined: 2004-05-26
Points: 0

> It is the better way to upload all artifacts to the
> central maven repository. I don't know why those
> java.net projects prefer their own repository.
> But it is much better than nothing - so I accept it.

I was about to respond to your problems, but I'm glad to see you guys made it work in between :)
To sync something with maven central repo in long term you need to provide rsync (or similar) access, there is no way for projects on java.net to do so (in difference to sf.net for example), unless project has its own server. So all of the projects are by default stuck to java.net repo. It should be pretty simple to sync whole java.net to central repo, but you would have to ask at maven2-repository.dev.java.net mailing list why it is not done. One possible reason is that central repo is much more strict in what goes there and who can upload the code.
Long term plan for swinglabs projects is to do both, keep uploading artifacts to java.net repo and setup auto upload via rsync to central repo as well, but we have to make some configuration changes first.

hope that answers your question.
Jan

cedarsoft
Offline
Joined: 2008-09-13
Points: 0

Thanks for your comment.

I hope the situation will improve in the near future. I am sure it is a great benefit for every project to be in the central maven repository.
But adding one additional repository is ok for me. Just begging for more ;-).

rah003
Offline
Joined: 2004-05-26
Points: 0

> But adding one additional repository is ok for me. Just begging for more ;-).
for more ... repos or for more projects in it? It there is any swinglabs sub project that you would like to see in repo, just let me know.

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Cedarsoft

I am very impressed with your detailed instruction,
"Maven Publisher" role is received and "pom.xml" is committed to the JXLayer root directory

Could you help me with a couple of questions?
I already use the ant script to compile and create JXLayer jar,
so I prefer just to deploy that jar to the Maven rep

I suspect that I don't need to do "mvn compile" etc... in this case
and just need to download the maven ant tasks and add a maven deploy task
to my build.xml, is that correct?

I also need to deploy two jars:

- jxlayer.jar (doesn't have any dependencies) and
- jxlayer-demo.jar (depends on swingx and filters)

any hints of how to do it are welcome

By the way, is it possible to ask Maven to download the latest swingx and filters jars?

Thank you very much!
alexp

rah003
Offline
Joined: 2004-05-26
Points: 0

Hi Alex,
jxlayer incl sources and javadoc is in the java net repo, see http://download.java.net/maven/2/org/swinglabs/jxlayer/3.0/

as for your question - I would not upload demos to the maven. It is used/meant for maintaining dependencies rather then general broadcasting tool for all the jars you produce.

BTW sorry it took so long, you need to keep nagging me more often. ;)
Jan

dingfelder
Offline
Joined: 2010-09-12
Points: 0

so, what do we need to put into our local POMs to be able to grab the latest jxlayer.jar?

rah003
Offline
Joined: 2004-05-26
Points: 0

the usual ... :)
[code]

org.swinglabs
jxlayer
3.0

[/code]

and since java.net repo is not synced with central, you need to make sure you have it in the list of repositories in your configuration.

dingfelder
Offline
Joined: 2010-09-12
Points: 0

> the usual ... :)

> and since java.net repo is not synced with central,
> you need to make sure you have it in the list of
> repositories in your configuration.

That last part is what I was getting at...

Many folks who are new to Maven are used to adding a jar dependency to their POM but do not know much about configuring repositories.

I assume what you are asking for us to do is to add something like the following to our maven settings.xml configuration file



javaNet
Java Net Releases

true
always
warn

http://download.java.net/maven/2
default

I did that and am getting errors downloading it. I suspect my repository is not configured properly in my settings file or something.

The bigger question is: (when) will you start syncing the jars with the main maven repository?

I understand that the you do not have to do that, and clearly the choice is yours.

Having said that, if you do keep the jars only in your own repository, the wider maven community will never know about them, as most maven users will not have your repository defined.

So if you want a wide user-base to start having access to your jars, the easiest way is to follow the normal maven guidelines and replicate the jars to their main repository. It would certainly make life easier for folks like me, as we would just have to add the pom dependency and bingo, everything would work.

Cheers,

Ding

tyken
Offline
Joined: 2006-03-08
Points: 0
ljnelson
Offline
Joined: 2003-08-04
Points: 0

Hello, Alex.

Thank you so much for this wonderful library.

Has there been any progress in putting JXLayer into a Maven repository?

Best,
Laird

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Laird

Unfortunately I didn't have time to study Maven and set it up

alexp

cedarsoft
Offline
Joined: 2008-09-13
Points: 0

I really love maven. This is so usefull when trying out new libs. Adding a dependency is just a matter of seconds instead of spending several minutes until all dependencies are downloaded and configured successfully (think of all those questions regarding filters.jar).
Upgrading to a new version is also very easy.

So I have created a pom.xml that can be used without touching anything else. I also added all necessary things into the pom so that you should be able to upload the artifacts to the java.net maven repository.

Just copy the attached content to a file named "pom.xml" within the root directory of the jxlayer project and call
"mvn compile" to compile the sources.
"mvn install" will create a jar and install it into your local maven repository.
"mvn deploy" will upload the created jar to the java.net maven repository (see below).

There are a few steps left (can't do that since I don't have the necessary project permissions). But I added links to the
relevant URLs - just follow the instructions there.

Instructions are from https://maven2-repository.dev.java.net/
I have prepared anything, so you just have to do those two steps:

- (Request a "Maven Publisher" role so that you can get the write access to the repository) at https://maven2-repository.dev.java.net/servlets/ProjectMembershipRequest.
- Follow this (https://javanettasks.dev.java.net/nonav/maven/config.html) instruction and create your ~/.java.net file. This is used to authenticate yourself during the deployment.

I declared two dependencies: One to swingx - I chose version 0.93 since this is the latest version within the repository.
The other one is the dependency to "com.jhlabs:filters:2.0.235". This dependency is located in the central maven repository. So there are no addition steps needed.

I hope this gives you the help you need to be able to deploy your great lib to the maven repository.

Here comes the pom.xml:

[code]

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

4.0.0

pom org.jdesktop
jxlayer
0.1-SNAPSHOT
jxlayer
The universal decorator for Swing components
https://jxlayer.dev.java.net/

BSD
http://www.opensource.org/licenses/bsd-license.php


scm:svn:https://jxlayer.dev.java.net/svn/jxlayer/trunk
scm:svn:https://jxlayer.dev.java.net/svn/jxlayer/trunk



org.swinglabs
swingx
0.9.3


com.jhlabs
filters
2.0.235



java.net-m2-repository
java-net:/maven2-repository/trunk/www/repository/



maven
Maven Central Repository
http://repo1.maven.org/maven/


java.net-m2-repository
Java.net Repository for Maven
http://download.java.net/maven/2
default


src/java
src/demo



org.jvnet.wagon-svn
wagon-svn
RELEASE

org.apache.maven.plugins
maven-compiler-plugin

1.5
1.5

org.apache.maven.plugins
maven-source-plugin



jar



[/code]

tyken
Offline
Joined: 2006-03-08
Points: 0

Great work cedarsoft! :)

hervea
Offline
Joined: 2008-11-05
Points: 0

From my netbeans / maven machinery, I can't see JXLayer 4. I see JXLayer 3.

My maven repos are :
[code]


maven
Maven Central Repository
http://repo1.maven.org/maven/


java.net-m2-repository
Java.net Repository for Maven
http://download.java.net/maven/2
default


[/code]
In what repo is JXLayer 4 ?

Thanks.

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Hervea

Sorry for delay, the guy who supports SwingLabs Maven repo is on vacation now,
so it will take some time to update the repo

You can always find the latest bits of jxlayer on jxlayer.dev.java.net

Thanks
alexp

hervea
Offline
Joined: 2008-11-05
Points: 0

How long are the vacation in the Sun Company ?

dingfelder
Offline
Joined: 2010-09-12
Points: 0

Most Americans get 2-3 weeks.

I think if we are patient we will get it soon :-)

If you need to, you can download it and add it as a local jar


org.swinglabs
jxlayer
4.0
system

${workspace-dir}/some_dir/JXLayer_4.0.jar
`

Message was edited by: dingfelder

rafale
Offline
Joined: 2006-05-05
Points: 0

SwingX library is already in teh java.net repository :
http://download.java.net/maven/2/org/swinglabs/swingx/

tyken
Offline
Joined: 2006-03-08
Points: 0

SwingX 0.9.3 does not include JXlayer.

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Tyken

There is still no answer from the SwingX team (vacation time?)
So if I would be glad if you consult me with Maven.

What should I do to set it up on the jxlayer project site?

Thanks
alexp

tyken
Offline
Joined: 2006-03-08
Points: 0

You can find a small example on: http://www.tyken.net/jxlayer-src.zip
Im guessing you have ant scripts which already creates all the appropriate zip (src, doc, all ++) so doing a total port to maven is not recommended.

What I suggest is that you just add a pom.xml to the source repository and move the source packages to src/main/java (maven requires this). The pom.xml needs to include a reference to a maven repository where all releases will be published. After this is setup properly doing a new release should be as simple as doing these two commands:
1. mvn release:prepare
2. mvn release:perform

This will tag the release in subversion and upload the released files to the maven repository.

I'll check out the whole source three for JXLayer and port it to maven later this week. I'll create a zip for you as I did above with the whole port. Sounds ok?

Maven has reporting plugins which will run e.g. checkstyle, findbugs, pmd, jdepend and so on. Any interest in having these reports?

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Tyken

> and move the source packages to src/main/java (maven requires this)

Unfortunately, it is not so easy, the SwingLabs scripts rely on the current directory structure.
I wonder, is it possible to maven it without touching the sources?

Thanks
alexp

tyken
Offline
Joined: 2006-03-08
Points: 0

After reading some maven docs it seems that it is possible to override the default directory structure.

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

If you tell me how to quickly install Maven
and make it work with existing file structure
I'll do it much faster
:-)

Thanks
alexp

tyken
Offline
Joined: 2006-03-08
Points: 0

http://maven.apache.org/guides/getting-started/index.html

To override the position of the source folder you have to put the following inside the pom.xml:


...
${project.basedir}/src/main/java
...

The maven repository that you will be using also needs to be setup in pom.xml.

As far as I can see the demo klasses requires som libraries. These has to be added as maven dependencies or simply filtered out when building with maven.

After all of the above is done, scm is added to the pom.xml and the maven-release-plugin is configured doing a release should be just the matter of typing:

mvn release:prepare
mvn release:perform

Maven is hard to get if you never have used it before. Let me know if there is anything I can help you with.

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Tyken

Since JXLayer is a part of SwingLabs project, I asked SwingLabs guys to set up the repository on swinglabs.org

just like they have it for swingx, timing framework etc...

I'll ask them if they have a special maven repository and let you know

Thanks

alexp

dingfelder
Offline
Joined: 2010-09-12
Points: 0

I too would love to have it available via maven.

I currently have to get lucky and discover that there is a new release, and then go find it, download it manually, and add it to my local repository. If it were in the maven central repository, all I would have to do is change my version number and push the build button.

The suggested (maven) way to make your jar available is to add it to the central apache maven repository. This process is described fully at:
http://maven.apache.org/guides/mini/guide-central-repository-upload.html

Note: you can also sync your own repository to the central repository automatically.

Hope this helps.

Ding

dingfelder
Offline
Joined: 2010-09-12
Points: 0

also... is there a mailing list where we can get notified of updates?

alexfromsun
Offline
Joined: 2005-09-05
Points: 0

Hello Andy

I want to be consistent with other projects so
I am still waiting an answer from SwingLabs team about Maven

The mailing lists are described here:
https://jxlayer.dev.java.net/servlets/ProjectMailingListList

the commits@jxlayer.dev.java.net is what you are looking for,
I think it is the only useful list because all other issues I prefer to discuss in this forum

Thanks
alexp