maven-2

spring - hibernate load *.hbm.xml from classpath resource

筅森魡賤 提交于 2019-12-04 03:44:15
问题 I have some hbm.xml files in classpath resource located in src/main/resources maven's folder. I used spring's LocalSessionFactoryBean to load these files with the following bean config: <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSourceOracle"/> <property name="mappingResources"> <list> <value>mapping/SystemUser.hbm.xml</value> <value>mapping/SystemCredential.hbm.xml</value> <value>mapping

Is it possible to set a maven property from ant?

浪子不回头ぞ 提交于 2019-12-04 03:38:14
I tried to use the maven-antrun-plugin to check in a first execution if a file exists and then set a property accordingly. In another execution (another phase) of the antrun-plugin I want to make use of the property. But the property set in one execution cannot be used in another execution since it's an ant and not a maven property and doesn't get propagated. Is it possible to propagate the ant property to maven or in other words set a maven property from ant? Using another Maven build like in this question is not an option. Another way that might work somehow would be an external build.xml

Configure a hudson maven job to keep building if there are test failures, but only deploy if there are no test failures

落花浮王杯 提交于 2019-12-04 03:25:56
I've created a hudson job for our maven multi-project with 5 modules to deploy the SNAPSHOT artifacts to the maven repository. That's ok, as long as it builds successfully without test failures. However, now I'd like to fulfill the following requirements: When a module has a test failure, the build should continue bulding and test the other modules, but turn yellow. Using -Dmaven.test.failure.ignore=true accomplishes, but fails at the next requirement. When a module has a test failure, none of the artifacts should be deployed to the maven repository. Other projects depend on the snapshots this

GroovyDoc as Maven Plugin

风流意气都作罢 提交于 2019-12-04 03:11:44
Is there a maven plugin available somewhere that utilizes GroovyDoc , preferably as a report? I guess GMaven would be the place to look but the docs are ancient (1.0, whereas the current version is 1.3) and the GMaven plugin doesn't have any mojo that fits as you can see: mvn help:describe -DgroupId=org.codehaus.gmaven -DartifactId=gmaven-plugin This plugin has 9 goals: groovy:compile Description: Compiles Groovy sources. groovy:console Description: Launches the Groovy GUI console. groovy:execute Description: Executes a Groovy script. groovy:generateStubs Description: Generate Java stubs from

How to populate web application with initial data

别来无恙 提交于 2019-12-04 03:10:18
I am writing web application and am wondering what the recommended way is to populate initial data. This is JPA/Hibernate and Spring application and is built by maven. Up to now I've used script wich populate database with initial data, started by hand. Unit tests work with theirs own data, created in code before each test. My test classes extends org.springframework.test.jpa.AbstractJpaTests . Finally I'd like to have a maven build which create database form entities (now I need to run application first time to create database, then run script) then populates initial/dictionary data and run

Upgrading from Spring 3.0.3.RELEASE results in: java.lang.NoSuchFieldError: USER_DECLARED_METHODS

家住魔仙堡 提交于 2019-12-04 03:05:50
I have a Spring-MVC 3.0 web application built with Maven. All Spring dependency versions are defined with a maven property <spring.version>3.0.3.RELEASE</spring.version> . When I change the version to either 3.0.4.RELEASE or 3.0.5.RELEASE , then the web application fails with the following exception: ERROR: [DispatcherServlet] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is java.lang

persistence.xml not found during maven testing

情到浓时终转凉″ 提交于 2019-12-04 03:01:01
I'm trying to load test data into a test DB during a maven build for integration testing. persistence.xml is being copied to target/test-classes/META-INF/ correctly, but I get this exception when the test is run. javax.persistence.PersistenceException: No Persistence provider for EntityManager named aimDatabase It looks like it's not finding or loading persistence.xml. jhumble Just solved the same problem with a Maven/Eclipse based JPA project. I had my META-INF directory under src/main/java with the concequence that it was not copied to the target directory before the test phase. Moving this

How can I execute the opposite of mvn install from a script that does not know the name of the artifact or group ID of the artifact being uninstalled? [duplicate]

丶灬走出姿态 提交于 2019-12-04 02:52:51
This question already has answers here : Closed 5 years ago . How to remove jar file from local maven repository which was added with install:install-file? (6 answers) How to do remove a projects artifacts from the local maven repo? (3 answers) This sounds like it should be easy, but I've yet to find an answer. If I install an artifact with mvn install, how do I remove said artifact? I tried using dependency:purge-local-repository, but it only removes the dependencies - not the actual artifact. Any ideas? I'm using maven 2.2.1 if that helps. Edit: I'm aware of the similar question, but I'm

IntelliJ not seeing resources folder

為{幸葍}努か 提交于 2019-12-04 02:52:17
I created a new Project from scratch in IntelliJ by using a Maven Module . I didn't select any specific archetypes and I clicked on finish. The project gets created nicely and I have the java and resources folders under src/main as expected. Unfortunately, my application does not find any property files in the resources folder because it looks in the project base folder instead. I double checked that the resources folder is marked as 'source folder' in the Project Structure and I also tried to add the following to the pom.xml with no success: <resources> <resource> <directory>src/main

Can maven-exec-plugin fail the build?

早过忘川 提交于 2019-12-04 02:50:54
问题 I have a maven execution that runs a javascript compressor as a command line program, however, this tool also does some jslint checks as well. If these jslint checks fail so should my build. These errors are output as a parseable string to stdout. If this maven plugin cannot solve this problem, I'm happy to use any other suggested. Thanks. 回答1: To my knowledge, exec:exec will fail the build if the return code of the executed command is not 0 (or one of the configured successCodes). Maybe you