I'm working on a project that incorporates some Jersey dependencies not packaged with Glassfish and need to know what version of Jersey Glassfish 4.1.1 is using.
In the Glassfish Maven pom.xml, here
https://maven.java.net/content/repositories/releases/org/glassfish/main/extras/glassfish-embedded-all/4.1.1/glassfish-embedded-all-4.1.1.pom, there is a reference to Jersey:
<dependency>
<groupId>org.glassfish.main.packager</groupId>
<artifactId>jersey</artifactId>
<version>${project.version}</version>
<type>zip</type>
<optional>true</optional>
</dependency>
Which is actually a reference to the Jersey version embedded in Glassfish, here https://maven.java.net/content/repositories/releases/org/glassfish/main/packager/jersey/4.1.1/jersey-4.1.1.pom.
So from my understanding, Glassfish copies its dependencies at the time they are included into its own repository without retaining version information. How do I get that version information?
As mentioned in Updating Jersey 2 in GlassFish 4, two options mentioned are to:
Just unzip one of the Jersey jars e.g. (jersey-common) and look at the Bundle-Version in the META-INF/MANIFEST.MF file. You can find the jars in <glassfish-home>/glasssfish/modules
Just start up the server, with a JAX-RS application running and
log
Initiating Jersey application, version Jersey: 2.5.1 2014-01-02 13:43:00...]]
Related
In the Readme-File of the jboss-client, it says:
Maven users should not use this jar, but should use the following BOM dependencies instead [...]
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb-client-bom</artifactId>
<type>pom</type>
</dependency>
In the Maven Repository, there are several different versions of jboss-as-ejb-client-bom. Unfortunately, there is no indication in the readme, which version of this artifact to use.
When using JBoss libraries, I usually declare this dependency in the pom.xml's dependencyManagement section in the version corresponding to JBoss server version:
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>eap-runtime-artifacts</artifactId>
<version>7.0.0.GA</version>
<type>pom</type>
</dependency>
In the eap-runtime-artifacts BOM, the jboss-as-ejb-client-bom is not managed, thus I need to specify a version. As there is also no version 7.0.0.GA of the client, I am not sure which version to use. So, my questions basically is:
Do I have to use a specific version of jboss-client (artifact jboss-as-ejb-client-bom), depending on which version of JBoss server (artifact eap-runtime-artifacts) I use? If so, where do I find the corresponding versions of client and server?
I am trying to use "swagger-jaxrs-maven" plugin to generate RESTful API docs from the source code.
I followed this web site:
swagger-jaxrs-maven
but maven complained that it can't find this plugin, so I searched it on
maven central repository
It only finds it under groupId com.greensopinion.swagger. So I changed it accordingly.
But now I get this error:
[ERROR] Failed to execute goal
com.greensopinion.swagger:jaxrs-gen:1.3.0:generate (default) on
project treaty: Execution default of goal com.greensopinion.swagg
er:jaxrs-gen:1.3.0:generate failed: Unable to load the mojo 'generate'
in the plugin 'com.greensopinion.swagger:jaxrs-gen:1.3.0' due to an
API incompatibility:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
com/greensopinion/swagger/jaxrsgen/SwaggerJaxrsGeneratorMojo :
Unsupported major.mi nor version 52.0
I cleaned all my local maven repository and re-tried, it doesn't work.
My maven is 3.2.3 and JDK is 1.7.
My RESTful framework is Jersey2.17 with Jackson.
Any suggestion on how to make it work?
This issue is not related to swagger or maven but to your JDK version (version 52.0 means a JDK 8 is expected).
See https://stackoverflow.com/a/35866015/779338 for mode details.
Furthermore, if you download the pom.xml of swagger-jaxrs-maven available in maven central repository, you can see that a JDK8 (maven.compiler.source=1.8) has been used to generate a java 8 package (maven.compiler.target=1.8), then it can't be used with a JDK7.
I have following Maven dependencies, it turns out fine.
For Swagger, Phillip project which just plug and play.
<dependency>
<groupId>com.github.phillip-kruger</groupId>
<artifactId>apiee-core</artifactId>
<version>1.0.8</version>
</dependency>
JAVA EE - JAX-RS api
<!-- Java EE -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
Use JDK 1.8 or above.
I use eclipse and wildly server.
I'm trying to migrate from Jersey 1.x (1.2) to 2.x (2.6), I have trouble identifying the exact maven dependencies, jersey documentation is not comprehensive enough, it doesn't mention what maven dependencies are needed for the new version.
Does anyone have comprehensive list of maven dependencies needed for Jersey 2.x (2.6)?
Jersey doc
https://jersey.java.net/documentation/latest/migration.html#mig-1.x
For a servlet environment, the only dependency you need is
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.6</version>
</dependency>
This will pull in all you need. If you are in a servlet 2.5 environment, then you would use this instead
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>2.6</version>
</dependency>
Further information about 2.5 servlet, can be seen here
Alternatively, you could create a project from a Maven archetype, as seen here
UPDATE
Just as a note, the significance of using Jersey 2.6 is that it is the last version to support Java 6. If this is not a requirement for you, I would recommend using the latest version.
i am new to spring framework. When i try to download required jar files for spring, then there is 2 options for same classes-
org.springframework.xyz-2.5.6.A.jar and spring-xyz-2.5.6.RELEASE.jar.
I want to know what is the difference and which is recommended to use?
thanks.
The org.springframework.xyz version is the artifact ID used by SpringSource in their Enterprise Bundle Repository, a self-contained set of OSGi-compliant JARs for both Spring and non-Spring artifacts. The spring-xyz version is the standard non-OSGi version available on Maven Central.
If you're using OSGi then use the EBR JARs, if you're not then use the standard ones.
The current Maven dependency for spring-context is
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
The resulting JAR is spring-context-3.2.4.RELEASE.jar.
So the second name looks OK to me.
By declaring the following dependency:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
I can use about everything I need for a Java EE 6 Project (Servlet 3.0, JPA 2, EJB, CDI, etc).
The problem is: Maven can not download the Javadocs for the dependency (or at least m2eclipse "Download JavaDoc" feature don't work), so Eclipse don't show me the Javadocs when I use the very handy code completion feature.
I've found this post specific to Servlet 3.0 API, Maven dependency for Servlet 3.0 API?.
Can anyone kindly point to a solution that works for every API? Or, can anyone please provide a dummy guide to install Java EE 6 Javadocs and link it to javaee-web-api artifact in the local repository?
Assuming you have Java EE javadocs, you can install them to your local maven repository using the maven install plugin. Look at this usage link
You would use the -Dclassifier=sources to indicate you are installing sources. See this example for this.