Linux deploys Java projects in Linux __php

Source: Internet
Author: User

in the process of reading any questions, welcome to Exchange

Email: 1494713801@qq.com

qq:1494713801

1, check out the project from SVN

SVN Co SVN address and project directory (e.g., SVN co Http://172.18.59.101/svn/svnroot/project/testpro)

2. Use MVN to download project-dependent packages and package items (enter commands at Pom.xml siblings )

MVN install--install jar in local repository

MVN install:install-file-dfile= "Lib/server-1.1.jar"-dgroupid= "Org.server"-dartifactid= "Server"-Dversion= "1.1"- dpackaging=jar--Publish Third-party jars to the local library

MVN-E-X Clean compile--Delete the compiled content from the target directory and compile the project

MVN package--Packing

3, start the operation of the project

Appendix:

First, mvn common command

1. Create a generic Java project for Maven:
MVN Archetype:create-dgroupid=packagename-dartifactid=projectname
2. Create a Web project for maven:
MVN Archetype:create-dgroupid=packagename-dartifactid=webappname-darchetypeartifactid=maven-archetype-webapp
3. Compile source code: MVN Compile
4. Compile test code: MVN test-compile
5. Run Tests: MVN test
6. Produce site (Generate project related information website): MVN site
7. Pack (Generate target directory, compile, test code, generate test report, generate Jar/war file): MVN package
8. Install JAR:MVN install in local repository
9. Purge the resulting items (delete the compiled content from the target directory): MVN clean
10. Build Eclipse Project: MVN eclipse:eclipse
11. Build idea Project: MVN Idea:idea
12. Combined use of GOAL commands, such as only packaging and not testing: Mvn-dtest Package
13. Compile the test content: MVN test-compile
14. Only dozen jar Packs: mvn Jar:jar
15. Test-only and not compile, and do not test compilation: MVN test-skipping compile-skipping Test-compile
(-skipping flexible use, of course, can also be used for other combinations of commands)
16. Some system settings for clearing eclipse: MVN Eclipse:clean
17. Display version information: mvn-version/-v
18. Web project to generate WTP Plug-ins: mvn-dwtpversion=1.0 eclipse:eclipse
19. Clear configuration information for Eclipse Project (Web project): mvn-dwtpversion=1.0 Eclipse:clean
20. Publish a third-party jar to the local library: MVN Install:install-file-dgroupid=com-dartifactid=client-dversion=0.1.0-dpackaging=jar-dfile=d : \client-0.1.0.jar
21. Display detailed error message: MVN-E
22. Verify that the project is correct and that all required resources are available: MVN validate
23. Compile the Project test code: MVN test-compile
24. Process and publish packages in an environment where integration testing can be run: mvn integration-test
25. Run any checks to verify that the package is valid and meets the quality standard: MVN verify
26. Generate any additional source code required by the application, such as XDOCLET:MVN generate-sources
The Exec plug-in allows us to run this program without loading the appropriate dependencies into classpath: mvn exec:java-dexec.mainclass=org.sonatype.mavenbook.weather.main
28. Print out the list of resolved dependencies: MVN dependency:resolve
29. Print the entire dependency tree: MVN dependency:tree
30. To view a complete dependency trail containing artifacts that were rejected for conflict or other reasons, open the debug tag run for Maven: mvn install-x
31. Build the assembly MAVEN Assembly plug-in is a plug-in to create your application-specific distribution package: MVN install assembly:assembly
32. Use the Hibernate3 plug-in to construct the database: MVN HIBERNATE3:HBM2DDL
33. Use the describe target of the help plug-in to output information for the Maven-Help plug-in: MVN help:describe-dplugin=help
34. Use the Help plug-in to output the complete target column with parameters: MVN help:describe-dplugin=help-dfull
35. Get the information of a single target, set Mojo parameters and plugin parameters. This command lists all the information for the compile target of the compiler plug-in: MVN help:describe-dplugin=compiler-dmojo=compile-dfull
36. List the targets available for all Maven Exec plug-ins: mvn help:describe-dplugin=exec-dfull
37. Look at this "valid (Effective)" POM, which exposes MAVEN's default settings: MVN help:effective-pom

Ps:

Typically, this is done by first downloading code from CVS or SVN to the local computer, then executing MVN eclipse:eclipse generating ecllipse project files, and then importing it into Eclipse, and then executing MVN compile or MVN test test after modifying the code. You can also download the Maven plug-in for Eclipse.

Using multiple repositories with applications
<repositories>
<repository>
<id>Ibiblio</id>
<name>Ibiblio</name>
<url>http://www.ibiblio.org/maven/</url>
</repository>
<repository>
<id>PlanetMirror</id>
<name>planet mirror</name>
<url>http://public.planetmirror.com/pub/maven/</url>
</repository>
</repositories>


MVN Deploy:deploy-file-dgroupid=com-dartifactid=client-dversion=0.1.0-dpackaging=jar-dfile=d:\client-0.1.0.jar- drepositoryid=maven-repository-inner-durl=ftp://xxxxxxx/opt/maven/repository/

Two, SVN conflict resolution

The first is to use the Update option for conflict resolution, which means that the-accept parameter is used as a conflict process regardless of whether the current copy is the latest version

–accept Arg:specify Automatic Conflict resolution action
(' Postpone ', ' base ', ' mine-conflict ', ' theirs-conflict ', ' mine-full ', ' theirs-full ', ' edit ', ' launch ')

(p) Postpone–mark the conflict to be resolved later//Let the file remain in conflict state after the update is complete.
(DF) Diff-full–show All changes made to merged file///Use standard difference format to display the difference between the base revision and the conflicting file itself.
(e) Edit–change merged file in an editor//open conflicting files with your favorite editor, which is set by environment variable editor.
(r) resolved–accept merged version of File//finish editing, notify SVN that you have resolved the file conflict and that it must accept the current content-essentially, you have "resolved" the conflict.
(MF) mine-full–accept My version of entire file (ignore their change//discards new changes received from the server and uses only the local modifications you view the file.
(TF) theirs-full–accept their version of entire file (lose my changes)//discard your local modifications to the view file, using only newly received changes from the server.
(l) Launch–launch External tool to resolve conflict//initiates an external program to perform conflict resolution, which requires some prior preparation.
(h) Help–show this list//displays all commands that may be used in conflict resolution.

The second is not dealing with conflicts at update, using SVN resolve to resolve conflicts

1, using SVN resolve–accept base to select the base version, that is, 1.txt.rold as the last submitted version

–accept arg:specify Automatic conflict resolution source
(' base ', ' working ', ' mine-conflict ', ' theirs-conflict ', ' mine-full ', ' theirs-full ')

2, manually modify the 1.txt file, and then the current copy that is 1.txt as the last submitted version

SVN resolve–accept Working 1.txt

3, SVN resolve–accept theirs-full 1.txt use 1.txt.rnew as the last submitted version

4, SVN resolve–accept mine-full 1.txt use 1.txt.mine as the last submitted version

5. SVN resolve–accept mine-conflict 1.txt uses the 1.txt.mine conflict section as the last-submitted version

6. SVN resolve–accept theirs-conflict 1.txt uses the 1.txt.rnew conflict section as the last-submitted version

Third, use SVN revert to cancel the change

The two days before the conflict to resolve the use of SVN resolve this command, found this article is mainly because he –accept parameters of the comparison is more detailed than the official document.

Conflict Classification

Occasionally, you encounter conflicts when you update from a version library, merge files, or switch working copies to a different URL. There are two types of conflicts: file conflicts

File conflicts occur when two (or more) developers modify a row that is adjacent or identical in the same file. Tree conflict

A tree conflict occurs when a developer moves, renames, deletes a file or folder, and another developer moves, renames, deletes, or simply modifies it. file Conflicts

File conflicts occur when two or more developers modify a row that is adjacent or identical in the same file. Because Subversion does not know the specifics of your project, it leaves the work of conflict resolution to the developers. In the event of a conflict, you should open the problematic file and look for a line that starts with a string <<<<<<<. Areas with conflicts are marked in the following way:

<<<<<<< filename
  Your modifications
 =======
  Merge from the code >>>>>>> version in the version library
 

For each conflicting file Subversion placed three files in your directory: file name. ext.mine

This is your file, which exists in your working copy before you update your working copy-that is, there are no conflicting flags. There is nothing else in this file except your latest modification. File name. EXT.R old version

This is the underlying version (base revision) file before you update your working copy. In other words, it is the file that was checked out before you made the final change. File name. EXT.R New version

This file is received by your Subversion client from the server when you update your working copy. This file corresponds to the latest version in the version library.

You can run the external merge tool/conflict Editor by tortoisesvn→ edit conflicts, or you can use any other editor to resolve conflicts manually. You need to flush out what code is needed, make some necessary changes, and save it.

Then, execute the command tortoisesvn→ resolved and the author's modifications to the version library. Note that the resolved command does not really resolve the conflict, it simply deletes the filename.ext.mine and filename.ext.r* two files and allows you to submit changes.

If your binaries are conflicting, subversion will not attempt to merge the files. The local file stays the same (exactly the way you last modified it), but you'll see the filename.ext.r* file. If you want to undo your changes and keep the version in the library, use the Restore (Revert) command. If you want to keep your version covered in the version library version, use the resolved command and then submit your version.

You can right-click the parent folder, select tortoisesvn→ resolved ..., use the resolved command to resolve multiple files. This action will appear with a dialog box listing all the conflicting files under the folder, and you can choose which ones to mark as resolved. Tree Conflict

A tree conflict occurs when a developer moves, renames, deletes a file or folder, and another developer moves, renames, deletes, or simply modifies it. There are many different situations that can cause tree conflicts, and different situations require different steps to resolve the conflict.

When a file is deleted by Subversion on this computer, the file is also removed from the native file system. Therefore, even if it is part of a tree conflict, it can neither display conflicting superimposed icons nor resolve conflicts by right-clicking. Use the Check Modify dialog box to get edit conflict options.

TortoiseSVN can help find the correct location for the merged changes, but some extra work needs to be done to organize the conflict. Keep in mind that after an update operation, the base file for the working copy will include the version of each project in the version library when the update operation is performed. If you undo the change after the update is made, the working copy will return to the status of the version library, not the state before you start making the changes. local deletion, when updated with changes entered

Developer A modifies the FOO.C and submits it to the version library

Developer B also renamed the file foo.c to bar.c in his working copy, or simply deleted FOO.C or its parent folder.

Updating the working copy of developer B can cause tree conflicts:

In the working copy, the FOO.C is deleted, but is marked as a tree conflict.

If the conflict is caused by changing the file name rather than deleting the file, then BAR.C is marked for addition, but it does not include what developer A modifies.

Developer B must now make a choice whether to retain developer A's changes. In the case of changing the filename, he can merge the foo.c changes into the renamed file BAR.C. In cases where a file or folder is deleted, he can choose to keep the item that contains developer A changes and discard the deletion. Or do nothing and directly mark the conflict as resolved, so that he actually discards developer A's changes.

If TortoiseSVN can find the original file that was renamed BAR.C, the Conflict Editing dialog box will be able to merge the changes. Depending on where the update operation is invoked, it may not be able to find the original file. local changes, when updated with delete entry

Developer A renamed the file foo.c to BAR.C and submitted it to the version library.

Developer B modifies the file foo.c in his working copy.

Or in the case of a folder name change ...

Developer A renames the parent folder Foofolder to Barfolder and submits it to the version library.

Developer B modifies the file foo.c in his working copy.

Updating the working copy of developer B can cause tree conflicts. For a simple file conflict:

BAR.C is added to the working copy as a normal file.

FOO.C is marked for addition (including its history) and creates a tree conflict.

For a folder conflict:

Barfolder is added to the working copy as a normal folder.

Foofolder is marked for addition (including its history) and creates a tree conflict.

FOO.C is marked as modified.

Developer B now needs to decide whether to accept the structural changes made by developer A and merge her changes into the appropriate files under the new structure, or simply discard developer A's changes and keep the local files.

To merge her native changes into the new layout, developer B must first find out what the conflicting files foo.c the new file name in the version library after renaming/moving. You can use the Log dialog box to complete this task. Changes must be merged manually because there is no way to do this automatically or simply. Once the changes have been migrated, the path to the conflict is redundant and can be deleted. In this case, use the Delete button in the Conflict Editing dialog box to clean up and mark the conflict as resolved.

If developer B thinks the change of a is wrong, she must select the retention button in the Conflict Editing dialog box. This will mark the conflicting files/folders as resolved, but you will need to manually delete developer A's changes. It is also through the Log dialog box to help track which files have moved. Local Delete, when updated with delete entry

Developer A renamed the file foo.c to BAR.C and submitted it to the version library.

Developer B renamed the file foo.c to bix.c

Updating the working copy of developer B can cause tree conflicts:

BIX.C is marked for addition (including its history).

BAR.C is added to the working copy, and its status is ' normal '.

FOO.C is marked for deletion and a tree conflict is generated.

To resolve this conflict, developer B must find out what the new file name in the version library foo.c after renaming/moving. You can use the Log dialog box to complete this task.

Then developer B needs to decide which of the new file names in FOO.C needs to be retained-the one that developer A changed or the one he changed.

After developer B manually resolves the conflict, use the buttons in the Conflict Editing dialog box to mark the tree conflict as resolved. local missing, changes are entered when merging

Developer A works on the backbone, modifies the foo.c and submits it to the version library

Developer B works on the branch, renaming FOO.C to BAR.C and submitting it to a version library

The skeleton of the merged developer A Change to a branch working copy of developer B causes a tree conflict:

Bar.c already exists in the working copy and has a status of ' normal '.

FOO.C is marked as missing and produces a tree conflict.

To resolve this conflict, developer B will remove it from the conflict list by marking the file as resolved in the Conflict Editing dialog box. She then needs to decide whether to copy the missing files foo.c from the version library to the working copy, whether to ignore changes made by developer A to the foo.c and merge to the renamed BAR.C or whether the change has been resolved by marking conflicts to nothing.

Note that if you copy the missing files from the repository to the working copy and then mark them as resolved, the files you have copied will be deleted again. You must resolve the conflict first. local changes, when merging with delete entry

Developer A works on the backbone, renaming foo.c to BAR.C and submitting it to a version library

Developer B works on the branch, modifies the FOO.C and submits it to the version library

There were similar cases when the folder was renamed, but it was not recognized in Subversion 1.6 ...

Developer A works on the backbone, renaming the parent folder Foofolder to Barfolder and submitting it to the version library.

Developer B works on the branch and modifies the foo.c in her working copy.

The skeleton of the merged developer A Change to a branch working copy of developer B causes a tree conflict:

BAR.C is marked for addition.

FOO.C is marked for modification and creates a tree conflict.

Developer B now needs to decide whether to accept the structural changes made by developer A and merge her changes into the appropriate files under the new structure, or simply discard developer A's changes and keep the local files.

To merge her native changes into the new layout, developer B must first find out what the conflicting files foo.c the new file name in the version library after renaming/moving. You can do this by using a Log dialog box that applies to the merged source code. The conflict editor only displays the log of a working copy because it doesn't know which path changes to merge into, so you need to find it yourself. Changes must be merged manually because there is no way to do this automatically or simply. Once the changes have been migrated, the path to the conflict is redundant and can be deleted. In this case, use the Delete button in the Conflict Editing dialog box to clean up and mark the conflict as resolved.

If developer B thinks the change of a is wrong, she must select the retention button in the Conflict Editing dialog box. This will mark the conflicting files/folders as resolved, but you will need to manually delete developer A's changes. It is also through the Log dialog box to help track which files have moved. local deletion, when merging with delete entry

Developer A works on the backbone, renaming foo.c to BAR.C and submitting it to a version library

Developer B works on a per cent, renaming foo.c to BIX.C and submitting it to a version library

The skeleton of the merged developer A Change to a branch working copy of developer B causes a tree conflict:

The bix.c is marked as a normal (unmodified) state.

BAR.C is marked for addition (including its history).

FOO.C is marked as missing and creates a tree conflict.

To resolve this conflict, developer B must first identify the conflicting files foo.c the new file name in the version library after renaming/moving. You can do this by using a Log dialog box that applies to the merged source code. The conflict editor only displays the log of a working copy because it doesn't know which path changes to merge into, so you need to find it yourself.

Then developer B needs to decide which of the new file names in FOO.C needs to be retained-the one that developer A changed or the one he changed.

After developer B manually resolves the conflict, use the buttons in the Conflict Editing dialog box to mark the tree conflict as resolved.

About My Solution
I encountered this problem, no matter how kind can not be deleted. Finally, you have to delete all the local files and update the library again. Then delete the file you want to delete, and then submit it. There is no such problem.

From: http://hi.baidu.com/ostech/blog/item/1c6ea627ca67af6b34a80f91.html

This article from reprint please indicate the source: http://blog.csdn.net/lifxue/archive/2009/10/14/4662902.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.