maven-3

How to manage artifactory / maven artifact using different profiles

独自空忆成欢 提交于 2020-01-15 03:32:33
问题 i have some problems understanding how to manage different "jar" files generated using different profiles. An example. I have a project : my.project:sample:1.0 And we use two profiles: Using Profile1 is compiling using java 7 and with dependency other:project:1.0 Using Profile2 is compiling using java 6 and with dependency different:project:3.0 Using command line in local environment is easy to manage, but I don't know how to store and manage it on artifactory. We have two different projects

can I specify a maven project.artifactId at runtime?

旧城冷巷雨未停 提交于 2020-01-14 08:19:23
问题 I have a maven POM that I'd like to use as a template, producing artifacts with different names depending on what arguments I pass to it. But I can't figure out how to specify the artifactId at runtime. If I parameterize the <artifactId> element like this: <artifact>foo-${bar}</artifact> maven complains: [WARNING] 'artifactId' contains an expression but should be a constant. If I leave out <artifactId> in the POM and try to specify it on the command line with mvn -Dproject.artifactId=foo ...

enforce custom rule in external projects

主宰稳场 提交于 2020-01-14 05:51:07
问题 I have one Parent maven project and 4 modules in that project: Now I want to put some custom rule that says there can be no project versions or dependency versions that begin with the string "master-". This rule will be applicable to all the external projects that depends on eBill Software. So I created a new module with name customRule whose parent is again eBill Software. I followed writing-a-custom-rule and my rule class is in new module. Relevant part of CustomRule.java in module

How to run findbug on the test code

喜欢而已 提交于 2020-01-14 02:33:47
问题 I have a test only maven project. The folder structure is as follows project-root |_ src | |_ main | | |_ java | | |_ resources | |_ test | |_ java | |_ resources |_ .classpath |_ .project When I run the findbug plugin It do not pick the classes under test. Is there a way we can instrument the test code which is under test, to find bug? My maven pon has the below plugin under the reporting section <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven

How to use Aether (eclipse) in Maven Plugins using API 3.1.1?

好久不见. 提交于 2020-01-13 19:05:32
问题 I am developing a new Maven plugin using API v3.1.1 because I need to upgrade to Maven 3.1.1, and need the Aether way of dealing with artifact repositories, among other things retrieving the complete list of artifact versions. I am using Eclipse Aether (0.9.0.M4), NOT Sonatype Aether. I have already read through http://wiki.eclipse.org/Aether and tried the demos http://git.eclipse.org/c/aether/aether-demo.git/tree/, but I have not been able to understand why the following within a subclass of

How to use Aether (eclipse) in Maven Plugins using API 3.1.1?

人盡茶涼 提交于 2020-01-13 19:02:27
问题 I am developing a new Maven plugin using API v3.1.1 because I need to upgrade to Maven 3.1.1, and need the Aether way of dealing with artifact repositories, among other things retrieving the complete list of artifact versions. I am using Eclipse Aether (0.9.0.M4), NOT Sonatype Aether. I have already read through http://wiki.eclipse.org/Aether and tried the demos http://git.eclipse.org/c/aether/aether-demo.git/tree/, but I have not been able to understand why the following within a subclass of

Sonar scanner with Maven and JDK 11

依然范特西╮ 提交于 2020-01-13 10:56:30
问题 I can make Sonar scanner work with OpenJDK 8 but not with OpenJDK 11. The Maven command used is: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.report.export.path=sonar-report.json -P ci The build fails with: [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project framework-bio: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0

jaxws-api 2.2 not loaded in maven build

允我心安 提交于 2020-01-13 10:53:28
问题 I have generated Java code with Apache CXF tool wsdl2java. In the comments of my service it says that I should endorse Jaxws API 2.2 but don't know what it means. In my Maven POM I have this: <dependency> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId> <version>2.2</version> </dependency> On build, I get these errors in Maven: cannot find symbol symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[]) I have checked JAX-WS API 2

jaxws-api 2.2 not loaded in maven build

巧了我就是萌 提交于 2020-01-13 10:53:09
问题 I have generated Java code with Apache CXF tool wsdl2java. In the comments of my service it says that I should endorse Jaxws API 2.2 but don't know what it means. In my Maven POM I have this: <dependency> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api</artifactId> <version>2.2</version> </dependency> On build, I get these errors in Maven: cannot find symbol symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[]) I have checked JAX-WS API 2

Creating Maven Archetype: is there a way to specify a default groupId

泪湿孤枕 提交于 2020-01-13 03:57:20
问题 I have created a maven archetype using create-from-project . Is there a way to specify a default groupId ? This archetype is for internal use only, default groupId would save some keystrokes. Thanks. 回答1: You can do this by specifying a propertyFile This property file may contains few properties including default groupId. So something like this (in a file named something.properties): groupId=com.company and to create the archetype mvn archetype:create-from-project -Darchetype.properties=..