w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I import a non-Maven Java project in Netbeans to a Maven project in Eclipse properly?
Create a new maven project in eclipse, notice that you have an src/main/java/ folder Go to your netbeans java project, right-click on 'Source Pakages', click on properties and copy the location of this folder Go to your files explorer and paste the location, copy all folders under src/ return to your maven project in eclipse and paste the folders (actually your java packages) under the src/main/java folder if you used jar libraries just add them to dependencies in the pom.xml

Categories : Java

maven install error,can't perform any maven operation on specifical maven project/modules
16386 is the index in the array. The problem is that the array is not as big as 16386. (i.e. size of the array < 16387) Anyway, it won't help you to solve this problem. You can check that your pom.xml contains this (and that it is valid): <?xml version="1.0" encoding="UTF-8" ?> EDIT Your problem is certainly a local problem. So check validity of your maven config files: .m2/settings.xml M2_HOME/conf/settings.xml

Categories : Maven

Maven: Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version
Oh, I resolved my issue. I include info for maven-project-info-reports-plugin in plugin section where maven-resources-plugin is described <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <executions> <execution> <phase>test</phase> <goals> <goal>resources</goal> <goal>testResources</goal> </goals> </execution> </executions> </plugin> <plugin> &

Categories : Maven

Maven: Using Exec Maven Plugin and reading project properties
could you use profiles to tie it to a specific phase but only in certain circumstances / certain environments ? http://maven.apache.org/guides/introduction/introduction-to-profiles.html You could use user, or environment variables, or explicitly use a particular profile, to trigger your choice of profile. Then in this new profile you can redefine to have a phase all to yourself. Truly creating a new lifecycle phase of your own seems possible, although not easy : https://community.jboss.org/wiki/CreatingACustomLifecycleInMaven?_sscc=t to be honest, I'd stick with the command line you have, calling validate and then exec. I don't know of any side effects, and as you say it's just a local, standalone sort of task.

Categories : Maven

New to maven creating maven project in Netbean getting error
I just found the answer to this myself, after struggling all day. Here's what you do to find more about the problem cause: Go to Tools->Options Choose the Java tile at dialog top (2nd from left in NetBeans 7.4). Choose the Maven tab (two right from Ant tab). Under the execution category add the text "-e" (no quotes) in the Global Execution Options. (This will tell Maven to show the full error messages. OPTIONAL: list -X for full debug dump.) Click OK on the Options dialog to close it and save the changes. In my case, the extra logging told me: org.apache.maven.archetype.exception.UnknownArchetype java.util.zip.ZipException: error in opening zip file. Which meant it couldn't read the jar file (as Windows programs seem to treat jars like zip folders). So the fix was simple: Find th

Categories : Java

