http://hsqldb.org/ - where is the maven repository for the latest version 2.0.0 bits
Just to clarify a bit, and to help anyone who gets here looking for a direct solution in the pom, the groupId has changed to reflect the new preferred syntax, so your pom.xml should contain:
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.0.0</version>
Instead of:
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.whatever</version>
The latter groupId doesn't contain anything newer than 1.8.0.10, which caught me out.
It seems to be deployed to REPO1 already; http://repo1.maven.org/maven2/org/hsqldb/hsqldb/2.0.0/
It seems that the latest version still hasn't been deployed to the central Maven repository or any other public repo available on the net. Until then you can install it manually on your local machine or even better deploy on your company's repository.
Related
All of a sudden all my Mule Maven projects are throwing this error when running mvn clean test:
java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
at org.mule.tck.junit4.AbstractMuleTestCase.(AbstractMuleTestCase.java:71)
I can add a dependency for it, but I shoudln't really have to.
Nothings changed in my code. I am using Mule 3.4
You need commons-cli.jar in your classpath, add this Maven dependency to your pom
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.1</version>
</dependency>
Update: OP's code was fixed after adding commons-cli 1.1 dependency.
Issue description and how to fix it: http://ricston.com/blog/mule-classnotfoundexception-tests-commons-cli/
In a nutshell, you probably have an incorrect JAR named commons-cli-1.2. Delete that and rerun your maven build. You should be good after that.
If the follogin dependency in available in the POM. it should be working fine.
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>3.4.0</version>
<scope>test</scope>
</dependency>
Then use mvn clean compile to update the dependency.
mvn eclipse:clean eclipse:eclipse clean compile
Hope this helps.
Maven behaviour isn't reproducible from one run to the next: apart from generic network problems and repository corruption problems, anything might be updated automatically at any time, breaking any step of the execution, even if you don't change any of your files.
Your error message about a class in some Apache Commons library suggests a disagreement between the version of that library Mule should be using (one that has the ParseException class) and the library version it actually loads (without the class and causing the exception).
Plausible version mismatch scenarios include an update to a buggy new version of Mule (maybe only to a wrong or corrupted POM) which specifies an incompatible library version, or a random upgrade or downgrade of the latest library version in your repository as a consequence of adding or updating something unrelated to Mule.
Analysis suggestions:
What plugins in your Maven repository have a snapshot version? Which ones of these snapshots were updated around the time the error first appeared?
Which library jars, and which versions, include the ParseException class? What depends on specific versions or on the latest version of those jars?
I am trying to add a WSDL module to my existing application, but I'm struggling to get the dependencies resolved.
According to their website, this is the correct dependency
<dependency>
<groupId>org.ow2.easywsdl</groupId>
<artifactId>easywsdl-wsdl</artifactId>
<version>2.1</version>
</dependency>
After a search (search.maven.org), I already changed the version to 2.3 and there are a bunch of files that are downloaded into my local repository, but when running the application (with the websites demo code), I bump into this error:
java.lang.ClassNotFoundException: com.ebmwebsourcing.easycommons.uri.UriManager
And I believe it has something to do with the missing artifacts :
com.ebmwebsourcing.easycommons:easycommons.uri:jar:1.1
com.ebmwebsourcing.easycommons:easycommons.logger:jar:1.1
In particular the first one. Now, I'm relatively new to using Maven... How would I go about solving this?
Thanks.
The solution is to add the petalslink repository. Appearantly the standard maven repository doesn't contain the easycommons dependency. The petalslink repository does.
Is there a way to specify the artifact version outside of the POM file?
I have 2 CI projects that build an artifact. One builds a "stable" development version from a 'develop' branch and the other builds an unstable version which is the result of merging all active feature branches into the develop branch. I want the stable version to build as xyz-1.0.jar and the integration build to go in as xyz-1.0-SNAPSHOT.jar. Is there a way for the CI job to run a maven task or specify via the command line if a release or snapshot jar should be built without manually modifying the POM? Currently I have the version specified as 1.0 in the pom. I considered using the release plugin but I don't want the automatic version number increase and tagging that it does.
Short answer: no. And here are some additional remarks:
It doesn't make much sense to use a "released" version (i.e. non SNAPSHOT) for a branch under CI since released versions are not downloaded again even if a newer version is available.
Released versions should be tagged (e.g. 1.0), maintenance is done is in a branch derived from the tag (e.g. 1.0.1-SNAPSHOT).
If you want to distinguish versions built from different branches, use different versions in the POMs.
I was able to accomplish this by using a property in my POM and then overriding it via the command line.
pom.xml:
...
<version>${artifactVersion}</version>
<properties>
<artifactVersion>1.0</artifactVersion> <!-- default version -->
</properties>
...
Then overriding with mvn -DartifactVersion=1.0-SNAPSHOT package
But Pascal's answer above is more in line with what I was really asking. My solution is more of a workaround I feel.
You should be able to achieve this using maven profiles
I need to download a file from a non-standard layout repository.
The standard repository layout is groupId>/<artifactId>/<version>/<artifactId>-<version>.<packaging> however, I need to download the following file:
http://hudson.myserver.com:10000/repo/ocp-services/schemas/trunk/201/archive/schemas/dist/schemas.jar
where ocp-services is effectively the groupId, schemas is the artifactId and 201 is the version.
How would I add a dependency to this file and get it downloaded into my project and local repository?
This is a Hudson file repository if this is of any help, but it is a third parties so difficult to get them to change any location.
One option would be to register a custom ArtifactRepositoryLayout implementation and to declare a repository using this custom layout. I've never done that but it should be possible, check this blog post.
A second option would be to configure Maven to go through some kind of custom proxy (e.g. a Servlet) and to rewrite the URL on the fly for this particular dependency.
In both cases, I'm afraid Maven will complain about missing metadata ("A dependency in Maven isn't just a JAR file", see 3.5.5. Maven's Dependency Management) because the hudson file repository is just not a Maven repository. Maybe this can be handled programmatically though. But as I said, I've never done this.
A third option would be to ask the project building the JAR you need to deploy it (in the maven sense). That would be of course the best solution.
A last one option would be to just download this JAR and to install it manually in your local repository. If this is an option, go for it.
Have you tried adding this to your pom.xml :
<dependencies>
<dependency>
<groupId>ocp-services</groupId>
<artifactId>schemas</artifactId>
<version>201</version>
<type>jar</type>
</dependency>
</dependencies>
or if that don't work as Pascal says install it manually
I'm just starting to use Apache Buildr and I'm constantly running into the problem of not knowing what repo urls and versions are available for me to use.
For example I want to use Scala 2.8 in a build file, the id i previously used was:
2.8.0-SNAPSHOT
But now this is not found. I also want to use the latest version of Apache POI. If I look on the maven2 repo:
http://mirrors.ibiblio.org/maven2/
I can see that it only has up to version 3.2.
Is there any standard way of finding repos and searching them for what they have available?
Is there any standard way of finding repos and searching them for what they have available?
No, there is no directory of repositories (actually, having many repositories kinda defeats the concept of a central and unique repository but I guess that centralizing everything is a bit utopia).
But there are several repository search engines that index the most "famous" one (like central, java.net, codehaus, jboss):
http://repository.apache.org/
http://www.artifact-repository.org/
http://mvnrepository.com/
http://www.mvnbrowser.com/
http://www.jarvana.com/
http://mavensearch.net/
http://maven.ozacc.com/
http://www.mavenreposearch.com/
http://www.mvnsearch.org/
http://repository.sonatype.org/
In the particular case of Apache POI, version 3.6 is available in the central repo. To use it, just declare the following dependency:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.6</version>
</dependency>
To search the repositories try NetBeans. It provides a nice repository browser, where you can add the repositories which you like.
Here are some (see Pascal's for more):
http://download.java.net/maven/2/ ('java.net')
http://repository.jboss.com/maven2/ ('jboss.org')
http://bits.netbeans.org/maven2/
http://repo1.maven.org/eclipse
NetBeans also provides autocompletion within the pom.xml for dependencies etc (e.g. to get the latest version) ... but for scala I am not sure if this is useful.