maven-plugin

Maven plugin to restrict specific packages from being used

≡放荡痞女 提交于 2019-11-28 08:30:22
I work in a team of around 40 developers, and I do not want any developer to use some specific API(java.sun.Base64 to be precise) to be used by any of the developers and rather make them use alternatives to the sun API as its proprietary. Are there any plugins for maven, by which , specifying the restricted packages in the pom.xml , the build will break if any of those packages are being used anywhere in the code?? Or is there a more graceful way to do this?? Thanks Mark O'Connor You want to define an architectural rule for your project, which is best enforced by source code analysis. Sonar

How can I add war file to another java web application dependencies?

家住魔仙堡 提交于 2019-11-28 08:17:39
I have web maven project. Project's output is a war file. I want to add this war file as dependency to project_b. The project_b's pom.xml file, have a plugin as following: ... <plugin> <inherited>true</inherited> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <warName>geoserver</warName> <webappDirectory>${project.build.directory}/geoserver</webappDirectory> <packagingExcludes>WEB-INF/lib/servlet-api*.jar</packagingExcludes> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>

Maven JaCoCo plugin error

梦想的初衷 提交于 2019-11-28 06:53:07
I have configured the Maven JaCoCo plugin as follows in my pom.xml file: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <jacoco.version>0.5.9.201207300726</jacoco.version> </properties> <profiles> <profile> <id>jacoco4</id> <build> <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>${jacoco.version}</version> <executions> <execution> <goals> <goal>prepare-agent</goal> </goals> <configuration <destfile>${project.build.directory}/target/jacoco.exec</destfile> <datafile>${project.build.directory}/target/jacoco

Maven:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources

一世执手 提交于 2019-11-28 06:44:23
I am building my project using Maven. My maven version is apache-maven-3.0.4. I am using Eclipse Luna. When I try to build my project I get the following error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources (default-resources) on project OrionCommunity: Mark invalid -> [Help 1]. Following is the stack trace when I run mvn clean install -X : [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1:53.295s

Multiple antrun tasks in maven

这一生的挚爱 提交于 2019-11-28 05:26:48
How would you execute ant tasks at different phases in a maven build cycle? I used this in the build/plugins section <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>clean</id> <phase>clean</phase> <configuration> <tasks> <echo message = ">>>>>>>>>>>>>>>>>>>>>>>>>>clean"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> <execution> <id>compile</id> <phase>compile</phase> <configuration> <tasks> <echo message = ">>>>>>>>>>>>>>>>>>>>>>>>>>>>compile"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> <execution>

Tomcat-maven-plugin 401 error

早过忘川 提交于 2019-11-28 04:38:12
问题 i am learning tomcat basics and while i tried to deploy my web-application on tomcat i am getting the following error [ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project struts2-demoapp: Cannot invoke Tomcat manager: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/html/deploy?path=%2FmkyWebApp&war= -> [Help 1] [ERROR] as per this it seems war file location is not being passed to the tomcat manager.i have the

How to create a project using maven-archetype-plugin? What is artefactId etc?

血红的双手。 提交于 2019-11-28 04:06:39
I am new to Maven and am using the maven.apache.org tutorial here as an introduction. In the " How do I make my first Maven project? " section of the tutorial, it teaches us to generate a Maven archetype project by executing the following command: mvn archetype:generate After Maven downloaded many artifacts, it suddenly stopped and asked the following question on the command line: Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 149: The Apache tutorial does not describe this prompt. I have two questions: 1. What is the question above asking for? How

How to include external jars in maven jar build process?

时光毁灭记忆、已成空白 提交于 2019-11-28 02:32:35
问题 I want to build a .jar file with dependencies in maven. Unfortunately I have to include some external .jars in my buildpath. When I now try to build this project with maven package I will get an error that those external .jars are not found. How to adapt my pom file to add those jars? current: <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org

String arrays as command line arguments for maven plugin

人走茶凉 提交于 2019-11-28 00:42:15
I'm writing a maven plugin that has a parameter that's a String[]. Like this: /** * @parameter expression="${args}" */ protected String[] args; This can be utilized through the POM like this: <args> <arg>arg1</arg> <arg>arg2</arg> <args> But I want to send it in from the command line -Dargs={arg1, arg2} Is this possible? Rich Seller You can't do it directly as far as I know, but it is pretty common practice to accept a delimited String and split that into an array yourself. For example the maven-site-plugin allows you to specify a comma-delimited String of locales, while the maven-scala-plugin

Maven failure to find maven-plugins:maven-cobertura-plugin

做~自己de王妃 提交于 2019-11-28 00:07:23
问题 I try to compile maven web project with <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws</artifactId> <version>3.0.5-FINAL</version> </dependency> The problem is that when I try compile it I get the following errors: [ERROR] Failed to execute goal on project inferx-d2aserver: Could not resolve dependencies for project com.inferx:inferx-d2aserver:war:4.0: The following artifacts could not be resolved: maven-plugins:maven-cobertura-plugin:plugin:1.3, maven-plugins