maven-2

Maven EAR module and EJB dependencies tests

删除回忆录丶 提交于 2020-01-11 02:26:06
问题 We are building our EAR & EJB projects with maven. It will build all the EJB projects and then they are used as the dependency for EAR, so they are packed into the EAR file eventually. The problem is that each EJB project has junit tests that check the EJB. For now these tests are not very useful because they try to connect to application server (jboss) and execute methods from EJB interface. Is there any way I can build the EJBs, build and deploy the EAR and then run all the tests from all

Hibernate ManyToOne with FetchType.LAZY not fetching lazy

雨燕双飞 提交于 2020-01-11 00:09:16
问题 I am using Hibernate with spring. I have a model-class like this. @Entity @Table(name = "forumtopic") public final class Forumtopic extends AbstractUserTracking implements java.io.Serializable { /**SNIP **/ private Forumcategory forumcategory; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "FkForumcategoryId", nullable = false) public Forumcategory getForumcategory() { return this.forumcategory; } public void setForumcategory(final Forumcategory forumcategory) { this.forumcategory =

Eclipse + Maven: force Execution Environment “JavaSE-1.6” instead of fixed JDK

半城伤御伤魂 提交于 2020-01-10 19:33:52
问题 I'm using Eclipse as IDE and Maven outside of it to keep all dependencies up to date and update the Eclipse-project as such. In Eclipse I usually specify the JRE system library as an execution environment for any Java-project, usually "JavaSE-1.6". In the pom.xml I use the following lines: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-eclipse

Eclipse + Maven: force Execution Environment “JavaSE-1.6” instead of fixed JDK

三世轮回 提交于 2020-01-10 19:33:26
问题 I'm using Eclipse as IDE and Maven outside of it to keep all dependencies up to date and update the Eclipse-project as such. In Eclipse I usually specify the JRE system library as an execution environment for any Java-project, usually "JavaSE-1.6". In the pom.xml I use the following lines: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-eclipse

Eclipse + Maven: force Execution Environment “JavaSE-1.6” instead of fixed JDK

牧云@^-^@ 提交于 2020-01-10 19:33:05
问题 I'm using Eclipse as IDE and Maven outside of it to keep all dependencies up to date and update the Eclipse-project as such. In Eclipse I usually specify the JRE system library as an execution environment for any Java-project, usually "JavaSE-1.6". In the pom.xml I use the following lines: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-eclipse

How to deploy Applet with dependencies jar using maven and sign it?

冷暖自知 提交于 2020-01-10 08:54:10
问题 Can someone show me how pom file should look like to create a jar file with applet which depends from some other jars is it possible to have one jar as applet, and how to sign it? 回答1: If you would like your classes and the dependencies to appear in one jar file , you should use either the assembly plugin or the one-jar plugin before the jarsigner. I have the following working setup with the assembly plugin, it will produce the normal (signed) jar and a ${artifactId}-${version}-jar-with

Log4j2 - Configure RolloverStrategy to delete old log files

戏子无情 提交于 2020-01-10 05:14:08
问题 I'm trying to configure log4j to keep only specified amount of backup files or keep files that are not older than some age. Ultimately I want to have time [daily] based triggering policy and keep 30 backup files or delete files that are older then 30 days. After doing some research I learned that I can't specify max number of backup files when using time policy however I came across this issue https://issues.apache.org/jira/browse/LOG4J2-435 and this documentation fragment http://logging

How to set up Maven to override a settings file for another when running a test?

对着背影说爱祢 提交于 2020-01-10 05:07:25
问题 See the following Maven generated project target classes test-classes src main java scripts resources datasource-settings.xml test java resources datasource-settings.xml I would like, when running a test , to use the settings found in test/resources/datasource-settings.xml instead of main/resources/datasource-settings.xml. Is it possible ? If so, what should i do to get my goal ? 回答1: Resources placed in ${basedir}/src/test/resources (the default location) will be automatically added to the

Can't instantiate javax.servlet.ServletException

谁都会走 提交于 2020-01-10 01:14:07
问题 I am trying to create instance of class javax.servlet.ServletException with following code public class MyTroubleViewer { public static void main(String[] args) { javax.servlet.ServletException servletException = new javax.servlet.ServletException("Hello"); System.out.println(servletException.getMessage()); } } But I get exception on creating: Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet

Hibernate 3.4 with slf4j and log4j

可紊 提交于 2020-01-09 07:14:49
问题 I'm attempting to upgrade from Hibernate 3.2 to 3.4, which apparently uses slf4j. Our project currently uses log4j. So my assumption is that I should be using the slf4j-log4j12 wrapped implementation. The Maven slf4j dependency is: <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.5.6</version> </dependency> While the log4j dependency is: <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> </dependency> Both