maven-2

Maven Embedded Glassfish plugin

时光怂恿深爱的人放手 提交于 2019-12-18 12:28:47
问题 I cannot seem to get the Maven Glassfish plugin working for the life of me: <project> ... <pluginRepositories> <pluginRepository> <id>glassfish-repository</id> <name>Java.net Repository for Glassfish</name> <url>http://download.java.net/maven/glassfish</url> <layout>default</layout> <snapshots> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> ... <build> <plugins> <plugin> <groupId>org.glassfish</groupId> <artifactId>maven

Maven plugin can't load class

强颜欢笑 提交于 2019-12-18 12:28:16
问题 I'm trying to make a maven plugin that needs to use reflection. I want a project to run the plugin, and give it the full name of a class in the project, and the plugin will load it by reflection to get info from it. There's something strange with the classloader though, because it can't find the class when I use Class.forName("package.MyClass"); Looking here, I can't quite figure out if my plugin's classloader, when being run in a different project, has access to that project's classes. 回答1:

Hibernate, Spring and SLF4J Binding

大憨熊 提交于 2019-12-18 12:24:51
问题 I'm trying to setup a webapp with maven2 managed dependcies. Here my pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>mtx-production</groupId> <artifactId>mtx-production</artifactId> <version>0.0.1</version> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId

Maven release plugin: specify java compiler version

隐身守侯 提交于 2019-12-18 12:17:02
问题 I have this project made of multiple jars and war to make an ear. I build everything in snapshot and it works great. Then I made a release for every single project and saw that the jars and the war were slightly different in size than the snapshot ones. Comparing file to file I realized that the .class files were all there, but slightly larger or bigger, nothing more than 40 bytes generally. I force compilation to use java 1.5 using this tag in Maven: <build> <pluginManagement> <plugins>

HowTo Unit Test Client Server Code

风格不统一 提交于 2019-12-18 12:12:15
问题 I'm currently writing a Java Client Server Application. So i want to implement two Libraries, one for the Client and one for the Server. The Client Server Communication has a very strict protocol, that I wan't to test with JUnit. As build tool im using Maven and a Husdon Server for continues Integration. Actually I do not have any good Idea how to test these Client / Server Libraries. I got following Approaches: Just write a Dummy Client for testing the server and write a Dummy Server to test

Custom maven assembly

喜你入骨 提交于 2019-12-18 11:58:01
问题 I'm starting to work with Maven but am not yet successfully thinking in Maven's terms. I have a specific requirement and the docs aren't giving me enough clues, so I could use a bit of help: I'd like to create an assembly that builds a jar-with-dependencies like the "standard" target of this name, but excluding a couple of the resources. I want log4j.properties and a couple of other configuration files to not be in the jar. builds a .ZIP file containing in its root directory the .jar from

Integrating Maven & Non-maven projects

让人想犯罪 __ 提交于 2019-12-18 11:57:57
问题 I'm currently working on two projects simultaneously: My main project (built with maven) A spike of an open source project, which my main project depends on (not build with maven) How do I set up maven to use the OSS project as a dependency with the least amount of friction, given that I'm often developing the two in tandem? 回答1: I can think of several solutions: Mavenize the existing OSS project. This is of course the "ideal" option but often not feasible (even if you introduce the new build

Integrating Maven & Non-maven projects

旧城冷巷雨未停 提交于 2019-12-18 11:57:03
问题 I'm currently working on two projects simultaneously: My main project (built with maven) A spike of an open source project, which my main project depends on (not build with maven) How do I set up maven to use the OSS project as a dependency with the least amount of friction, given that I'm often developing the two in tandem? 回答1: I can think of several solutions: Mavenize the existing OSS project. This is of course the "ideal" option but often not feasible (even if you introduce the new build

How to create a swing application using maven?

送分小仙女□ 提交于 2019-12-18 11:55:08
问题 I was trying to start new swing application using maven, so I started searching on maven documentation but (frustratingly) found no clue. So I'm asking: what is the archetype used? what are the dependencies? how to build swing app in maven [is there is plugin to do so]? 回答1: what is the archetype used? A swing application is a standard JAR so just use the standard archetype: mvn archetype:generate -DgroupId=com.mycompany.app \ -DartifactId=myswingapp \ -Dversion=1.0-SNAPSHOT what are the

How to configure hibernate-tools with maven to generate hibernate.cfg.xml, *.hbm.xml, POJOs and DAOs

一曲冷凌霜 提交于 2019-12-18 11:50:01
问题 can any one tell me how to force maven to precede mapping .hbm.xml files in the automatically generated hibernate.cfg.xml file with package path? My general idea is, I'd like to use hibernate-tools via maven to generate the persistence layer for my application. So, I need the hibernate.cfg.xml, then all my_table_names.hbm.xml and at the end the POJO's generated. Yet, the hbm2java goal won't work as I put *.hbm.xml files into the src/main/resources/package/path/ folder but hbm2cfgxml specifies