Skip to main content

Posts

Showing posts with the label maven

Find Oracle JDBC driver in Maven repository

I want to add the oracle jdbc driver to my project as dependency (runtime scope) - ojdbc14. In MVNrepository site the dependency to put in the POM is: <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.3.0</version> </dependency> of course this does't work as it is not in the central repository used by maven. 2 questions: How do I find a repository (if any) that contains this artifact? How do I add it so that Maven will use it?

What maven dependency need to have Class LocalContainerEntityManagerFactoryBean?

In my project class LocalContainerEntityManagerFactoryBean not found. I don't understand why? In other simple project with this class all works fine. <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="simpleTest" /> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="true" /> <property name="generateDdl" value="true" /> <property name="databasePlatform" value="org.hibernate.dialect.H2Dialect" /> </bean> </property> </bean>

Maven looking for wrong archetype packaging

I successfully created an archetype. The archetype is referenced in my company's Nexus, the catalog looks well formed. But when I try to generate a project from this archetype, maven will look for a jar, and my archetype is packaged as a 'maven-archetype' (see the stack trace below) [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: local -> com.XXX.archetypes:frameworkV4Project Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Downloading: http://XXX/content/repositories/xxx-releases/com/xxx/archetypes/frameworkV4Project/1.0.0/frameworkV4Project-1.0.0.jar [INFO] Unable to find resource 'com.XXX.archetypes:frameworkV4Project:jar:1.0.0' in repository frameworkV4Project-repo (http://XXX/content/repositories/XXX-releases) Downloadi

Jboss 7 auto deploy plugin cannot connect to localhost:8080

I configured the plugin in maven as shown below <plugin> <groupId>org.jboss.as.plugins</groupId> <artifactId>jboss-as-maven-plugin</artifactId> <version>7.0.2.Final</version> <configuration> <hostname>localhost</hostname> <port>8080</port> <filename>target/TestApp.war</filename> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>deploy</goal> </goals> </execution> </executions> </plugin> I then trigger it using maven using mvn -U clean install package It does build and everything works fine bu

Shared library for two projects

I'm running two webapps (based on Spring, JPA and JSF) on the same tomcat server. Now my WARs beginning to get big in size which I would like to change. For development I'm using the embedded jetty/tomcat plugin - maybe this is interesting. What I want to achieve is: Creating a jar which holds the classes which are needed for both projects, e.g. Spring, Hibernate and MySQL - I want to build those as a seperate JAR and deploy this on the server. My next thought was to provide this bundle to my projects as dependency with provided scope. That would shrink my WAR files. Can I achieve this on a really simple way? It would be great if I could use the embedded jetty/tomcat server for development.

Spring 2.5 + quartz java.lang.NoClassDefFoundError: org/quartz/JobDetail

I have an issue with quartz library. I'm using it with spring 2.5: <bean id="reminderBean" class="com.mail.timexis.ReminderBean"> <property name="mailSender"> <ref local="timexisMailSender" /> </property> </bean> <bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="reminderBean" /> <property name="targetMethod" value="execute" /> </bean> <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetail" /> <!-- run every morning at 6 AM --> <property name="cronExpression" value="* * * * * ?" /> </bean>

Generating hashCode() and equals() when creating Java classes using Mojo Jaxb2 maven plugin

The code I'm working on is using jaxb2-maven-plugin from org.codehaus.mojo to generate Java classes from XSD schema. I'm looking for a way to automatically implement equals() and hashCode() methods for those classes, but it seems there is not a way. I know that there are other JAXB2 Maven plugins that do that (http://confluence.highsource.org/display/J2B/Home for example), but I was wondering if anyone of you encountered this issue before and if there's a way for fixing it. I'm generating the classes using the xjc goal.

How do I remove the root element of my Jetty webapp url?

I am running a Java webapp (let's call it mywebapp). Currently I access my page in this webapp by pointing locally to: http://localhost:9000/mywebapp/mystuff However, I need to access it using: http://localhost:9000/mystuff How can I do this? I've tried messing with some confs, but to no avail... This is my current root.xml: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <Set name="contextPath">/root</Set> <Set name="war"> <SystemProperty name="app.webapps.path"/>/mywebapp.war </Set> </Configure> Also tried: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configu