Restore deleted Eclipse Project
If you have another repository with your work (like a central git server,another developer, another computer or something like that) you can just clone your repository back from that: File -> Import -> Projects from Git -> URI -> Type in your server/the other developers repo and complete the wizard. And here is the reason why you lost your work: In order to make git work, egit moves all the project files into the repository (which is only a special directory). Therefore, if you delete the repository, you also delete all the files in it, containing your whole project. For the future: To move your repository, just move it to another position using a normal file explorer. After that, tell eclipse about that by removing the repository from the repositories view (NOT delet

Categories : Eclipse

How to configure the Project ( depends on maven/web.xml/servlet APi) AJAX call not to include the Project name in it?
What worked for me is in the Pom.xml i added this <finalName>Jira-Synchronization</finalName> under the <build> tag and that was able to output the WAR with the desired name as i like

Categories : Java

Maven error: Failed to execute goal on project : Could not resolve dependencies for project
The first thing is you are having the wrong credentials for the repository ...(http://www.jets3t.org/maven2): Access denied to: http://www.jets3t.org/maven2/org/... Apart from that the repository does not look like Maven repository. And also the http://ericbottard.github.com/cloudfoundry-tomcat-7 gives a page not found which gives me the impression this is not a valid repository. Furthermore i would suggest first to use Maven Central only which means no repository entries in your pom.xml files which is the wrong way at all. Just check if it works without the repository definition. If you really need to define other repository better use a repository manager (Artifactory, Nexus, Archiva). One other thing is that i see in your pom the version which is a released versions already in c

Categories : Maven

why won't this richfaces demo project work in myeclipse web project with maven support
That's a dependency conflict for some google's library, probably guava or google collection. To fix it, you need to have a look into your dependency tree. As you're using myeclipse, open your pom.xml file and in the tabs below select the dependency hierarchy view. Then search for the dependencies I told you. There can be different problems: You're excluding a dependency for an artifact which needs it. Maven is resolving a conflict with new Google's dependency, but this method is in the old one and a third-party library you are using makes use of it. In this case you should try to update your third party library or downgrade the version of the one you're using by your own. For some artifact, you included a version of the API dependency and other version of the implementation. In this case

Categories : Java

Retrieve Jetty from Maven Central Repository as project dependency in IntelliJ IDEA Project
Check the dependency type. There are so called pom type of dependencies, which act as a list of other dependencies. To be able to fetch them, you have to mark them as pom dependencies in your pom.xml If you only need the server component, try searching for this string 'org.eclipse.jetty:jetty-server:9.0.3.v20130506'

Categories : Java

What's an easy way to convert legacy Java project with lots of jar libraries to maven project dependency list?
There's no magic bullet here. This will be a tedious manual trial-and-error task: Take your best guess as to the dependency version numbers Attempt to build If it builds, attempt to run it If you get errors, go back to step 1 and refine Once you get it done Maven should make it much easier going forwards.

Categories : Maven

Import maven project error in mac: 'project was marked as readonly'
Navigate to project folder through console (cmd in windows, terminal in linux) type mvn eclipse:eclipse Press Enter. If it is web application, type mvn eclipse:eclipse -Dwtpversion=2.0 Press Enter. Delete the project (not physically) from eclipse and reimport.

Categories : Eclipse

Creating a Maven Artifact from (Eclipse) Project, and Generating New Project from it
You need to run the archetype plugin from within your original project to generate an archetype descriptor. Here is an example of how to do this. The complete steps are listed here: http://hello-its-crazy.blogspot.in/2012/08/steps-to-create-maven-archetype-from.html

Categories : Java

How to configure FindBugs to run only on one project in a multi-module maven project
Add a configuration the scala-module pom.xml that explicitly instructs findbugs to skip the module, i.e. <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </reporting> Note that Maven often requires you to repeat boilerplate XML for cases like this.

Categories : Maven

Adding eclipse project dependencies to a Maven project
I'm not sure about your question 1, but if I understand it correctly, you would like to build with Eclipse two Maven projects where A depends on B? Then you may use an Eclipse plugin like m2eclipse. For your second question, I think the solution would be to use the system scope for your dependency that you can't find in any public repository. Of course, if you can deploy the dependency on an entreprise repository it would be better.

Categories : Java

Converting Maven project to Dynamic Web Project for Eclipse
WTP version is rather old, you should add a web project features instead. Edit the .project file and write under the natures tag <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> and under the buildSpec tag add builders <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand>

Categories : Java

Maven dependency on another Maven project
Problem The console output says that Maven is searching for com.aerospike:aerospike artifact in the JBoss public repository but that artifact isn't there. Failure to find com.aerospike:aerospike-client:jar:3.0.6 in http://repository.jboss.org/nexus/content/groups/public The OP stated that he installed it locally. Discussion Maven is trying to download a locally installed artifact from a remote repository that does not have that artifact. By default dependencies are first searched in local repository. AFAIK, the only thing that can override this behavior are the artifact update policies defined in settings.xml. AFAIK, the offline build (-o) should override any such policies. I tried to reproduce this situation by deleting dependencies from my

Categories : Linux

Referring a project directly from git in your maven project Pom.xml
Your main Maven project can't directly depend on source code stored in Git. Maven is quite extensible and you could write a plugin that will clone the Git repository, build the Maven project and install it to your local repository. However, I'm not aware of any existing plugins. The simplest workflow as the only developer of the projects is: Clone (or pull) both Git repositories to projectA and projectB Change projectB, commit and optionally push your changes Run mvn install in projectB Go to projectA and check that you reference the correct version of projectB (usually *-SNAPSHOT while developing) Run mvn test in projectA and it will take the fresh version of projectB Optionally, you can create a root pom which include the main project and its dependencies as modules, so that they ar

Categories : GIT

Conversion of dynamic web project in to maven project
Create project with command mvn archetype:generate. Choose the archetype id as struts2-archetype-starter with archetype number. Give groupid, archetype id, version and package properly as asked by console.

Categories : Java

What is the correct procedure for including a Maven-Spring-Roo-Hibernate jar in a Non-Maven-Non-Spring project?
Because the application context don't aware about the model. You are creating the model out of the appcontext. if you get the Model using getBean("MyUser"); some thing like that will work. else auto-wire the model and use that model for your crud operations. You can see the following code in MyUser - @PersistenceContext rotected transient EntityManager entityManager; Then only the entityManager object will initialized inside the the Myuser. @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath*:/META-INF/spring/applicationContext.xml"}) public class SomeTest extends AbstractJUnit4SpringContextTests { @Autowired MyUser myUser; // use this object for ur crud operations @Test public void someTest() throws Exce

Categories : Java

two projects can't be opened anymore - can't find .project file - how can i restore my work?
You can either find the .project file (which may be hidden on Mac?) or you can import your project folder into Aptana and it will create a new .project file. File > Import > General > Existing Folder as New Project

Categories : HTML

Maven can't get dependency information, although jar is in place
It says the reason in the message: Cannot find parent: org.apache.commons:commons-parent for project: commons-beanutils:commons-beanutils:jar:1.8.0 To be able to figure out the dependencies, maven not only needs the actual artifact metadata, but dependent metadata as well. That's what you're missing. Since the commons-parent 11 required by commons-beanutils 1.8 is in maven central repo, a retry with proper network connection to maven central should fix this. However, if it does not, post the full output with debug turned on (mvn -X). Edit: now with debug output, we can see that C:Userskmilyutin.m2 epositoryorgapachecommonscommons-parent11commons-parent-11.pom is broken: org.apache.maven.project.InvalidProjectModelException: Parse error reading POM. Reason: end tag not allow

Categories : Maven

maven build - version information
Set project version in pom as a place holder <groupId>test</groupId> <artifactId>x</artifactId> <version>${project.version}</version> now you can pass version from command line mvn -Dproject.version=1.1.1 package

Categories : Java

how to add my one project jar in another maven project in netbeans
With the assumption that you have that auth.jar in your local repository (as it builds fine). Why don't you give a try like this. <dependency> <groupId>com.payupaisa.oauth</groupId> <artifactId>auth</artifactId> <version>1.0.0</version> <scope>compile</scope> </dependency> Honestly speaking I don't prefer to give the jar location in my pom file and using scope as system, I leave this task to handle by Maven to resolve all the artifacts either by searching in local maven repository first(/.m2) or in MAVEN CENTRAL REPO if it is a 3rd party jar.

Categories : Spring

Storing structured Maven derived information in a Database
I suggest using SonarQube (previously called Sonar). One of the standard metrics captured is unit test duration. If you're using Bamboo or Jenkins there is an additional build stability plugin which captures metrics related to build duration, success and failures.

Categories : Database

Maven: How to consolidate Manifest information from dependencies into one file
You can use the maven-dependency-plugin which has a goal tree which seemed to the right choice for your problem. You can define the goal tree and use the option outputFile to create a stand-alone file which contains the full tree of our project.

Categories : Maven

The POM for project is missing, no dependency information available
Change: <!-- ANT4X --> <dependency> <groupId>net.sourceforge</groupId> <artifactId>ant4x</artifactId> <version>${net.sourceforge.ant4x-version}</version> <scope>provided</scope> </dependency> To: <!-- ANT4X --> <dependency> <groupId>net.sourceforge.ant4x</groupId> <artifactId>ant4x</artifactId> <version>${net.sourceforge.ant4x-version}</version> <scope>provided</scope> </dependency> The groupId of net.sourceforge was incorrect. The correct value is net.sourceforge.ant4x.

Categories : Java

Converting Maven project to EAR
I would suggest using maven-ear-plugin. The pom.xml would have the following item inside <build><plugins>..</plugins>..</build> listing: (taken from the documentation) <build> <plugins> <plugin> <artifactId>maven-ear-plugin</artifactId> <version>2.8</version> <configuration> <!-- configuration elements go here --> </configuration> </plugin> </plugins> </build> Please also refer to the documentation here: http://maven.apache.org/plugins/maven-ear-plugin/usage.html. Maven handles all the dependencies that you list in the <dependencies>...</dependencies> section that follows the above block. For example: <dependencies>

Categories : Java

Getting an error when trying to run a Maven project
looks like you dont have a java compiler (javac) on the path, but rather a java runtime environment (a JRE). make sure you have an environment variable called JAVA_HOME that points to the root sirectory of a JDK and that %JAVA_HOME%in is on the path. you could verify thisby running mvn -version and looking at the output printed

Categories : Java

Maven Project Properties
As Stewart says, these are defined in the Super POM (Introduction to the POM - Super POM). To see the values they have for a project, run mvn help:effective-pom to show your project's POM merged with the definitions from the Super POM: ... <build> <sourceDirectory>XXX/src/main/java</sourceDirectory> <scriptSourceDirectory>XXX/src/main/scripts</scriptSourceDirectory> <testSourceDirectory>XXX/src/test/java</testSourceDirectory> <outputDirectory>XXX/target/classes</outputDirectory> ... You can override these values in your own projects; using the properties to refer to them means that plugins referring to these paths will pick up the overridden values.

Categories : Maven

Robotium project and maven
No, you do not per se need Maven. As a matter of fact, the Getting Started of Robotium gives a basic example of how to do this in just Eclipse. Now, would life be better when using Maven. I generally like "yes" for an answer to that question. Testing is only one part of your iterative development, and it is great to have all your steps automated. Doing that with Maven allows you to leverage the entire lifecycle that it offers for your project from test driven development, perhaps in an IDE, to packaging and deployment. And the Android Maven Plugin fits into that approach.

Categories : Android

can not run maven project in Tomcat 7
Regardless of why or how maven processes your web.xml file, it might be a good idea to check to deployed war file what kind of web.xml file is there and if it meets the requirements and if it is the one you wanted to be there.

Categories : Java

Using SWTBot on a Maven Project
if you installed the swtbot plugin/bundle via eclipse then you'll need an eclipse plugin project that depends on that bundle to hold your tests. Create a new plugin project and edit the manifest file to import the swtbot bundle. You will then need a run configuration that will launch the application under test. I'm not sure how this can be achieved with a standalone maven project, but there's probably a way. If the project under test was an Eclipse application, you'd only need to right-click on your swtbot test and select run as swtbot test. I don't have an Eclipse with swtbot up and running atm so I can't give more detail, sry [EDIT] IMHO you should first try to test a dummy eclipse application. Put the plugin containing your test and the one containing your dummy app in your workspace

Categories : Java

Cannot build Maven Project
I think its because some of the arguments sent to exec-maven-plugin contains spaces. In your case it looks like ${project.build.directory} or some other variable resolves to C:Documents and Settingssomething. When you are passing this: <argument>-srcdir</argument> <argument>${project.build.directory}/classes</argument> It will resolve to: -srcdir=C:Documents and Settingssomething/classes. When it should have been something like: -srcdir="C:Documents and Settingssomething/classes" with "".

Categories : Maven

Maven archetype for a JBoss esb project
Ok, here is what I did, so its useful for someone else who is trying the same: Create a JBoss ESB template project with files and folders in the desired format. Open Cmd prompt and goto the root of this project and enter: mvn archetype:create-from-project Once the Build is successful, the archetype resources gets created under the target folder of this project. Now move the archetype resources, archetype-metdata and project files along with the generated POM file to a new project which will basically act as your new template archetype project. Do a mvn install and now you are ready to use your custom Maven JBossESB archetype! If you want to extend this and have this as an Eclipse plugin, this link describes how to do it. pretty useful feature IMO http://java.dzone.com/articles/work

Categories : Maven

Jenkins slave and Maven Project
When using slaves, you just have to ensure that each slave has external tools installed (Maven in your case), and properly configured (available in path, custom settings.xml if any, etc.) To avoid having to bind a job to a unique slave, an obvious best practice is to have all your slave configured alike (i.e. all linux slaves with all needed tools, same for windows slaves, etc.) Once all your tools are available on each slave, Jenkins takes care of running the project on an available node (master or a slave). Monitoring, log tail, build history and so on... is transparently available to the user, whatever the node used. You don't even need to care about plugins, they are automatically available to the slaves once installed on the master.

Categories : Maven

Maven update project and dependencies
I am not sure about the particular mentioned jar. But when you do build you should be connected to internet cause some external jar referred in POM get downloaded while building your project. Also please check whether the mentioned jar is is maven repository or not. Above jar is related to slf4j so i think it will be resolved if you are connected to internet .

Categories : Java

maven - mirror depending on project
Unfortunately there is not an out-of-the-box solution with Maven. Usual i check in my settings.xml via git and having different branches for different networks like at work, home etc. The result is reduced to a simple git checkout HOME or git checkout WORK etc.

Categories : Maven

How to compile Maven project with Xlint
You can define a compiler plugin like this: <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <compilerArgument>${compilerArgument}</compilerArgument> </configuration> </plugin> Then pass parameter from the command line: mvn -DcompilerArgument=-Xlint:deprecation compile If you don't pass -DcompilerArgument, it will not break the build because 'compilerArgument' in the compiler plugin argument will be empty and ignored.

Categories : Java

Can I use Frege in my project via a maven dependency?
There is a Maven plugin for Frege here: https://github.com/talios/frege-maven-plugin but I am not sure how much it is up to date with current Frege version. Further as far as I know, the Frege jar is still not in any central repository so you would need to have it in some local repository to use that plugin. For example, https://github.com/talios/frege-testing/blob/master/pom.xml You can also invoke the Frege compiler through Ant in Maven (not the best way but still an option): <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>compile</phase> <configuration> <target> <property name="compile_classpath" r

Categories : Misc



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.