maven-2

Proguard configuration on a Enterprise Java Application

老子叫甜甜 提交于 2019-12-24 08:58:38
问题 I'm trying to use proguard in a Maven project this is a obfuscate plugin, when I run it I have an error: Failed to execute goal com.pyx4me:proguard-maven-plugin:2.0.4:proguard (default) on project MavenEnterpriseApp-ear: Obfuscation failed (result=1) -> [Help 1] when I run maven with -e or -X I have: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.pyx4me:proguard-maven-plugin:2.0.4:proguard (default) on project MavenEnterpriseApp-ear: Obfuscation failed

Configuring Maven with two versions of Java

随声附和 提交于 2019-12-24 07:50:03
问题 I need two versions of Java ie. Java5 and Java6 on the same machine, as some of my projects support Java6 and some supports Java5. So I made it by putting the path of Java6 in JAVA_HOME and Java5 in JAVA5_HOME. I added both the JAVA_HOMEs in the PATH variable. But when I do java -version, then by default I am getting the following result java version "1.6.0" Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing) Is it possible to

Maven: How to read the Parent POM version

自作多情 提交于 2019-12-24 05:56:58
问题 Background: Most of my Java project have a lot of boiler-plate configuration that I end up writing into my POM. (For example the sourceEncoding is always UTF-8, the organization details never change). To save having to copy-paste blocks of configuration I've created my own standard 'parent' POM I can extend for each of my projects. I also have a number of tools that I use in every Java project I work on (e.g. checkstyle, PMD etc) so I've added the plug-ins for each tool into my standard

How do I exclude a dependency in provided scope when running in Maven test scope?

北城以北 提交于 2019-12-24 05:06:35
问题 How do I exclude a dependency in provided scope when running in Maven test scope? I have an unusual use case where I need to exclude a particular provided implementation and replace it with another in the test cases. It seems that Maven tests always include other scopes as well but in my case I want to make some exception. How do I do this? 回答1: There are situations where you need to run your tests in a different module. That may be what you need here. It allows your tests to use different

Maven Profile with different config files

别等时光非礼了梦想. 提交于 2019-12-24 05:01:08
问题 my project structure looks like this -src/main/java -src/main/resources -dev -app.properties -prod -app.properties -sandbox -app.properties and I defined a maven profiles like this <profiles> <profile> <id>dev</id> <properties> <build.profile>dev</build.profile> </properties> <build> <resources> <resource> <directory>src/main/resources/dev</directory> </resource> </resources> </build> </profile> <profile> <id>prod</id> <properties> <build.profile>prod</build.profile> </properties> <build>

Maven Could not transfer artifact junit:junit:jar:3.8.1

我怕爱的太早我们不能终老 提交于 2019-12-24 04:56:19
问题 My software version: Eclipse for Java Developers: http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr2 SVN Plugin: http://subclipse.tigris.org/update_1.8.x The exception message: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failure to transfer junit:junit:jar:3.8.1 from http://repo1.maven.org

Maven deploy artifact war from repository to remote server

喜欢而已 提交于 2019-12-24 03:52:55
问题 I have a build process after which I upload my war to our local Maven repository. When we deploy to TEST and PROD, I would like to use maven cargo plugin and specify the version to deploy to these environments. How can I configure my pom ( or maybe a new pom called pom-deploy.xml) to pull a particular war from the repository and deploy it remotely? Thanks 回答1: To get the WAR file in your new project just declare a dependency for it. 来源: https://stackoverflow.com/questions/972993/maven-deploy

How to copy/clone a maven2 repository server

妖精的绣舞 提交于 2019-12-24 03:49:12
问题 I want to create a local maven2 repository so we can download dependencies faster. we use sbt what is the simplest way to take all or some depedencies from http://oss.sonatype.org/content/repositories/releases and put it in our server I was thinking of a script to download some jars and put it in a sftp server and use sftp resolver with sbt https://github.com/harrah/xsbt/wiki/Resolvers 回答1: A pretty simple way would be to install a repository manager. A popular one is Sonatype Nexus (the

Maven: How do I deploy my WAR file to a remote Tomcat server?

﹥>﹥吖頭↗ 提交于 2019-12-24 03:15:21
问题 I'm using Maven 3.0.3. I want to deploy my WAR file to a remote Tomcat 6 server, running the Tomcat manager app, in the verify phase of my project. How can I do that? I thought the Cargo plugin was the key to salvation but when I added this to my pom.xml file ... <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <configuration> <container> <containerId>tomcat${tomcat.major}x</containerId> <zipUrlInstaller> <url>http://archive.apache.org/dist/tomcat

m2eclipse filtering test resources

我与影子孤独终老i 提交于 2019-12-24 02:22:41
问题 I am using m2eclipse and I want to right click and run tests from inside eclipse while the test resources get filtered from Maven. How can I do this? From eclipse when I right click on a test I do not get any m2eclipse options Julia. Similar to: Debugging maven junit tests with filtered resources? 回答1: Setup filtering in your pom.xml (and you'll get filtering under Eclipse with m2eclipse, m2eclipse runs process-resources after a change of any resource). Run your test as any other test ( right